Hyunsun Moon
Committed by Gerrit Code Review

CORD-472 Added additional flow rules for physical connection

Change-Id: Ic6d37024e4407182a440fbe68460e7688ecb6305
...@@ -441,6 +441,51 @@ public class CordVtnRuleInstaller { ...@@ -441,6 +441,51 @@ public class CordVtnRuleInstaller {
441 441
442 processFlowRule(true, flowRule); 442 processFlowRule(true, flowRule);
443 443
444 + // take a packet to the local ip through Linux stack
445 + selector = DefaultTrafficSelector.builder()
446 + .matchInPort(phyPort)
447 + .matchEthType(Ethernet.TYPE_IPV4)
448 + .matchIPDst(localIp.toIpPrefix())
449 + .build();
450 +
451 + treatment = DefaultTrafficTreatment.builder()
452 + .setOutput(PortNumber.LOCAL)
453 + .build();
454 +
455 + flowRule = DefaultFlowRule.builder()
456 + .fromApp(appId)
457 + .withSelector(selector)
458 + .withTreatment(treatment)
459 + .withPriority(HIGHER_PRIORITY)
460 + .forDevice(deviceId)
461 + .forTable(TABLE_FIRST)
462 + .makePermanent()
463 + .build();
464 +
465 + processFlowRule(true, flowRule);
466 +
467 + // take an arp packet from physical through Linux stack
468 + selector = DefaultTrafficSelector.builder()
469 + .matchInPort(phyPort)
470 + .matchEthType(Ethernet.TYPE_ARP)
471 + .build();
472 +
473 + treatment = DefaultTrafficTreatment.builder()
474 + .setOutput(PortNumber.LOCAL)
475 + .build();
476 +
477 + flowRule = DefaultFlowRule.builder()
478 + .fromApp(appId)
479 + .withSelector(selector)
480 + .withTreatment(treatment)
481 + .withPriority(HIGHER_PRIORITY)
482 + .forDevice(deviceId)
483 + .forTable(TABLE_FIRST)
484 + .makePermanent()
485 + .build();
486 +
487 + processFlowRule(true, flowRule);
488 +
444 // take all else to the next table 489 // take all else to the next table
445 selector = DefaultTrafficSelector.builder() 490 selector = DefaultTrafficSelector.builder()
446 .build(); 491 .build();
......