new feature: exclude ports from netem #27
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change introduces a new command line argument --exclude_sport. It allows to exclude source ports from the network emulation.
The use case is to build physical network emulator devices which serve the tcgui and other services (like mitmweb UI, ssh) without emulation. This keeps the web interfaces responsive when emulating high delays, packet drops etc.
The qdisc setup becomes more complex but is still understandable.
A type prio qdisc is used which provides 3 priority bands. The actual netem qdisc is put as a leaf to class 1:3 and a default (low priority) filter passes all traffic into it. Excluded ports use a higher priority filter to pass traffic from those ports in band 1:1 which doesn't have the netem leaf.