-
Notifications
You must be signed in to change notification settings - Fork 35
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 can i make composition of endpoints? #9676
Comments
I was able to modify the code of cmd-nse-icmp-responder-vpp so that it also creates a kernel interface. I tested it by replacing the image inside the "Memif2Memif" example and it seems to work. Now what I am wondering is if there is a way to do the same thing within the cmd-nse-firewall-vpp image. |
Hello!
We're using a simple trick in cmd-nse-vl3-vpp that might be what you want. Have a look at https://github.com/networkservicemesh/cmd-nse-vl3-vpp/blob/main/main.go#L424 I think we could consider this problem within our technical backlog on Bug fixing week (from 12th to 19th Sept) Added on the project board. We'll post any info as soon as we get started work with the ticket. |
Thanks for the reply @denis-tingaikin Maybe I didn't explain well what i wanted to achieve. Do you have any suggestions to map a memif interface (the one present in cmd-nse-firewall -vpp) into a kernel one?(using kerneltap and l2xconnect). |
Hello @isZams , |
Hi @glazychev-art Thanks for the reply. Actually what I would like is to have a container to use as a sidecar inside a pod to interact with NSM. This container would have to implement two kernel interfaces (so it would work at L2), one for incoming and one for outgoing traffic. |
If it helps, @edwarnicke suggested to start from the code of cmd-nse-icmp-responder and then add the part where the cmd-nsc request is created https://github.com/networkservicemesh/cmd-nsc/blob/main/main.go#L190 |
@isZams You need exactly the same application as cmd-nse-firewall-vpp but without VPP, in the OS space. Then there will be these 2 kernel interfaces. I think @edwarnicke is mainly right, but the data will not be transmitted in this case. Because cmd-nse-icmp-responder and cmd-nsc have their IP-addresses. We need to add routing between. Perhaps the simplest way to check is to define NSC and NSE containers in the same pod (need to check how this will work). The main thing is not to get confused in the services and set the CIDRs correctly. NSC(actual) ===== [NSE: CIDR 172.16.0.0/31(kernel 172.16.0.0) ------ manual routing------ NSC (kernel 172.16.1.1)] ===== NSE(actual) (CIDR 172.16.1.0/31) |
@glazychev-art i followed your suggestions but i still have a problem. The kernel interface(172.16.0.0) is up and works but the other one (kernel 172.16.1.1) not. These are the files that i'm using: |
@isZams
|
@glazychev-art
|
@isZams
It says that "if the source (cmd-nsc of the passthrough-1 in our case) has app: passthrough-1 label, NSM has to choose the endpoint that has app: gateway" Regarding routing, have you tried to use a simple |
@glazychev-art
The first container it is used create a kernel interface within the POD, for the incoming traffic, while the second container has to be attached to the previous interface in order to perform the packet filtering. When SFC performs what it has to do, it will forward the traffic to the next endpoint of the chain (so the actual service requested by the NSC)
|
@isZams
You can add a third container (SFC) there without any problems:
They are all located in the same network space - i.e. we see all network interfaces from any container of the Pod.
You were right here, it is possible to do this via iptables, the rules could be like this:
Now |
Thank you very much again for your help @glazychev-art , I just wanted to better understand the mechanisms of NSM. Thanks again. |
@isZams |
Sorry again @glazychev-art but I have another doubt. |
It doesn’t matter what container you want to run in your pod - be it a packet filter, or any http server. Being in the NSM network is ensured by a sidecar container (in your case, 2 sidecar containers - cmd-nsc and cmd-nse). Have you tried running a pod like this (with three containers)? Have you faced any problems? |
@glazychev-art , yes I tried to add a 3rd alpine container that would control passing traffic on one of the 2 kernel interfaces (just as simple example) . The problem is that the pod remains in the "CrashLoopBackOff" state. EDIT |
I think the original problem has been resolved, so we can close this issue. |
Hello everyone, I would like to understand how I can manage the composition of a chain of security functions. More specifically, what I need is the creation of a kernel interface in the various pods in the middle of the chain. Taking a look at the code used to implement "cmd-nse-icmp-responder" and ""cmd-nse-icmp-responder-vpp," I saw how the related "kernel" and "memif" interfaces are created. However, I did not understand if it is possible to use the same approach, or something similar, for creating the kernel interface within "cmd-nse-firewall-vpp," that is, the image used in the "nse-composition" example within the various "passthroughs" . In the end, what I want to achieve is an identical result to this example, only that the pods in the middle of the chain are composed of 2 containers: one container that implements the actual security function, and another container useful for creating interface (a kernel one) that will then allow me to work with NSM.
I asked for the specific case of "cmd-nse-firewall-vpp" because I would like the traffic to flow, considering also a certain order, within the chain, but any other approach that works is fine as well, and I don't know if "cmd-nse-icmp-responder" would then allow me to handle anything beyond a simple ping.
Also, I wanted to ask where some documentation could be found so that I can get a clearer view of the actions and mechanisms that need to be implemented.
I thank you in advance for any responses.
EDIT
I have already looked at the various issues and I wanted to ask if the suggestion provided in this one, should actually be done like this:
The added packages are:
The text was updated successfully, but these errors were encountered: