Newer
Older
[map-topology](https://dev.iopsys.eu/iopsys/map-topology)
## Introduction
This package provides the `topologyd` daemon.
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:
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 3 :
Repeat Step 1-2 until no new Nbr(Ni) can be inserted in 'G'.
`map-topology` provides the `topology` UBUS object with following methods:
#To (re)build topology -
root@iopsys:~$ ubus call topology refresh
#To get status (can be "incomplete" or "available") -
root@iopsys:~$ ubus call topology status
"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,
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
{
"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"
}
],
{
"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"
}
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.