Headers

Useful headers

From the corresponding wikipedia articles.

https://en.wikipedia.org/wiki/IPv4

IPv4 header format
OffsetsOctet0123
OctetBit012345678910111213141516171819202122232425262728293031
00VersionIHLDSCPECNTotal Length
432IdentificationFlagsFragment Offset
864Time To LiveProtocolHeader Checksum
1296Source IP Address
16128Destination IP Address
20160Options (if IHL > 5)
60480

https://en.wikipedia.org/wiki/IPv6_packet

IPv6 Header
OffsetsOctet0123
OctetBit012345678910111213141516171819202122232425262728293031
00VersionTraffic classFlow label
432Payload lengthNext headerHop limit
864Source address
1296
16128
20160
24192Destination address
28224
32256
36288

https://en.wikipedia.org/wiki/Transmission_Control_Protocol

TCP segment header
OffsetsOctet0123
OctetBit 7 6 5 4 3 2 1 0 7 65432107654321076543210
00Source portDestination port
432Sequence number
864Acknowledgment number (if ACK set)
1296Data offsetReserved
0 0 0
NS
CWR
ECE
URG
ACK
PSH
RST
SYN
FIN
Window Size
16128ChecksumUrgent pointer (if URG set)
20
160
Options (if data offset > 5. Padded at the end with "0" bytes if necessary.)
60480

  • URG 32
  • ACK 16
  • PSH 8
  • RST 4
  • SYN 2
  • FIN 1

https://en.wikipedia.org/wiki/User_Datagram_Protocol

UDP datagram header
OffsetsOctet0123
OctetBit 0 1 2 3 4 5 6 7 8 910111213141516171819202122232425262728293031
0 0Source portDestination port
432LengthChecksum

DNS: https://datatracker.ietf.org/doc/html/rfc1035#section-4.1.1