Skip to content

Conversation

riuriuriu
Copy link

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.


                            root qdisc (prio 1:)
                                   |
               --------------------------------------------------
               |                                                |
           class 1:1                                       class 1:3
   (filters for exclude_sport)                      (all remaining traffic)
                                                                |
                                                                |
                                                     leaf qdisc (netem 30:)
                                                        (e.g. delay 100ms)

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.

                            root qdisc (prio 1:)
                                   |
               --------------------------------------------------
               |                                                |
           class 1:1                                       class 1:3
   (filters for exclude_sport)                      (all remaining traffic)
                                                                |
                                                                |
                                                     leaf qdisc (netem 30:)
                                                        (e.g. delay 100ms)
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

Successfully merging this pull request may close these issues.

2 participants