IP Header Constants

pcapkit.corekit.const.ipheader holds the IPv4, IPv6 and IP Authentication Header lengths and offsets the RFCs fix and that code beyond their own protocols reads: other protocols, IP reassembly and the toolkit. Each is the one home of its value (#1739), and none is configurable.

Added in version 1.7.0: Moved here from pcapkit.protocols.internet.ipv4.schema, pcapkit.protocols.internet.ipv6.protocol, pcapkit.protocols.internet.ipv6.schema and pcapkit.protocols.internet.ah.schema (#2883).

pcapkit.corekit.const.ipheader.IP_MAX_LENGTH = 65535

The most octets a 16-bit IP length field declares, for IPv4’s Total Length the header included (RFC 791 Section 3.1) and for IPv6’s Payload Length the fixed header excluded (RFC 8200 Section 3); a longer IPv6 payload is a jumbogram, whose Jumbo Payload Length must exceed it (RFC 2675 Section 2).

pcapkit.corekit.const.ipheader.IPV4_HEADER_LEN = 20

Length of the fixed IPv4 header, i.e. with no options, RFC 791 Section 3.1.

pcapkit.corekit.const.ipheader.IPV6_HEADER_LEN = 40

Length of the fixed IPv6 header, i.e. the offset of the first extension header, RFC 8200 Section 3.

pcapkit.corekit.const.ipheader.IPV6_NEXT_HEADER_OFFSET = 6

Offset of the Next Header field within the fixed IPv6 header, RFC 8200 Section 3.

pcapkit.corekit.const.ipheader.AH_HEADER_LEN = 12

Length of the fixed part of an IP Authentication Header (AH), before its Integrity Check Value, RFC 4302 Section 2.