-
Notifications
You must be signed in to change notification settings - Fork 27
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
Emulate netlink Link Attributes #5
Comments
I've been looking into this and it seems to me the best way is to add shaping to The alternative is a separate controller daemonset watching Topology resources and filtering on |
I think the first option makes sense. In fact, there's a standard CNI plugin now that implements bandwidth shaping, so would be interesting to see if its code can be re-used as-is https://github.com/containernetworking/plugins/blob/76307bf0f6929b39986f1c6f5e4b6abdb82b8815/plugins/meta/bandwidth/ifb_creator.go#L61 |
I hadn't thought about a discrete chained plugin for this, but I like it. The extant (ETA) It's not yet clear to me how or when the runtime decides to invoke CHECK, however. If it can't be reliably triggered, then there's a problem. Experimenting with (ETA again) Seems to happen eventually, but still poring over the CNI spec to see if it's defined or left up to the runtime. I deployed an iperf server and client and annotated an egress limit on the client after container start, and it didn't take effect right away. When I came back to it an hour later the limit was in effect. |
yep, it looks like some of their functions, e.g. |
Unfortunately that code only handles a TBF, so loss/corruption/delay/dupe/reorder will need new code. |
yep, but it's a good place to start (or a good template to copy?) |
OK, so dockershim's implementation of the bandwidth capabilities convention is just plain broken; it sets the rate properly but sets burst to MaxInt32. So depending on all kinds of variables, any given iperf run can spike to max throughput no matter what limit is set. So the upshot: AFAICT kubelet only fires CNI plugins once. The CHECK command seems to be ... nowhere I can find. Even then, the spec says this needs to do nothing or return an error, and I haven't figured out what happens if kubelet gets an error. So that's not looking good for a chained plugin, b/c the behavior I'm after needs to be completely dynamic; I want to change qdiscs at runtime, not just at boot time. |
in this case, what you mentioned above as option#2 (daemonset list/watching Topology resources and changing qdisc) seems like the only option. I'm not 100% how you'd be able to get a handle for a veth link from root NS once it's been moved to a container. what's your use case for doing this at runtime? the topology is still built at create time. |
I'm building a general network emulation platform on k8s to support engineering studies at higher fidelity than discrete event sims (like OPNET) and with less resource requirements than VM based emulators (like GNS3) with the ability to do real software-in-the-loop (and eventually hardware-in-the-loop). That means I need interactivity (comes for free on k8s) and scripted events. I'm also looking at hooking up with Chaos Toolkit as another driver. (ETA) I'm already doing |
right, gotcha. yeah, sidecars could be a viable option. networkservicemesh.io works this way. In fact, this would even make it possible to change the topology at runtime. but then you won't need meshnet-cni at all. |
Back to looking at this feature req. now that I have a multinode cluster working again. I'mna take a stab at adding this behavior to meshnetd; it should be straightforward to register a watch on topos, filter on I've done similar filters in controllers I've written in Python, so it should work b/c as a daemonset there's no chance that instances will fight with one another. That will make the traffic shaping dynamic while not interfering with how the plugin sets things up. A first version will just set a rate/delay/loss/corrupt/dupe/reorder discipline on the device root. It would be interesting to be able to do arbitrary disciplines, but maybe that's better left to the workload. The caveat will be any workload that mucks with the qdisc will have to attach to this qdisc as a parent, unless I can figure out some way to be non-interfering. |
@Cerebus I know this is an old thread, but it's still open. :) Were you able to make any progress on this feature? |
Currently we can't set the link attributes like queuing which can be used to emulate the link parameters like speed. Enabling these features will aid in creating a more realistic network lab emulation.
The text was updated successfully, but these errors were encountered: