Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to deal with fragment? #41

Open
rhoninzhang opened this issue Jun 21, 2018 · 1 comment
Open

how to deal with fragment? #41

rhoninzhang opened this issue Jun 21, 2018 · 1 comment

Comments

@rhoninzhang
Copy link

Hey, it's a great job, I can modify data in net transmission with it, but if the package more than 1460 bytes, it will be fragmented due to IP MTU.

Since the complete message was packed via private protocol, the fragment can't be parsed and modified, is any method for caching fragment in netfilterqueue and send after repackaging, or could you please give any suggestion? Many thanks in advance.

@mattfox
Copy link
Collaborator

mattfox commented Jun 21, 2018

Netfilterqueue doesn't reassemble packets itself.

Suggestions:

  1. Keep your own cache of IP fragments received, and implement something such as https://tools.ietf.org/html/rfc815 to re-assemble them. When you have a full packet, send from Python. But you won't be using set_payload for this, as you will be sending a brand new packet.
  2. Investigate if your network card supports and has enabled large receive offload/generic receive offload and if that might solve the problem for you. Try ethtool -k eth0 | grep offload to see your interface settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants