-
Notifications
You must be signed in to change notification settings - Fork 373
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
Packets from unknown interface are allowed in table 0 #195
Comments
Run conformance test after change the default action as "drop", and find following cases might fail. It might be a race between Openflow realization and GARP packets. Go binding is async, it returns when the Openflow entry is sent out to the outbound stream, but not wait for the ACK from OVS. Actually, if the FlowMod message is accepted by OFSwitch without any error, there is no reply message sent back to the controller. More investigation are needed to find a valid solution. [sig-apps] StatefulSet [k8s.io] Basic StatefulSet functionality [StatefulSetBasic] should perform rolling updates and roll backs of template modifications [Conformance] |
If wait 50ms before sending the GARP, the failed cases could pass in Conformance. But it adds extra waiting time for K8S to know Pod is running. |
I would suggest to start a goroutine to send several GARPs with a short interval, like 3 packets with 100ms interval. Then it wouldn't extend the time agent processes CNI ADD, and it leaves 200ms to realize the flows. |
@wenyingd does libOpenflow support flow monitors & notifications? I think longer term that's what we may want to do instead of relying on a timer. It may be useful for other things to if we have a simple framework in libOpenflow / Antrea to just register a Go channel that can get notified when a specific flow is added to a specific table. Then this Go routine here could just wait for the notification and stop sending GARPs only when the notification is received. |
For a single FlowMod message, OVS didn't support to send back an ACK to the controller(ofnet/Antrea) actively. We could leverage Multipart message to check FlowStats, ofnet could decode the Multipart reply message to ensure if a flow entry is installed on the OVS. For each Multipart request message, Antrea could define the Match and cookieIDs of the expeced Flow entry. If we want to leverage this feature to check the realization of every flow entry, for we didn't have a specific cookieID for each flow, we should also use the Match condition in the Multipart message. After OVS has sent back the multipart reply message, we also need to decode the message, and mapping the results in the flow list to the required flow entry. Do you think it satisfy the requirement @antoninbas ? I have some quick questions about it:
|
I am not too familiar with OF Multipart messages, but that sounds like a big change. I thought Multipart messages were to support very large messages. I think what I was suggesting was more something like this:
We can also wait for bundle support:
The bundle solution is probably best but the barrier one works too. I believe that by the time we get the bundle / barrier reply, we are guaranteed that flows have been installed (so no need for a "retry" mechanism). There is no need to block and delay the CNI Add reply if we don't want to do so. Sending the GARP will be done asynchronously in a separate goroutine. The goroutine will use select to wait on the channel mentioned above. When libOpenflow notifies us after receiving the matching barrier / bundle reply, we send one last GARP message and terminate the goroutine. I like this solution but it's not a "must-have" at the moment. We can merge your PR and open an issue to track this (and wait for bundle support). |
I agree to use bundle feature if we want to make the flow installation work like a "sync" mode. |
@wenyingd it's not really synchronous from the client perspective: the call to libOpenflow won't block and we don't necessarily need to wait for the reply message before we return the CNI Add reply. |
Describe the bug
The openflow entries in table0 are as following show. Antrea has added marks to the register according to packet's in_port. So the packet sent from Pod/gateway/tunnel should be resubmitted by flow entries 1~5, and the packets from unknown source might be handled by flow 6 or 7. It might introduce security risks because of the unknown packets.
To Reproduce
Deploy Antrea and create Pods.
Expected
Packets fronm unknown source are dropped in table 0.
Actual behavior
Accordint to flow 6 and 7, ip packets from unknown interface are resubmitted to table 10, and non-ip packets from unknown interface are forwarding normal.
Versions:
0.1/0.2
The text was updated successfully, but these errors were encountered: