4

How small is the smallest frame size in Ethernet? What is the TCP and IP protocol overhead?

What I want to find out is the overhead of a single byte TCP/IP stream in terms of used bandwidth (one way, excluding the ACK). I assume it is in the vicinity of 32-100 bytes, but its really not my area of expertise.

EDIT I'm programming a web server and I want to program the correct sizes for my application data so I get good throughput in my program. For this I want to know what limits I have to reduce bandwidth.

Jack Wester
  • 5,170
  • 3
  • 28
  • 47
  • 4
    For those of you closing this question. If I'm *developing* server side software, how is this not related to programming? TCP/IP processing is software just as JSON processing is software. Although I understand there are more programmers using web servers and operating systems than developing them, the question relates well for programming the stuff that the tags mark. – Jack Wester Jan 20 '12 at 00:51
  • If you're looking for good throughput, bigger is better (up to about 1400 bytes). The less data you have being sent or received at a time, the higher the frame overhead will be (proportionally). The headers will be pretty much the same size whether you're sending one byte or one thousand. – cHao Jan 20 '12 at 02:32
  • @cHao - Thats not the issue. Each request comes from unique clients. We serve over 20 million clients and handle many billion requests monthly. Message data are a few bytes. – Jack Wester Jan 20 '12 at 04:55
  • Are you writing the device driver? If not, you don't deal with Ethernet frames, you deal with TCP streams or UDP datagrams. So Ethernet parameters are irrelevant, they're handled by the network stack. – Barmar Nov 18 '14 at 01:39
  • I wan't to see how far behind ethernet is from the throughput achievable using custom infiniband hardware for insane amounts of minuscule messages (IP is not needed and certainly not TCP as ordering is anyways irrelevant to me). I wanted to see if I can avoid exotic hardware. – Jack Wester Jan 14 '15 at 16:58

1 Answers1

7

The 802.3 standard specifies the minimal frame size as implementation-dependent. All the specific, most popular implementations (up to and including 100Mbps, 1Gbps, and 10Gbps) have it set as 512 bits, which is equal to 64 octets. Keep in mind that this includes the header (not including the preamble and the SFD, so 12 bytes for the addresses and 2 bytes for the frame type) and the CRC (4 bytes) in the trailer. Therefore, while transmitting a frame with the minimal size, we've got 46 bytes for the data itself.

The basic IPv4 header is 20 bytes long, and the TCPv4 header is 20 bytes as well. Keep in mind that both of these headers can include an additional optional "Options" field that may enlarge them (I don't know about any systems actually doing that, though). That leaves you 6 bytes for your real data inside a minimally-sized Ethernet frame.

Daniel Kamil Kozar
  • 18,476
  • 5
  • 50
  • 64
  • Super. So assume the answer to the question is 64 bytes and the second is 40-58 bytes given that we are talking about modern NICs. Thank you! – Jack Wester Jan 17 '12 at 23:06
  • A follow up question is that I interpret your answer as I would be more likely to have 24 bytes than 6 bytes of real data given that the option field is not in effect. Correct? – Jack Wester Jan 17 '12 at 23:07
  • Not really. The size of the IPv4 and TCP headers *without* any additional options is exactly 20 bytes (or, more appropriately, octets). I haven't included the extra option field in my final answer, you're right with the 6 bytes. :) – Daniel Kamil Kozar Jan 17 '12 at 23:09
  • Got it. 46 - 20 - 20 equals 6. Silly of me. Thank you again! – Jack Wester Jan 17 '12 at 23:14