Merge branch 'optical_path_provisioner'
Conflicts: apps/optical/src/main/resources/demo-3-roadm-2-ps.json Change-Id: I6fb95eb8de5b8331678c8cdac621309ea4d2d2b8
Showing
4 changed files
with
28 additions
and
56 deletions
... | @@ -291,6 +291,17 @@ public class OpticalConfigProvider extends AbstractProvider implements DevicePro | ... | @@ -291,6 +291,17 @@ public class OpticalConfigProvider extends AbstractProvider implements DevicePro |
291 | linkProviderService.linkDetected(linkDescription); | 291 | linkProviderService.linkDetected(linkDescription); |
292 | log.info(String.format("WDM link: %s : %s", | 292 | log.info(String.format("WDM link: %s : %s", |
293 | linkDescription.src().toString(), linkDescription.dst().toString())); | 293 | linkDescription.src().toString(), linkDescription.dst().toString())); |
294 | + | ||
295 | + | ||
296 | + DefaultLinkDescription linkDescriptionReverse = | ||
297 | + new DefaultLinkDescription(snkPoint, | ||
298 | + srcPoint, | ||
299 | + Link.Type.OPTICAL, | ||
300 | + extendedAttributes); | ||
301 | + | ||
302 | + linkProviderService.linkDetected(linkDescriptionReverse); | ||
303 | + log.info(String.format("WDM link: %s : %s", | ||
304 | + linkDescriptionReverse.src().toString(), linkDescriptionReverse.dst().toString())); | ||
294 | } | 305 | } |
295 | 306 | ||
296 | // Discover the packet optical link objects | 307 | // Discover the packet optical link objects |
... | @@ -322,6 +333,16 @@ public class OpticalConfigProvider extends AbstractProvider implements DevicePro | ... | @@ -322,6 +333,16 @@ public class OpticalConfigProvider extends AbstractProvider implements DevicePro |
322 | linkProviderService.linkDetected(linkDescription); | 333 | linkProviderService.linkDetected(linkDescription); |
323 | log.info(String.format("Packet-optical link: %s : %s", | 334 | log.info(String.format("Packet-optical link: %s : %s", |
324 | linkDescription.src().toString(), linkDescription.dst().toString())); | 335 | linkDescription.src().toString(), linkDescription.dst().toString())); |
336 | + | ||
337 | + DefaultLinkDescription linkDescriptionReverse = | ||
338 | + new DefaultLinkDescription(snkPoint, | ||
339 | + srcPoint, | ||
340 | + Link.Type.OPTICAL, | ||
341 | + extendedAttributes); | ||
342 | + | ||
343 | + linkProviderService.linkDetected(linkDescriptionReverse); | ||
344 | + log.info(String.format("Packet-optical link: %s : %s", | ||
345 | + linkDescriptionReverse.src().toString(), linkDescriptionReverse.dst().toString())); | ||
325 | } | 346 | } |
326 | 347 | ||
327 | } | 348 | } | ... | ... |
... | @@ -52,37 +52,9 @@ | ... | @@ -52,37 +52,9 @@ |
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": { |
... | @@ -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": 10 | ||
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": 11 | 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