March 2013 Archives

Linux, FCoE, BPDUs, and Network Control

In the process of provisioning a server, I observed a reproducible problem:

 On RHEL 6.3 (the latest version), if fcoe-utils, fcoe-target-utils, and lldpad are installed - on execution of "reboot", the network port at the switch is disabled and the error given at the switch was a BPDU has been received and the port disabled.  The specific trigger is the presence of lldpad; this daemon emits a BPDU packet on shutdown which, upon reception causes the network port to be automatically disabled.   lldpad is a dependency of fcoe-utils; fcoe-utils is a dependency of system-kickstart-configurator.  This type of feature is called "Last Gasp" in some parts of industry, and is an attempt to maintain disk coherency when using Fibre Channel Over Ethernet (FCoE) by signaling to the other device that the first device is going offline. Fcoe-utils are not installed by default or by the guided installation process unless a package which depends on the fcoe-utils package is installed.

 A BPDU is a type of packet used in between switches and other devices in Spanning Tree Protocol (STP), IEEE 802.1d, and other protocols of that family.   The BPDU packet allows switches to communicate with each other and prevent cross-switch or same-switch network loops from impacting the operation of a network.  Such a loop exists if a user connects two network jacks together through a crossover cable, or if a user connects two network jacks together with an Ethernet switch or hub.  BPDUs are also used by Fibre Channel over Ethernet (FCoE) (a comparable protocol to iSCSI) to provide "rapid convergence" of a distributed storage network over Ethernet.  "Rapid Convergence" is a result of Rapid Spanning Tree Protocol (RSTP), 802.1w.  The FCoE standards inherit or borrow from other pre-existing protocol standards, including those for STP and RSTP.

Most large site networks are configured to disable a user Ethernet port if a BPDU packet is received on that user port.  This prevents users from installing unauthorized network equipment or causing network loops, either intentionally of inadvertently.  It is an unintended side-effect of the vendor's implementation of a loop-prevention mechanism that specific FCoE-related BPDU packets cause the mechanism to be activated and the corresponding user port to be disabled.

Linux's built-in bridging support (bridge, "brctl", "br2684ctl" on certain platforms, etc.) may also emit BPDU packets from a network card when a bridge virtual device is configured on the system and Spanning Tree Protocol (STP) is enabled on a bridge virtual device related to that network card.  The reception of such a packet on a campus network port configured for end-users causes the port to be automatically disabled, as explained above. This behavior is prevented by disabling STP on a per-bridge basis using the brctl utility included with most Linux distributions. This issue may impact other Linux systems which rely upon software virtual bridges, such as host-based virtualization platforms (KVM, qemu, etc.) but will vary from vendor to vendor.

My experience thus far is that KVM does not enable STP, or I set some magic variable a few months back that I have not been able to locate.

Impedance Mismatch Calculator

This website has been entirely too useful lately. To give you an idea of how:

Compare a source impedance of 50-ohms (and 0-ohms +J) to terminal loads of 25, 50, 75, and 110 ohms.

Compare a source impedance of 5-ohms (and 0-ohms +J) to a load impedance of 4-ohms or 8-ohms. Note the change in decibels and the return loss figures.

Never mind that it is for coax, for simple mismatch calculations, it works well.

Ammeter Shunts

Had an interesting question posed this afternoon, which later evolved into some experimentation. A fellow ham was building a project and looking for a specific ammeter, which I thought was odd because the range he specified I had not seen listed. Typically, meters are 0-1, 0-1.5, 0-2.5, 0-3, 0-5 and multiples thereof. He was specifically looking for a zero-to-two ampere ammeter. I suggested building a shunt, but he continued to search.

Later, I needed to test the meters and check some batteries out that were charging, so I sat down and figured up some multipliers for the voltage ranges needed. However, I hadn't built a shunt myself yet, though I knew the basic theory.

Here's a website that explains it in great detail, and gives some advice for building a relatively precision device. Here's another. And still further, here's a third. Wikipedia has an entry as well, but the past three websites solve the problems with formulas.

I started looking for calculators to speed the process. I found myself plugging values into this website to arrive at a resistance for the shunt resistor. This website on copper wire sizes and resistance includes a calculator at the top of the table. Of note, it lets you calculate the resistance of a length of a given gauge of wire.

Having recently acquired a FS=15mA (& 0.045V) and desiring to read 0 - 150mA instead of 0 - 15 mA, I plugged the values onto the first calculator.

Desired Full Scale Current (I) .150 amps
Meter Full Scale Current (IA) 15000 microamps
Meter Full Scale Voltage Drop (VA)  0.045 volts

Required Shunt Resistor (RP)  0.333 ohms
Resistor Wattage (P)  0.00608 watts

So one can see from the power dissipated that a power resistor is not required, and only 0.333 ohms of resistance is needed. From this point, I dabbled a bit until I came up to a conclusion of a relatively easy to find wire size that I had on hand, using the second calculator. Right about 2.01 feet of #32 got me to 0.33 ohms, which is close enough. I added a little wire to the ends because it is easier to remove wire than add it (particularly on a case like this, where minute resistances are important). I wound the wire around a screwdriver, tied it up with a bread-tie and installed it on the back of the meter. I then tested it by placing it between the battery and the charger, and placing a digital multimeter in series with it.

The digital multimeter confirmed that the meter shunt was working, and seemed to be amazingly dead on the money, considering the relative lack of precision associated with it's manufacture. Of course, not everyone has a roll of #32 magnet wire on hand for occasions like this, but the spool has served me very well over the years. Beware of inductive effects of wire loops when you're bundling the wire up.

So, when it doubt, make your own shunt unless you need repeatable laboratory grade readings or you're working with high-power/continuous-duty stuff. The beauty of analog meters is that unlike the digital multimeter (DMM), they don't cost you anything to run, and they don't consume batteries sitting idle. It's simple, it's fun, and best of all you get to make science when it happens. Analog meters work on current, and current is defined in both electronics and physics as the same thing (though the physics definition is a bit longer). Enjoy! :)


I = 5 A
Ia = 1000 uA (FS=1ma)
Va = 43 mV
Rp = 0.00860
P = 0.215

Works out to a little over six inches of 22 AWG hookup wire.

Weston Model 1011: 5mA - 0 - 5mA, 19.4mV full scale.

Rp: 0.00388 ohms
Rp: 0.0969

About this Archive

This page is an archive of entries from March 2013 listed from newest to oldest.

February 2013 is the previous archive.

April 2013 is the next archive.

Find recent content on the main index or look in the archives to find all content.