vaguue / over-the-wire

Network inspection library for Node
https://vaguue.github.io/over-the-wire
GNU General Public License v3.0
59 stars 2 forks source link

Add ICMP Layer #3

Open vaguue opened 8 months ago

vaguue commented 8 months ago

Feature Request: ICMP Layer Support

Objective: Enhance the lib/layers module by introducing an ICMP layer that can read and create ICMP packets, aligning with the existing layer interface structure.

Detailed Description

The ICMP (Internet Control Message Protocol) layer is used by network devices, including routers, to send error messages and operational information indicating success or failure when communicating with another IP address. Implementing this layer will enable our library to handle ICMP packets, both in parsing and creation scenarios.

Starting Point

For the implementation, please refer to the existing exampleLayer.js in lib/layers as a base structure for the new layer.

Requirements:

  1. ICMP Layer Implementation: The ICMP layer should be capable of understanding and constructing ICMP packets. It should adhere to the specifications outlined for ICMP packets, including fields like type, code, checksum and the rest.

  2. Interface Compliance: The new ICMP layer must comply with the existing layer interface to ensure compatibility with the rest of the library. This includes implementing any required methods and properties defined in the layer interface.

  3. Testing: Comprehensive tests must be written to cover:

    • Parsing ICMP packets from a buffer and verifying the accuracy of the parsed data.
    • Creating ICMP packets and ensuring the generated buffer is correct as per ICMP specifications.
    • Comparison with existing protocol layers and their tests for consistency in implementation and testing approach.

Reference:

Developers should refer to the implementation and tests of adjacent protocols within the lib/layers directory for guidance on structure, coding standards, and testing methodologies.

Outcome: By introducing ICMP layer support, the library will be significantly more versatile in handling network traffic, paving the way for more advanced features and use cases.

Next Steps:

  1. Review the ICMP protocol specifications.
  2. Design the ICMP layer interface in alignment with the existing layer structure.
  3. Implement the ICMP layer, followed by the development of unit tests.
  4. Perform thorough testing to ensure reliability and compliance with ICMP standards.

Contributions: We welcome contributions for this feature. If you are interested in working on this, please comment below, and let's discuss how we can collaborate effectively. For any questions or to propose implementation details, feel free to reach out or start a discussion in this issue.