Reply
Emerging Member
Posts: 52
Registered: ‎01-18-2015
Kudos: 3

Unifi switch, STP and Sonos

I'm seeing horrible connectivity problems on the wired side of my home LAN. Upon digging into it, the problem is that my Unifi Switch is periodically blocking the ports leading to most of my wired network. I'm pretty sure the problem is STP path cost conflict between the Unifi switch and my Sonos gear, but I don't know what to do about it... has anyone seen this and solved it?

 

I have a 24 port Unifi Switch at the core of my network, configured with a couple different tagged VLANs, untagged is the Unifi management VLAN. I have a few Unifi APs hanging off the switch and they and their wireless clients are fine. I also have a few 3rd-party dumb switches hanging off the Unifi switch on ports configured only for a single VLAN which is my private LAN. Any such ports which lead to Sonos gear are the ones that get blocked.

 

The symptom is that traffic stops flowing, and if I hit refresh in the Unifi dashboard at exactly the right time, I *might* see the port listed as blocked. (Aside: seems you have to catch it in the act to get the GUI to admit to this. Isn't this an event worthy of logging to the events log, admin section?)

 

If I ssh into the switch and run "mca-dump info | grep stp", that's more likely to show up to date info and during connectivity problems will show stp_state:discarding for the affected ports.

 

I was running Unifi 4.8.12 when I started noticing this problem; I just upgraded to 4.8.14 to see if it would make a difference (it didn't). Previously I was running 4.7.5 and I don't think it had this problem. Did anything change with STP in the Unifi switch between 4.7.5 and 4.8.12?

 

Other things I've read: https://community.ubnt.com/t5/UniFi-Routing-Switching/Spanning-Tree/td-p/1186491 is from a year ago and specifically says "happy to see it's 802.1w which works with Sonos".

 

Sonos has pretty extensive KB articles on their use of STP and how to configure your switch to work with it; unfortunately they're still stuck on 802.1D and its path costs that predate gigabit networks, and their answer is pretty much "configure all your switches to use the path costs from 1994", and that doesn't seem to be an option for the Unifi switch.

 

I don't know how 802.1w and 802.1D manage to interoperate in practice. I tried running tcpdump on the router and I can see the announce packets coming from the unifi switch on the untagged interface. I don't see any STP packets coming from the Sonos setup, either on the untagged interface or with the VLAN tag I'd expect. Which makes me wonder, how does STP work in the presence of VLANs - the STP packets from the Sonos and Ubiquiti gear are on different VLANs and probably don't see each other, which is kind of the point of VLANs? I mean, I don't really want the Sonos units interacting with the Unifi management network, but they do need to be able to agree on STP.

 

New Member
Posts: 31
Registered: ‎04-01-2015
Kudos: 1
Solutions: 1

Re: Unifi switch, STP and Sonos

[ Edited ]

Can you not just shut off STP? No need for it in networks with non redundant paths to other switches.

 

I'm looking at buying unfi switch as well, but If I can't shut this feature off I may just pass on it.

 

Edit: I missed this when you said you had a couple of dumb switvches hanging off it. So perhaps turning off STP is not an option.

SuperUser
Posts: 15,007
Registered: ‎08-07-2008
Kudos: 7193
Solutions: 414
Contributions: 1

Re: Unifi switch, STP and Sonos

STP can be disabled . In the switch config in the controller. Cheers2

 

Allan

Walks in, tells it like it is, walks out , milks a cow
Emerging Member
Posts: 52
Registered: ‎01-18-2015
Kudos: 3

Re: Unifi switch, STP and Sonos

Well, I'd rather leave STP enabled, but as it is in conjunction with Sonos' implementation it's doing more harm than good and my options are

 

* disable STP on the Unifi switch (and depend on myself not to loop the network)

* configure one of the STP implementations to use the same path cost metrics as the other one (and neither one seems to be configurable)

* disable the Sonos wireless implementation (not doable, I have ethernet to most but not all of the Sonos locations)

* connect exactly one of the Sonos units to ethernet, and so their forwarding and STP affects only the Sonos devices (doable, but why rely on wireless when I have ethernet)

* connect zero of the Sonos units to ethernet, and they use their Wi-Fi radios to join my existing APs instead of meshing amongst themselves (again, doable, but why rely on wireless when I have ethernet)

* stop using Sonos

* stop using the Unifi switch

Emerging Member
Posts: 52
Registered: ‎01-18-2015
Kudos: 3

Re: Unifi switch, STP and Sonos

Sounds like a decent option but I can't find the place to do it... I thought I'd dug through all the configuration screens before posting this, and now that you say it's doable (which I believe -- the 4.8.14 release notes make an oblique reference that it's possible: "[USW] Decrease log verbosity when STP is disabled"), I'm digging through again and can't find it.

 

To make sure I'm understanding correctly - "switch config in the controller", I interpret as, log into the controller web GUI, go to Devices, click the switch and I get a popup with a visualization of the ports and 3 tabs "details", "ports", "configuration". "details" is read only information, "ports" has per-port configuration and I don't see anything relevant to STP there, "configuration" is for the switch as a whole and has a bunch of nested options that expand when selected but I don't see anything relevant to STP there.

 

There's also "settings" (at the global level of the dashboard) in which I can define networks, which have per-network switch settings like IGMP snooping, but I don't see anything about STP there either.

 

This is controller 4.8.14 and the current switch firmware 3.3.9.4015.

Emerging Member
Posts: 52
Registered: ‎01-18-2015
Kudos: 3

Re: Unifi switch, STP and Sonos

https://community.ubnt.com/t5/UniFi-Routing-Switching/UniFi-Switch-Config-Limitations-ie-Can-I-disab... has people wanting to disable or configure STP on the Unifi switch, can't figure out how.

 

https://community.ubnt.com/t5/UniFi-Routing-Switching/Disable-STP-on-Unifi-Switch/td-p/1273579 has a way to disable STP by editing the controller config file. Also to change bridge priority but not path costs.

 

I guess now I get to go learn how to use the config file (https://help.ubnt.com/hc/en-us/articles/205146040-UniFi-config-properties-File-Explanation).

Emerging Member
Posts: 52
Registered: ‎01-18-2015
Kudos: 3

Re: Unifi switch, STP and Sonos

Also: can anyone confirm if something changed in this regard between Unifi versions 4.7.5 and 4.8.12?

 

And wouldn't it be a good idea to log STP problems in the event log?

 

Thanks!

 

New Member
Posts: 31
Registered: ‎04-01-2015
Kudos: 1
Solutions: 1

Re: Unifi switch, STP and Sonos

Being able to modify STP settings is a key enterprise class feature. Otherwise how would you control this in a larger enviroment with mulitple core switches with attached downstream switches? All STP events should be logged to the units local logs. It seems that this is one of those features that should not require many hoops to jump through to modify and gain visibility into its functionality.

 

Just a little concerning to say the least.

Ubiquiti Employee
Posts: 8,717
Registered: ‎01-28-2013
Kudos: 14205
Solutions: 594
Contributions: 20

Re: Unifi switch, STP and Sonos

In UniFi 4.0-4.8.x you need to use config.properties to change STP status and STP priority. In 4.9.x it is now configurable via the UI. We just released 4.9.2 to beta yesterday. UI configurable priority can go from 0-61440.

 

Cheers,

Mike

 

Screen Shot 2016-03-15 at 10.48.15.png

Emerging Member
Posts: 52
Registered: ‎01-18-2015
Kudos: 3

Re: Unifi switch, STP and Sonos

Thanks. FWIW setting the STP priority on the unifi switch to a lower value (the Sonos setup also defaults to 0x8000 or 32768 and tend sto have numerically lower MAC addresses which I guess makes it the default) seems to have fixed my problem without needing to actually disable STP on the switch.

Ubiquiti Employee
Posts: 8,717
Registered: ‎01-28-2013
Kudos: 14205
Solutions: 594
Contributions: 20

Re: Unifi switch, STP and Sonos


metamatt wrote:

Thanks. FWIW setting the STP priority on the unifi switch to a lower value (the Sonos setup also defaults to 0x8000 or 32768 and tend sto have numerically lower MAC addresses which I guess makes it the default) seems to have fixed my problem without needing to actually disable STP on the switch.


You're welcome. Glad to hear that setting the priority lower has solved the issue. 

 

Cheers,
Mike

Established Member
Posts: 920
Registered: ‎11-06-2014
Kudos: 394
Solutions: 12

Re: Unifi switch, STP and Sonos

Late reply to the topic, but one way is to turn off wireless to all but one speaker.  That will fix the broadcast storm issue.

 

https://bsteiner.info/articles/disabling-sonos-wifi

Reply