PcapPlusPlus icon indicating copy to clipboard operation
PcapPlusPlus copied to clipboard

Add ICMPv6 and NDP protocol

Open kolbex opened this issue 3 years ago • 10 comments

Add ICMPv6 and NDP layer support

  • Add layer classes for handling ICMPv6 and NDP packets
  • Supported packet types: Echo Request, Echo Reply, Neighbor Advertisement, Neighbor Solicitation
  • Supports crafting and parsing
  • Add tests
  • Update README.md file

kolbex avatar Jun 13 '22 16:06 kolbex

Thanks @maruu for the review, i currently pushed the changes, @seladb this PR is ready for review

kolbex avatar Jun 20 '22 13:06 kolbex

@clementperon could you do the review? @seladb seems to be unavailable at the moment

kolbex avatar Jun 21 '22 08:06 kolbex

@clementperon could you do the review? @seladb seems to be unavailable at the moment

Hi @kolbex , I'm sorry for the late reply, I was out for a few weeks. I'll try to review this PR over the weekend. Thank you so much for this contribution!

seladb avatar Jun 24 '22 05:06 seladb

@kolbex what should we do with this PR? Please see my comment on the general design: https://github.com/seladb/PcapPlusPlus/pull/902#pullrequestreview-1019350061

seladb avatar Jul 14 '22 07:07 seladb

@seladb thanks for the review and sorry for the late reply i also find it a good idea to move the NDP Layer together with the ICMPv6 Layer into one layer, and i was also thinking about a solution with tlv, i will let you next week if i can provide a solution with tlv Additionally i added ICMPv6_ECHO_REQUEST and ICMPv6_ECHO_REPLY messages, but further messages are not planed from my side to implement. I will push the changes next week.

kolbex avatar Jul 16 '22 08:07 kolbex

@seladb thanks for the review and sorry for the late reply i also find it a good idea to move the NDP Layer together with the ICMPv6 Layer into one layer, and i was also thinking about a solution with tlv, i will let you next week if i can provide a solution with tlv Additionally i added ICMPv6_ECHO_REQUEST and ICMPv6_ECHO_REPLY messages, but further messages are not planed from my side to implement. I will push the changes next week.

Sounds good @kolbex , thank you! 🙏

seladb avatar Jul 16 '22 08:07 seladb

Hi @kolbex ! if you're interested we have Slack workspace for PcapPlusPlus where we chat outside of GitHub. If you're interested in joining please send me your email and I'll send you an invite (you can either paste your email here or send an email to [email protected])

seladb avatar Jul 16 '22 18:07 seladb

Hi @seladb, regarding tlv: in the NDP option types the length is stored in units of 8 octets, how can this be handled in pcpp?

kolbex avatar Jul 19 '22 10:07 kolbex

Hi @seladb, regarding tlv: in the NDP option types the length is stored in units of 8 octets, how can this be handled in pcpp?

@kolbex from the examples I saw and the (little) documentation I read it looks like ICMPv6 options are in the format of Type (1 byte), Length (1 byte), Value (variable length). In that case you can look at IPv4Layer as a good example:

Please let me know what you think

seladb avatar Jul 20 '22 07:07 seladb

Hi @seladb, i updated the PR according to your review:

  • TLV support for NDP messages
  • ICMPv6 and NDP is combined to one layer
  • ICMPv6Layer as a abstract layer base for icmpv6 messages
  • Added messages: echo request and echo reply

can you please do another review? Please let me know what do you think

One failure which i currently saw because of the dev branch merge: ProtocolType is crashing with FTP

kolbex avatar Aug 01 '22 15:08 kolbex

@seladb can you please do the next review

kolbex avatar Aug 08 '22 12:08 kolbex

Thank you so much @kolbex for working on this, I really appreciate your contribution! 🙏 ❤️ ICMPv6 was missing in PcapPlusPlus, and it's a great addition to this project!

seladb avatar Aug 13 '22 22:08 seladb