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 ARP Layer #1

Closed vaguue closed 5 months ago

vaguue commented 9 months ago

Feature Request: ARP Layer Support

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

Detailed Description

The ARP (Address Resolution Protocol) layer is crucial for mapping network interface addresses to physical device addresses. Implementing this layer will enable our library to handle ARP 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. ARP Layer Implementation: The ARP layer should be capable of understanding and constructing ARP packets. It should adhere to the specifications outlined for ARP packets, including fields like hardwareType, protocolType, hardwareSize, protocolSize, opcode (request or reply), hardwareSrc, protocolSrc, hardwareDst, protocolDst.

  2. Interface Compliance: The new ARP 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 ARP packets from a buffer and verifying the accuracy of the parsed data.
    • Creating ARP packets and ensuring the generated buffer is correct as per ARP 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 ARP 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 ARP protocol specifications.
  2. Design the ARP layer interface in alignment with the existing layer structure.
  3. Implement the ARP layer, followed by the development of unit tests.
  4. Perform thorough testing to ensure reliability and compliance with ARP 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.