28 jan 2007 kl. 03.48 skrev Matthew Kaufman:
Your assumption that Ethernet, for instance, takes a nonzero amount of time to send the payload bytes of your packet is correct.
Er, actually that is somewhat incorrect. An Ethernet frame must hold at least 46 bytes of data payload and a null-sized UDP datagram will only give you 28 bytes of ethernet payload (20 bytes IPv4 header + 8 bytes UDP header). That means that at the link layer, Ethernet will add 18 bytes of pure garbage to produce a minimum-sized ethernet frame.
So, up to 18 bytes of UDP data is transmitted at the same cost as 0 bytes if you use Ethernet. After that the transmission delay factor begins to be a function of the UDP payload size.
That said, you should also consider the signalling and framing that Ethernet adds. Each new Ethernet transmission requires 8 bytes preamble + 18 bytes framing + 12 bytes waiting time + potential waiting time due to collisions. That means, that you can send at least another 8 + 18 + 12 + 18 = 56 bytes of data in your first frame without it actually being more expensive than splitting it up into two minimum-sized ethernet frames. So, 74 bytes of UDP payload in one ethernet frame is as expensive as two frames carrying 18 bytes each.
This way of reasoning could of course be extrapolated up until the MTU size, but I think it comes down to this: It's not that expensive to add extra bytes to your payload unless you have very slow links with high degrees of multiplexing.
It also occupies more RAM in every router it stops at.
Most routers have queues which are limited in the number of packets rather than the total amount of payload. So, many small packets are in some sense worse for the router than one larger one.
/Lars-Åke Larzon _______________________________________________ p2p-hackers mailing list [email protected] http://lists.zooko.com/mailman/listinfo/p2p-hackers
