IP Header

Byte Bit 0 4 8 12 16 20 24 28
   0 IP Version Hdrlen TOS Datagram (or fragment) length
   4 Identification r D M Fragment offset
   8 TTL Protocol Checksum
  12 Source
  16 Destination

TCP Header (follows IP header)

Byte Bit 0 4 8 12 16 20 24 28
  20 Source port Destination port
  24 Sequence number
  28 Acknowledgement number
  32 Hdrlen (reserved) U A P R S F Window size
  36 Checksum Urgent pointer

UDP Header (follows IP header)

Byte Bit 0 4 8 12 16 20 24 28
  20 Source port Destination port
  24 Datagram (or fragment) length Checksum

Checksum pseudo-header (used during checksum calculation)

Byte Bit 0 4 8 12 16 20 24 28
   0 Source
   4 Destination
   8 zero Protocol Datagram (or fragment) length
  12 TCP or UDP header
   data
   pad (0)

$Id: tcpheader.html 14 2004-03-15 22:29:45Z mnadler $