support bidirectional links
Change-Id: I6c5d092abf7629b28ea0b1928ee6cf63f99de962
Showing
4 changed files
with
31 additions
and
59 deletions
| ... | @@ -290,6 +290,17 @@ public class OpticalConfigProvider extends AbstractProvider implements DevicePro | ... | @@ -290,6 +290,17 @@ public class OpticalConfigProvider extends AbstractProvider implements DevicePro |
| 290 | linkProviderService.linkDetected(linkDescription); | 290 | linkProviderService.linkDetected(linkDescription); |
| 291 | log.info(String.format("WDM link: %s : %s", | 291 | log.info(String.format("WDM link: %s : %s", |
| 292 | linkDescription.src().toString(), linkDescription.dst().toString())); | 292 | linkDescription.src().toString(), linkDescription.dst().toString())); |
| 293 | + | ||
| 294 | + | ||
| 295 | + DefaultLinkDescription linkDescriptionReverse = | ||
| 296 | + new DefaultLinkDescription(snkPoint, | ||
| 297 | + srcPoint, | ||
| 298 | + Link.Type.OPTICAL, | ||
| 299 | + extendedAttributes); | ||
| 300 | + | ||
| 301 | + linkProviderService.linkDetected(linkDescriptionReverse); | ||
| 302 | + log.info(String.format("WDM link: %s : %s", | ||
| 303 | + linkDescriptionReverse.src().toString(), linkDescriptionReverse.dst().toString())); | ||
| 293 | } | 304 | } |
| 294 | 305 | ||
| 295 | // Discover the packet optical link objects | 306 | // Discover the packet optical link objects |
| ... | @@ -321,6 +332,16 @@ public class OpticalConfigProvider extends AbstractProvider implements DevicePro | ... | @@ -321,6 +332,16 @@ public class OpticalConfigProvider extends AbstractProvider implements DevicePro |
| 321 | linkProviderService.linkDetected(linkDescription); | 332 | linkProviderService.linkDetected(linkDescription); |
| 322 | log.info(String.format("Packet-optical link: %s : %s", | 333 | log.info(String.format("Packet-optical link: %s : %s", |
| 323 | linkDescription.src().toString(), linkDescription.dst().toString())); | 334 | linkDescription.src().toString(), linkDescription.dst().toString())); |
| 335 | + | ||
| 336 | + DefaultLinkDescription linkDescriptionReverse = | ||
| 337 | + new DefaultLinkDescription(snkPoint, | ||
| 338 | + srcPoint, | ||
| 339 | + Link.Type.OPTICAL, | ||
| 340 | + extendedAttributes); | ||
| 341 | + | ||
| 342 | + linkProviderService.linkDetected(linkDescriptionReverse); | ||
| 343 | + log.info(String.format("Packet-optical link: %s : %s", | ||
| 344 | + linkDescriptionReverse.src().toString(), linkDescriptionReverse.dst().toString())); | ||
| 324 | } | 345 | } |
| 325 | 346 | ||
| 326 | } | 347 | } | ... | ... |
| ... | @@ -47,42 +47,14 @@ | ... | @@ -47,42 +47,14 @@ |
| 47 | "nodeName1": "ROADM1", | 47 | "nodeName1": "ROADM1", |
| 48 | "nodeName2": "ROADM3", | 48 | "nodeName2": "ROADM3", |
| 49 | "numWaves": 80, | 49 | "numWaves": 80, |
| 50 | - "port1": 10, | 50 | + "port1": 20, |
| 51 | "port2": 30 | 51 | "port2": 30 |
| 52 | }, | 52 | }, |
| 53 | "type": "wdmLink" | 53 | "type": "wdmLink" |
| 54 | }, | 54 | }, |
| 55 | - { | ||
| 56 | - "allowed": true, | ||
| 57 | - "nodeDpid1": "00:00:ff:ff:ff:ff:ff:03", | ||
| 58 | - "nodeDpid2": "00:00:ff:ff:ff:ff:ff:01", | ||
| 59 | - "params": { | ||
| 60 | - "distKms": 1000, | ||
| 61 | - "nodeName1": "ROADM3", | ||
| 62 | - "nodeName2": "ROADM1", | ||
| 63 | - "numWaves": 80, | ||
| 64 | - "port1": 30, | ||
| 65 | - "port2": 10 | ||
| 66 | - }, | ||
| 67 | - "type": "wdmLink" | ||
| 68 | - }, | ||
| 69 | 55 | ||
| 70 | { | 56 | { |
| 71 | "allowed": true, | 57 | "allowed": true, |
| 72 | - "nodeDpid1": "00:00:ff:ff:ff:ff:ff:02", | ||
| 73 | - "nodeDpid2": "00:00:ff:ff:ff:ff:ff:03", | ||
| 74 | - "params": { | ||
| 75 | - "distKms": 2000, | ||
| 76 | - "nodeName1": "ROADM2", | ||
| 77 | - "nodeName2": "ROADM3", | ||
| 78 | - "numWaves": 80, | ||
| 79 | - "port1": 20, | ||
| 80 | - "port2": 31 | ||
| 81 | - }, | ||
| 82 | - "type": "wdmLink" | ||
| 83 | - }, | ||
| 84 | - { | ||
| 85 | - "allowed": true, | ||
| 86 | "nodeDpid1": "00:00:ff:ff:ff:ff:ff:03", | 58 | "nodeDpid1": "00:00:ff:ff:ff:ff:ff:03", |
| 87 | "nodeDpid2": "00:00:ff:ff:ff:ff:ff:02", | 59 | "nodeDpid2": "00:00:ff:ff:ff:ff:ff:02", |
| 88 | "params": { | 60 | "params": { |
| ... | @@ -91,7 +63,7 @@ | ... | @@ -91,7 +63,7 @@ |
| 91 | "nodeName2": "ROADM2", | 63 | "nodeName2": "ROADM2", |
| 92 | "numWaves": 80, | 64 | "numWaves": 80, |
| 93 | "port1": 31, | 65 | "port1": 31, |
| 94 | - "port2": 20 | 66 | + "port2": 21 |
| 95 | }, | 67 | }, |
| 96 | "type": "wdmLink" | 68 | "type": "wdmLink" |
| 97 | }, | 69 | }, |
| ... | @@ -104,20 +76,7 @@ | ... | @@ -104,20 +76,7 @@ |
| 104 | "nodeName1": "ROUTER1", | 76 | "nodeName1": "ROUTER1", |
| 105 | "nodeName2": "ROADM1", | 77 | "nodeName2": "ROADM1", |
| 106 | "bandWidth": 100000, | 78 | "bandWidth": 100000, |
| 107 | - "port1": 10, | 79 | + "port1": 1, |
| 108 | - "port2": 11 | ||
| 109 | - }, | ||
| 110 | - "type": "pktOptLink" | ||
| 111 | - }, | ||
| 112 | - { | ||
| 113 | - "allowed": true, | ||
| 114 | - "nodeDpid1": "00:00:ff:ff:ff:ff:ff:01", | ||
| 115 | - "nodeDpid2": "00:00:ff:ff:ff:ff:00:01", | ||
| 116 | - "params": { | ||
| 117 | - "nodeName1": "ROADM1", | ||
| 118 | - "nodeName2": "ROUTER1", | ||
| 119 | - "bandWidth": 100000, | ||
| 120 | - "port1": 11, | ||
| 121 | "port2": 10 | 80 | "port2": 10 |
| 122 | }, | 81 | }, |
| 123 | "type": "pktOptLink" | 82 | "type": "pktOptLink" |
| ... | @@ -131,24 +90,11 @@ | ... | @@ -131,24 +90,11 @@ |
| 131 | "nodeName1": "ROUTER2", | 90 | "nodeName1": "ROUTER2", |
| 132 | "nodeName2": "ROADM2", | 91 | "nodeName2": "ROADM2", |
| 133 | "bandWidth": 100000, | 92 | "bandWidth": 100000, |
| 134 | - "port1": 10, | 93 | + "port1": 1, |
| 135 | - "port2": 21 | 94 | + "port2": 11 |
| 136 | }, | 95 | }, |
| 137 | "type": "pktOptLink" | 96 | "type": "pktOptLink" |
| 138 | }, | 97 | }, |
| 139 | - { | ||
| 140 | - "allowed": true, | ||
| 141 | - "nodeDpid1": "00:00:ff:ff:ff:ff:ff:02", | ||
| 142 | - "nodeDpid2": "00:00:ff:ff:ff:ff:00:02", | ||
| 143 | - "params": { | ||
| 144 | - "nodeName1": "ROADM2", | ||
| 145 | - "nodeName2": "ROUTER2", | ||
| 146 | - "bandWidth": 100000, | ||
| 147 | - "port1": 21, | ||
| 148 | - "port2": 10 | ||
| 149 | - }, | ||
| 150 | - "type": "pktOptLink" | ||
| 151 | - } | ||
| 152 | 98 | ||
| 153 | ] | 99 | ] |
| 154 | } | 100 | } | ... | ... |
| ... | @@ -70,6 +70,7 @@ public class OpticalConnectivityIntentCompiler implements IntentCompiler<Optical | ... | @@ -70,6 +70,7 @@ public class OpticalConnectivityIntentCompiler implements IntentCompiler<Optical |
| 70 | public List<Intent> compile(OpticalConnectivityIntent intent) { | 70 | public List<Intent> compile(OpticalConnectivityIntent intent) { |
| 71 | // TODO: compute multiple paths using the K-shortest path algorithm | 71 | // TODO: compute multiple paths using the K-shortest path algorithm |
| 72 | List<Intent> retList = new ArrayList<>(); | 72 | List<Intent> retList = new ArrayList<>(); |
| 73 | + log.info("The system is comipling the OpticalConnectivityIntent:" + intent.toString()); | ||
| 73 | Path path = calculatePath(intent.getSrcConnectPoint(), intent.getDst()); | 74 | Path path = calculatePath(intent.getSrcConnectPoint(), intent.getDst()); |
| 74 | if (path == null) { | 75 | if (path == null) { |
| 75 | return retList; | 76 | return retList; |
| ... | @@ -88,6 +89,8 @@ public class OpticalConnectivityIntentCompiler implements IntentCompiler<Optical | ... | @@ -88,6 +89,8 @@ public class OpticalConnectivityIntentCompiler implements IntentCompiler<Optical |
| 88 | intent.getDst(), | 89 | intent.getDst(), |
| 89 | path); | 90 | path); |
| 90 | 91 | ||
| 92 | + log.info("a new OpticalPathIntent was created: " + newIntent.toString()); | ||
| 93 | + | ||
| 91 | retList.add(newIntent); | 94 | retList.add(newIntent); |
| 92 | 95 | ||
| 93 | return retList; | 96 | return retList; |
| ... | @@ -123,6 +126,7 @@ public class OpticalConnectivityIntentCompiler implements IntentCompiler<Optical | ... | @@ -123,6 +126,7 @@ public class OpticalConnectivityIntentCompiler implements IntentCompiler<Optical |
| 123 | Iterator<Path> itr = paths.iterator(); | 126 | Iterator<Path> itr = paths.iterator(); |
| 124 | while (itr.hasNext()) { | 127 | while (itr.hasNext()) { |
| 125 | Path path = itr.next(); | 128 | Path path = itr.next(); |
| 129 | + // log.info(String.format("total link number.:%d", path.links().size())); | ||
| 126 | if (path.cost() >= 10000) { | 130 | if (path.cost() >= 10000) { |
| 127 | itr.remove(); | 131 | itr.remove(); |
| 128 | } | 132 | } | ... | ... |
| ... | @@ -116,6 +116,7 @@ public class OpticalPathIntentInstaller implements IntentInstaller<OpticalPathIn | ... | @@ -116,6 +116,7 @@ public class OpticalPathIntentInstaller implements IntentInstaller<OpticalPathIn |
| 116 | appId, | 116 | appId, |
| 117 | 100, | 117 | 100, |
| 118 | true); | 118 | true); |
| 119 | + | ||
| 119 | rules.add(new FlowRuleBatchEntry(FlowRuleOperation.ADD, rule)); | 120 | rules.add(new FlowRuleBatchEntry(FlowRuleOperation.ADD, rule)); |
| 120 | 121 | ||
| 121 | prev = link.dst(); | 122 | prev = link.dst(); | ... | ... |
-
Please register or login to post a comment