I recently had an issue with an openwrt router that I returned to production. It took me two days to discover that I had attached the switch cables backwards. Now this is clearly a silly mistake on my part, but it got me wondering about error, collission, crc, etc. packets. This situation should have created a ton of those.
I realized that I have never seen any port or interface statistics beyond total rx/tx traffic. It seems to me that this is rather basic diagnostics. Perhaps not for consumer grade routers, but I have always thought of openwrt as elevating equipment above basic consumer grade equipment.
So my question is: Does the firmware have a mechanism for detecting and collecting and counting these errors?
The cables themselves were fine. Rather, it is a 4 port switch with vlans. So for example, the cable going to port 4 should have been in port 1. The was that port 4 is untagged and port 1 is tagged. Ports 1 and 2 serve as trunks while 3 and 4 are direct connections to end devices. I would think this would throw packet errors because I believe this all happens at level 2.
Thanks for the snippet to query the stats. I also subsequently found some collectd modules that appear to support those stats. Its a bit challenging finding the right mods because descriptions are short and some mods seem to do the same or similar things. Working through that.
TBH, I have never checked a switch to see if errors are thrown in this scenario, but my assumption is that there would be no errors. The switch is performing as designed/configured/expected -- ignoring the tagged packets on the untagged interface and vice versa. I would also expect the same to be true if you had tagged packets (on ingress) for which the port was not a member of a given VLAN, as well as the opposite situation where the downstream device isn't configured for a VLAN that the switch port does have included.
Cool... Maybe my above assumptions are wrong. Do you mind elaborating a bit (so that I can learn + correct the above post)?
From this, I'm guessing that the inbound packets that contain tags for which the port is not a member would generate this error, right? Would it happen if ingress packets were untagged and the port wasn't an untagged member of any networks? And what about egress packets -- if the port is has a tagged VLAN but the downstream device doesn't match have that same VLAN configured, would errors be thrown?
Thanks all. To be clear, I was mostly looking to understand what errors statistics are available for switch ports. I’d just never thought of it before because I hadn’t had a problem with hardware nor done anything this stupid previously.
I’ll tag this as resolved, but still interested in any other nuggets of wisdom you folks would like to throw into the topic. I’m mainly a software guy, so I’m always on the prowl for ways to get smarter about hardware.