[39dll] UDP vs TCP / nagle algorithm
#1
Posted 20 June 2012 - 06:32 PM
I recently converted my server for my game to UDP and turned on the nagle algorithm, however not entirely sure what speed differences it will make, currently i have a C++ server (using 39Dll) and have it set to run at 1000fps, anyway i just wanted to know what the nagle algorithm actually does, i was reading up on it and it says it turns off tcp's latency (as normally tcp has congestion control) however i just kind of want what it actually does to be clarified and what sort of speed increase it will have.
I Also changed all the recurrent packets like positioning to use the UDP protocol, i also just want to know how much of a difference that can potentially make to the speed at which the game runs (ik physical factors still come into play, but i would hope that it would improve those).
i also just want to ask some questions about what is a normal / reasonable amount of data to send from the server, as i want the game to run as smoothly as possible without impeding connection as much as possible)
Atm it seems to be at about 20 to 30 packets a second with a size of 220b/s to 350b/s (depending on the nature of packets) (From the client to the server).
also atm, udp is used for sending packets to the server, but not for the server sending packets back as i was under the impression that the client would need to portforward if he wanted to receive udp packets from the server (without a Network address Translator).
Thanks for any help, i just want to know these facts so i can adjust the max player count accordingly.
#2
Posted 20 June 2012 - 07:32 PM
#3
Posted 20 June 2012 - 08:16 PM
Before:
TCP Normal
After:
TCP W/ Nagle
UDP
i just wanted to see how much of a speed increase i could get
#4
Posted 20 June 2012 - 09:03 PM
im trying to learn why my udp code needs to forward certain ports. does your udp code with tcp bypass this? why exactly do u need tcp?IK, but im using both.
Before:
TCP Normal
After:
TCP W/ Nagle
UDP
i just wanted to see how much of a speed increase i could get!
#5
Posted 20 June 2012 - 09:31 PM
client:
connect:
global.clientudp = udpconnect(1000,true);
global.server_udp_port = 1001;
send packet:
sendmessage(global.clientudp, server ip, global.server_udp_port);
Server:
start:
global.serverudp = udpconnect(1001,true);
then on receivemessage(global.serverudp)
i just relay back with tcp.
so the client sends packets over udp but receives them via tcp.
#6
Posted 21 June 2012 - 02:42 PM
so the client sends packets over udp but receives them via tcp.
confused
Edited by PoniesForPeace, 21 June 2012 - 02:43 PM.
#7
Posted 21 June 2012 - 08:52 PM
(you would want to use both udp and tcp together).
the client sends the packets via UDP. But all Packets sent from the server to the client need to be done using TCP (otherwise the client would need to forward a UDP port for listening).
#8
Posted 22 June 2012 - 02:06 AM
when you use UDP, in order that the client doesn't need to portforward, u send the packets back to the client via tcp.
(you would want to use both udp and tcp together).
the client sends the packets via UDP. But all Packets sent from the server to the client need to be done using TCP (otherwise the client would need to forward a UDP port for listening).
DOOD that helps so much
i probably still wont get it to work but IT MAKES IT SO MUCH CLEARER NOW
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











