alshabib
Committed by Gerrit Code Review

forwarding radius packets to radius

Change-Id: I28678715adc42358d85006e2df0baa25d768746d
......@@ -121,9 +121,9 @@ public class AAA {
// NAS MAC address
private static final String NAS_MAC_ADDRESS = "00:00:00:00:10:01";
// Radius Switch Id
private static final String DEFAULT_RADIUS_SWITCH = "of:5e3e486e73000187";
private static final String DEFAULT_RADIUS_SWITCH = "of:90e2ba82f97791e9";
// Radius Port Number
private static final String DEFAULT_RADIUS_PORT = "5";
private static final String DEFAULT_RADIUS_PORT = "129";
@Property(name = "radiusIpAddress", value = DEFAULT_RADIUS_IP,
label = "RADIUS IP Address")
......
......@@ -133,24 +133,48 @@ public class CordFabricManager implements FabricService {
.build();
TrafficSelector toRadius = DefaultTrafficSelector.builder()
.matchInPort(PortNumber.portNumber(2))
.matchEthType(Ethernet.TYPE_IPV4)
.matchIPProtocol(IPv4.PROTOCOL_UDP)
.matchUdpDst(radiusPort)
.build();
TrafficTreatment puntToController = DefaultTrafficTreatment.builder()
.punt()
TrafficSelector fromRadius = DefaultTrafficSelector.builder()
.matchInPort(PortNumber.portNumber(5))
.matchEthType(Ethernet.TYPE_IPV4)
.matchIPProtocol(IPv4.PROTOCOL_UDP)
.matchUdpDst(radiusPort)
.build();
TrafficTreatment toOlt = DefaultTrafficTreatment.builder()
.setOutput(PortNumber.portNumber(2))
.build();
TrafficTreatment sentToRadius = DefaultTrafficTreatment.builder()
.setOutput(PortNumber.portNumber(5))
.build();
ForwardingObjective radiusToController = DefaultForwardingObjective.builder()
ForwardingObjective radiusToServer = DefaultForwardingObjective.builder()
.fromApp(appId)
.makePermanent()
.withFlag(ForwardingObjective.Flag.VERSATILE)
.withPriority(PRIORITY)
.withSelector(toRadius)
.withTreatment(puntToController)
.withTreatment(sentToRadius)
.add();
ForwardingObjective serverToRadius = DefaultForwardingObjective.builder()
.fromApp(appId)
.makePermanent()
.withFlag(ForwardingObjective.Flag.VERSATILE)
.withPriority(PRIORITY)
.withSelector(fromRadius)
.withTreatment(toOlt)
.add();
ForwardingObjective upCtrl = DefaultForwardingObjective.builder()
.fromApp(appId)
.makePermanent()
......@@ -173,7 +197,8 @@ public class CordFabricManager implements FabricService {
flowObjectiveService.forward(fabricDeviceId, upCtrl);
flowObjectiveService.forward(fabricDeviceId, downCtrl);
flowObjectiveService.forward(fabricDeviceId, radiusToController);
flowObjectiveService.forward(fabricDeviceId, radiusToServer);
flowObjectiveService.forward(fabricDeviceId, serverToRadius);
}
@Override
......
......@@ -253,6 +253,8 @@ public class HostMonitor implements TimerTask {
ethernet.setVlanID(vlan.toShort());
}
ethernet.setPad(true);
return ethernet;
}
......
......@@ -101,6 +101,10 @@ public class OLTPipeline extends AbstractHandlerBehaviour implements Pipeliner {
.matchEthType(EthType.EtherType.EAPOL.ethType().toShort())
.build();
TrafficSelector arpSelector = DefaultTrafficSelector.builder()
.matchEthType(EthType.EtherType.ARP.ethType().toShort())
.build();
TrafficTreatment treatment = DefaultTrafficTreatment.builder()
.punt()
.build();
......@@ -109,7 +113,11 @@ public class OLTPipeline extends AbstractHandlerBehaviour implements Pipeliner {
PacketPriority.CONTROL.priorityValue(),
appId, 0, true, null);
flowRuleService.applyFlowRules(flowRule);
FlowRule arpRule = new DefaultFlowRule(deviceId, arpSelector, treatment,
PacketPriority.CONTROL.priorityValue(),
appId, 0, true, null);
flowRuleService.applyFlowRules(flowRule, arpRule);
}
@Override
......