blob: 90efcf43be6e91e0c96273b57eb354c93e0c57b2 [file] [log] [blame]
Thomas Vachuska781d18b2014-10-27 10:31:25 -07001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2014-present Open Networking Foundation
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.provider.host.impl;
alshabibe1cf87d2014-10-17 09:23:50 -070017
Charles Chan35a32322017-08-14 11:42:11 -070018import com.google.common.collect.Sets;
alshabibe1cf87d2014-10-17 09:23:50 -070019import org.apache.felix.scr.annotations.Activate;
20import org.apache.felix.scr.annotations.Component;
21import org.apache.felix.scr.annotations.Deactivate;
Thomas Vachuska33601602014-11-19 03:32:15 -080022import org.apache.felix.scr.annotations.Modified;
23import org.apache.felix.scr.annotations.Property;
alshabibe1cf87d2014-10-17 09:23:50 -070024import org.apache.felix.scr.annotations.Reference;
25import org.apache.felix.scr.annotations.ReferenceCardinality;
Jonathan Harte8600eb2015-01-12 10:30:45 -080026import org.onlab.packet.ARP;
Yi Tsengfcf5dce2017-07-26 14:30:41 -070027import org.onlab.packet.BasePacket;
Charles Chane6067892016-11-17 10:23:46 -080028import org.onlab.packet.DHCP;
Yi Tsengfcf5dce2017-07-26 14:30:41 -070029import org.onlab.packet.DHCP6;
Jonathan Harte8600eb2015-01-12 10:30:45 -080030import org.onlab.packet.Ethernet;
Pavlin Radoslavovd6612f92015-02-23 13:53:32 -080031import org.onlab.packet.ICMP6;
Thomas Vachuskaf845cf62015-03-24 10:13:09 -070032import org.onlab.packet.IPacket;
Charles Chane6067892016-11-17 10:23:46 -080033import org.onlab.packet.IPv4;
Jonathan Harte8600eb2015-01-12 10:30:45 -080034import org.onlab.packet.IPv6;
Charles Chan35a32322017-08-14 11:42:11 -070035import org.onlab.packet.Ip4Address;
Yi Tsengfcf5dce2017-07-26 14:30:41 -070036import org.onlab.packet.Ip6Address;
Jonathan Harte8600eb2015-01-12 10:30:45 -080037import org.onlab.packet.IpAddress;
Charles M.C. Chan956cb692015-04-26 18:49:39 +080038import org.onlab.packet.MacAddress;
Charles Chane6067892016-11-17 10:23:46 -080039import org.onlab.packet.UDP;
Jonathan Harte8600eb2015-01-12 10:30:45 -080040import org.onlab.packet.VlanId;
Yi Tsengfcf5dce2017-07-26 14:30:41 -070041import org.onlab.packet.dhcp.Dhcp6ClientIdOption;
42import org.onlab.packet.dhcp.Dhcp6IaAddressOption;
43import org.onlab.packet.dhcp.Dhcp6IaNaOption;
44import org.onlab.packet.dhcp.Dhcp6IaTaOption;
45import org.onlab.packet.dhcp.Dhcp6RelayOption;
Charles M.C. Chan956cb692015-04-26 18:49:39 +080046import org.onlab.packet.ipv6.IExtensionHeader;
Jonathan Harte8600eb2015-01-12 10:30:45 -080047import org.onlab.packet.ndp.NeighborAdvertisement;
48import org.onlab.packet.ndp.NeighborSolicitation;
Charles M.C. Chan441d7da2015-03-17 21:03:39 +080049import org.onlab.packet.ndp.RouterAdvertisement;
50import org.onlab.packet.ndp.RouterSolicitation;
Jian Lid9b5f552016-03-11 18:15:31 -080051import org.onlab.util.Tools;
Thomas Vachuska6519e6f2015-03-11 02:29:31 -070052import org.onosproject.cfg.ComponentConfigService;
Pavlin Radoslavovd36a74b2015-01-09 11:59:07 -080053import org.onosproject.core.ApplicationId;
54import org.onosproject.core.CoreService;
Ray Milkeyfacf2862017-08-03 11:58:29 -070055import org.onosproject.net.intf.InterfaceService;
Brian O'Connorabafb502014-12-02 22:26:20 -080056import org.onosproject.net.ConnectPoint;
Pavlin Radoslavovd36a74b2015-01-09 11:59:07 -080057import org.onosproject.net.Device;
Charles Chan888e20a2017-05-01 15:44:23 -070058import org.onosproject.net.DeviceId;
Brian O'Connorabafb502014-12-02 22:26:20 -080059import org.onosproject.net.Host;
60import org.onosproject.net.HostId;
61import org.onosproject.net.HostLocation;
62import org.onosproject.net.device.DeviceEvent;
63import org.onosproject.net.device.DeviceListener;
64import org.onosproject.net.device.DeviceService;
Pavlin Radoslavovd36a74b2015-01-09 11:59:07 -080065import org.onosproject.net.flow.DefaultTrafficSelector;
sdn94b00152016-08-30 02:12:32 -070066import org.onosproject.net.flow.DefaultTrafficTreatment;
Pavlin Radoslavovd36a74b2015-01-09 11:59:07 -080067import org.onosproject.net.flow.TrafficSelector;
sdn94b00152016-08-30 02:12:32 -070068import org.onosproject.net.flow.TrafficTreatment;
Brian O'Connorabafb502014-12-02 22:26:20 -080069import org.onosproject.net.host.DefaultHostDescription;
70import org.onosproject.net.host.HostDescription;
71import org.onosproject.net.host.HostProvider;
72import org.onosproject.net.host.HostProviderRegistry;
73import org.onosproject.net.host.HostProviderService;
74import org.onosproject.net.host.HostService;
sdn94b00152016-08-30 02:12:32 -070075import org.onosproject.net.packet.DefaultOutboundPacket;
76import org.onosproject.net.packet.OutboundPacket;
Brian O'Connorabafb502014-12-02 22:26:20 -080077import org.onosproject.net.packet.PacketContext;
Jonathan Hart3cfce8e2015-01-14 16:43:27 -080078import org.onosproject.net.packet.PacketPriority;
Brian O'Connorabafb502014-12-02 22:26:20 -080079import org.onosproject.net.packet.PacketProcessor;
80import org.onosproject.net.packet.PacketService;
81import org.onosproject.net.provider.AbstractProvider;
82import org.onosproject.net.provider.ProviderId;
83import org.onosproject.net.topology.Topology;
84import org.onosproject.net.topology.TopologyService;
Thomas Vachuska33601602014-11-19 03:32:15 -080085import org.osgi.service.component.ComponentContext;
alshabibe1cf87d2014-10-17 09:23:50 -070086import org.slf4j.Logger;
87
sdn94b00152016-08-30 02:12:32 -070088import java.nio.ByteBuffer;
Thomas Vachuskaf845cf62015-03-24 10:13:09 -070089import java.util.Dictionary;
Yi Tseng7a38f9a2017-06-09 14:36:40 -070090import java.util.Objects;
91import java.util.Optional;
Madan Jampania3770c32015-12-11 12:07:41 -080092import java.util.concurrent.ExecutorService;
Yi Tseng7a38f9a2017-06-09 14:36:40 -070093import java.util.stream.Stream;
Charles Chan35a32322017-08-14 11:42:11 -070094import java.util.Set;
Thomas Vachuskaf845cf62015-03-24 10:13:09 -070095
Madan Jampania3770c32015-12-11 12:07:41 -080096import static java.util.concurrent.Executors.newSingleThreadScheduledExecutor;
97import static org.onlab.util.Tools.groupedThreads;
Thomas Vachuskaf845cf62015-03-24 10:13:09 -070098import static org.slf4j.LoggerFactory.getLogger;
99
alshabibe1cf87d2014-10-17 09:23:50 -0700100/**
Thomas Vachuskaec9c7dd2015-09-03 18:30:04 -0700101 * Provider which uses an OpenFlow controller to detect network end-station
102 * hosts.
alshabibe1cf87d2014-10-17 09:23:50 -0700103 */
104@Component(immediate = true)
105public class HostLocationProvider extends AbstractProvider implements HostProvider {
alshabibe1cf87d2014-10-17 09:23:50 -0700106 private final Logger log = getLogger(getClass());
107
Pavlin Radoslavovd36a74b2015-01-09 11:59:07 -0800108 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
109 protected CoreService coreService;
110
111 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
alshabibe1cf87d2014-10-17 09:23:50 -0700112 protected HostProviderRegistry providerRegistry;
113
114 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
Pavlin Radoslavovd6612f92015-02-23 13:53:32 -0800115 protected PacketService packetService;
alshabibe1cf87d2014-10-17 09:23:50 -0700116
117 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
118 protected TopologyService topologyService;
119
Thomas Vachuska33601602014-11-19 03:32:15 -0800120 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
121 protected HostService hostService;
122
123 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
124 protected DeviceService deviceService;
125
Thomas Vachuska6519e6f2015-03-11 02:29:31 -0700126 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
127 protected ComponentConfigService cfgService;
128
Yi Tseng7a38f9a2017-06-09 14:36:40 -0700129 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
130 protected InterfaceService interfaceService;
131
alshabibe1cf87d2014-10-17 09:23:50 -0700132 private HostProviderService providerService;
133
134 private final InternalHostProvider processor = new InternalHostProvider();
Thomas Vachuska33601602014-11-19 03:32:15 -0800135 private final DeviceListener deviceListener = new InternalDeviceListener();
136
Pavlin Radoslavovd36a74b2015-01-09 11:59:07 -0800137 private ApplicationId appId;
138
Thomas Vachuska33601602014-11-19 03:32:15 -0800139 @Property(name = "hostRemovalEnabled", boolValue = true,
140 label = "Enable host removal on port/device down events")
141 private boolean hostRemovalEnabled = true;
alshabibe1cf87d2014-10-17 09:23:50 -0700142
Yi Tseng7a38f9a2017-06-09 14:36:40 -0700143 @Property(name = "requestArp", boolValue = true,
144 label = "Request ARP packets for neighbor discovery by the " +
Charles Chane6067892016-11-17 10:23:46 -0800145 "Host Location Provider; default is true")
Yi Tseng7a38f9a2017-06-09 14:36:40 -0700146 private boolean requestArp = true;
Charles Chane6067892016-11-17 10:23:46 -0800147
Yi Tseng7a38f9a2017-06-09 14:36:40 -0700148 @Property(name = "requestIpv6ND", boolValue = false,
149 label = "Requests IPv6 Neighbor Discovery by the " +
Thomas Vachuska27bee092015-06-23 19:03:10 -0700150 "Host Location Provider; default is false")
Yi Tseng7a38f9a2017-06-09 14:36:40 -0700151 private boolean requestIpv6ND = false;
Charles Chane6067892016-11-17 10:23:46 -0800152
153 @Property(name = "useDhcp", boolValue = false,
Yi Tseng7a38f9a2017-06-09 14:36:40 -0700154 label = "Use DHCP for neighbor discovery by the " +
Charles Chane6067892016-11-17 10:23:46 -0800155 "Host Location Provider; default is false")
156 private boolean useDhcp = false;
alshabibe1cf87d2014-10-17 09:23:50 -0700157
Yi Tsengfcf5dce2017-07-26 14:30:41 -0700158 @Property(name = "useDhcp6", boolValue = false,
159 label = "Use DHCPv6 for neighbor discovery by the " +
160 "Host Location Provider; default is false")
161 private boolean useDhcp6 = false;
162
Jonathan Hart9af322d2016-01-06 17:42:04 -0800163 @Property(name = "requestInterceptsEnabled", boolValue = true,
164 label = "Enable requesting packet intercepts")
165 private boolean requestInterceptsEnabled = true;
166
Charles Chan35a32322017-08-14 11:42:11 -0700167 @Property(name = "multihomingEnabled", boolValue = false,
168 label = "Allow hosts to be multihomed")
169 private boolean multihomingEnabled = false;
Madan Jampania3770c32015-12-11 12:07:41 -0800170
Charles Chan35a32322017-08-14 11:42:11 -0700171 protected ExecutorService eventHandler;
sdn94b00152016-08-30 02:12:32 -0700172
alshabibe1cf87d2014-10-17 09:23:50 -0700173 /**
174 * Creates an OpenFlow host provider.
175 */
176 public HostLocationProvider() {
Brian O'Connorabafb502014-12-02 22:26:20 -0800177 super(new ProviderId("of", "org.onosproject.provider.host"));
alshabibe1cf87d2014-10-17 09:23:50 -0700178 }
179
180 @Activate
Thomas Vachuska33601602014-11-19 03:32:15 -0800181 public void activate(ComponentContext context) {
Thomas Vachuska6519e6f2015-03-11 02:29:31 -0700182 cfgService.registerProperties(getClass());
183 appId = coreService.registerApplication("org.onosproject.provider.host");
Jonathan Hart9af322d2016-01-06 17:42:04 -0800184 eventHandler = newSingleThreadScheduledExecutor(
HIGUCHI Yutad9e01052016-04-14 09:31:42 -0700185 groupedThreads("onos/host-loc-provider", "event-handler", log));
alshabibe1cf87d2014-10-17 09:23:50 -0700186 providerService = providerRegistry.register(this);
Brian O'Connor3b783262015-07-29 17:49:24 -0700187 packetService.addProcessor(processor, PacketProcessor.advisor(1));
Thomas Vachuska33601602014-11-19 03:32:15 -0800188 deviceService.addListener(deviceListener);
Jonathan Hart9af322d2016-01-06 17:42:04 -0800189
190 modified(context);
Jonathan Hart3cfce8e2015-01-14 16:43:27 -0800191
Charles M.C. Chane148de82015-05-06 12:38:21 +0800192 log.info("Started with Application ID {}", appId.id());
193 }
194
195 @Deactivate
196 public void deactivate() {
Charles M.C. Chane148de82015-05-06 12:38:21 +0800197 cfgService.unregisterProperties(getClass(), false);
Thomas Vachuska27bee092015-06-23 19:03:10 -0700198
199 withdrawIntercepts();
200
Charles M.C. Chane148de82015-05-06 12:38:21 +0800201 providerRegistry.unregister(this);
202 packetService.removeProcessor(processor);
203 deviceService.removeListener(deviceListener);
Madan Jampania3770c32015-12-11 12:07:41 -0800204 eventHandler.shutdown();
Charles M.C. Chane148de82015-05-06 12:38:21 +0800205 providerService = null;
206 log.info("Stopped");
207 }
208
209 @Modified
210 public void modified(ComponentContext context) {
Charles M.C. Chane148de82015-05-06 12:38:21 +0800211 readComponentConfiguration(context);
Jonathan Hart9af322d2016-01-06 17:42:04 -0800212
213 if (requestInterceptsEnabled) {
214 requestIntercepts();
215 } else {
216 withdrawIntercepts();
217 }
Charles M.C. Chane148de82015-05-06 12:38:21 +0800218 }
219
220 /**
Thomas Vachuska27bee092015-06-23 19:03:10 -0700221 * Request packet intercepts.
Charles M.C. Chane148de82015-05-06 12:38:21 +0800222 */
Thomas Vachuska27bee092015-06-23 19:03:10 -0700223 private void requestIntercepts() {
Charles Chane6067892016-11-17 10:23:46 -0800224 // Use ARP
225 TrafficSelector arpSelector = DefaultTrafficSelector.builder()
226 .matchEthType(Ethernet.TYPE_ARP)
227 .build();
Yi Tseng7a38f9a2017-06-09 14:36:40 -0700228 if (requestArp) {
Charles Chane6067892016-11-17 10:23:46 -0800229 packetService.requestPackets(arpSelector, PacketPriority.CONTROL, appId);
Thomas Vachuska27bee092015-06-23 19:03:10 -0700230 } else {
Charles Chane6067892016-11-17 10:23:46 -0800231 packetService.cancelPackets(arpSelector, PacketPriority.CONTROL, appId);
Pavlin Radoslavov93b606b2015-02-25 17:28:39 -0800232 }
Thomas Vachuska27bee092015-06-23 19:03:10 -0700233
Charles Chane6067892016-11-17 10:23:46 -0800234 // Use IPv6 Neighbor Discovery
235 TrafficSelector ipv6NsSelector = DefaultTrafficSelector.builder()
236 .matchEthType(Ethernet.TYPE_IPV6)
237 .matchIPProtocol(IPv6.PROTOCOL_ICMP6)
238 .matchIcmpv6Type(ICMP6.NEIGHBOR_SOLICITATION)
239 .build();
240 TrafficSelector ipv6NaSelector = DefaultTrafficSelector.builder()
241 .matchEthType(Ethernet.TYPE_IPV6)
242 .matchIPProtocol(IPv6.PROTOCOL_ICMP6)
243 .matchIcmpv6Type(ICMP6.NEIGHBOR_ADVERTISEMENT)
244 .build();
Yi Tseng7a38f9a2017-06-09 14:36:40 -0700245 if (requestIpv6ND) {
Charles Chane6067892016-11-17 10:23:46 -0800246 packetService.requestPackets(ipv6NsSelector, PacketPriority.CONTROL, appId);
247 packetService.requestPackets(ipv6NaSelector, PacketPriority.CONTROL, appId);
Thomas Vachuska27bee092015-06-23 19:03:10 -0700248 } else {
Charles Chane6067892016-11-17 10:23:46 -0800249 packetService.cancelPackets(ipv6NsSelector, PacketPriority.CONTROL, appId);
250 packetService.cancelPackets(ipv6NaSelector, PacketPriority.CONTROL, appId);
251 }
Thomas Vachuska27bee092015-06-23 19:03:10 -0700252 }
253
254 /**
255 * Withdraw packet intercepts.
256 */
257 private void withdrawIntercepts() {
258 TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
259 selector.matchEthType(Ethernet.TYPE_ARP);
Aaron Kruglikov07a923d2015-07-03 13:30:57 -0700260 packetService.cancelPackets(selector.build(), PacketPriority.CONTROL, appId);
Thomas Vachuska27bee092015-06-23 19:03:10 -0700261
262 // IPv6 Neighbor Solicitation packet.
263 selector.matchEthType(Ethernet.TYPE_IPV6);
264 selector.matchIPProtocol(IPv6.PROTOCOL_ICMP6);
265 selector.matchIcmpv6Type(ICMP6.NEIGHBOR_SOLICITATION);
266 packetService.cancelPackets(selector.build(), PacketPriority.CONTROL, appId);
267
268 // IPv6 Neighbor Advertisement packet.
269 selector.matchIcmpv6Type(ICMP6.NEIGHBOR_ADVERTISEMENT);
270 packetService.cancelPackets(selector.build(), PacketPriority.CONTROL, appId);
Pavlin Radoslavov93b606b2015-02-25 17:28:39 -0800271 }
272
273 /**
274 * Extracts properties from the component configuration context.
275 *
276 * @param context the component context
277 */
278 private void readComponentConfiguration(ComponentContext context) {
279 Dictionary<?, ?> properties = context.getProperties();
280 Boolean flag;
281
Jian Lid9b5f552016-03-11 18:15:31 -0800282 flag = Tools.isPropertyEnabled(properties, "hostRemovalEnabled");
Pavlin Radoslavov93b606b2015-02-25 17:28:39 -0800283 if (flag == null) {
284 log.info("Host removal on port/device down events is not configured, " +
Yi Tseng7a38f9a2017-06-09 14:36:40 -0700285 "using current value of {}", hostRemovalEnabled);
Pavlin Radoslavov93b606b2015-02-25 17:28:39 -0800286 } else {
287 hostRemovalEnabled = flag;
288 log.info("Configured. Host removal on port/device down events is {}",
289 hostRemovalEnabled ? "enabled" : "disabled");
Thomas Vachuska33601602014-11-19 03:32:15 -0800290 }
Pavlin Radoslavov93b606b2015-02-25 17:28:39 -0800291
Yi Tseng7a38f9a2017-06-09 14:36:40 -0700292 flag = Tools.isPropertyEnabled(properties, "requestArp");
Charles Chane6067892016-11-17 10:23:46 -0800293 if (flag == null) {
294 log.info("Using ARP is not configured, " +
Yi Tseng7a38f9a2017-06-09 14:36:40 -0700295 "using current value of {}", requestArp);
Charles Chane6067892016-11-17 10:23:46 -0800296 } else {
Yi Tseng7a38f9a2017-06-09 14:36:40 -0700297 requestArp = flag;
Charles Chane6067892016-11-17 10:23:46 -0800298 log.info("Configured. Using ARP is {}",
Yi Tseng7a38f9a2017-06-09 14:36:40 -0700299 requestArp ? "enabled" : "disabled");
Charles Chane6067892016-11-17 10:23:46 -0800300 }
301
Yi Tseng7a38f9a2017-06-09 14:36:40 -0700302 flag = Tools.isPropertyEnabled(properties, "requestIpv6ND");
Pavlin Radoslavov93b606b2015-02-25 17:28:39 -0800303 if (flag == null) {
304 log.info("Using IPv6 Neighbor Discovery is not configured, " +
Yi Tseng7a38f9a2017-06-09 14:36:40 -0700305 "using current value of {}", requestIpv6ND);
Pavlin Radoslavov93b606b2015-02-25 17:28:39 -0800306 } else {
Yi Tseng7a38f9a2017-06-09 14:36:40 -0700307 requestIpv6ND = flag;
Pavlin Radoslavov93b606b2015-02-25 17:28:39 -0800308 log.info("Configured. Using IPv6 Neighbor Discovery is {}",
Yi Tseng7a38f9a2017-06-09 14:36:40 -0700309 requestIpv6ND ? "enabled" : "disabled");
Charles Chane6067892016-11-17 10:23:46 -0800310 }
311
312 flag = Tools.isPropertyEnabled(properties, "useDhcp");
313 if (flag == null) {
314 log.info("Using DHCP is not configured, " +
Yi Tseng7a38f9a2017-06-09 14:36:40 -0700315 "using current value of {}", useDhcp);
Charles Chane6067892016-11-17 10:23:46 -0800316 } else {
317 useDhcp = flag;
318 log.info("Configured. Using DHCP is {}",
Yi Tseng7a38f9a2017-06-09 14:36:40 -0700319 useDhcp ? "enabled" : "disabled");
Pavlin Radoslavov93b606b2015-02-25 17:28:39 -0800320 }
Jonathan Hart9af322d2016-01-06 17:42:04 -0800321
Jian Lid9b5f552016-03-11 18:15:31 -0800322 flag = Tools.isPropertyEnabled(properties, "requestInterceptsEnabled");
Jonathan Hart9af322d2016-01-06 17:42:04 -0800323 if (flag == null) {
324 log.info("Request intercepts is not configured, " +
Yi Tseng7a38f9a2017-06-09 14:36:40 -0700325 "using current value of {}", requestInterceptsEnabled);
Jonathan Hart9af322d2016-01-06 17:42:04 -0800326 } else {
327 requestInterceptsEnabled = flag;
328 log.info("Configured. Request intercepts is {}",
Yi Tseng7a38f9a2017-06-09 14:36:40 -0700329 requestInterceptsEnabled ? "enabled" : "disabled");
Jonathan Hart9af322d2016-01-06 17:42:04 -0800330 }
Charles Chan35a32322017-08-14 11:42:11 -0700331
332 flag = Tools.isPropertyEnabled(properties, "multihomingEnabled");
333 if (flag == null) {
334 log.info("Multihoming is not configured, " +
335 "using current value of {}", multihomingEnabled);
336 } else {
337 multihomingEnabled = flag;
338 log.info("Configured. Multihoming is {}",
339 multihomingEnabled ? "enabled" : "disabled");
340 }
341
Pavlin Radoslavov93b606b2015-02-25 17:28:39 -0800342 }
343
alshabibe1cf87d2014-10-17 09:23:50 -0700344 @Override
345 public void triggerProbe(Host host) {
Saurav Dasb0ae6ee2017-03-04 16:08:47 -0800346 //log.info("Triggering probe on device {} ", host);
Jonathan Hartf353e402016-09-23 09:27:36 -0700347
348 // FIXME Disabling host probing for now, because sending packets from a
349 // broadcast MAC address caused problems when two ONOS networks were
350 // interconnected. Host probing should take into account the interface
351 // configuration when determining which source address to use.
352
353 //MastershipRole role = deviceService.getRole(host.location().deviceId());
354 //if (role.equals(MastershipRole.MASTER)) {
355 // host.ipAddresses().forEach(ip -> {
356 // sendProbe(host, ip);
357 // });
358 //} else {
359 // log.info("not the master, master will probe {}");
360 //}
sdn94b00152016-08-30 02:12:32 -0700361 }
362
363 private void sendProbe(Host host, IpAddress targetIp) {
364 Ethernet probePacket = null;
365 if (targetIp.isIp4()) {
366 // IPv4: Use ARP
367 probePacket = buildArpRequest(targetIp, host);
368 } else {
369 // IPv6: Use Neighbor Discovery
Jonathan Hartf353e402016-09-23 09:27:36 -0700370 //TODO need to implement ndp probe
sdn94b00152016-08-30 02:12:32 -0700371 log.info("Triggering probe on device {} ", host);
372 }
373
374 TrafficTreatment treatment = DefaultTrafficTreatment.builder().setOutput(host.location().port()).build();
375
376 OutboundPacket outboundPacket = new DefaultOutboundPacket(host.location().deviceId(), treatment,
377 ByteBuffer.wrap(probePacket.serialize()));
378
379 packetService.emit(outboundPacket);
380 }
381
Charles Chan888e20a2017-05-01 15:44:23 -0700382 // This method is using source ip as 0.0.0.0 , to receive the reply even from the sub net hosts.
sdn94b00152016-08-30 02:12:32 -0700383 private Ethernet buildArpRequest(IpAddress targetIp, Host host) {
Charles Chan35a32322017-08-14 11:42:11 -0700384 return ARP.buildArpRequest(MacAddress.BROADCAST.toBytes(), Ip4Address.ZERO.toOctets(),
385 MacAddress.BROADCAST.toBytes(), targetIp.toOctets(),
386 MacAddress.BROADCAST.toBytes(), VlanId.NONE.toShort());
alshabibe1cf87d2014-10-17 09:23:50 -0700387 }
388
389 private class InternalHostProvider implements PacketProcessor {
Charles M.C. Chan956cb692015-04-26 18:49:39 +0800390 /**
Charles Chan888e20a2017-05-01 15:44:23 -0700391 * Create or update host information.
392 * Will not update IP if IP is null, all zero or self-assigned.
Charles M.C. Chan956cb692015-04-26 18:49:39 +0800393 *
Thomas Vachuska27bee092015-06-23 19:03:10 -0700394 * @param hid host ID
395 * @param mac source Mac address
Charles M.C. Chan956cb692015-04-26 18:49:39 +0800396 * @param vlan VLAN ID
397 * @param hloc host location
Charles Chan888e20a2017-05-01 15:44:23 -0700398 * @param ip source IP address or null if not updating
Charles M.C. Chan956cb692015-04-26 18:49:39 +0800399 */
Charles Chan888e20a2017-05-01 15:44:23 -0700400 private void createOrUpdateHost(HostId hid, MacAddress mac,
401 VlanId vlan, HostLocation hloc,
402 IpAddress ip) {
Charles Chan35a32322017-08-14 11:42:11 -0700403 Set<HostLocation> newLocations = Sets.newHashSet(hloc);
404
405 if (multihomingEnabled) {
406 Host existingHost = hostService.getHost(hid);
407 if (existingHost != null) {
408 Set<HostLocation> prevLocations = existingHost.locations();
409 newLocations.addAll(prevLocations);
410
411 if (!existingHost.locations().contains(hloc)) {
412 probeLocations(existingHost);
413 }
414 }
415 }
416
Charles Chan888e20a2017-05-01 15:44:23 -0700417 HostDescription desc = ip == null || ip.isZero() || ip.isSelfAssigned() ?
Charles Chan35a32322017-08-14 11:42:11 -0700418 new DefaultHostDescription(mac, vlan, newLocations, Sets.newHashSet(), false) :
419 new DefaultHostDescription(mac, vlan, newLocations, Sets.newHashSet(ip), false);
Sahil Lele3a0cdd52015-07-21 14:16:31 -0700420 try {
Ray Milkeydc083442016-02-22 11:27:57 -0800421 providerService.hostDetected(hid, desc, false);
Sahil Lele3a0cdd52015-07-21 14:16:31 -0700422 } catch (IllegalStateException e) {
423 log.debug("Host {} suppressed", hid);
424 }
Charles M.C. Chan956cb692015-04-26 18:49:39 +0800425 }
alshabibe1cf87d2014-10-17 09:23:50 -0700426
Charles Chane6067892016-11-17 10:23:46 -0800427 /**
Charles Chan35a32322017-08-14 11:42:11 -0700428 * Start verification procedure of all previous locations by sending probes.
429 *
430 * @param host Host to be probed
431 */
432 private void probeLocations(Host host) {
433 host.locations().forEach(location -> {
434 MacAddress probeMac = providerService.addPendingHostLocation(host.id(), location);
435
436 host.ipAddresses().stream().findFirst().ifPresent(ip -> {
Charles Chan2fde6d42017-08-23 14:46:43 -0700437 log.debug("Probing host {} with {}", host.id(), ip);
Charles Chan35a32322017-08-14 11:42:11 -0700438 Ethernet probe;
439 if (ip.isIp4()) {
440 probe = ARP.buildArpRequest(probeMac.toBytes(), Ip4Address.ZERO.toOctets(),
441 host.id().mac().toBytes(), ip.toOctets(),
442 host.id().mac().toBytes(), host.id().vlanId().toShort());
443 } else {
444 probe = NeighborSolicitation.buildNdpSolicit(
445 ip.getIp6Address().toOctets(),
446 IPv6.getLinkLocalAddress(probeMac.toBytes()),
447 IPv6.getSolicitNodeAddress(ip.getIp6Address().toOctets()),
448 probeMac.toBytes(),
449 IPv6.getMCastMacAddress(ip.getIp6Address().toOctets()),
450 host.id().vlanId());
451 }
452 sendProbe(probe, location);
453 });
454 });
455 }
456
457 /**
458 * Send the probe packet on given port.
459 *
460 * @param probe the probe packet
461 * @param connectPoint the port we want to probe
462 */
463 private void sendProbe(Ethernet probe, ConnectPoint connectPoint) {
464 log.info("Probing host {} on location {} with probeMac {}",
465 probe.getDestinationMAC(), connectPoint, probe.getSourceMAC());
466 TrafficTreatment treatment = DefaultTrafficTreatment.builder().setOutput(connectPoint.port()).build();
467 OutboundPacket outboundPacket = new DefaultOutboundPacket(connectPoint.deviceId(),
468 treatment, ByteBuffer.wrap(probe.serialize()));
469 packetService.emit(outboundPacket);
470 }
471
472 /**
Charles Chan888e20a2017-05-01 15:44:23 -0700473 * Updates IP address for an existing host.
Charles Chane6067892016-11-17 10:23:46 -0800474 *
475 * @param hid host ID
476 * @param ip IP address
477 */
Charles Chan888e20a2017-05-01 15:44:23 -0700478 private void updateHostIp(HostId hid, IpAddress ip) {
Charles Chane6067892016-11-17 10:23:46 -0800479 Host host = hostService.getHost(hid);
480 if (host == null) {
Charles Chan35a32322017-08-14 11:42:11 -0700481 log.warn("Fail to update IP for {}. Host does not exist", hid);
Charles Chane6067892016-11-17 10:23:46 -0800482 return;
483 }
484
Charles Chan888e20a2017-05-01 15:44:23 -0700485 HostDescription desc = new DefaultHostDescription(hid.mac(), hid.vlanId(),
Charles Chan35a32322017-08-14 11:42:11 -0700486 host.locations(), Sets.newHashSet(ip), false);
Charles Chane6067892016-11-17 10:23:46 -0800487 try {
488 providerService.hostDetected(hid, desc, false);
489 } catch (IllegalStateException e) {
490 log.debug("Host {} suppressed", hid);
491 }
492 }
493
alshabibe1cf87d2014-10-17 09:23:50 -0700494 @Override
495 public void process(PacketContext context) {
alshabib4a179dc2014-10-17 17:17:01 -0700496 if (context == null) {
497 return;
498 }
alshabibe1cf87d2014-10-17 09:23:50 -0700499
Thomas Vachuskaf845cf62015-03-24 10:13:09 -0700500 Ethernet eth = context.inPacket().parsed();
Jonathan Harte8600eb2015-01-12 10:30:45 -0800501 if (eth == null) {
502 return;
503 }
Jonathan Hartf353e402016-09-23 09:27:36 -0700504
Charles M.C. Chan956cb692015-04-26 18:49:39 +0800505 MacAddress srcMac = eth.getSourceMAC();
Jonathan Hartf353e402016-09-23 09:27:36 -0700506 if (srcMac.isBroadcast() || srcMac.isMulticast()) {
507 return;
508 }
Jonathan Harte8600eb2015-01-12 10:30:45 -0800509
alshabibe1cf87d2014-10-17 09:23:50 -0700510 VlanId vlan = VlanId.vlanId(eth.getVlanID());
511 ConnectPoint heardOn = context.inPacket().receivedFrom();
512
Thomas Vachuskaf845cf62015-03-24 10:13:09 -0700513 // If this arrived on control port, bail out.
514 if (heardOn.port().isLogical()) {
515 return;
516 }
517
alshabibe1cf87d2014-10-17 09:23:50 -0700518 // If this is not an edge port, bail out.
519 Topology topology = topologyService.currentTopology();
520 if (topologyService.isInfrastructure(topology, heardOn)) {
521 return;
522 }
523
Thomas Vachuskaec9c7dd2015-09-03 18:30:04 -0700524 HostLocation hloc = new HostLocation(heardOn, System.currentTimeMillis());
alshabibe1cf87d2014-10-17 09:23:50 -0700525 HostId hid = HostId.hostId(eth.getSourceMAC(), vlan);
Charles Chan35a32322017-08-14 11:42:11 -0700526 MacAddress destMac = eth.getDestinationMAC();
527
528 // Receives a location probe. Invalid entry from the cache
529 if (multihomingEnabled && destMac.isOnos() && !MacAddress.NONE.equals(destMac)) {
530 log.info("Receives probe for {}/{} on {}", srcMac, vlan, heardOn);
531 providerService.removePendingHostLocation(destMac);
532 return;
533 }
alshabibe1cf87d2014-10-17 09:23:50 -0700534
Charles M.C. Chan7fee36a2014-12-31 00:19:59 +0800535 // ARP: possible new hosts, update both location and IP
alshabibe1cf87d2014-10-17 09:23:50 -0700536 if (eth.getEtherType() == Ethernet.TYPE_ARP) {
537 ARP arp = (ARP) eth.getPayload();
Pavlin Radoslavovd6612f92015-02-23 13:53:32 -0800538 IpAddress ip = IpAddress.valueOf(IpAddress.Version.INET,
539 arp.getSenderProtocolAddress());
Charles Chan888e20a2017-05-01 15:44:23 -0700540 createOrUpdateHost(hid, srcMac, vlan, hloc, ip);
alshabibe1cf87d2014-10-17 09:23:50 -0700541
Charles Chan5d5e0622015-09-25 13:00:06 -0700542 // IPv4: update location only
alshabibe1cf87d2014-10-17 09:23:50 -0700543 } else if (eth.getEtherType() == Ethernet.TYPE_IPV4) {
Yi Tsengcfa637a2017-07-26 17:24:10 -0700544 DHCP dhcp = findDhcp(eth).orElse(null);
545 if (dhcp != null) {
546 if (useDhcp) {
547 // learn host (server or client) MAC address
548 createOrUpdateHost(hid, srcMac, vlan, hloc, null);
549
550 // DHCP ACK: additionally update IP of DHCP client
551 if (dhcp.getPacketType().equals(DHCP.MsgType.DHCPACK)) {
552 MacAddress hostMac = MacAddress.valueOf(dhcp.getClientHardwareAddress());
553 VlanId hostVlan = VlanId.vlanId(eth.getVlanID());
554 HostId hostId = HostId.hostId(hostMac, hostVlan);
555 updateHostIp(hostId, IpAddress.valueOf(dhcp.getYourIPAddress()));
556 }
557 }
558 } else {
559 // learn host MAC address
Yi Tseng7a38f9a2017-06-09 14:36:40 -0700560 createOrUpdateHost(hid, srcMac, vlan, hloc, null);
Charles Chane6067892016-11-17 10:23:46 -0800561 }
Charles Chan5d5e0622015-09-25 13:00:06 -0700562 //
563 // NeighborAdvertisement and NeighborSolicitation: possible
564 // new hosts, update both location and IP.
565 //
566 // IPv6: update location only
Charles M.C. Chan7fee36a2014-12-31 00:19:59 +0800567 } else if (eth.getEtherType() == Ethernet.TYPE_IPV6) {
Charles M.C. Chan7fee36a2014-12-31 00:19:59 +0800568 IPv6 ipv6 = (IPv6) eth.getPayload();
Charles M.C. Chan956cb692015-04-26 18:49:39 +0800569 IpAddress ip = IpAddress.valueOf(IpAddress.Version.INET6,
Thomas Vachuska27bee092015-06-23 19:03:10 -0700570 ipv6.getSourceAddress());
Charles M.C. Chan7fee36a2014-12-31 00:19:59 +0800571
Charles M.C. Chan956cb692015-04-26 18:49:39 +0800572 // skip extension headers
573 IPacket pkt = ipv6;
574 while (pkt.getPayload() != null &&
575 pkt.getPayload() instanceof IExtensionHeader) {
576 pkt = pkt.getPayload();
577 }
Charles M.C. Chan9148d2d2015-04-27 03:36:39 +0800578 pkt = pkt.getPayload();
Yi Tsengfcf5dce2017-07-26 14:30:41 -0700579
580 // DHCPv6 protocol
581 DHCP6 dhcp6 = findDhcp6(pkt).orElse(null);
582 if (dhcp6 != null && useDhcp6) {
583 createOrUpdateHost(hid, srcMac, vlan, hloc, null);
584 handleDhcp6(dhcp6, vlan);
585 return;
586 }
587
Charles M.C. Chan9148d2d2015-04-27 03:36:39 +0800588 if (pkt != null && pkt instanceof ICMP6) {
Yi Tsengfcf5dce2017-07-26 14:30:41 -0700589 // Neighbor Discovery Protocol
Charles M.C. Chan956cb692015-04-26 18:49:39 +0800590 pkt = pkt.getPayload();
591 // RouterSolicitation, RouterAdvertisement
Charles M.C. Chan9148d2d2015-04-27 03:36:39 +0800592 if (pkt != null && (pkt instanceof RouterAdvertisement ||
Thomas Vachuska27bee092015-06-23 19:03:10 -0700593 pkt instanceof RouterSolicitation)) {
Charles M.C. Chan441d7da2015-03-17 21:03:39 +0800594 return;
595 }
Charles M.C. Chan9148d2d2015-04-27 03:36:39 +0800596 if (pkt != null && (pkt instanceof NeighborSolicitation ||
Thomas Vachuska27bee092015-06-23 19:03:10 -0700597 pkt instanceof NeighborAdvertisement)) {
Charles M.C. Chan956cb692015-04-26 18:49:39 +0800598 // Duplicate Address Detection
599 if (ip.isZero()) {
Charles M.C. Chan441d7da2015-03-17 21:03:39 +0800600 return;
Charles M.C. Chan7fee36a2014-12-31 00:19:59 +0800601 }
Charles M.C. Chan956cb692015-04-26 18:49:39 +0800602 // NeighborSolicitation, NeighborAdvertisement
Charles Chan888e20a2017-05-01 15:44:23 -0700603 createOrUpdateHost(hid, srcMac, vlan, hloc, ip);
Charles M.C. Chan956cb692015-04-26 18:49:39 +0800604 return;
Charles M.C. Chan7fee36a2014-12-31 00:19:59 +0800605 }
Charles M.C. Chan7fee36a2014-12-31 00:19:59 +0800606 }
Charles M.C. Chan956cb692015-04-26 18:49:39 +0800607
608 // multicast
609 if (eth.isMulticast()) {
610 return;
611 }
612
613 // normal IPv6 packets
Charles Chan888e20a2017-05-01 15:44:23 -0700614 createOrUpdateHost(hid, srcMac, vlan, hloc, null);
alshabibe1cf87d2014-10-17 09:23:50 -0700615 }
616 }
Yi Tseng7a38f9a2017-06-09 14:36:40 -0700617
Yi Tsengfcf5dce2017-07-26 14:30:41 -0700618 /**
619 * Handles DHCPv6 packet, if message type is ACK, update IP address
620 * according to DHCPv6 payload (IA Address option).
621 *
622 * @param dhcp6 the DHCPv6 payload
623 * @param vlanId the vlan of this packet
624 */
625 private void handleDhcp6(DHCP6 dhcp6, VlanId vlanId) {
626 // extract the relay message if exist
627 while (dhcp6 != null && DHCP6.RELAY_MSG_TYPES.contains(dhcp6.getMsgType())) {
628 dhcp6 = dhcp6.getOptions().stream()
629 .filter(opt -> opt instanceof Dhcp6RelayOption)
630 .map(BasePacket::getPayload)
631 .map(pld -> (DHCP6) pld)
632 .findFirst()
633 .orElse(null);
634 }
635
636 if (dhcp6 == null) {
637 // Can't find dhcp payload
638 log.warn("Can't find dhcp payload from relay message");
639 return;
640 }
641
642 if (dhcp6.getMsgType() != DHCP6.MsgType.REPLY.value()) {
643 // Update IP address only when we received REPLY message
644 return;
645 }
646 Optional<Dhcp6ClientIdOption> clientIdOption = dhcp6.getOptions()
647 .stream()
648 .filter(opt -> opt instanceof Dhcp6ClientIdOption)
649 .map(opt -> (Dhcp6ClientIdOption) opt)
650 .findFirst();
651
652 if (!clientIdOption.isPresent()) {
653 // invalid DHCPv6 option
654 log.warn("Can't find client ID from DHCPv6 {}", dhcp6);
655 return;
656 }
657
658 byte[] linkLayerAddr = clientIdOption.get().getDuid().getLinkLayerAddress();
659 if (linkLayerAddr == null || linkLayerAddr.length != 6) {
660 // No any mac address found
661 log.warn("Can't find client mac from option {}", clientIdOption);
662 return;
663 }
664 MacAddress clientMac = MacAddress.valueOf(linkLayerAddr);
665
666 // Extract IPv6 address from IA NA ot IA TA option
667 Optional<Dhcp6IaNaOption> iaNaOption = dhcp6.getOptions()
668 .stream()
669 .filter(opt -> opt instanceof Dhcp6IaNaOption)
670 .map(opt -> (Dhcp6IaNaOption) opt)
671 .findFirst();
672 Optional<Dhcp6IaTaOption> iaTaOption = dhcp6.getOptions()
673 .stream()
674 .filter(opt -> opt instanceof Dhcp6IaTaOption)
675 .map(opt -> (Dhcp6IaTaOption) opt)
676 .findFirst();
677 Optional<Dhcp6IaAddressOption> iaAddressOption;
678 if (iaNaOption.isPresent()) {
679 iaAddressOption = iaNaOption.get().getOptions().stream()
680 .filter(opt -> opt instanceof Dhcp6IaAddressOption)
681 .map(opt -> (Dhcp6IaAddressOption) opt)
682 .findFirst();
683 } else if (iaTaOption.isPresent()) {
684 iaAddressOption = iaTaOption.get().getOptions().stream()
685 .filter(opt -> opt instanceof Dhcp6IaAddressOption)
686 .map(opt -> (Dhcp6IaAddressOption) opt)
687 .findFirst();
688 } else {
689 iaAddressOption = Optional.empty();
690 }
691 if (iaAddressOption.isPresent()) {
692 Ip6Address ip = iaAddressOption.get().getIp6Address();
693 HostId hostId = HostId.hostId(clientMac, vlanId);
694 updateHostIp(hostId, ip);
695 } else {
696 log.warn("Can't find IPv6 address from DHCPv6 {}", dhcp6);
697 }
698 }
699
Yi Tseng7a38f9a2017-06-09 14:36:40 -0700700 private Optional<DHCP> findDhcp(Ethernet eth) {
701 IPacket pkt = eth.getPayload();
702 return Stream.of(pkt)
703 .filter(Objects::nonNull)
704 .filter(p -> p instanceof IPv4)
705 .map(IPacket::getPayload)
706 .filter(Objects::nonNull)
707 .filter(p -> p instanceof UDP)
708 .map(IPacket::getPayload)
709 .filter(Objects::nonNull)
710 .filter(p -> p instanceof DHCP)
711 .map(p -> (DHCP) p)
712 .findFirst();
713 }
Yi Tsengfcf5dce2017-07-26 14:30:41 -0700714
715 private Optional<DHCP6> findDhcp6(IPacket pkt) {
716 return Stream.of(pkt)
717 .filter(Objects::nonNull)
718 .filter(p -> p instanceof UDP)
719 .map(IPacket::getPayload)
720 .filter(Objects::nonNull)
721 .filter(p -> p instanceof DHCP6)
722 .map(p -> (DHCP6) p)
723 .findFirst();
724 }
alshabibe1cf87d2014-10-17 09:23:50 -0700725 }
Thomas Vachuska33601602014-11-19 03:32:15 -0800726
727 // Auxiliary listener to device events.
728 private class InternalDeviceListener implements DeviceListener {
729 @Override
730 public void event(DeviceEvent event) {
Madan Jampania3770c32015-12-11 12:07:41 -0800731 eventHandler.execute(() -> handleEvent(event));
732 }
733
734 private void handleEvent(DeviceEvent event) {
Pavlin Radoslavovd36a74b2015-01-09 11:59:07 -0800735 Device device = event.subject();
736 switch (event.type()) {
Thomas Vachuska27bee092015-06-23 19:03:10 -0700737 case DEVICE_ADDED:
738 break;
739 case DEVICE_AVAILABILITY_CHANGED:
Charles Chan888e20a2017-05-01 15:44:23 -0700740 if (hostRemovalEnabled && !deviceService.isAvailable(device.id())) {
741 processDeviceDown(device.id());
Thomas Vachuska27bee092015-06-23 19:03:10 -0700742 }
743 break;
744 case DEVICE_SUSPENDED:
745 case DEVICE_UPDATED:
746 // Nothing to do?
747 break;
748 case DEVICE_REMOVED:
749 if (hostRemovalEnabled) {
Charles Chan888e20a2017-05-01 15:44:23 -0700750 processDeviceDown(device.id());
Thomas Vachuska27bee092015-06-23 19:03:10 -0700751 }
752 break;
753 case PORT_ADDED:
754 break;
755 case PORT_UPDATED:
Charles Chan888e20a2017-05-01 15:44:23 -0700756 if (hostRemovalEnabled && !event.port().isEnabled()) {
757 processPortDown(new ConnectPoint(device.id(), event.port().number()));
Thomas Vachuska27bee092015-06-23 19:03:10 -0700758 }
759 break;
760 case PORT_REMOVED:
761 // Nothing to do?
762 break;
763 default:
764 break;
Thomas Vachuska33601602014-11-19 03:32:15 -0800765 }
766 }
767 }
768
Charles Chan888e20a2017-05-01 15:44:23 -0700769 /**
770 * When a device goes down, update the location of affected hosts.
771 *
772 * @param deviceId the device that goes down
773 */
774 private void processDeviceDown(DeviceId deviceId) {
775 hostService.getConnectedHosts(deviceId).forEach(affectedHost -> affectedHost.locations().stream()
776 .filter(hostLocation -> hostLocation.deviceId().equals(deviceId))
777 .forEach(affectedLocation ->
778 providerService.removeLocationFromHost(affectedHost.id(), affectedLocation))
779 );
780 }
781
782 /**
783 * When a port goes down, update the location of affected hosts.
784 *
785 * @param connectPoint the port that goes down
786 */
787 private void processPortDown(ConnectPoint connectPoint) {
788 hostService.getConnectedHosts(connectPoint).forEach(affectedHost ->
789 providerService.removeLocationFromHost(affectedHost.id(), new HostLocation(connectPoint, 0L))
790 );
Thomas Vachuska33601602014-11-19 03:32:15 -0800791 }
792
alshabibe1cf87d2014-10-17 09:23:50 -0700793}