tags:

views:

305

answers:

3

Hi,

what is the size of an empty UDP datagram? And that of an empty TCP packet?

I can only find infos about the MTU, but I want to know what is the "base" size of these, in order to estimate bandwidth consumption for protocols on top of them.

Thanks in advance for infos.

+2  A: 

See User Datagram Protocol. The UDP Header is 8 Bytes (64 bits) long.

The mimimum size of the bare TCP header is 5 words (32bit word), while the maximum size of a TCP header is 15 words.

Best wishes, Fabian

halfdan
+1  A: 

Artelius and halfdan are correct, but you're missing something: UDP and TCP both run on top of some physical transport. For example, if you're using UDP over ethernet, you should also include the size of the ethernet frame

Useless
Well.. and of course the IP frame if you want it to be routed.
halfdan
There is no such thing as an "IP frame": you probably want to be referring to an "IP packet".
jldupont
A: 

Size of Ethernet frame - 24 Bytes Size of IPv4 Header (without any options) - 20 bytes Size of TCP Header (without any options) - 20 Bytes So total size of empty TCP datagram - 24 + 20 + 20 = 64 bytes

Size of UDP header - 8 bytes So total size of empty UDP datagram - 24 + 20 + 8 = 52 bytes

Himanshu
this (modulo possible errors :) was indeed the overall result I was looking for indeed!
puccio
I think the minimum ethernet frame is 64 bytes (the payload must be padded to at least 46 bytes).
Useless
Not all TCP and UDP is carried on top of Ethernet, though - in fact the same packet may well be carried on several different physical layers during its transit across various networks.
caf
You are assuming that the IP server layer rides on top of Ethernet - a fair assumption for LANS, a lower probability one when it comes to the WAN.
jldupont