blob: d0af3b5490f71700a0a91e8f1b84bb1529ed0907 [file] [log] [blame]
Thomas Vachuska781d18b2014-10-27 10:31:25 -07001/*
Ray Milkey34c95902015-04-15 09:47:53 -07002 * Copyright 2014-2015 Open Networking Laboratory
Thomas Vachuska781d18b2014-10-27 10:31:25 -07003 *
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07004 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
Thomas Vachuska781d18b2014-10-27 10:31:25 -07007 *
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07008 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
Thomas Vachuska781d18b2014-10-27 10:31:25 -070015 */
Brian O'Connorabafb502014-12-02 22:26:20 -080016package org.onosproject.optical;
weibitf32383b2014-10-22 10:17:31 -070017
weibitf32383b2014-10-22 10:17:31 -070018import org.apache.felix.scr.annotations.Activate;
19import org.apache.felix.scr.annotations.Component;
Marc De Leenheer16f857b2015-05-05 20:50:24 -070020import org.apache.felix.scr.annotations.Deactivate;
weibitf32383b2014-10-22 10:17:31 -070021import org.apache.felix.scr.annotations.Reference;
22import org.apache.felix.scr.annotations.ReferenceCardinality;
Marc De Leenheer8b3e80b2015-03-06 14:27:03 -080023import org.onosproject.cluster.ClusterService;
24import org.onosproject.cluster.NodeId;
Brian O'Connorabafb502014-12-02 22:26:20 -080025import org.onosproject.core.ApplicationId;
26import org.onosproject.core.CoreService;
Marc De Leenheer8b3e80b2015-03-06 14:27:03 -080027import org.onosproject.mastership.MastershipService;
Brian O'Connorabafb502014-12-02 22:26:20 -080028import org.onosproject.net.ConnectPoint;
Marc De Leenheer1afa2a02015-05-13 09:18:07 -070029import org.onosproject.net.Device;
Brian O'Connorabafb502014-12-02 22:26:20 -080030import org.onosproject.net.Host;
31import org.onosproject.net.Link;
Marc De Leenheer8c2caac2015-05-28 16:37:33 -070032import org.onosproject.net.OchPort;
Marc De Leenheer1afa2a02015-05-13 09:18:07 -070033import org.onosproject.net.OduCltPort;
Marc De Leenheer8c2caac2015-05-28 16:37:33 -070034import org.onosproject.net.OduSignalType;
Brian O'Connorabafb502014-12-02 22:26:20 -080035import org.onosproject.net.Path;
Marc De Leenheer1afa2a02015-05-13 09:18:07 -070036import org.onosproject.net.Port;
37import org.onosproject.net.device.DeviceService;
Brian O'Connorabafb502014-12-02 22:26:20 -080038import org.onosproject.net.host.HostService;
39import org.onosproject.net.intent.HostToHostIntent;
40import org.onosproject.net.intent.Intent;
41import org.onosproject.net.intent.IntentEvent;
42import org.onosproject.net.intent.IntentListener;
Brian O'Connorabafb502014-12-02 22:26:20 -080043import org.onosproject.net.intent.IntentService;
44import org.onosproject.net.intent.IntentState;
Marc De Leenheer8c2caac2015-05-28 16:37:33 -070045import org.onosproject.net.intent.OpticalCircuitIntent;
Brian O'Connorabafb502014-12-02 22:26:20 -080046import org.onosproject.net.intent.OpticalConnectivityIntent;
47import org.onosproject.net.intent.PointToPointIntent;
Brian O'Connor6de2e202015-05-21 14:30:41 -070048import org.onosproject.net.resource.device.DeviceResourceService;
Ayaka Koshibebcb02372015-06-01 10:56:42 -070049import org.onosproject.net.resource.link.LinkResourceAllocations;
Brian O'Connor6de2e202015-05-21 14:30:41 -070050import org.onosproject.net.resource.link.LinkResourceService;
Brian O'Connorabafb502014-12-02 22:26:20 -080051import org.onosproject.net.topology.LinkWeight;
52import org.onosproject.net.topology.PathService;
53import org.onosproject.net.topology.TopologyEdge;
weibitf32383b2014-10-22 10:17:31 -070054import org.slf4j.Logger;
55import org.slf4j.LoggerFactory;
56
Marc De Leenheer16f857b2015-05-05 20:50:24 -070057import java.util.Collections;
Brian O'Connor772852a2014-11-17 15:51:19 -080058import java.util.Iterator;
Marc De Leenheer16f857b2015-05-05 20:50:24 -070059import java.util.LinkedList;
Brian O'Connor772852a2014-11-17 15:51:19 -080060import java.util.List;
61import java.util.Set;
Brian O'Connorc7bdd8c2014-12-08 01:29:53 -080062
Marc De Leenheer16f857b2015-05-05 20:50:24 -070063import static com.google.common.base.Preconditions.checkArgument;
Marc De Leenheer16f857b2015-05-05 20:50:24 -070064import static com.google.common.base.Preconditions.checkNotNull;
65
weibitf32383b2014-10-22 10:17:31 -070066/**
Marc De Leenheer16f857b2015-05-05 20:50:24 -070067 * OpticalPathProvisioner listens for event notifications from the Intent F/W.
weibitf32383b2014-10-22 10:17:31 -070068 * It generates one or more opticalConnectivityIntent(s) and submits (or withdraws) to Intent F/W
69 * for adding/releasing capacity at the packet layer.
weibitf32383b2014-10-22 10:17:31 -070070 */
71
72@Component(immediate = true)
73public class OpticalPathProvisioner {
74
75 protected static final Logger log = LoggerFactory
76 .getLogger(OpticalPathProvisioner.class);
77
78 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
79 private IntentService intentService;
80
81 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
Brian O'Connor772852a2014-11-17 15:51:19 -080082 protected PathService pathService;
weibitf32383b2014-10-22 10:17:31 -070083
84 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
85 protected CoreService coreService;
86
weibit7e583462014-10-23 10:14:05 -070087 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
Praseed Balakrishnanc0029652014-11-14 13:38:49 -080088 protected HostService hostService;
89
Marc De Leenheer8b3e80b2015-03-06 14:27:03 -080090 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
91 protected MastershipService mastershipService;
92
93 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
94 protected ClusterService clusterService;
95
Marc De Leenheer1afa2a02015-05-13 09:18:07 -070096 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
Marc De Leenheer1afa2a02015-05-13 09:18:07 -070097 protected DeviceService deviceService;
98
99 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
100 protected DeviceResourceService deviceResourceService;
101
102 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
103 protected LinkResourceService linkResourceService;
104
105 private ApplicationId appId;
Brian O'Connorc7bdd8c2014-12-08 01:29:53 -0800106
weibitf32383b2014-10-22 10:17:31 -0700107 private final InternalOpticalPathProvisioner pathProvisioner = new InternalOpticalPathProvisioner();
108
109 @Activate
110 protected void activate() {
111 intentService.addListener(pathProvisioner);
Brian O'Connorabafb502014-12-02 22:26:20 -0800112 appId = coreService.registerApplication("org.onosproject.optical");
Marc De Leenheer1afa2a02015-05-13 09:18:07 -0700113 initOpticalPorts();
Marc De Leenheer16f857b2015-05-05 20:50:24 -0700114 log.info("Started");
115 }
116
117 @Deactivate
118 protected void deactivate() {
119 intentService.removeListener(pathProvisioner);
120 log.info("Stopped");
weibitf32383b2014-10-22 10:17:31 -0700121 }
122
Marc De Leenheer1afa2a02015-05-13 09:18:07 -0700123 /**
124 * Initialize availability of optical ports.
125 */
126 private void initOpticalPorts() {
127 // TODO: check for existing optical intents
128 return;
Brian O'Connorc7bdd8c2014-12-08 01:29:53 -0800129 }
130
weibitf32383b2014-10-22 10:17:31 -0700131 public class InternalOpticalPathProvisioner implements IntentListener {
132 @Override
133 public void event(IntentEvent event) {
134 switch (event.type()) {
Brian O'Connor7a71d5d2014-12-02 00:12:27 -0800135 case INSTALL_REQ:
weibitf32383b2014-10-22 10:17:31 -0700136 break;
137 case INSTALLED:
138 break;
139 case FAILED:
Marc De Leenheer16f857b2015-05-05 20:50:24 -0700140 log.info("Intent {} failed, calling optical path provisioning app.", event.subject());
Brian O'Connor772852a2014-11-17 15:51:19 -0800141 setupLightpath(event.subject());
weibitf32383b2014-10-22 10:17:31 -0700142 break;
143 case WITHDRAWN:
Marc De Leenheer16f857b2015-05-05 20:50:24 -0700144 log.info("Intent {} withdrawn.", event.subject());
Marc De Leenheer4a1c1fa2015-06-01 18:08:56 -0700145 releaseResources(event.subject());
weibitf32383b2014-10-22 10:17:31 -0700146 break;
147 default:
148 break;
149 }
150 }
151
Brian O'Connor772852a2014-11-17 15:51:19 -0800152 private void setupLightpath(Intent intent) {
Marc De Leenheer1afa2a02015-05-13 09:18:07 -0700153 checkNotNull(intent);
154
Brian O'Connorc7bdd8c2014-12-08 01:29:53 -0800155 // TODO change the coordination approach between packet intents and optical intents
156 // Low speed LLDP may cause multiple calls which are not expected
157
Ray Milkeyf9af43c2015-02-09 16:45:48 -0800158 if (!IntentState.FAILED.equals(intentService.getIntentState(intent.key()))) {
Marc De Leenheer8b3e80b2015-03-06 14:27:03 -0800159 return;
Marc De Leenheerb473b9d2015-02-06 15:21:03 -0800160 }
Brian O'Connorc7bdd8c2014-12-08 01:29:53 -0800161
Marc De Leenheer1afa2a02015-05-13 09:18:07 -0700162 // Get source and destination based on intent type
163 ConnectPoint src;
164 ConnectPoint dst;
Brian O'Connor772852a2014-11-17 15:51:19 -0800165 if (intent instanceof HostToHostIntent) {
166 HostToHostIntent hostToHostIntent = (HostToHostIntent) intent;
Marc De Leenheer8b3e80b2015-03-06 14:27:03 -0800167
Brian O'Connor772852a2014-11-17 15:51:19 -0800168 Host one = hostService.getHost(hostToHostIntent.one());
169 Host two = hostService.getHost(hostToHostIntent.two());
Marc De Leenheer8b3e80b2015-03-06 14:27:03 -0800170
Marc De Leenheer1afa2a02015-05-13 09:18:07 -0700171 checkNotNull(one);
172 checkNotNull(two);
Marc De Leenheer8b3e80b2015-03-06 14:27:03 -0800173
Marc De Leenheer1afa2a02015-05-13 09:18:07 -0700174 src = one.location();
175 dst = two.location();
Brian O'Connor772852a2014-11-17 15:51:19 -0800176 } else if (intent instanceof PointToPointIntent) {
177 PointToPointIntent p2pIntent = (PointToPointIntent) intent;
Marc De Leenheer8b3e80b2015-03-06 14:27:03 -0800178
Marc De Leenheer1afa2a02015-05-13 09:18:07 -0700179 src = p2pIntent.ingressPoint();
180 dst = p2pIntent.egressPoint();
Brian O'Connor772852a2014-11-17 15:51:19 -0800181 } else {
Marc De Leenheer1afa2a02015-05-13 09:18:07 -0700182 return;
Brian O'Connor772852a2014-11-17 15:51:19 -0800183 }
Praseed Balakrishnanc0029652014-11-14 13:38:49 -0800184
Marc De Leenheer1afa2a02015-05-13 09:18:07 -0700185 if (src == null || dst == null) {
186 return;
187 }
188
189 // Ignore if we're not the master for the intent's origin device
190 NodeId localNode = clusterService.getLocalNode().id();
191 NodeId sourceMaster = mastershipService.getMasterFor(src.deviceId());
192 if (!localNode.equals(sourceMaster)) {
193 return;
194 }
195
196 // Generate optical connectivity intents
Sho SHIMIZUfb446fe2015-05-21 14:45:23 -0700197 List<Intent> intents = getOpticalIntents(src, dst);
Marc De Leenheer1afa2a02015-05-13 09:18:07 -0700198
199 // Submit the intents
Brian O'Connor772852a2014-11-17 15:51:19 -0800200 for (Intent i : intents) {
Marc De Leenheer1afa2a02015-05-13 09:18:07 -0700201 intentService.submit(i);
Sho SHIMIZUb5d38412015-05-21 11:12:58 -0700202 log.debug("Submitted an intent: {}", i);
Brian O'Connor772852a2014-11-17 15:51:19 -0800203 }
weibit7e583462014-10-23 10:14:05 -0700204 }
205
Marc De Leenheer16f857b2015-05-05 20:50:24 -0700206 /**
207 * Returns list of cross connection points of missing optical path sections.
208 *
209 * Scans the given multi-layer path and looks for sections that use cross connect links.
210 * The ingress and egress points in the optical layer are returned in a list.
211 *
212 * @param path the multi-layer path
213 * @return list of cross connection points on the optical layer
214 */
215 private List<ConnectPoint> getCrossConnectPoints(Path path) {
216 boolean scanning = false;
217 List<ConnectPoint> connectPoints = new LinkedList<ConnectPoint>();
218
219 for (Link link : path.links()) {
220 if (!isCrossConnectLink(link)) {
221 continue;
222 }
223
224 if (scanning) {
225 connectPoints.add(checkNotNull(link.src()));
226 scanning = false;
227 } else {
228 connectPoints.add(checkNotNull(link.dst()));
229 scanning = true;
230 }
231 }
232
233 return connectPoints;
234 }
235
236 /**
Marc De Leenheer1afa2a02015-05-13 09:18:07 -0700237 * Checks if cross connect points are of same type.
Marc De Leenheer16f857b2015-05-05 20:50:24 -0700238 *
239 * @param crossConnectPoints list of cross connection points
Marc De Leenheer1afa2a02015-05-13 09:18:07 -0700240 * @return true if cross connect point pairs are of same type, false otherwise
Marc De Leenheer16f857b2015-05-05 20:50:24 -0700241 */
242 private boolean checkCrossConnectPoints(List<ConnectPoint> crossConnectPoints) {
243 checkArgument(crossConnectPoints.size() % 2 == 0);
244
245 Iterator<ConnectPoint> itr = crossConnectPoints.iterator();
246
247 while (itr.hasNext()) {
248 // checkArgument at start ensures we'll always have pairs of connect points
249 ConnectPoint src = itr.next();
250 ConnectPoint dst = itr.next();
251
Marc De Leenheer1afa2a02015-05-13 09:18:07 -0700252 Device.Type srcType = deviceService.getDevice(src.deviceId()).type();
253 Device.Type dstType = deviceService.getDevice(dst.deviceId()).type();
254
255 // Only support connections between identical port types
256 if (srcType != dstType) {
257 log.warn("Unsupported mix of cross connect points");
Marc De Leenheer16f857b2015-05-05 20:50:24 -0700258 return false;
259 }
260 }
261
262 return true;
263 }
264
265 /**
Marc De Leenheer1afa2a02015-05-13 09:18:07 -0700266 * Scans the list of cross connection points and returns a list of optical connectivity intents.
Marc De Leenheer16f857b2015-05-05 20:50:24 -0700267 *
268 * @param crossConnectPoints list of cross connection points
269 * @return list of optical connectivity intents
270 */
271 private List<Intent> getIntents(List<ConnectPoint> crossConnectPoints) {
272 checkArgument(crossConnectPoints.size() % 2 == 0);
273
Sho SHIMIZU79945e82015-05-20 17:20:47 -0700274 List<Intent> intents = new LinkedList<>();
Marc De Leenheer16f857b2015-05-05 20:50:24 -0700275 Iterator<ConnectPoint> itr = crossConnectPoints.iterator();
276
277 while (itr.hasNext()) {
278 // checkArgument at start ensures we'll always have pairs of connect points
279 ConnectPoint src = itr.next();
280 ConnectPoint dst = itr.next();
281
Marc De Leenheer1afa2a02015-05-13 09:18:07 -0700282 Port srcPort = deviceService.getPort(src.deviceId(), src.port());
283 Port dstPort = deviceService.getPort(dst.deviceId(), dst.port());
Marc De Leenheer8c2caac2015-05-28 16:37:33 -0700284
Marc De Leenheer1afa2a02015-05-13 09:18:07 -0700285 if (srcPort instanceof OduCltPort && dstPort instanceof OduCltPort) {
Marc De Leenheer8c2caac2015-05-28 16:37:33 -0700286 // Create OTN circuit
287 Intent circuitIntent = OpticalCircuitIntent.builder()
288 .appId(appId)
289 .src(src)
290 .dst(dst)
291 .signalType(OduCltPort.SignalType.CLT_10GBE)
Marc De Leenheer4a1c1fa2015-06-01 18:08:56 -0700292 .bidirectional(true)
Marc De Leenheer8c2caac2015-05-28 16:37:33 -0700293 .build();
294 intents.add(circuitIntent);
Marc De Leenheer1afa2a02015-05-13 09:18:07 -0700295 continue;
Marc De Leenheer8c2caac2015-05-28 16:37:33 -0700296 } else if (srcPort instanceof OchPort && dstPort instanceof OchPort) {
297 // Create lightpath
298 // FIXME: hardcoded ODU signal type
299 Intent opticalIntent = OpticalConnectivityIntent.builder()
300 .appId(appId)
301 .src(src)
302 .dst(dst)
303 .signalType(OduSignalType.ODU4)
Marc De Leenheer4a1c1fa2015-06-01 18:08:56 -0700304 .bidirectional(true)
Marc De Leenheer8c2caac2015-05-28 16:37:33 -0700305 .build();
306 intents.add(opticalIntent);
307 continue;
308 } else {
309 log.warn("Unsupported cross connect point types {} {}", srcPort.type(), dstPort.type());
310 return Collections.emptyList();
Marc De Leenheer1afa2a02015-05-13 09:18:07 -0700311 }
Marc De Leenheer16f857b2015-05-05 20:50:24 -0700312 }
313
314 return intents;
315 }
316
Marc De Leenheer1afa2a02015-05-13 09:18:07 -0700317 /**
318 * Returns list of optical connectivity intents needed to create connectivity
319 * between ingress and egress.
320 *
321 * @param ingress the ingress connect point
322 * @param egress the egress connect point
323 * @return list of optical connectivity intents, empty list if no path was found
324 */
325 private List<Intent> getOpticalIntents(ConnectPoint ingress, ConnectPoint egress) {
Brian O'Connor772852a2014-11-17 15:51:19 -0800326 Set<Path> paths = pathService.getPaths(ingress.deviceId(),
Marc De Leenheer16f857b2015-05-05 20:50:24 -0700327 egress.deviceId(),
328 new OpticalLinkWeight());
Brian O'Connor772852a2014-11-17 15:51:19 -0800329
330 if (paths.isEmpty()) {
Marc De Leenheer16f857b2015-05-05 20:50:24 -0700331 return Collections.emptyList();
weibit7e583462014-10-23 10:14:05 -0700332 }
Brian O'Connor772852a2014-11-17 15:51:19 -0800333
Marc De Leenheer1afa2a02015-05-13 09:18:07 -0700334 // Search path with available cross connect points
335 for (Path path : paths) {
336 List<ConnectPoint> crossConnectPoints = getCrossConnectPoints(path);
Brian O'Connor772852a2014-11-17 15:51:19 -0800337
Marc De Leenheer1afa2a02015-05-13 09:18:07 -0700338 // Skip to next path if cross connect points are mismatched
Marc De Leenheer16f857b2015-05-05 20:50:24 -0700339 if (!checkCrossConnectPoints(crossConnectPoints)) {
340 continue;
Brian O'Connor772852a2014-11-17 15:51:19 -0800341 }
342
Marc De Leenheer16f857b2015-05-05 20:50:24 -0700343 return getIntents(crossConnectPoints);
Brian O'Connor772852a2014-11-17 15:51:19 -0800344 }
Brian O'Connorc7bdd8c2014-12-08 01:29:53 -0800345
Marc De Leenheer16f857b2015-05-05 20:50:24 -0700346 return Collections.emptyList();
Brian O'Connor772852a2014-11-17 15:51:19 -0800347 }
348
Marc De Leenheer1afa2a02015-05-13 09:18:07 -0700349 /**
350 * Link weight function that emphasizes re-use of packet links.
351 */
352 private class OpticalLinkWeight implements LinkWeight {
353 @Override
354 public double weight(TopologyEdge edge) {
355 // Ignore inactive links
356 if (edge.link().state() == Link.State.INACTIVE) {
357 return -1;
358 }
Brian O'Connorc7bdd8c2014-12-08 01:29:53 -0800359
Marc De Leenheer1afa2a02015-05-13 09:18:07 -0700360 // TODO: Ignore cross connect links with used ports
361
362 // Transport links have highest weight
363 if (edge.link().type() == Link.Type.OPTICAL) {
364 return 1000;
365 }
366
367 // Packet links
368 return 1;
Brian O'Connorc7bdd8c2014-12-08 01:29:53 -0800369 }
weibitf32383b2014-10-22 10:17:31 -0700370 }
Brian O'Connorc7bdd8c2014-12-08 01:29:53 -0800371
Marc De Leenheer1afa2a02015-05-13 09:18:07 -0700372 /**
Marc De Leenheer4a1c1fa2015-06-01 18:08:56 -0700373 * Release resources associated to the given intent.
Marc De Leenheer1afa2a02015-05-13 09:18:07 -0700374 *
Marc De Leenheer4a1c1fa2015-06-01 18:08:56 -0700375 * @param intent the intent
Marc De Leenheer1afa2a02015-05-13 09:18:07 -0700376 */
Marc De Leenheer4a1c1fa2015-06-01 18:08:56 -0700377 private void releaseResources(Intent intent) {
Ayaka Koshibebcb02372015-06-01 10:56:42 -0700378 LinkResourceAllocations lra = linkResourceService.getAllocations(intent.id());
Marc De Leenheer1afa2a02015-05-13 09:18:07 -0700379 if (intent instanceof OpticalConnectivityIntent) {
380 deviceResourceService.releasePorts(intent.id());
Marc De Leenheerc9733082015-06-04 12:22:38 -0700381 if (lra != null) {
382 linkResourceService.releaseResources(lra);
383 }
384 } else if (intent instanceof OpticalCircuitIntent) {
Marc De Leenheer9f7d1892015-05-30 13:22:24 -0700385 deviceResourceService.releasePorts(intent.id());
386 deviceResourceService.releaseMapping(intent.id());
Ayaka Koshibebcb02372015-06-01 10:56:42 -0700387 if (lra != null) {
388 linkResourceService.releaseResources(lra);
389 }
Marc De Leenheer1afa2a02015-05-13 09:18:07 -0700390 }
Marc De Leenheer1afa2a02015-05-13 09:18:07 -0700391 }
Brian O'Connor772852a2014-11-17 15:51:19 -0800392 }
weibitf32383b2014-10-22 10:17:31 -0700393
Marc De Leenheer16f857b2015-05-05 20:50:24 -0700394 /**
395 * Verifies if given link is cross-connect between packet and optical layer.
396 *
397 * @param link the link
398 * @return true if the link is a cross-connect link
399 */
400 public static boolean isCrossConnectLink(Link link) {
401 if (link.type() != Link.Type.OPTICAL) {
402 return false;
Praseed Balakrishnanc0029652014-11-14 13:38:49 -0800403 }
Marc De Leenheer16f857b2015-05-05 20:50:24 -0700404
405 checkNotNull(link.annotations());
406 checkNotNull(link.annotations().value("optical.type"));
407
Sho SHIMIZU6d283122015-05-21 11:07:02 -0700408 return link.annotations().value("optical.type").equals("cross-connect");
Brian O'Connor772852a2014-11-17 15:51:19 -0800409 }
Praseed Balakrishnanc0029652014-11-14 13:38:49 -0800410
weibitf32383b2014-10-22 10:17:31 -0700411}