internet: (fixes #809) Solves IPv4,6 Raw Socket Fragmentation Issue
Resolves #809 (closed)
This MR solves the fragmentation issue that was arising because of no reassembly of the packets sent using the IPv4 and IPv6 Raw Socket. The modified code first merges the fragmented packets before forwarding up to the application layer.
I have also added a test that checks whether the packets are actually being reassembled or not. Logic of the test is as follows:
- Send a large packet from the sender application.
- Check the size of the packet received at the receiver application.
- Do the following checks:
- Check if the size of the payload received is equal to the size of the payload sent.
- Check if only 1 packet is received. If more than 1 packet is received, there is some issue.
Another test case that I have added is the following:
- Send a large packet from the sender
- Add a ReceiveListErrorModel on the receiver to drop the second packet received
- Make sure that nothing is received by the socket and there is exactly 1 fragment dropped at the physical layer.
Edited by Aditya Ruhela