IP - Internet Protocol

pcapkit.protocols.internet.ip contains IP only, which is a base class for Internet Protocol (IP) protocol family *, eg. IPv4, IPv6, and IPsec.

class pcapkit.protocols.internet.ip.IP(file=None, length=None, **kwargs)[source]

Bases: Internet[PT], Generic[PT]

This class implements all protocols in IP family.

  • Internet Protocol version 4 (IPv4) [RFC 791]

  • Internet Protocol version 6 (IPv6) [RFC 2460]

  • Authentication Header (pcapkit.~protocols.internet.ah.AH) [RFC 4302]

  • Encapsulating Security Payload (ESP) [RFC 4303]

  • *args (Any) – Arbitrary positional arguments.

  • **kwargs (Any) – Arbitrary keyword arguments.

Return type


classmethod id()[source]

Index ID of the protocol.


Index ID of the protocol.

Return type

tuple[Literal[“IPv4”], Literal[“IPv6”]]