Add UDP layer
Closed this issue · 4 comments
Feature Request: UDP Layer Support
Objective: Enhance the lib/layers
module by introducing an UDP layer that can read and create UDP packets, aligning with the existing layer
interface structure.
Detailed Description
The UDP (User Datagram Protocol) layer is one of the core communication protocols of the Internet protocol suite used to send messages (transported as datagrams in packets) to other hosts on an Internet Protocol (IP) network. Within an IP network, UDP does not require prior communication to set up communication or data paths.
Starting Point
For the implementation, please refer to the existing exampleLayer.js
in lib/layers
as a base structure for the new layer.
Requirements:
-
UDP Layer Implementation: The UDP layer should be capable of understanding and constructing UDP packets. It should adhere to the specifications outlined for UDP packets, including fields like
src, dst, headerLength, checksum
. -
Interface Compliance: The new UDP 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 thelayer
interface. -
Testing: Comprehensive tests must be written to cover:
- Parsing UDP packets from a buffer and verifying the accuracy of the parsed data.
- Creating UDP packets and ensuring the generated buffer is correct as per UDP 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 UDP 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:
- Review the UDP protocol specifications.
- Design the UDP layer interface in alignment with the existing layer structure.
- Implement the UDP layer, followed by the development of unit tests.
- Perform thorough testing to ensure reliability and compliance with UDP 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.
Hello, really interesting project. I would like to contribute to this issue. Please let me know if I can start right away.
@kajeli7 Hi! It would be very good, I can provide you with a guide on how to setup a new layer:
- Have a look at example layer and other layers as well (
TCP
for example) - I use my little module struct-compile for parsing raw binary data, but it's not necessary
- Have a look at test module for layers, example for TCP
If you have any questions or suggestions feel free to tell me, I can give you my discord/telegram/email.
Also I'm actually looking for collaborators, because I have a lot of plans for this projects which are impossible to do by myself in a reasonable amount of time :)
@vaguue
Thanks for the info!
It would be great if you could share your Discord account with me where we can chat while I am working on this issue this week.
@kajeli7 seva0075 - my Discord ID
UPD: Just made a discord server too in case we have more people collaborating: https://discord.gg/KythtrMx