-
Notifications
You must be signed in to change notification settings - Fork 104
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
Add Shadow Services #140
Add Shadow Services #140
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added some general comments about the code.
Main worries are about span mode, I think we re wasting too mush resources for this support.
There is an additional perf ring buffer and thread for each cube, there are also additional lookups in the configuration map, I think it can be a good idea to try to implement this based on the conditional compilation.
@mauriciovasquezbernal yes, I know, span mode consumes a lot of resources you're right, but I wouldn't know how to improve it, maybe the conditional compilation con help us. |
Francesco, still missing a little bit of documentation. We should integrate at least the concept of "shadow" service in the documentation: what it is, and what it does. |
Yes, please use conditional compilation. You can remove the map with the span flag and do a compilation time check with a |
b38b921
to
cecc5ec
Compare
d91c131
to
61aa015
Compare
- shadow = defines if the service is visible in Linux - span = defines if all traffic is sent to Linux (valid only for shadow services) Signed-off-by: francescomessina <francescomessina92@hotmail.com>
This commit adds a method to get the prefix from netmask, and the one to get the netmask from the prefix. Signed-off-by: francescomessina <francescomessina92@hotmail.com>
Signed-off-by: francescomessina <francescomessina92@hotmail.com>
Signed-off-by: francescomessina <francescomessina92@hotmail.com>
Signed-off-by: francescomessina <francescomessina92@hotmail.com>
61aa015
to
c8d1d27
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested it, many of the features are working as expected:
- namespace and ports are created when a service is in shadow mode
- IPs in the polycube instance and in the namespace are updated accordingly
- span mode allows to use wireshark, even in other services as bridge
There are some details to be considered:
- there is not check for shadow when enabling span mode
- I think the documentation has to be extended, why are these services neeed?, Me, as a user, when should use a shadow service?
- is this possible to add automatic tests for some features?
-- check if the namespace is created
-- check if ip addresses are updated
-- check if the routing table is updated
-- something more?
Signed-off-by: francescomessina <francescomessina92@hotmail.com>
Signed-off-by: francescomessina <francescomessina92@hotmail.com>
f769ac5
to
539f5e8
Compare
This commit introduces the following points: - create a namespace for each new shadow service - create a veth and configure the its parameters (if available) - creates a second "hidden" port for each new port created on the shadow service and connects it to the veth - manages incoming traffic on the second port (traffic generated by the namespace) and forwards it out - defines the method "pcn_pkt_redirect_ns()" useful to developers to send the packets to the namespace - handles the Span mode directly in the cube_tc class (only if active) Signed-off-by: francescomessina <francescomessina92@hotmail.com>
This commit register a Shadow router to the netlink events and implements the functions to handle netlink notifications - Route added to the namespace - Route removed from the namespace - Interface removed - New Address on the interface Local traffic and ARP traffic of a Shadow router is managed by the namespace. The setIP, setNetmask and setMac methods have been implemented on the router. Signed-off-by: francescomessina <francescomessina92@hotmail.com>
Signed-off-by: francescomessina <francescomessina92@hotmail.com>
Signed-off-by: francescomessina <francescomessina92@hotmail.com>
539f5e8
to
ca8f301
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks Francesco.
This PR adds the shadow mode on the cubes.
It adds span mode (only for shadow cubes).
It extends the pcn-router to manage netlink notifications
and take advantage of the shadow mode