Repository navigation
feat: implement RFC 5837 ICMP interface and next-hop identification - #137
Merged
Merged
Conversation
… parser - An IP Address sub-object with an AFI other than 1/2 has an unknowable length, so the name and MTU sub-objects after it cannot be located; mark the object malformed instead of reading them from the wrong offset. - Remove the `state::InterfaceInfo` alias: `probe::InterfaceInfo` is the local network interface, and two types with that name would be a trap. Use `IcmpInterfaceInfo` directly. - Drop the `.clone()` on `interface_info` in the parser's match arms; the arms are exclusive, so it moves like `mpls_labels` already does. - Say plainly that duplicate-role handling is lenient (first object per role wins) rather than the RFC's discard-the-message; rename the test to match. - Hoist two Arista frames to consts and add a 20k-case proptest that mutates and truncates them through parse_icmp_response: any router on the path can hand this parser arbitrary bytes, so it must never panic. - CHANGELOG entry under [Unreleased].
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves #134.
Implements support for RFC 5837 (Extending ICMP for Interface and Next-Hop Identification), which defines ICMP extension objects (Class 2) appended to ICMP Time Exceeded, Destination Unreachable, and Parameter Problem messages to identify interfaces and next-hops traversed along a network path.
Key Changes
RFC 5837 Parser (
src/probe/correlate.rs):ifIndex(bit 4), IP address with IPv4/IPv6 AFI (bit 5), human-readable interface name with UTF-8 and null-padding stripping (bit 6), and interface MTU (bit 7).RFC 4884 ICMPv6 Header Fix:
State & Receiver Pipeline (
src/state/session.rs,src/trace/receiver.rs):InterfaceRoleandIcmpInterfaceInfostructs (withInterfaceInfoalias) tostate::session.ResponderStats.interface_infowith JSON serialization support.record_response_with_extensionsandrecord_response_detecting_flaps_with_extensionstoHop, while maintaining backwards compatibility withrecord_response_with_mpls.BatchedResponsein the trace receiver.TUI Hop Detail View (
src/tui/views/hop.rs):Tests:
Review fixes (second commit)
state::InterfaceInfoalias (probe::InterfaceInfois the local NIC type); code usesIcmpInterfaceInfo..clone()s in the parser's exclusive match arms.parse_icmp_response— the parser sits on a trust boundary and must never panic.[Unreleased]entry.The six embedded Arista frames were verified byte-for-byte against the pcaps from #134 (frames 1/3/7 of each capture; note the two "packet 7" vectors are Destination Unreachable, which exercises the DU path as well as Time Exceeded).