forwarding radius packets to radius

Change-Id: I28678715adc42358d85006e2df0baa25d768746d
diff --git a/apps/aaa/src/main/java/org/onosproject/aaa/AAA.java b/apps/aaa/src/main/java/org/onosproject/aaa/AAA.java
index db4797b..e7b3603 100644
--- a/apps/aaa/src/main/java/org/onosproject/aaa/AAA.java
+++ b/apps/aaa/src/main/java/org/onosproject/aaa/AAA.java
@@ -121,9 +121,9 @@
     // 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")
diff --git a/apps/cordfabric/src/main/java/org/onosproject/cordfabric/CordFabricManager.java b/apps/cordfabric/src/main/java/org/onosproject/cordfabric/CordFabricManager.java
index 4549bd0..4e1b90b 100644
--- a/apps/cordfabric/src/main/java/org/onosproject/cordfabric/CordFabricManager.java
+++ b/apps/cordfabric/src/main/java/org/onosproject/cordfabric/CordFabricManager.java
@@ -133,24 +133,48 @@
                 .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();
 
-        ForwardingObjective radiusToController = DefaultForwardingObjective.builder()
+        TrafficTreatment toOlt = DefaultTrafficTreatment.builder()
+                .setOutput(PortNumber.portNumber(2))
+                .build();
+
+
+        TrafficTreatment sentToRadius = DefaultTrafficTreatment.builder()
+                .setOutput(PortNumber.portNumber(5))
+                .build();
+
+        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 @@
 
         flowObjectiveService.forward(fabricDeviceId, upCtrl);
         flowObjectiveService.forward(fabricDeviceId, downCtrl);
-        flowObjectiveService.forward(fabricDeviceId, radiusToController);
+        flowObjectiveService.forward(fabricDeviceId, radiusToServer);
+        flowObjectiveService.forward(fabricDeviceId, serverToRadius);
     }
 
     @Override
diff --git a/core/net/src/main/java/org/onosproject/net/host/impl/HostMonitor.java b/core/net/src/main/java/org/onosproject/net/host/impl/HostMonitor.java
index 2351b03..6dc71fc 100644
--- a/core/net/src/main/java/org/onosproject/net/host/impl/HostMonitor.java
+++ b/core/net/src/main/java/org/onosproject/net/host/impl/HostMonitor.java
@@ -253,6 +253,8 @@
             ethernet.setVlanID(vlan.toShort());
         }
 
+        ethernet.setPad(true);
+
         return ethernet;
     }
 
diff --git a/drivers/src/main/java/org/onosproject/driver/pipeline/OLTPipeline.java b/drivers/src/main/java/org/onosproject/driver/pipeline/OLTPipeline.java
index 50888fb..0adc575 100644
--- a/drivers/src/main/java/org/onosproject/driver/pipeline/OLTPipeline.java
+++ b/drivers/src/main/java/org/onosproject/driver/pipeline/OLTPipeline.java
@@ -101,6 +101,10 @@
                 .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 @@
                                                 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