<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: UDP vs. TCP</title>
	<atom:link href="http://gafferongames.com/networking-for-game-programmers/udp-vs-tcp/feed/" rel="self" type="application/rss+xml" />
	<link>http://gafferongames.com</link>
	<description>Glenn Fiedler&#039;s Game Development Articles and Tutorials</description>
	<lastBuildDate>Tue, 07 Sep 2010 17:03:11 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Where there&#039;s a will, be fast &#187; Simple game architecture &#8211; part 2: playing with yourself</title>
		<link>http://gafferongames.com/networking-for-game-programmers/udp-vs-tcp/#comment-2013</link>
		<dc:creator>Where there&#039;s a will, be fast &#187; Simple game architecture &#8211; part 2: playing with yourself</dc:creator>
		<pubDate>Tue, 07 Sep 2010 17:03:11 +0000</pubDate>
		<guid isPermaLink="false">http://gafferongames.wordpress.com/?page_id=84#comment-2013</guid>
		<description>[...] Gaffer on Games [...]</description>
		<content:encoded><![CDATA[<p>[...] Gaffer on Games [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://gafferongames.com/networking-for-game-programmers/udp-vs-tcp/#comment-1311</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Fri, 06 Aug 2010 15:16:23 +0000</pubDate>
		<guid isPermaLink="false">http://gafferongames.wordpress.com/?page_id=84#comment-1311</guid>
		<description>Do you understand what Nagle&#039;s algorithm really does? Turning it off does not stop TCP waiting for lost packets to be resent - it just turns off the code that coalesces small packets into one large packet on the send side.

&lt;a href=&quot;http://en.wikipedia.org/wiki/Nagle%27s_algorithm&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Nagle&#039;s_algorithm&lt;/a&gt;

Even with Nagle&#039;s algorithm disabled my points about TCP&#039;s behavior under packet loss still stand. When a packet is lost TCP must wait for that packet to be resent. While waiting any other (out of order) packets received are held hostage in a queue so that the data transmission looks like a reliable ordered stream.

The only way to avoid this is to use UDP.</description>
		<content:encoded><![CDATA[<p>Do you understand what Nagle&#8217;s algorithm really does? Turning it off does not stop TCP waiting for lost packets to be resent &#8211; it just turns off the code that coalesces small packets into one large packet on the send side.</p>
<p><a href="http://en.wikipedia.org/wiki/Nagle%27s_algorithm" rel="nofollow">http://en.wikipedia.org/wiki/Nagle&#39;s_algorithm</a></p>
<p>Even with Nagle&#8217;s algorithm disabled my points about TCP&#8217;s behavior under packet loss still stand. When a packet is lost TCP must wait for that packet to be resent. While waiting any other (out of order) packets received are held hostage in a queue so that the data transmission looks like a reliable ordered stream.</p>
<p>The only way to avoid this is to use UDP.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: thebest</title>
		<link>http://gafferongames.com/networking-for-game-programmers/udp-vs-tcp/#comment-1292</link>
		<dc:creator>thebest</dc:creator>
		<pubDate>Thu, 05 Aug 2010 20:23:46 +0000</pubDate>
		<guid isPermaLink="false">http://gafferongames.wordpress.com/?page_id=84#comment-1292</guid>
		<description>Do you even understand what he is saying? This guide is pretty fucking stupid, as are you for following it word for word. TCP is great, and unless you&#039;re writing an FPS, it performs perfectly fine. My question is how low your IQ would have to be to listen to this guy when he says &quot;Even with Nagle&#039;s algorithm disabled, TCP still does bad fuck TCP&quot; (paraphrased)? How does it do bad?</description>
		<content:encoded><![CDATA[<p>Do you even understand what he is saying? This guide is pretty fucking stupid, as are you for following it word for word. TCP is great, and unless you&#8217;re writing an FPS, it performs perfectly fine. My question is how low your IQ would have to be to listen to this guy when he says &#8220;Even with Nagle&#8217;s algorithm disabled, TCP still does bad fuck TCP&#8221; (paraphrased)? How does it do bad?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Glenn Fiedler</title>
		<link>http://gafferongames.com/networking-for-game-programmers/udp-vs-tcp/#comment-837</link>
		<dc:creator>Glenn Fiedler</dc:creator>
		<pubDate>Tue, 13 Apr 2010 06:11:05 +0000</pubDate>
		<guid isPermaLink="false">http://gafferongames.wordpress.com/?page_id=84#comment-837</guid>
		<description>these things map well to reliable events. basically keep sending the event at some desired rate (more frequently = more time critcial info) until you receive an ACK for one of the packets which the event was sent in.

read the article or reliability and flow control later on in the series for more info about how to setup an ACK system over UDP

cheers</description>
		<content:encoded><![CDATA[<p>these things map well to reliable events. basically keep sending the event at some desired rate (more frequently = more time critcial info) until you receive an ACK for one of the packets which the event was sent in.</p>
<p>read the article or reliability and flow control later on in the series for more info about how to setup an ACK system over UDP</p>
<p>cheers</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jack</title>
		<link>http://gafferongames.com/networking-for-game-programmers/udp-vs-tcp/#comment-836</link>
		<dc:creator>jack</dc:creator>
		<pubDate>Tue, 13 Apr 2010 00:19:13 +0000</pubDate>
		<guid isPermaLink="false">http://gafferongames.wordpress.com/?page_id=84#comment-836</guid>
		<description>if you have something such as a attack command (user fires a shot, swings their sword, etc), do you implement some kind of lossless UDP? Or, is their perhaps another model?</description>
		<content:encoded><![CDATA[<p>if you have something such as a attack command (user fires a shot, swings their sword, etc), do you implement some kind of lossless UDP? Or, is their perhaps another model?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Glenn Fiedler</title>
		<link>http://gafferongames.com/networking-for-game-programmers/udp-vs-tcp/#comment-835</link>
		<dc:creator>Glenn Fiedler</dc:creator>
		<pubDate>Wed, 24 Feb 2010 16:42:36 +0000</pubDate>
		<guid isPermaLink="false">http://gafferongames.wordpress.com/?page_id=84#comment-835</guid>
		<description>RE: Geo

Dedicated servers generally run at fixed tick rates, but each player is in their own time stream (fps), and thus advance each player forward independently in time with (potentially) variable dt.

Clients typically run at whatever framerate they like, the exception being if you are synchronizing via deterministic lockstep therefore each player would need to have the same DT for everything to stay in sync, also, fixed dt (or at least, a multiple of a fixed base dt) is very useful for networking physics simulation

cheers</description>
		<content:encoded><![CDATA[<p>RE: Geo</p>
<p>Dedicated servers generally run at fixed tick rates, but each player is in their own time stream (fps), and thus advance each player forward independently in time with (potentially) variable dt.</p>
<p>Clients typically run at whatever framerate they like, the exception being if you are synchronizing via deterministic lockstep therefore each player would need to have the same DT for everything to stay in sync, also, fixed dt (or at least, a multiple of a fixed base dt) is very useful for networking physics simulation</p>
<p>cheers</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Glenn Fiedler</title>
		<link>http://gafferongames.com/networking-for-game-programmers/udp-vs-tcp/#comment-834</link>
		<dc:creator>Glenn Fiedler</dc:creator>
		<pubDate>Wed, 24 Feb 2010 16:41:32 +0000</pubDate>
		<guid isPermaLink="false">http://gafferongames.wordpress.com/?page_id=84#comment-834</guid>
		<description>yes. data is sent as atomic packets. you cannot receive a partial UDP packet. each packet sent that is not lost or corrupted results in one packet to be read, of the same exact size and contents that were sent.

regarding two packets per-frame. it&#039;s certainly &quot;OK&quot; but is not ideal. consider that each UDP packet has both a UDP header (8 bytes) and an IP header (20 bytes average) -- if you group all of your data together in one packet per-frame, you get more payload bytes vs. packet header overhead

cheers</description>
		<content:encoded><![CDATA[<p>yes. data is sent as atomic packets. you cannot receive a partial UDP packet. each packet sent that is not lost or corrupted results in one packet to be read, of the same exact size and contents that were sent.</p>
<p>regarding two packets per-frame. it&#8217;s certainly &#8220;OK&#8221; but is not ideal. consider that each UDP packet has both a UDP header (8 bytes) and an IP header (20 bytes average) &#8212; if you group all of your data together in one packet per-frame, you get more payload bytes vs. packet header overhead</p>
<p>cheers</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Geo</title>
		<link>http://gafferongames.com/networking-for-game-programmers/udp-vs-tcp/#comment-833</link>
		<dc:creator>Geo</dc:creator>
		<pubDate>Wed, 24 Feb 2010 11:10:16 +0000</pubDate>
		<guid isPermaLink="false">http://gafferongames.wordpress.com/?page_id=84#comment-833</guid>
		<description>Hi

On UDP, can you guarantee that one recvfrom() matches exactly one sendto() ? I.e if a client sends 3 messages/frame at 30fps will they arrive in 3 recvfrom/frame? On TCP they will surely arrive concatenated by the TCP layer. The problem is code design for parsing the array received from the socket - if i expect a single UDP header(seq, ackbitfield) and more than one game headers( a server sends X*playerAction messages concatenated by me) ; or i must expect multiple udp headers.

For an action game, is it ok to have always 2 sendto/frame ? i.e. one for position(unreliable) one for actions(reliable) or the number of sendto/frame shoul be minimal?

Thanks a lot!</description>
		<content:encoded><![CDATA[<p>Hi</p>
<p>On UDP, can you guarantee that one recvfrom() matches exactly one sendto() ? I.e if a client sends 3 messages/frame at 30fps will they arrive in 3 recvfrom/frame? On TCP they will surely arrive concatenated by the TCP layer. The problem is code design for parsing the array received from the socket &#8211; if i expect a single UDP header(seq, ackbitfield) and more than one game headers( a server sends X*playerAction messages concatenated by me) ; or i must expect multiple udp headers.</p>
<p>For an action game, is it ok to have always 2 sendto/frame ? i.e. one for position(unreliable) one for actions(reliable) or the number of sendto/frame shoul be minimal?</p>
<p>Thanks a lot!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: [NRPPJ - 1/12] UDP vs. TCP &#187; BloGUI</title>
		<link>http://gafferongames.com/networking-for-game-programmers/udp-vs-tcp/#comment-832</link>
		<dc:creator>[NRPPJ - 1/12] UDP vs. TCP &#187; BloGUI</dc:creator>
		<pubDate>Fri, 12 Feb 2010 03:01:15 +0000</pubDate>
		<guid isPermaLink="false">http://gafferongames.wordpress.com/?page_id=84#comment-832</guid>
		<description>[...] termina aqui o primeiro artigo dessa série. Na postagem original (em inglês) no blog do Glenn a discussão a respeito do tema continua nos comentários. Alguns leitores [...]</description>
		<content:encoded><![CDATA[<p>[...] termina aqui o primeiro artigo dessa série. Na postagem original (em inglês) no blog do Glenn a discussão a respeito do tema continua nos comentários. Alguns leitores [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Geo</title>
		<link>http://gafferongames.com/networking-for-game-programmers/udp-vs-tcp/#comment-831</link>
		<dc:creator>Geo</dc:creator>
		<pubDate>Thu, 11 Feb 2010 18:37:28 +0000</pubDate>
		<guid isPermaLink="false">http://gafferongames.wordpress.com/?page_id=84#comment-831</guid>
		<description>Thanks.

I am curious about something. You always refer to 30 packets/second so i am guessing that all multiplayer games must be tick based(i.e on tick X everything is the same on all machines).

The problem is that on slower machines(phones) you cannot limit the fps to it;s lower value because it would be too small. A way around it is to have constant 30 calls/sec to update and up to 30 calls to render. So each render will interpolate between the next update and the last one. Another way is to use everything time-based and have variable fps between machines. I think this may be a problem implementing lock-step games... what do you think?

Thank you again for sharing your knowledge!</description>
		<content:encoded><![CDATA[<p>Thanks.</p>
<p>I am curious about something. You always refer to 30 packets/second so i am guessing that all multiplayer games must be tick based(i.e on tick X everything is the same on all machines).</p>
<p>The problem is that on slower machines(phones) you cannot limit the fps to it;s lower value because it would be too small. A way around it is to have constant 30 calls/sec to update and up to 30 calls to render. So each render will interpolate between the next update and the last one. Another way is to use everything time-based and have variable fps between machines. I think this may be a problem implementing lock-step games&#8230; what do you think?</p>
<p>Thank you again for sharing your knowledge!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
