Committed by
Gerrit Code Review
forwarding radius packets to radius
Change-Id: I28678715adc42358d85006e2df0baa25d768746d
Showing
4 changed files
with
43 additions
and
8 deletions
| ... | @@ -121,9 +121,9 @@ public class AAA { | ... | @@ -121,9 +121,9 @@ public class AAA { |
| 121 | // NAS MAC address | 121 | // NAS MAC address |
| 122 | private static final String NAS_MAC_ADDRESS = "00:00:00:00:10:01"; | 122 | private static final String NAS_MAC_ADDRESS = "00:00:00:00:10:01"; |
| 123 | // Radius Switch Id | 123 | // Radius Switch Id |
| 124 | - private static final String DEFAULT_RADIUS_SWITCH = "of:5e3e486e73000187"; | 124 | + private static final String DEFAULT_RADIUS_SWITCH = "of:90e2ba82f97791e9"; |
| 125 | // Radius Port Number | 125 | // Radius Port Number |
| 126 | - private static final String DEFAULT_RADIUS_PORT = "5"; | 126 | + private static final String DEFAULT_RADIUS_PORT = "129"; |
| 127 | 127 | ||
| 128 | @Property(name = "radiusIpAddress", value = DEFAULT_RADIUS_IP, | 128 | @Property(name = "radiusIpAddress", value = DEFAULT_RADIUS_IP, |
| 129 | label = "RADIUS IP Address") | 129 | label = "RADIUS IP Address") | ... | ... |
| ... | @@ -133,24 +133,48 @@ public class CordFabricManager implements FabricService { | ... | @@ -133,24 +133,48 @@ public class CordFabricManager implements FabricService { |
| 133 | .build(); | 133 | .build(); |
| 134 | 134 | ||
| 135 | TrafficSelector toRadius = DefaultTrafficSelector.builder() | 135 | TrafficSelector toRadius = DefaultTrafficSelector.builder() |
| 136 | + .matchInPort(PortNumber.portNumber(2)) | ||
| 136 | .matchEthType(Ethernet.TYPE_IPV4) | 137 | .matchEthType(Ethernet.TYPE_IPV4) |
| 137 | .matchIPProtocol(IPv4.PROTOCOL_UDP) | 138 | .matchIPProtocol(IPv4.PROTOCOL_UDP) |
| 138 | .matchUdpDst(radiusPort) | 139 | .matchUdpDst(radiusPort) |
| 139 | .build(); | 140 | .build(); |
| 140 | 141 | ||
| 141 | - TrafficTreatment puntToController = DefaultTrafficTreatment.builder() | 142 | + TrafficSelector fromRadius = DefaultTrafficSelector.builder() |
| 142 | - .punt() | 143 | + .matchInPort(PortNumber.portNumber(5)) |
| 144 | + .matchEthType(Ethernet.TYPE_IPV4) | ||
| 145 | + .matchIPProtocol(IPv4.PROTOCOL_UDP) | ||
| 146 | + .matchUdpDst(radiusPort) | ||
| 147 | + .build(); | ||
| 148 | + | ||
| 149 | + TrafficTreatment toOlt = DefaultTrafficTreatment.builder() | ||
| 150 | + .setOutput(PortNumber.portNumber(2)) | ||
| 151 | + .build(); | ||
| 152 | + | ||
| 153 | + | ||
| 154 | + TrafficTreatment sentToRadius = DefaultTrafficTreatment.builder() | ||
| 155 | + .setOutput(PortNumber.portNumber(5)) | ||
| 143 | .build(); | 156 | .build(); |
| 144 | 157 | ||
| 145 | - ForwardingObjective radiusToController = DefaultForwardingObjective.builder() | 158 | + ForwardingObjective radiusToServer = DefaultForwardingObjective.builder() |
| 146 | .fromApp(appId) | 159 | .fromApp(appId) |
| 147 | .makePermanent() | 160 | .makePermanent() |
| 148 | .withFlag(ForwardingObjective.Flag.VERSATILE) | 161 | .withFlag(ForwardingObjective.Flag.VERSATILE) |
| 149 | .withPriority(PRIORITY) | 162 | .withPriority(PRIORITY) |
| 150 | .withSelector(toRadius) | 163 | .withSelector(toRadius) |
| 151 | - .withTreatment(puntToController) | 164 | + .withTreatment(sentToRadius) |
| 152 | .add(); | 165 | .add(); |
| 153 | 166 | ||
| 167 | + ForwardingObjective serverToRadius = DefaultForwardingObjective.builder() | ||
| 168 | + .fromApp(appId) | ||
| 169 | + .makePermanent() | ||
| 170 | + .withFlag(ForwardingObjective.Flag.VERSATILE) | ||
| 171 | + .withPriority(PRIORITY) | ||
| 172 | + .withSelector(fromRadius) | ||
| 173 | + .withTreatment(toOlt) | ||
| 174 | + .add(); | ||
| 175 | + | ||
| 176 | + | ||
| 177 | + | ||
| 154 | ForwardingObjective upCtrl = DefaultForwardingObjective.builder() | 178 | ForwardingObjective upCtrl = DefaultForwardingObjective.builder() |
| 155 | .fromApp(appId) | 179 | .fromApp(appId) |
| 156 | .makePermanent() | 180 | .makePermanent() |
| ... | @@ -173,7 +197,8 @@ public class CordFabricManager implements FabricService { | ... | @@ -173,7 +197,8 @@ public class CordFabricManager implements FabricService { |
| 173 | 197 | ||
| 174 | flowObjectiveService.forward(fabricDeviceId, upCtrl); | 198 | flowObjectiveService.forward(fabricDeviceId, upCtrl); |
| 175 | flowObjectiveService.forward(fabricDeviceId, downCtrl); | 199 | flowObjectiveService.forward(fabricDeviceId, downCtrl); |
| 176 | - flowObjectiveService.forward(fabricDeviceId, radiusToController); | 200 | + flowObjectiveService.forward(fabricDeviceId, radiusToServer); |
| 201 | + flowObjectiveService.forward(fabricDeviceId, serverToRadius); | ||
| 177 | } | 202 | } |
| 178 | 203 | ||
| 179 | @Override | 204 | @Override | ... | ... |
| ... | @@ -253,6 +253,8 @@ public class HostMonitor implements TimerTask { | ... | @@ -253,6 +253,8 @@ public class HostMonitor implements TimerTask { |
| 253 | ethernet.setVlanID(vlan.toShort()); | 253 | ethernet.setVlanID(vlan.toShort()); |
| 254 | } | 254 | } |
| 255 | 255 | ||
| 256 | + ethernet.setPad(true); | ||
| 257 | + | ||
| 256 | return ethernet; | 258 | return ethernet; |
| 257 | } | 259 | } |
| 258 | 260 | ... | ... |
| ... | @@ -101,6 +101,10 @@ public class OLTPipeline extends AbstractHandlerBehaviour implements Pipeliner { | ... | @@ -101,6 +101,10 @@ public class OLTPipeline extends AbstractHandlerBehaviour implements Pipeliner { |
| 101 | .matchEthType(EthType.EtherType.EAPOL.ethType().toShort()) | 101 | .matchEthType(EthType.EtherType.EAPOL.ethType().toShort()) |
| 102 | .build(); | 102 | .build(); |
| 103 | 103 | ||
| 104 | + TrafficSelector arpSelector = DefaultTrafficSelector.builder() | ||
| 105 | + .matchEthType(EthType.EtherType.ARP.ethType().toShort()) | ||
| 106 | + .build(); | ||
| 107 | + | ||
| 104 | TrafficTreatment treatment = DefaultTrafficTreatment.builder() | 108 | TrafficTreatment treatment = DefaultTrafficTreatment.builder() |
| 105 | .punt() | 109 | .punt() |
| 106 | .build(); | 110 | .build(); |
| ... | @@ -109,7 +113,11 @@ public class OLTPipeline extends AbstractHandlerBehaviour implements Pipeliner { | ... | @@ -109,7 +113,11 @@ public class OLTPipeline extends AbstractHandlerBehaviour implements Pipeliner { |
| 109 | PacketPriority.CONTROL.priorityValue(), | 113 | PacketPriority.CONTROL.priorityValue(), |
| 110 | appId, 0, true, null); | 114 | appId, 0, true, null); |
| 111 | 115 | ||
| 112 | - flowRuleService.applyFlowRules(flowRule); | 116 | + FlowRule arpRule = new DefaultFlowRule(deviceId, arpSelector, treatment, |
| 117 | + PacketPriority.CONTROL.priorityValue(), | ||
| 118 | + appId, 0, true, null); | ||
| 119 | + | ||
| 120 | + flowRuleService.applyFlowRules(flowRule, arpRule); | ||
| 113 | } | 121 | } |
| 114 | 122 | ||
| 115 | @Override | 123 | @Override | ... | ... |
-
Please register or login to post a comment