Question about sockets

05/04/2011 20:24 _Emme_#1
So, after skimming through a few public sources I noticed one thing in common - all sockets are running under TCP protocol and not UDP.

I'd like to get an good explanation why this is, since TCP wants an acknowledgement after sending a packet, and UDP does not, UDP should be the right choise to minimize lag, right?

Thanks
05/04/2011 20:26 Basser#2
The client no likes/uses UDP.

Why does the client not like UDP;
- UDP is never used to send important information, as it is less accurate and 'makes mistakes', where TCP offers error correction.
05/04/2011 20:35 _Emme_#3
Quote:
Originally Posted by Basser View Post
The client no likes/uses UDP.
Oh, so the client only want Tcp protocols? Would be fun to see if someone manages to get it working on Udp and see how much packet loss it would be really, could speed it up a whole lot if there's a lot of players active etc.
05/04/2011 21:27 KraHen#4
[Only registered and activated users can see links. Click Here To Register...]
05/04/2011 22:17 Syst3m_W1z4rd#5
I hope this helps.
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
05/04/2011 22:27 _Emme_#6
@System_Wizard
I know what Tcp and Udp is, duh....


Ok, so let's say UDP will loose a lot of packets (don't think anyone actually tried, but we put this in worst-scenario), how about going with RUDP (Reliable User Data Protocol). RUDP includes retransmission of lost packets and flow control, and is also faster than TCP.

Why haven't anyone tried this, seems like the right way to go to reduce lag?
05/04/2011 22:35 Syst3m_W1z4rd#7
Quote:
Originally Posted by EmmeTheCoder View Post
@System_Wizard
I know what Tcp and Udp is, duh....


Ok, so let's say UDP will loose a lot of packets (don't think anyone actually tried, but we put this in worst-scenario), how about going with RUDP (Reliable User Data Protocol). RUDP includes retransmission of lost packets and flow control, and is also faster than TCP.

Why haven't anyone tried this, seems like the right way to go to reduce lag?
UDP is mostly used for streaming media like sounds and videos, because it's about speed.
TCP would be most common to use, because it can handle it, if you're sending the data to fast or any data is lost, where UDP wouldn't do anything, if the client isn't receiving anything.
05/04/2011 23:36 _Emme_#8
Quote:
Originally Posted by Syst3m_W1z4rd View Post
UDP is mostly used for streaming media like sounds and videos, because it's about speed.
TCP would be most common to use, because it can handle it, if you're sending the data to fast or any data is lost, where UDP wouldn't do anything, if the client isn't receiving anything.
Please, no. TCP is based on UDP with a few layers added on it to retransmit lost packets, flow control, acknowledgement and a few other things, hence why it's slower than UDP.
And, UDP is not chose for it's speed when it comes to streaming, VoIP and when speaking in the phone, it's used so it won't retransmit lost packets, because if it would it would overlap the current packet, or getting played twice etc etc.
05/05/2011 00:00 CptSky#9
UDP can be used for a lot of program if you can handle the fact that you may have loose packets... Like checking every packet you are supposed to receive on the two sides (Client/Server) and if you lost a packet, you'll need to resend it... But for games like CO2, it would be very hard... TCP is slower, but the difference isn't too important for CO2.
05/05/2011 00:32 Korvacs#10
UDP would be useless in this case, essentially your saying that we can happily increase the speed at which packets are sent but equally happily sacrifice the reliability of packets getting to the client, this principle works well for things like Voip because it doesnt matter if the packets dont get there, you wouldnt even notice 1 missing packet in a Voip stream.

However for the conquer client, and indeed most games of this nature 1 missed packet can result in huge repercussions on the clients end, what happens if you missed a jump packet being sent to the client, something so small means that the player's next jump could result in them being disconnected, or that in the middle of pvp players just stand still and bug out, or if the item removal packet isnt sent to the client then the player is under the impression that the item is still there.

Having to then resend the packet further complicates the procedure, and on top of all of these disadvantages is the fact that the client just isnt designed for this type of protocol and the bandwidth that the server would require would increase because of the constant resending.

Reducing lag on a private server isnt about the protocol being used in the first place, its about how the server handles its packets, if the server isnt handling the packets fast enough in the first place then changing over to UDP would simply reduce performance further and based upon what i've seen released in the community thats what it comes down to.
05/05/2011 00:56 _tao4229_#11
[Only registered and activated users can see links. Click Here To Register...] uses UDP.

That should solve any questions on whether it's reliable enough for Conquer or not.
05/05/2011 08:55 _Emme_#12
Quote:
Originally Posted by _tao4229_ View Post
[Only registered and activated users can see links. Click Here To Register...] uses UDP.

That should solve any questions on whether it's reliable enough for Conquer or not.
According to my network teacher who has scholarship in CCNA 1-3, he claims UDP would be the best choise for a MMORPG, even though the work to go there and handle it. Maybe RUDP is an option though, as it is as reliable as TCP but faster
05/05/2011 09:45 Korvacs#13
Actually Heroes of Newerth uses BOTH tcp and udp, and just because a game was designed around using UDP doesnt mean that conquer could use it, i think that should be clear to everyone >_>"
05/05/2011 10:01 _Emme_#14
Quote:
Originally Posted by Korvacs View Post
Actually Heroes of Newerth uses BOTH tcp and udp, and just because a game was designed around using UDP doesnt mean that conquer could use it, i think that should be clear to everyone >_>"
How about RUDP then? As reliable as TCP with retransmitting lost packets, still faster than tcp
05/05/2011 10:15 Korvacs#15
Quote:
Originally Posted by EmmeTheCoder View Post
How about RUDP then? As reliable as TCP with retransmitting lost packets, still faster than tcp
Your talking about completely changing the client's way to handle packets, unless you have the source i wouldnt even attempt it, you would have to change so much code, and at the end of the day the way the source handles the packets is the bottle neck anyway, not the protocol.

This is made even more obvious by the fact that so many games and applications still use TCP instead of UDP/RUDP.

So even if you did change the protocol over somehow, which i honestly dont believe you will be able to do, the performance that you will gain will be made completely redundant by the fact that the source isnt upto handling the packets in the first place.