Use NXAST_CONTROLLER2 and NXT_PACKET_IN2 in PacketInHandler #4726
Labels
kind/design
Categorizes issue or PR as related to design.
lifecycle/stale
Denotes an issue or PR has remained open with no activity and has become stale.
Describe what you are trying to solve
In the existing antrea code, a feature needs to use action
NXAST_CONTROLLER
in a flow and register aPacketInHandler
with a desired reason if it is expected to leverage OpenFlow packet_in mechanism to perform special actions, e.g., TraceFlow, ANP with FQDN, etc.There exists limitations in the available reasons in OVS packets:
To levearge the packet_in mechanism, antrea uses reason 0 and 1, and use reg0 to extend for different mechanism:
The weaknesses of the existing solution include,
Describe the solution you have in mind
A new design for the packetIn usage is proposed in this doc by introducing NXAST_CONTROLLER2 and NXT_PACKET_IN2 in the desired Flow action and packetIn format.
NXAST_CONTROLLER2 action adds a new field
userdata
whose type is[]byte
comparing to NXAST_CONTROLLER, which has little limitation on the usage. Hence, antrea can leverage it in the flow action "controller" to substitute the previous customization on reg0. eg.,The
userdata
value could be taken by aNXT_PACKET_IN2
message. So antrea can use it as the key to dispatch the messages to handler. In this way, we could implement a flat organization for multiple packetIn handlers.Describe how your solution impacts user flows
PacketInHandlers don't need to use reg0 to customize reasons any more (including set value in OpenFlow actions and parse values from packetIn message).
Describe the main design/architecture of your solution
To use NXAST_CONTROLLER2 and NXT_PACKET_IN2 in PacketInHandler, following steps are needed:
openflow15.OFPUTIL_PACKET_IN_NXT2
on br-int each time antrea-agent connected to OVSNXAST_CONTROLLER2
in the flow actionSendToController
when expecting to send the packet to antrea-agent. In the meanwhile, supporting to set userdata in the parameter.NXT_PACKET_IN2
for ofctrl.PacketInuserdata
as a key to register PacketInHandler or dispatch packetIn mesasgeTest plan
Additional context
The text was updated successfully, but these errors were encountered: