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

Added support for ingress traffic shaping #299

Merged
merged 9 commits into from
Sep 2, 2022

Conversation

shreyasar2202
Copy link
Contributor

@shreyasar2202 shreyasar2202 commented Sep 1, 2022

This PR addresses #287. The way ingress traffic shaping is done is by using virtual interfaces - IFBs.

  • The virtual interfaces created are linked to the test interfaces such that there is a one-to-one mapping between a virtual interface and a test interface.
  • Then, incoming traffic to each test interface is forced to first pass through the corresponding virtual interface. Linux's tc commands are then used to performing egress traffic control on the virtual interface.
  • Since the outbound traffic from the virtual interface passes through the test interface, this is effectively ingress traffic control. After a certain time interval, the traffic is restored to normal

kraken/plugins/network/ingress_shaping.py Show resolved Hide resolved
kraken/plugins/network/ingress_shaping.py Outdated Show resolved Hide resolved
kraken/plugins/network/kubernetes_functions.py Outdated Show resolved Hide resolved
kraken/plugins/network/kubernetes_functions.py Outdated Show resolved Hide resolved
kraken/plugins/network/kubernetes_functions.py Outdated Show resolved Hide resolved
kraken/plugins/network/kubernetes_functions.py Outdated Show resolved Hide resolved
kraken/plugins/network/pod_interface.j2 Show resolved Hide resolved
kraken/plugins/network/pod_module.j2 Outdated Show resolved Hide resolved
kraken/plugins/network/ingress_shaping.py Outdated Show resolved Hide resolved
@sandrobonazzola sandrobonazzola added this to the 1.0.2 milestone Sep 1, 2022
@sandrobonazzola sandrobonazzola linked an issue Sep 1, 2022 that may be closed by this pull request
@sandrobonazzola sandrobonazzola added the hold hold before merging label Sep 1, 2022
Copy link
Contributor

@janosdebugs janosdebugs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tentative approval, please add filtering for the parameters to the "tc" commands so they match ^[a-z0-9]+$ to avoid possible shell injections.

Copy link
Contributor

@sandrobonazzola sandrobonazzola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sandrobonazzola sandrobonazzola removed the hold hold before merging label Sep 1, 2022
@shreyasar2202
Copy link
Contributor Author

Tentative approval, please add filtering for the parameters to the "tc" commands so they match ^[a-z0-9]+$ to avoid possible shell injections.

I've used ^[a-z0-9\-\@\_]+$as some interfaces seem to have @, _ and - as well

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.

Network scenarios should support ingress traffic shaping
3 participants