[p2p-hackers] Keep Alive and network performance

Bryan Turner (brturn) brturn at cisco.com
Thu Feb 9 18:02:44 UTC 2006


Matt,

	TCP already uses keep-alives (typically set to 3-minutes).  Adding
additional keep-alives on top of this should be carefully deployed.  For
instance, if you send a keep-alive 3 minutes after the last packet received,
you will be coinciding with the "natural" TCP keep-alive and not gaining any
new information.

Overhead:

	TCP messages over the wire typically cost Ethernet + IP + TCP header
sizes, plus the size of your keep alive (the TCP keep alive on Windows was
64 bytes last I checked).  A good overview of packet overhead is [1].  So a
typical keep-alive is:
	~16 + 20 + 20 + 64 bytes = 120 bytes

	Plus the ACK response - also 120 bytes (although the ACK may be
acking other packets too, so this is a conservative estimate).  Thus the TCP
keep-alives consume:
	240 bytes/3 min = 80 bytes/min = 4 bytes/sec = 32 bits/sec

	If your link capacity is a conservative 256 Kbit/sec broadband, and
you wanted to use 1% for keep-alives, that gives you a budget of:
	~2600 bits/sec = 325 bytes/sec.

	That's about one keep-alive per second for 1% overhead.  If you have
control over the hardware abstraction layer in your app, I would suggest
piggybacking the socket write of the keep-alive with an outgoing data
payload so the OS will send them out as one packet on the wire, saving the
protocol overhead.

--Bryan
bryan.turner at pobox.com

[1] http://sd.wareonearth.com/~phil/net/overhead/

-----Original Message-----
From: p2p-hackers-bounces at zgp.org [mailto:p2p-hackers-bounces at zgp.org] On
Behalf Of Matthew Gertner
Sent: Wednesday, February 08, 2006 3:04 PM
To: Peer-to-peer development.
Subject: [p2p-hackers] Keep Alive and network performance

Hi,

We have a straightforward P2P topology with each peer in the network
attached to hub. We want to detect efficiently that a peer has disconnected
from the hub. The obvious way to do this would be to use our current TCP
connection with a relatively short Keep Alive value (a few seconds so we
could see the peer's presence updated quickly if they don't disconnect
cleanly). Does anyone have a feeling for the performance implications of
this approach if many peers are attached to a single hub? Is there another
approach that is recommend (such as using a custom UDP-based keep alive
protocol)?

Regards,
Matt
_______________________________________________
p2p-hackers mailing list
p2p-hackers at zgp.org
http://zgp.org/mailman/listinfo/p2p-hackers
_______________________________________________
Here is a web page listing P2P Conferences:
http://www.neurogrid.net/twiki/bin/view/Main/PeerToPeerConferences



More information about the P2p-hackers mailing list