Implement RFC 815-based IPv4 fragment reassembly#162
Conversation
Co-authored-by: mbehr1 <3258891+mbehr1@users.noreply.github.com>
Co-authored-by: mbehr1 <3258891+mbehr1@users.noreply.github.com>
…ly logic Co-authored-by: mbehr1 <3258891+mbehr1@users.noreply.github.com>
|
@copilot :
Start with the holes being stored in a separate list/vec. Allow not just the first packet to be received multiple times but any packet (should be compliant with RFC815). So remove the special logic for the first fragment. |
mbehr1
left a comment
There was a problem hiding this comment.
please change the implementation to be based on RFC815:
single buffer for the packet payload
information which data is available using "holes".
Start with the holes being stored in a separate list/vec.
Allow not just the first packet to be received multiple times but any packet (should be compliant with RFC815). So remove the special logic for the first fragment.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #162 +/- ##
==========================================
+ Coverage 83.03% 83.23% +0.19%
==========================================
Files 40 40
Lines 21153 21297 +144
==========================================
+ Hits 17565 17726 +161
+ Misses 3588 3571 -17 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@copilot can you refactor the changes wit a RFC815 alike solution? |
Co-authored-by: mbehr1 <3258891+mbehr1@users.noreply.github.com>
Refactored to use RFC 815 algorithm with hole descriptor list in commit e1f2587:
All tests pass.
Done in commit e1f2587. The RFC 815 implementation uses:
Removed the HashMap-based approach and first-fragment special logic as requested. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
The IPv4 fragment handler assumed in-order fragment arrival, violating RFC 791. Fragments arriving out-of-order were dropped.
Changes
RFC 815 Implementation:
Vec<Hole>) tracks missing data rangesFragment storage:
FragmentInfostruct with single buffer and hole list (RFC 815)HashMap<Key, Vec<u8>>toHashMap<Key, FragmentInfo>Reassembly logic:
Duplicate handling:
Test updates:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.