Skip to content
This repository has been archived by the owner on Jan 15, 2019. It is now read-only.

Add FDB data #2

Open
wvengen opened this issue Dec 27, 2016 · 5 comments
Open

Add FDB data #2

wvengen opened this issue Dec 27, 2016 · 5 comments

Comments

@wvengen
Copy link
Owner

wvengen commented Dec 27, 2016

The UniFi protocol supports communicating which devices are seen where (useful for making a network topology). This information is present in a forwarding database (FDB) and can be extracted using tswconf fdb entry show.

SWv1.3.3# tswconf fdb entry show

 ToughSwitch Init OK!
[addr]:dc-9f-db-07-08-09 [fid]:1 [static]:NO [dest_port]:0  
[dacmd]:FORWARD [sacmd]:FORWARD [leaky]:NO [mirror]:NO [clone]:NO [da_pri]:NO [queue]:0 [cross_pt_state]:NO [white_list_en]:NO

[addr]:80-2a-a8-51-52-53 [fid]:1 [static]:NO [dest_port]:1  
[dacmd]:FORWARD [sacmd]:FORWARD [leaky]:NO [mirror]:NO [clone]:NO [da_pri]:NO [queue]:0 [cross_pt_state]:NO [white_list_en]:NO

[addr]:80-2a-a8-52-53-54 [fid]:1 [static]:NO [dest_port]:1  
[dacmd]:FORWARD [sacmd]:FORWARD [leaky]:NO [mirror]:NO [clone]:NO [da_pri]:NO [queue]:0 [cross_pt_state]:NO [white_list_en]:NO

total 3 entries

operate done.

This can be put in the inform JSON as mac_table for each port:

{
  "port_table": [
    {
      "port_idx": 1,
      "mac_table": [{"mac": "80:2a:a8:51:52:53"}, {"mac": "80:2a:a8:52:53:54"}]
    }
  ]
}

Unfortunately I have found no age info yet (which is supported in mac_table).

@wvengen
Copy link
Owner Author

wvengen commented Dec 30, 2016

The mac_table entries also need an uptime key with a value greater than at 1000 (probably 300 or higher is also ok). When this key is absent or too small, the controller will give the following error:

java.lang.NullPointerException
	at com.ubnt.service.A.O0OO$_o.?00000(Unknown Source)
	at com.ubnt.service.A.float.o00000(Unknown Source)
	at com.ubnt.service.A.O0OO.o00000(Unknown Source)
	at com.ubnt.service.A.O0OO.o00000(Unknown Source)
	at com.ubnt.service.A.do$_o.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

@wvengen
Copy link
Owner Author

wvengen commented Dec 30, 2016

Now the trouble is, we don't have an uptime of a host. What is it used for anyway?
Also, the warning [<mac address>] does not match any network is shown for each entry. Perhaps this would be solved by including a USW (which isn't present in the simulated environment).

@wvengen
Copy link
Owner Author

wvengen commented Dec 30, 2016

Other fields that may be useful: rx_bytes, tx_bytes, rx_packets, tx_packets, name, vlan
also type = usw (I guess the default)

@jeffmurphy
Copy link

Is there anything you have to do to enable tswconf? e.g. when I run it:

SW.v1.3.3# tswconf fdb entry show

 ToughSwitch Init Fail! RV[-26]

@wvengen
Copy link
Owner Author

wvengen commented Jan 24, 2017

@jeffmurphy I didn't have to do anything. Perhaps some port or device settings might influence this (just guessing)?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants