Jump to content

  • Log In with Google      Sign In   
  • Create Account

hplus0603

Member Since 03 Jun 2003
Online Last Active Today, 02:54 PM

#5227650 UDP sockets size and speed question

Posted by hplus0603 on 06 May 2015 - 09:16 PM

You're correct in pointing out that, when I say:

(IPv6 doesn't fragment, but guarantees a minimum MTU of 1200 bytes)


I mean that the intervening nodes (routers) will not do fragmentation -- there's nothing preventing an IPv6 software stack on the sending end to implement this before it hits the network.

It is possible for the sending node to do path MTU discovery and use the Fragment extension. This is possible for an intermediate software layer to do, to support larger UDP datagrams, rather than limit the size of UDP datagrams. The way I read the spec, this is "strongly recommended" but not guaranteed.


#5227430 UDP sockets size and speed question

Posted by hplus0603 on 05 May 2015 - 10:31 PM

First: "packet" not "package."

 

Second, the maximum size of a packet depends on protocol and hardware.

The maximum size of a UDP datagram is 65507 bytes on IPv4.

On most networks, that will fragment into IP datagrams of size 1452, or 576, or 9000, or ... and be reassembled on the receiving side.

(IPv6 doesn't fragment, but guarantees a minimum MTU of 1200 bytes)

 

http://en.wikipedia.org/wiki/Maximum_transmission_unit

 

Third, transmission speed depends on speed of signal/light/electricity, speed of routing, and throughput of the narrowest link.

 

If your ping time is X and your throughput is Y and your packet is size Z, an estimate for transmission time is X/2+Z/Y.

 

This does not take into account buffering, interrupt latency, and game simulation delay.




#5226711 Alternative to NewRelic?

Posted by hplus0603 on 01 May 2015 - 09:26 AM

For host and application real-time metrics, we use istatd. (We have to run the host ourselves, of course.)

https://github.com/imvu-open/istatd

Having 10-second-granularity data is very helpful when trying to figure out which came first: an increase in load or a decrease in throughput or whatever.


#5226533 networking solutions for making MMO

Posted by hplus0603 on 30 April 2015 - 10:33 AM

@whiplash: For a better answer from the forums, you need to answer the questions that I posted in #5: http://www.gamedev.net/topic/667655-networking-solutions-for-making-mmo/?view=findpost&p=5224200


#5226405 Mixing WSASend (Client) with recv (Server)

Posted by hplus0603 on 29 April 2015 - 07:43 PM

So my client is sending a packet with WSASend() but obv. my server is not able to receive it since it uses recv().


As others said, that's not the problem. Both the send() and WSASend() functions have the role of "enqueue a network transmission formulated according to the TCP or UDP standard" (depending on the socket.)
On the other end of the wire, the actual network packet (signal on the wire) will look the same no matter which function was used to make it.
The receiving end then uses whatever function is appropriate for "dequeue a received network transmission decoded according to the TCP or UDP standard." This could be recv() or WSARecv() or BeginReceive() or one of a host of other APIs.

What matters is the actual standard format used by the network, and the great benefit of the internet is that all participants on the internet agree on what that packet format looks like. Else nothing would work!


#5225671 Compiling/Linking Raknet in Linux

Posted by hplus0603 on 26 April 2015 - 11:24 AM

First, when you make install, you need to "sudo make install" because /usr/local/ isn't writable by regular accounts.
Second, after installing or updating shared libraries, you often need to run "sudo ldconfig" to make them globally visible.
Third, /usr/local/lib isn't always enabled as a default search location, so you may need to link with -L/usr/local/lib (and compile with -I/usr/local/include)


#5225578 closesocket() an async socket after using sendto()

Posted by hplus0603 on 25 April 2015 - 09:51 PM

If that's what you want, I would keep receiving data, and just discard it if I'm in the "ignore" state.


#5225378 what could be wrong with my router.

Posted by hplus0603 on 24 April 2015 - 09:51 PM

The internet has lots of complaints about that router being dumb when port forwarding.
For example: http://forums.whirlpool.net.au/forum-replies.cfm?t=1739702

I would suggest getting hardware that can run open firmware (like OpenWRT or whatever) which is likely to be more suitable to the task of running a home server.
Another alternative is to rent a virtual private server slice or a dedicated "gaming" root server.


#5224561 Sending and receiving UDP broadcast message in C++ in Windows Phone.

Posted by hplus0603 on 20 April 2015 - 03:15 PM

I don't know. I try to rewrite this metronuggest code to c++ and I get this:


If you're not going to actually follow the questions and instructions that people offer in this thread, you are very unlikely to get good help from the thread.

You said:

DatagramSample runs very well


I asked:

Does the datagram sample run well with broadcast?


You said:

I don't know.


I suggest that you actually change the datagram sample to use broadcast, without porting anything to another language.
If you can make that run well with broadcast, then you can prove that your network and hardware is not the problem.
If you cannot make that run with broadcast, then it's possible that your network is the problem.


#5224200 networking solutions for making MMO

Posted by hplus0603 on 18 April 2015 - 12:49 PM

The answer to the question "what's best for a MMO" depends on the requirements.

How many players must be supported in a single instanced area at the same time?
Do you want town bazaars with 1000 players at the same time?
Do you want sports arenas with 40000 players at the same time?
Do you want social gathering spaces with 100 players at a time, where groups of maybe 10 then go to an instanced dungeon area?

The solutions, both in engine structure, and in gameplay, must be different for each of these scenarios.

So -- are you using Bolt now? What part of your game design do you think won't be possible on Bolt, and why?

Btw: @braindigitalis: Bolt Engine does not use PHP AFAICT. I believe @Pindwin suggested that, for the non-entity work (login, trade, etc,) a web service on top of WWW would also be needed.


#5224198 NPCs/Computer Enemies in Online Games

Posted by hplus0603 on 18 April 2015 - 12:44 PM

Typically, yes, the server will send the clients the "truth" about enemies.

The logic for what an enemy does may be co-simulated deterministically on each client, too, with occasional corrections/updates from the server, depending on the specifics.

Note that, if an enemy always follows the closest player, this will be different on different screens (unless you run everyone behind with a round-trip command latency,) so the server likely needs to at least send out "currently, enemy X is following player Y," and maybe more occasionally send out "and enemy X is at position Z with direction/orientation/velocities W."


#5223701 Sending and receiving UDP broadcast message in C++ in Windows Phone.

Posted by hplus0603 on 16 April 2015 - 09:44 AM

I cannot run metronuggest code, because my project isn't in c#.


If you can't run that example to compare with, then you can't figure out whether the problem is your networking hardware, your computer/OS, or your own code, or something else.

I think this forum has exhausted its ability to read your mind, and its ability to help you when you don't actually try all the things suggested, and don't actually answer all the questions asked. If you want someone to write your code for you and/or lead you to the solution in person, I suggest hiring a contractor.


#5223577 Sending and receiving UDP broadcast message in C++ in Windows Phone.

Posted by hplus0603 on 15 April 2015 - 07:54 PM

In the previoius message, you said that data was sent to the recipient, but it wasn't actually received by the receiving program.
In this latest message, you say that data isn't actually being sent from the sending program to the network.
Which one is it?

It's very hard to try to help you when you don't actually answer the questions we're asking to try to help you.

If you run the metronuggets code on sender and receiver, does it work?


#5223317 In game chat as separate service - pros/cons?

Posted by hplus0603 on 14 April 2015 - 08:48 PM

I'm assuming you mean text chat, not voice chat.
If you have a "game host," that hosts 2-N players for reasonable values of N, then you can do in-game chat using RPC through the game host.
Chatting over RPC will only stop scaling if you want to support chatting between games, between arbitrary numbers of users.
Even there, a single server (not federated) should easily get you to 10,000 chatters, and could with some coaxing perhaps support up to 100,000 chatters (if carefully designed and profiled.)
Will off-the-shelf ejabberd work? Probably, yes! If there's a client library for Unity that you like, perhaps that's the easiest solution.


#5223315 Sending and receiving UDP broadcast message in C++ in Windows Phone.

Posted by hplus0603 on 14 April 2015 - 08:45 PM

Did you notice, that this code is in C#?


The translation betweem C++/CLR and C# should be pretty simple, if you need to do it.
Also, Microsoft samples are often available in many languages if you look -- I don't know about this one in particular.

Finally, if you already tracked down that the packet makes it to the receiver, but the process doesn't get it, then what have you done to debug that problem?
Have you enabled broadcast on the receiver?
Are you binding to the right port?
What does Wireshark say on the receiving machine?




PARTNERS