MAP Topology
Introduction
This package provides the topologyd
daemon.
Overview
The topologyd
daemon constructs full topology of a IEEE1905 enabled Multi-AP network. It provides the topology
UBUS object and methods for building and showing the full topology of a network.
topologyd
uses IEEE1905 AL macaddress of a node, where it is running, as the starting (or Root) node. It then discovers it's immediate neighbors, the next-hop neighbors, the next to next-hop neighbors, and so on... until there are no more neighbor nodes in the network, to build the full topology around the starting node.
By default, topologyd
rebuilds the topology every 60 seconds.
To (re)build topology, the UBUS method "refresh" can be used. See Usage below:
Following algorithm is used to build the full topology:
At any node 'P' in the network:
Intial state :
Nbr(P) = {N0,..Nn} <== immediate neighbors of P.
G{P, N0,..Nn} <== graph of all known nodes at P.
Step 1 :
for all Ni in G :
Send Topology Request to Ni.
Step 2 :
Read Topology Response from Ni.
if Nbr(Ni) is not in G :
Insert Nbr(Ni) in G
Step 3 :
Repeat Step 1-2 until no new Nbr(Ni) can be inserted in 'G'.
UBUS API
map-topology
provides the topology
UBUS object with following methods:
'topology' @fc2af0e9
"refresh":{}
"status":{}
"dump":{}
"changelog":{}
"nodes":{}
Usage
#To (re)build topology -
root@iopsys:~$ ubus call topology refresh
#To get status (can be "incomplete" or "available") -
root@iopsys:~$ ubus call topology status
{
"status": "incomplete"
}
#To show current topology -
root@iopsys:# ubus call topology dump
{
"self": {
"ieee1905_macaddr": "00:22:07:70:f5:6c",
"num_neighbors": 1,
"neighbors": [
{
"nbr_mac_id": "00:22:07:6e:d8:08"
}
],
"num_non1905_neighbors": 3,
"non1905_neighbors": [
"00:22:07:6d:3d:8e",
"00:22:07:6d:3d:90",
"b0:5c:da:5d:9e:19"
]
},
"nodes": [
{
"ieee1905_macaddr": "00:22:07:6e:d8:08",
"num_neighbors": 1,
"neighbors": [
{
"nbr_mac_id": "00:22:07:70:f5:6c",
"link_metrics": [
{
"nbr_intf_macid": "00:22:07:70:f5:6c",
"ieee_bridge": 1,
"tx_packet_error": 0,
"tx_packet_ok": 1081,
"mac_thrput_capacity": 0,
"link_availability": 100,
"phy_rate": 0,
"rx_packet_error": 0,
"rx_packet_ok": 2265,
"rssi": 0
}
]
}
],
"num_non1905_neighbors": 1,
"non1905_neighbors": [
"b0:5c:da:5d:9e:19"
],
"registrar_freq_band": "802.11 2.4 GHz,802.11 5 GHz",
"non1905_nbr_localintf": "00:22:07:6e:d8:08",
"1905_nbr_localintf": "00:22:07:6e:d8:08",
"local_interface_nbr": 3,
"interfaces": [
{
"interface_id": "00:22:07:6e:d8:09",
"media_type": "IEEE 802.11ac",
"network_membership": "00:22:07:6e:d8:09",
"role": "AP",
"ap_channel_band": 2,
"freq_index1": 60,
"freq_index2": 0
},
{
"interface_id": "00:22:07:6e:d8:0a",
"media_type": "IEEE 802.11n 2.4",
"network_membership": "00:22:07:6e:d8:0a",
"role": "AP",
"ap_channel_band": 0,
"freq_index1": 11,
"freq_index2": 0
},
{
"interface_id": "00:22:07:6e:d8:08",
"media_type": "IEEE 802.3ab"
}
],
"l2_neighbor_num": 2,
"l2_neighbor": [
{
"local_intf_id": "00:22:07:6e:d8:08",
"local_nbr_id": "00:22:07:70:f5:6c"
},
{
"local_intf_id": "00:22:07:6e:d8:08",
"local_nbr_id": "b0:5c:da:5d:9e:19"
}
],
"bridging_tuple_num": 1,
"bridge_tuple": [
{
"br_mac": [
"00:22:07:6e:d8:09",
"00:22:07:6e:d8:0a",
"00:22:07:6e:d8:08"
]
}
],
"version": "1905.1a",
"friendly_name": "iopsysWrt",
"manufacturer_name": "IOPSYS",
"manufacturer_model": "EG400R0",
"control_url": "http://192.168.1.1",
"ipv4_itfr_num": 1,
"ipv4_params": [
{
"mac_address": "00:22:07:6e:d8:08",
"ipv4_addr_type": "IPV4_DHCP",
"ipv4_address": "192.168.1.1",
"dhcp_addr": "127.1.1.1"
}
],
"ipv6_itfr_num": 0,
"ipv6_params": [
]
}
]
}
#To show the topology changelogs -
root@iopsys:# ubus call topology changelog
{
"num_changelog": 2,
"changelog": [
{
"reporter": "00:22:07:6e:d8:08",
"reporter_interface": "00:22:07:6e:d8:08",
"neighbor": "00:22:07:6e:d8:08",
"is1905_neighbor": "true",
"event_type": "add",
"timestamp": "2020-08-25T12:02:46"
},
{
"reporter": "00:22:07:6e:d8:08",
"reporter_interface": "00:22:07:6e:d8:08",
"neighbor": "b0:5c:da:5d:9e:19",
"is1905_neighbor": "false",
"event_type": "add",
"timestamp": "2020-08-25T12:09:24"
}
]
}
#To show the topology nodes macaddress -
root@iopsys:# ubus call topology nodes
{
"ieee1905_macaddr": "00:22:07:70:f5:6c",
"neighbors": [
"00:22:07:6e:d8:08",
"00:22:07:6d:3d:8e"
]
}
Dependencies
To successfully build map-topology, the following libraries are needed:
Dependency | Link | License |
---|---|---|
libubox | https://git.openwrt.org/project/libubox.git | BSD |
libubus | https://git.openwrt.org/project/ubus.git | LGPL 2.1 |
Testing
- Tested with two IEEE1905 devices in the network.
- Tested with only one IEEE1905 AL macaddress interface.