adding rules for radius forwarding.

Change-Id: Ic3aee107a1802766c5c80adaf0c58dda7fab632c
This commit is contained in:
alshabib 2015-05-15 09:51:54 -07:00
parent 0799280ac9
commit c494f9903d

View File

@ -74,6 +74,8 @@ public class CordFabricManager implements FabricService {
private short openflowPort = 6633; private short openflowPort = 6633;
private short radiusPort = 1812;
private DeviceId fabricDeviceId = DeviceId.deviceId("of:5e3e486e73000187"); private DeviceId fabricDeviceId = DeviceId.deviceId("of:5e3e486e73000187");
private ConnectPoint oltConnectPoint = private ConnectPoint oltConnectPoint =
@ -98,18 +100,33 @@ public class CordFabricManager implements FabricService {
} }
private void setupDefaultFlows() { private void setupDefaultFlows() {
TrafficSelector toControllerS = DefaultTrafficSelector.builder() TrafficSelector toControllerOF = DefaultTrafficSelector.builder()
.matchEthType(Ethernet.TYPE_IPV4) .matchEthType(Ethernet.TYPE_IPV4)
.matchIPProtocol(IPv4.PROTOCOL_TCP) .matchIPProtocol(IPv4.PROTOCOL_TCP)
.matchTcpDst(openflowPort) .matchTcpDst(openflowPort)
.build(); .build();
TrafficSelector fromControllerS = DefaultTrafficSelector.builder() TrafficSelector fromControllerOF = DefaultTrafficSelector.builder()
.matchEthType(Ethernet.TYPE_IPV4) .matchEthType(Ethernet.TYPE_IPV4)
.matchIPProtocol(IPv4.PROTOCOL_TCP) .matchIPProtocol(IPv4.PROTOCOL_TCP)
.matchTcpSrc(openflowPort) .matchTcpSrc(openflowPort)
.build(); .build();
TrafficSelector toControllerRadius = DefaultTrafficSelector.builder()
.matchEthType(Ethernet.TYPE_IPV4)
.matchInPort(oltConnectPoint.port())
.matchIPProtocol(IPv4.PROTOCOL_UDP)
.matchUdpDst(radiusPort)
.build();
TrafficSelector fromControllerRadius = DefaultTrafficSelector.builder()
.matchEthType(Ethernet.TYPE_IPV4)
.matchInPort(oltControllerConnectPoint.port())
.matchIPProtocol(IPv4.PROTOCOL_UDP)
.matchUdpDst(radiusPort)
.build();
TrafficTreatment forwardToController = DefaultTrafficTreatment.builder() TrafficTreatment forwardToController = DefaultTrafficTreatment.builder()
.setOutput(oltControllerConnectPoint.port()) .setOutput(oltControllerConnectPoint.port())
.build(); .build();
@ -123,7 +140,7 @@ public class CordFabricManager implements FabricService {
.makePermanent() .makePermanent()
.withFlag(ForwardingObjective.Flag.VERSATILE) .withFlag(ForwardingObjective.Flag.VERSATILE)
.withPriority(PRIORITY) .withPriority(PRIORITY)
.withSelector(toControllerS) .withSelector(toControllerOF)
.withTreatment(forwardToController) .withTreatment(forwardToController)
.add(); .add();
@ -132,12 +149,32 @@ public class CordFabricManager implements FabricService {
.makePermanent() .makePermanent()
.withFlag(ForwardingObjective.Flag.VERSATILE) .withFlag(ForwardingObjective.Flag.VERSATILE)
.withPriority(PRIORITY) .withPriority(PRIORITY)
.withSelector(fromControllerS) .withSelector(fromControllerOF)
.withTreatment(forwardFromController)
.add();
ForwardingObjective radiusToController = DefaultForwardingObjective.builder()
.fromApp(appId)
.makePermanent()
.withFlag(ForwardingObjective.Flag.VERSATILE)
.withPriority(PRIORITY)
.withSelector(toControllerRadius)
.withTreatment(forwardToController)
.add();
ForwardingObjective radiusFromController = DefaultForwardingObjective.builder()
.fromApp(appId)
.makePermanent()
.withFlag(ForwardingObjective.Flag.VERSATILE)
.withPriority(PRIORITY)
.withSelector(fromControllerRadius)
.withTreatment(forwardFromController) .withTreatment(forwardFromController)
.add(); .add();
flowObjectiveService.forward(fabricDeviceId, ofToController); flowObjectiveService.forward(fabricDeviceId, ofToController);
flowObjectiveService.forward(fabricDeviceId, ofFromController); flowObjectiveService.forward(fabricDeviceId, ofFromController);
flowObjectiveService.forward(fabricDeviceId, radiusToController);
flowObjectiveService.forward(fabricDeviceId, radiusFromController);
} }
@Override @Override