Skip to content

feat(internet): implement ICMP and ICMPv6, sharing a thin dispatch base #2436

Closed

Description

@JarryShaw

Is your feature request related to a problem? Please describe.
Wave 2 of the roadmap (docs/source/contributing/pep.rst, "Wave 2 — the protocol pairs that want a shared abstract base"). ICMP (RFC 792) and ICMPv6 (RFC 4443) have no implementation at all — pcapkit/protocols/application/NotImplemented/icmp.py and icmpv6.py are both 0-byte placeholders, and pcapkit/protocols/internet/__init__.py:12 carries the maintainer's own standing TODO: Implement ECN, ICMP, ICMPv6, IGMP, Shim6.

Describe the solution you'd like
A thin shared ICMP-family base between Internet and ICMP/ICMPv6, following the existing IP (between Internet and IPv4/IPv6) and IPsec (between Internet and AH/ESP) precedent — both of those hold almost nothing beyond a classmethod id() returning the pair's names, for uniform dispatch and documentation grouping, not code reuse.

That's deliberately the right amount of sharing here, not more: past the common 4-byte type/code/checksum header, ICMP and ICMPv6's type registries are completely disjoint, ICMPv6 additionally carries Neighbor Discovery (RFC 4861) and MLD (RFC 3810) with no ICMPv4 equivalent, and the checksum algorithms differ (ICMPv6's includes the IPv6 pseudo-header the way TCP/UDP do; ICMPv4's doesn't). Each concrete class should implement its own schema, type registry, and checksum independently — forcing more into the shared base would misrepresent how little these two protocols actually share.

Each follows the standard schema/data/protocol split (discussion #251): a Schema_ICMP(Schema), a Data_ICMP(Protocol), and the protocol class itself registered onto Internet.

Describe alternatives you've considered
No shared base at all — rejected for inconsistency with the IP/IPsec precedent already in the codebase.

Additional context
MLD (RFC 3810) has no presence anywhere in the tree and is gated on ICMPv6 landing first — tracked as a follow-up, not part of this issue's scope. ICMPv6 should land with at minimum the common error/informational message types (Destination Unreachable, Packet Too Big, Time Exceeded, Parameter Problem, Echo Request/Reply); Neighbor Discovery message types (RFC 4861) can be a separate follow-up given their size.

Activity

  1. added
    enhancementIssues requesting a new capability (set by the feature request template)
    on Oct 30, 2026
  2. added this to the PyPCAPKit v1.5 milestone on Oct 30, 2026
  3. moved this to Pending in PyPCAPKiton Oct 30, 2026
  4. added
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Oct 30, 2026
  5. moved this from Pending to WIP in PyPCAPKiton Oct 30, 2026
  6. 10 remaining items

  7. added 2 commits that reference this issue on Oct 30, 2026
    ba0d432
    35aa251
  8. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementIssues requesting a new capability (set by the feature request template)

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions