Wednesday 29 October 2014

IP TCP UPD headers

  • The MTU is the maximum size of an IP packet that can be transmitted without fragmentation.
    IPv4 mandates a path MTU of at least 576 bytes, IPv6 of at least 1280 bytes.
    Ethernet has an MTU of 1500 bytes.
  • An IP packet is composed of two parts: the packet header and the payload.
    The size of an IPv4 header is at least 20 bytes, the size of an IPv6 header at least 40 bytes.
    The payload of an IP packet is typically a TCP segment or a UDP datagram.
  • A UDP datagram consists of a UDP header and the transported data.
    The size of a UDP header is 8 bytes.
  • The size of a TCP header is at least 20 bytes.
This means an IP packet with an empty UDP datagram as payload takes at least 28 (IPv4) or 48 (IPv6) bytes, but may take more bytes.
For TCP segments, a minimum of 40 bytes are needed for TCP and IP headers. 
Also note that in the case of Ethernet, the IP packet will additionally be wrapped in a MAC packet (14 byte header + 4 byte CRC) which will be embedded in an Ethernet frame (8 byte preamble sequence). This adds 26 bytes of data to the IP packet, but doesn't count against the MTU.

No comments:

Post a Comment