Reputation: 3266
When I was reading some source code of Beacon, I got confused by the OPAction_OUTPUT
.
The spec1.3 said
Required Action: Output. The Output action forwards a packet to a specified OpenFlow port (see 4.1). OpenFlow switches must support forwarding to physical ports, switch-defined logical ports and the required reserved ports (see 4.5).
But it confuse in two points:
first, The Output action forwards a *packet*
, but what this packet means? Does it means the OpenFlow packet-out
containing Output Action? Or the packet contained in the Data field of OpenFlow packet-out
.
Second, what's the next? What will OpenFlow Switch do when they got a packet-out containing OUTPUT
action?
Let me give an example: When OFcontroller got a packet-in, controller does(L2 switch):
if dst in self.mac_to_port[dpid]:
out_port = self.mac_to_port[dpid][dst]
else:
out_port = ofproto.OFPP_FLOOD
actions = [datapath.ofproto_parser.OFPActionOutput(out_port)]
out = datapath.ofproto_parser.OFPPacketOut(
datapath=datapath, buffer_id=msg.buffer_id, in_port=msg.in_port,
actions=actions)
datapath.send_msg(out) // send out the PacketOut containing output action
So, the question is:
OUTPUT
in this packet-out.Thanks!
Upvotes: 2
Views: 2093
Reputation: 3266
Mailing-list OpenFlow-spec
answered the question. To make the question completed and help others, I post it here. Credit goes to Simon.
From Simon Horman :
An OpenFlow Packet-Out message, which is interpreted as such, would be received over an OpenFlow channel between the switch and a controller. Traffic for the channel does not run through the OpenFlow pipeline (OF1.3.2 section 6.3.1).
Thus, it would be the packet contained in the data field of the Packet-Out message which is processed by an Output action. This field would be forwarded to the OpenFlow pipeline by the switch after it receives the Packet-Out message via a channel.
If the Packet-Out message is sent via a channel then it will be decoded by the switch and the data field will be forwarded to the OpenFlow pipleline as described above.
If the Packet-Out message is not sent via a channel but rather just happens to be a packet that contains data that looks like a Packet-Out message then it will be handled directly by the OpenFlow pipeline without any special processing.
Upvotes: 3