use of org.projectfloodlight.openflow.protocol.OFFlowMod.Builder in project open-kilda by telstra.
the class IngressFlowModFactory method makeDoubleVlanForwardMessage.
/**
* Make rule to match inner VLAN tag and forward in in ISL (or out port in case one-switch flow).
*/
public OFFlowMod makeDoubleVlanForwardMessage(EffectiveIds effectiveIds) {
FlowEndpoint endpoint = command.getEndpoint();
RoutingMetadata metadata = RoutingMetadata.builder().outerVlanId(endpoint.getOuterVlanId()).build(switchFeatures);
OFFlowMod.Builder builder = flowModBuilderFactory.makeBuilder(of, TableId.of(SwitchManager.INGRESS_TABLE_ID), 10).setMatch(of.buildMatch().setExact(MatchField.IN_PORT, OFPort.of(endpoint.getPortNumber())).setExact(MatchField.VLAN_VID, OFVlanVidMatch.ofVlan(endpoint.getInnerVlanId())).setMasked(MatchField.METADATA, OFMetadata.of(metadata.getValue()), OFMetadata.of(metadata.getMask())).build());
return makeForwardMessage(builder, effectiveIds, FlowEndpoint.makeVlanStack(endpoint.getInnerVlanId()));
}
use of org.projectfloodlight.openflow.protocol.OFFlowMod.Builder in project open-kilda by telstra.
the class IngressFlowModFactory method makeSingleVlanServer42IngressFlowMessage.
/**
* Make rule to forward server 42 traffic matched by outer VLAN tag and forward in in ISL.
*/
public OFFlowMod makeSingleVlanServer42IngressFlowMessage() {
RoutingMetadata metadata = buildServer42IngressMetadata();
OFFlowMod.Builder builder = flowModBuilderFactory.makeBuilder(of, TableId.of(SwitchManager.INGRESS_TABLE_ID)).setMatch(of.buildMatch().setExact(MatchField.IN_PORT, OFPort.of(command.getRulesContext().getServer42Port())).setMasked(MatchField.METADATA, OFMetadata.of(metadata.getValue()), OFMetadata.of(metadata.getMask())).build());
return makeServer42IngressFlowMessage(builder, Collections.emptyList());
}
use of org.projectfloodlight.openflow.protocol.OFFlowMod.Builder in project open-kilda by telstra.
the class IngressFlowModFactory method makeDoubleVlanServer42IngressFlowMessage.
/**
* Make rule to match server 42 packets by inner VLAN tag and forward in in ISL.
*/
public OFFlowMod makeDoubleVlanServer42IngressFlowMessage() {
FlowEndpoint endpoint = command.getEndpoint();
RoutingMetadata metadata = buildServer42IngressMetadata();
OFFlowMod.Builder builder = flowModBuilderFactory.makeBuilder(of, TableId.of(SwitchManager.INGRESS_TABLE_ID), SERVER_42_INGRESS_DOUBLE_VLAN_FLOW_PRIORITY_OFFSET).setMatch(of.buildMatch().setExact(MatchField.IN_PORT, OFPort.of(getCommand().getRulesContext().getServer42Port())).setExact(MatchField.VLAN_VID, OFVlanVidMatch.ofVlan(endpoint.getInnerVlanId())).setMasked(MatchField.METADATA, OFMetadata.of(metadata.getValue()), OFMetadata.of(metadata.getMask())).build());
return makeServer42IngressFlowMessage(builder, FlowEndpoint.makeVlanStack(endpoint.getInnerVlanId()));
}
use of org.projectfloodlight.openflow.protocol.OFFlowMod.Builder in project open-kilda by telstra.
the class IngressFlowModFactory method makeOuterOnlyVlanServer42IngressFlowMessage.
/**
* Make server 42 ingress rule to match RTT packets by port+vlan and route it into ISL/egress end.
*/
public OFFlowMod makeOuterOnlyVlanServer42IngressFlowMessage(int server42UpdPortOffset) {
Match match = makeServer42IngressFlowMatch(OfAdapter.INSTANCE.matchVlanId(of, of.buildMatch(), command.getEndpoint().getOuterVlanId()), server42UpdPortOffset);
OFFlowMod.Builder builder = flowModBuilderFactory.makeBuilder(of, TableId.of(SwitchManager.INGRESS_TABLE_ID)).setMatch(match);
return makeServer42IngressFlowMessage(builder, FlowEndpoint.makeVlanStack(command.getEndpoint().getOuterVlanId()));
}
use of org.projectfloodlight.openflow.protocol.OFFlowMod.Builder in project open-kilda by telstra.
the class IngressFlowModFactory method makeOuterOnlyVlanForwardMessage.
/**
* Make rule to match traffic by port+vlan and route it into ISL/egress end.
*/
public OFFlowMod makeOuterOnlyVlanForwardMessage(EffectiveIds effectiveIds) {
FlowEndpoint endpoint = command.getEndpoint();
OFFlowMod.Builder builder = flowModBuilderFactory.makeBuilder(of, TableId.of(SwitchManager.INGRESS_TABLE_ID)).setMatch(OfAdapter.INSTANCE.matchVlanId(of, of.buildMatch(), endpoint.getOuterVlanId()).setExact(MatchField.IN_PORT, OFPort.of(endpoint.getPortNumber())).build());
return makeForwardMessage(builder, effectiveIds, FlowEndpoint.makeVlanStack(endpoint.getOuterVlanId()));
}
Aggregations