Ask is moving to Stack Overflow and Serverfault.com! Please use the "opendaylight" tag on either of these sites. This site is now in Read-Only mode

Revision history [back]

click to hide/show revision 1
initial version

Answering my own question.

So, I learned that I could in fact create NodeConnectorIds (or TpIds, I presume) with the value of OpenFlow's reserved ports as the string. The values are given here, and a more detailed description of those values can be found here.

Sending packet directly to controller: Use the CONTROLLER port value.

Sending the packet to table 0 where it will then be processed: Use the TABLE port value. This is where "setIngress" comes into play: this will set the port from which the packet will be presumed to have come (useful if you have flow rules matching the in-port).

Here is an example:

public final static NodeConnectorId TABLE_PORT = new NodeConnectorId("0xfffffff9");
...
// Output from the ingress port, so the packet is processed from tables
NodeConnectorId egress = TABLE_PORT; 
// The first port, because it'll usually exist
NodeConnectorId ingress = new NodeConnectorId(node.getId().getValue() + ":1"); 
TransmitPacketInput input = new  TransmitPacketInputBuilder()
                            .setNode(MDSalAccessUtils.nodeRef(node.getId()))
                            .setEgress(MDSalAccessUtils.nodeConnectorRef(node.getId(), egress))
                            .setIngress(MDSalAccessUtils.nodeConnectorRef(node.getId(), ingress))
                            .setPayload(makePayload(node))
                            .build();
linkManager.packetProcessingService.transmitPacket(input);

and

public final static NodeConnectorId CONTROLLER_PORT = new NodeConnectorId("0xfffffffd");
...
// Output from the ingress port, so the packet is processed from tables
NodeConnectorId egress = CONTROLLER_PORT ; 
// The first port, because it'll usually exist
TransmitPacketInput input = new  TransmitPacketInputBuilder()
                            .setNode(MDSalAccessUtils.nodeRef(node.getId()))
                            .setEgress(MDSalAccessUtils.nodeConnectorRef(node.getId(), egress))
                            .setPayload(makePayload(node))
                            .build();
linkManager.packetProcessingService.transmitPacket(input);

Note that the port values here are valid for Openflow 1.1+, which is probably what you are using today. 1.0 values sit at fffx instead of fffffffx.