A method as implemented in a controller in a software defined network (SDIN), the controller storing an in-band control tree, the control tree spanning switches as an overlay to the SDN with the controller as the root of the control tree, the controller connected to at least a transit switch in the control tree, and the transit switch having at least one, first-degree, neighbor transit switch also in the control tree and having at least another, first-degree, neighbor switch that is not in the control tree, the method comprising:
- a. transmitting, to the transit switch, a packet-out message with an LLDP packet as its payload, wherein the transit switch:
- receives the packet-out message, extracts the LLDP packet from its payload, and multicasts the LLDP packet through all its active ports to the neighbor transit switch and neighbor switch;
- b. receiving, from the neighbor transit switch in the control tree, a first packet-in message, with the first packet-in message being generated by the neighbor transit switch using the received LLDP packet as the payload;
- c. receiving, from the neighbor switch not in the control tree, a second packet-in message with a hello message as its payload, with the second packet-in message being sent over the same port in the neighbor switch that received the LLDP packet transmitted in (a) and via the transit switch connected to the controller which then forwards the second packet-in message to the controller;
- d. adding a new link to the control tree for the neighbor switch that sent the second packet-in message in (c).