The previous part of this series, ARP poisoning on a switched LAN, lied to the hosts on a local area network () through the Address Resolution Protocol () and let the switch deliver the lie. This part, in the series opened by traffic diversion and the man in the middle, turns to the two attacks that lie to the switch itself. attacks the table in which a switch learns where each media access control (MAC) address lives, so that it can no longer place traffic and sends it everywhere. A spanning tree root takeover attacks the election by which switches agree on a loop-free set of paths, so that the paths bend towards the attacker. The mechanisms they abuse are explained elsewhere on the site and assumed here: the MAC address table for learning, filtering, flooding and ageing, BUM traffic, loops and broadcast storms for what flooding costs (: broadcast, unknown unicast and multicast), and spanning tree in one article for the protocol. After reading, you can estimate how long a switch's table takes to fill, say which traffic leaks while it is full and which does not, decode a configuration bridge protocol data unit () by hand, predict the election a forged one causes, and choose the guard that belongs on each kind of port.

Two tables, two lies

A switch keeps two kinds of state that an attached host can influence. The first is its filtering database, the table of MAC addresses and ports learned from the source address of every frame; the rule that fills it is in the MAC address table, and the only part that matters here is its last clause: when the table cannot hold an address, the switch cannot learn it, and frames sent to an address it does not know are flooded out of every port of the (virtual local area network). The second is its view of the spanning tree: which switch is the root, which of its own ports leads there, and which ports must block so that the network has no loops. The () builds that view from the BPDUs its neighbours send, and it believes them.

Both attacks are about position. gave the attacker the path by changing what hosts believe; MAC flooding gives it a copy of traffic by making the switch behave, for some destinations, like a hub; a root takeover moves the path itself. And both have defences that live in the switch configuration, off by default on most platforms, which is the practical reason to know them.

MAC flooding: a table that cannot say no

The idea, and the tool that made it routine

Juniper's port security overview describes the attack in four sentences: "In an overflow attack on the switching table, an intruder sends so many requests from new MAC addresses that the table cannot learn all the addresses. When the switch can no longer use information in the table to forward traffic, it is forced to broadcast messages. Traffic flow on the switch is disrupted, and packets are sent to all hosts on the network. In addition to overloading the network with traffic, the attacker might also be able to sniff that broadcast traffic" (Juniper, Overview of Port Security).

The tool that made it routine is small and old. Its manual page describes it as one that "floods the local network with random MAC addresses (causing some switches to fail open in repeating mode, facilitating sniffing)", and records its ancestry: "A straight C port of the original Net::RawIP macof program by Ian Vitek" (macof(8)). Sean Convery of Cisco Systems dated it in his USA presentation of 2002: "Theoretical attack until May 1999", then "macof tool since May 1999", "About 100 lines of perl from Ian Vitek", "Later ported to C by Dug Song for 'dsniff'" (Convery, 2002). "Fail open in repeating mode" is the whole idea: a switch whose table is full, for the addresses it cannot place, repeats frames to every port as a hub did.

What Cisco and @stake measured in 2002

Convery's slides report the tests Cisco ran with the security firm @stake against Catalyst switches, and they are the best public numbers on the attack:

Measurement (Catalyst 6506, 2002)Value
Rate at which the tool generated table entries155,000 MAC entries per minute
How the table is organized"63 bits of source (MAC, VLAN, misc) creates a 17 bit hash value"; "8 buckets to place CAM entries, if all 8 are filled the packet is flooded"
Entries at which the table is full, with a perfect hash"131,052 (approx. 16,000 x 8)"
Time it actually took to fill70 seconds, "Since hash isn't perfect"
What floods once it is full"traffic without a CAM entry floods on the local VLAN, but NOT existing traffic with an existing CAM entry"
Side effect"This attack will also fill CAM tables of adjacent switches"

(CAM, content-addressable memory, is the name Cisco uses for the table; the others are in the MAC address table.) The arithmetic is worth doing once. 155,000 entries a minute is about 2,583 a second, so a table of 131,052 entries would fill in about 51 seconds if every new address found a free slot; the measured 70 seconds is the cost of collisions in the hash, the subject of the same companion article. The capture on Convery's slide shows what an observer on an ordinary port saw afterwards: Internet Control Message Protocol () echo requests and replies between two other hosts, each marked "OOPS".

Yusuf Bhaiji of Cisco gave the table sizes of the time in slides presented at SANOG 7, the South Asian Network Operators Group meeting in Mumbai in January 2006 (dated 2005): about 16,000 entries on the 3000 family, 32,000 on the 4000 and 128,000 on the 6000; and the consequence in one line: a full table "will turn a VLAN on a switch basically into a hub" (Bhaiji, SANOG 7).

A worked example: a table of eight, filled by hand

To see exactly what leaks, shrink the switch to a table of eight entries and four ports, all in one VLAN, with entries ageing out after 300 seconds of silence (the common default; why it is 300 is in the companion article).

TimeEventTable after the event (address: port)Who receives the frame
0A (port 1), B (port 2) and C (port 3) talkA:1, B:2, C:3normal forwarding
1The host on port 4 sends five frames from invented sources X1 to X5A:1, B:2, C:3, X1:4, X2:4, X3:4, X4:4, X5:4 (8 of 8, full)the invented frames themselves, flooded
2A sends to Bunchangedport 2 only: B is in the table
3D connects on port 3 behind a small desk switch and sendsunchanged: D cannot be learnedD's own frame reaches its destination
4A sends to Dunchangedports 2, 3 and 4: D is unknown, so it floods, and port 4 sees it
300 to 301C has been silent; its entry ages out. Port 4 keeps sending from X1 to X5 and adds X6A:1, B:2, X1 to X6:4 (8 of 8)C's next frame cannot be learned either
302A sends to Cunchangedports 2, 3 and 4: C is now unknown too

Three things follow, and they are the practical shape of the attack. First, it does not expose established conversations at once: A to B in row 2 is still forwarded only to B, exactly as Convery's slide says. Second, what leaks is traffic to addresses the switch does not hold: new hosts, and hosts whose entries age out while the attacker keeps the table full by refreshing its own invented addresses. Third, the attacker has to keep sending; the moment it stops, its entries age out and the switch learns the real hosts again. That is also why the attack is noisy. A port that presents thousands of source addresses a minute is the most visible thing on the network, if anyone counts.

Convery's slides add the combination that speeds the leak up: a spanning tree topology change makes the table age "all entries in 15 seconds if they do not communicate (the default is 300 seconds)" (Convery, 2002). In the rapid version of the protocol a topology change flushes the learned addresses on the affected ports outright (Cisco, document 24062). A host that can cause topology changes can therefore empty the table of every quiet host, and a host that floods it can keep them out. The second half of this article is about the first of those powers.

The same attack against a software bridge

The table does not have to be silicon. In October 2023, Johannes Nixdorf posted a patch series to 's networking list titled "bridge: Add a limit on learned FDB entries" (FDB, forwarding database, is the kernel's name for the table). Its reasoning is the attack in a software setting: "A malicious actor behind one bridge port may spam the kernel with packets with a random source , each of which will create an FDB entry, each of which is a dynamic allocation in the kernel." And the arithmetic: "There are roughly 2^48 different MAC addresses, further limited by the rhashtable they are stored in to 2^31. Each entry is of the type struct net_bridge_fdb_entry, which is currently 128 bytes big. This means the maximum amount of memory allocated for FDB entries is 2^31 * 128B = 256GiB, which is too much for most computers" (Nixdorf, 16 October 2023, patch 2/5). The cover letter states the outcome plainly, "Without any limit a malicious actor may a kernel" (run it out of memory), and the design is a per-bridge limit where, in the words of the patch that implements it, "For backwards compatibility the default setting of 0 disables the limit" (Nixdorf, cover letter; patch 2/5). The kernel's bridge documentation now lists the two attributes that came of it, one reporting "The number of dynamically learned FDB entries for the current bridge" and one to "Set the number of max dynamically learned FDB entries" (Linux kernel, Ethernet bridging).

Two decades after the Catalyst tests, the lesson is the same in a different machine: a hardware table that fills makes a switch flood, and a software table that cannot fill makes a host run out of memory. Either way the answer is a limit on what one port may teach the table, set by someone who knows how many addresses that port should have. Virtualization makes the second case more than a curiosity, because a bridge inside a hypervisor has guests behind its ports that nobody has checked.

The guard: limit what a port may teach

The defence was on Convery's next slide in 2002, and it is still the defence: port security, which "Allows you to specify MAC addresses for each port, or to learn a certain number of MAC addresses per port", and "prevents macof from flooding the CAM table" (Convery, 2002). Cisco's current Catalyst 9300 guide describes the feature in its own terms (Cisco, Catalyst 9300 IOS XE 17.12, port security, 28 July 2023):

  • It can "restrict input to an interface by limiting and identifying MAC addresses of the stations allowed to access the port"; the default maximum is one secure address per port.
  • Secure addresses are static (configured), dynamic (learned and lost at restart) or sticky, which "can be dynamically learned or manually configured, stored in the address table, and added to the running configuration".
  • A violation occurs when the maximum is reached and a new address appears, or when "An address learned or configured on one secure interface is seen on another secure interface in the same VLAN".
  • The response is one of four modes: protect (drop silently), restrict (drop, and "An trap is sent, a syslog message is logged, and the violation counter increments"; SNMP is the Simple Network Management Protocol), shutdown, the default, which "causes the interface to become error-disabled and to shut down immediately", and shutdown vlan, which disables only the offending VLAN on the port.

The choice of mode has a history. Convery's 2002 slides warned that the "'Restrict' option may fail under macof load and disable the port, shutdown option is more appropriate", and showed the message a switch of the day logged when it did. Bhaiji's slides measured the cost of restrict under attack: "up to 99% CPU utilization" of the switch's central processing unit (CPU), though in their tests "packets were not dropped" and management stayed available; and they gave the arithmetic for a desk with a phone: "Three MAC addresses encompass the phone, the switch in the phone, and the PC" (Bhaiji, SANOG 7).

Other vendors name the same control differently. Juniper's MAC limiting "Protects against flooding of the Ethernet switching table", and its advice for the overflow attack is to configure "both a MAC limit for learned MAC addresses and some specific allowed MAC addresses", optionally with "persistent MAC learning", which it notes is "Also known as sticky MAC" (Juniper, as above). The Linux bridge has the per-bridge limit above, and a per-port switch, IFLA_BRPORT_LEARNING, that controls "whether a given port will learn source MAC addresses from received traffic or not", on by default (Linux kernel, Ethernet bridging). The worked hardening of a single access port, the National Security Agency's configuration line by line, is in keeping rogue devices off the network, with the NSA's own ranking: port security is a fallback where network access control cannot be deployed.

Run the eight-entry example again with a maximum of one address on port 4 and the default shutdown mode. The first invented address, X1, is learned. The second, X2, is a violation; the port is error-disabled before X2 reaches the table. The table holds A, B, C and X1, with room for D, and nothing floods for lack of space. The port is now dark, and someone has to come and look at it, which is the point.

STP root takeover: an election that believes the lowest number

The rule, in the inventor's words

The spanning tree algorithm is 's, published while she was at Digital Equipment Corporation in 1985, and the rule that matters here is in her paper: "The Root is the bridge in the network with the smallest ID. When a bridge receives a HELLO Message, it compares the ID of the Root in the HELLO Message with the currently best known Root. If the Root in the HELLO message has a lower ID than the currently known Root, then information about the current Root is discarded and overwritten by information about the newly discovered Root" (Perlman, 1985). The HELLO message is what the standard now calls a configuration BPDU. Nothing in it is signed. Whoever announces the lowest number becomes the root, and the (Institute of Electrical and Electronics Engineers) model of the identifier says which direction counts: the priority part of a bridge identifier is a four-bit value from 0 to 15, default 8, and "Lower numeric values indicate the better identifier"; the twelve bits after it are a system identifier extension, 0 to 4095 (IEEE 802.1, ieee802-dot1q-rstp YANG module), which Cisco's per-VLAN trees set to the VLAN number, as the spanning tree article quotes from Cisco's guide. On the wire the two are one sixteen-bit field, so the default priority 8 appears as 0x8000, 32,768, followed by the switch's MAC address.

The 2005 Black Hat Europe presentation of Yersinia, a framework for layer 2 attacks by David Barroso and Alfredo Andrés of the Spanish security firm S21sec, summed up the protocol's position in two words on one slide: "No authentication" (Barroso and Andrés, 2005). Two years earlier, Oleg Artemjev and Vladislav Myasnyankin had made the same point in : "STP has no any authentication allowing malicious users easily reach this by sending fake BPDU", and noted that a reconfiguration stops user traffic on the ports involved, so that endless elections are a denial of service (Artemjev and Myasnyankin, Phrack 61, 13 August 2003). They wrote that they had notified vendors before publishing, and that the answer from Cisco and Avaya had been, in their words, "unless this gives money we won't make investments" Reported by Artemjev and Myasnyankin, Phrack 61, 2003.

A configuration BPDU, written out

The Linux kernel builds a configuration BPDU in a 35-byte buffer whose layout is easy to read in its source (Linux kernel, net/bridge/br_stp_bpdu.c): two bytes of protocol identifier and one of version, all zero; a type byte (0 for a configuration BPDU, 0x80 for a topology change notification, per br_private_stp.h); a flags byte in which 0x01 is topology change and 0x80 its acknowledgement; then the root identifier, root path cost, the sending bridge's identifier and the port identifier; then four times, each two bytes in units of 1/256 of a second (STP_HZ 256). The frame around it is not Ethernet II: the kernel puts the BPDU behind an 802.2 logical link control (LLC) header whose service access points are LLC_SAP_BSPAN, 0x42, "Bridge Spanning Tree Proto" (include/uapi/linux/llc.h), with the control value 3 that marks an unacknowledged, connectionless frame (as Etienne Champetier's notes on LLC explain: Champetier, 2022), sent to the group address 01-80--00-00-00 that the IEEE Registration Authority lists for IEEE 802.1Q (IEEE RA, standard group MAC addresses). The timers' defaults, 20 seconds of maximum age and 15 of forward delay, are in the IEEE model, and the hello interval of 2 seconds in Cisco's description of the protocol (IEEE 802.1, rstp YANG; Cisco, document 24062).

Now the network. The intended root is switch S1, configured on purpose with priority 4 (16,384, 0x4000) and MAC address 00-00-5E-00-53-01, one of the addresses that (RFC) 9542 reserves for documentation (RFC 9542). An access switch, S2, has a host on port 3. The host sends the following configuration BPDU, every two seconds:

BytesFieldValueMeaning
0 to 5Destination01 80 C2 00 00 00the bridge group address
6 to 11Source00 00 5E 00 53 99the host
12 to 13Length00 2638 bytes follow: 3 of LLC and 35 of BPDU
14 to 16LLC42 42 03spanning tree service access points, unacknowledged connectionless control
17 to 18Protocol identifier00 00spanning tree
19Version00the original STP
20Type00configuration BPDU
21Flags00no topology change
22 to 29Root identifier00 00 00 00 5E 00 53 99priority 0, extension 0, and the host's own address: "I am the root"
30 to 33Root path cost00 00 00 00the root is at distance zero from itself
34 to 41Bridge identifier00 00 00 00 5E 00 53 99the same: the sender is the root
42 to 43Port identifier80 01port priority 8, port number 1
44 to 45Message age00 00fresh from the root
46 to 47Maximum age14 005,120/256 = 20 seconds
48 to 49Hello time02 00512/256 = 2 seconds
50 to 51Forward delay0F 003,840/256 = 15 seconds

Compare the root identifiers as S2 does, as two 64-bit numbers: 0x0000_00005E005399 against S1's 0x4000_00005E005301. The first sixteen bits decide it, 0x0000 is less than 0x4000, and the host's claim is superior. By Perlman's rule, S2 discards what it knew about S1, makes port 3 its root port, and starts announcing the host as root on its other ports; every switch that hears those announcements does the same, until the whole tree hangs from the host. An operator who reads BPDUs with tcpdump sees a summary like the one Artemjev and Myasnyankin printed in 2003 for an honest bridge, "802.1d config 8000.00:50:e2:bd:58:40.8002 root 8000.00:50:e2:bd:58:40 pathcost 0 age 0 max 20 hello 2 fdelay 15": a root that is also the sender, at cost zero (Phrack 61). A host port is the last place such a line should come from.

One detail is worth stopping on. Suppose the operator had set S1's priority to 0, the lowest there is. The tie on priority is broken by the MAC address, and the MAC address in a BPDU is whatever the sender writes there: a claim of 00-00-00-00-00-01 beats almost any real switch. Setting the root's priority is the first step of every design, as the spanning tree article says, and it decides which of your own switches wins; it does not stop a stranger from winning. Only a guard on the port does, and the STP election calculator will show the same comparison for any set of identifiers you give it.

What the takeover buys, and what it does not

Convery's 2002 slides spelled out the effects as Cisco and @stake measured them. A root change forces the network to reconverge, and "Standard 802.1d STP takes 30-45 seconds to deal with a failure or Root bridge change (nice DoS)", a denial of service (DoS) by itself. To see traffic, the claimant must be on the new path: the attack "Requires attacker is dual homed to two different switches (with a hub, it can be done with just one interface on the attacking host)", because the root sits in the middle of the tree only if traffic between two parts of the network has to cross it. When it does, the cost of the paths is computed from the root's point of view, and a gigabit backbone can find itself crossing the attacker's slowest link: "Taking a Gb backbone to half-duplex 10 Mb was verified" (Convery, 2002). His summary attack combined the two halves of this article: flood the access switch's table so that the busy servers' entries cannot come back, then claim the root so that the backbone runs through the attacker, which then receives whatever the full table floods.

A single-homed host that claims the root still does damage. Every reconvergence is a topology change, every topology change shortens the address table's ageing to the forward delay or flushes it, and the traffic for every quiet host is flooded until it is relearned, past the attacker's port among others. The Yersinia slides list the attacks the framework implemented against the protocol in exactly these classes: configuration and topology change BPDUs sent raw, denial of service with each, "Becoming the Root Role in the Spanning Tree", and the same "with a MiTM attack" (man in the middle) for the dual-homed case (Barroso and Andrés, 2005).

The guards

Every ships the same small set of controls, under its own names, and almost all of them are off by default. Their reliability uses, against loops and one-way links, are covered in layer 2 redundancy; here they are read as security controls.

: no BPDU on a host port, ever. On a Cisco Catalyst, BPDU guard enabled globally makes spanning tree shut down "ports that are in a PortFast operational state if any BPDU is received on them"; enabled on an interface, a received BPDU puts the port "in the error-disabled state", and "you must manually put the interface back in service" (Cisco, Catalyst 9300 IOS XE 17.12, optional spanning-tree features, 28 July 2023). PortFast, the feature that makes a host port forward at once, is itself "disabled on all interfaces" by default (same guide). Juniper's equivalent is BPDU protection: "If a BPDU is received on a protected interface, the interface is disabled and stops forwarding frames. By default, all BPDUs are accepted and processed on all interfaces", with bpdu-block-on-edge for edge ports and an optional disable timeout after which "protected interfaces are automatically cleared" (Juniper, BPDU protection for spanning-tree protocols). The Linux bridge's port flag IFLA_BRPORT_GUARD is off by default; "Turning this flag on will disable the bridge port if a STP BPDU packet is received", because "hostile devices on the network may send BPDU on a port and cause network failure" (Linux kernel, Ethernet bridging).

Root guard: BPDUs welcome, root claims not. Where a port faces a switch that must take part in the tree but must never be on the path to the root, the guard is root guard. Cisco: if the calculation would make such a port a root port, "root guard then places the interface in the (blocked) state", and it is "disabled on all interfaces" by default (Cisco, as above). Juniper's root protection describes the trigger and the recovery: "If the bridge receives superior STP BPDUs on a port that has root protection enabled, that port transitions to a root-prevented STP state (inconsistency state) and the interface is blocked", and "After the bridge stops receiving superior STP BPDUs on the interface with root protection, the interface returns to a listening state, followed by a learning state, and ultimately back to a forwarding state. Recovery back to the forwarding state is automatic." It also names the threat: "A user bridge application running on a PC can generate BPDUs, too, and interfere with root port election" (Juniper, Understanding Root Protection). The IEEE model has it as restricted-role, set "to prevent selection of the port as Root Port for the CIST or any MSTI, even if it has the best spanning tree priority vector", so that the port "will be selected as an Alternate Port rather than a Root Port", and the Linux bridge as IFLA_BRPORT_PROTECT, "also called root port guard", which "prevents a hostile guest from rerouting traffic" (IEEE 802.1, rstp YANG; Linux kernel, Ethernet bridging). (CIST and MSTI are the common and internal spanning tree and the multiple spanning tree instances of the multiple spanning tree protocol.)

Restricted topology change: no flushing from outside. The IEEE model has a second restriction, restricted-tcn, "Set to prevent propagation of topology changes and topology change notifications to other ports. Set to prevent a Bridge external to a core region of the network causing address flushing", with the warning that it "can cause temporary loss of connectivity after a topology change" (IEEE 802.1, as above). It answers the single-homed half of the attack, the one that empties tables without moving the root.

is not a guard. Filtering stops a port from sending and receiving BPDUs, and Cisco's warning is the right summary: "Enabling BPDU filtering on an interface is the same as disabling spanning tree on it and can result in spanning-tree loops" (Cisco, as above). The Linux documentation calls its disabled state "also called BPDU filter", for "an untrusted port, like a leaf virtual device" (Linux kernel, Ethernet bridging). A filter makes the attacker's BPDUs disappear, and with them the switch's ability to notice that someone has plugged a second cable into the same desk.

Do not switch the protocol off. Convery's advice in 2002 stands: "Don't disable STP, introducing a loop would become another attack" (Convery, 2002). Cisco's campus design guide of 2008 puts the choice for access ports in one sentence, "Enable either Root Guard or BPDU Guard on access layer ports", and the operational condition in another: "Only use BPDU Guard if you are able to intervene and re-enable error-disabled ports" (Cisco, Campus Network for High Availability Design Guide, 21 May 2008).

The forged BPDU, three ports, three outcomes

Where the forged BPDU arrivesGuard on that portWhat happens
S2 port 3, a desk port configured as edgeBPDU guard (Cisco), bpdu-block-on-edge (Juniper), port guard (Linux)The port is disabled on the first BPDU and stays down until an operator, a timer or a link reset brings it back; the claim never enters the election
S2's downlink to a small switch in a meeting roomRoot guard (Cisco), root protection (Juniper), restricted role (IEEE), root port guard (Linux)The port blocks while superior BPDUs arrive and is never made the root port; the rest of the tree keeps S1 as root; on Juniper it recovers by itself when the claims stop
Any port with none of thesenoneThe host becomes root after the next round of BPDUs, every switch reconverges, and every topology change floods traffic for quiet hosts

The record, and what it does not contain

YearEventSource
1985Perlman publishes the spanning tree algorithm: the bridge with the smallest identifier is rootPerlman, 1985
1999macof, a Perl program by Ian Vitek, makes table overflow practical; later ported to C for dsniffConvery, 2002; macof(8)
2002Cisco and @stake measure overflow and root attacks on Catalyst switches; Convery presents them at Black Hat USAConvery, 2002
2003Artemjev and Myasnyankin publish their analysis of STP attacks in Phrack 61Phrack 61
2005Yersinia presented at Black Hat Europe with attacks on STP, the Dynamic Trunking Protocol (), 802.1Q, the VLAN Trunking Protocol (VTP), the Cisco Discovery Protocol (CDP), the Dynamic Host Configuration Protocol () and the Hot Standby Router Protocol (HSRP), as its manual page names themBarroso and Andrés, 2005; yersinia(8)
2006Bhaiji's SANOG 7 slides give table sizes and port security practice, including the cost of restrict modeBhaiji, SANOG 7
2008Cisco's campus design guide recommends root guard or BPDU guard on every access portCisco, 2008
2023Linux bridge gains a limit on learned entries, default off, after a memory exhaustion analysisNixdorf, 2023

What the record does not contain, in this research, is a public incident report of a root takeover or a table overflow used against a real network by an intruder, with dates and numbers in the owner's own words. The documented evidence is test reports, tools and the vendors' guidance; the best-documented layer 2 collapse, the Beth Israel Deaconess Medical Center outage of November 2002, was a loop and not an attack, and is told in layer 2 redundancy. The absence of reports is not evidence of absence: both attacks leave traces only inside the network they hit.

The Brazilian angle

The Brazilian Internet exchange's rules show what these controls look like when applied without exception. .br, operated by (Núcleo de Informação e Coordenação do Ponto BR), joins autonomous systems over a shared layer 2 fabric, where a full table or a moving root would hurt every participant at once. Its Technical Requirements Policy, version 1.0 of 30 June 2017, is written for the intermediate interconnection points (CIX) that aggregate several participants onto one exchange port, and its section on the participants fixes the addresses: "One physical address (MAC) per VLAN: frames forwarded in a given VLAN must all have the same MAC address" (our translation, as for the policy's other quotations here), and "each Participant must use a single physical MAC address per network device, typically a router, and at most two network devices. That is, IX.br filters the MAC addresses on the virtual port of each CIX Participant, and at most 2 physical addresses may be registered" (IX.br, Technical Requirements Policy (in Portuguese), V1.0, 30 June 2017). That is port security with a maximum of two and a registered list, on every such port; a participant cannot teach the fabric a third address however many it sends. The same policy allows only Ethernet II frames, "not allowing the use of LLC/SNAP (802.2) encapsulation" (SNAP: subnetwork access protocol), and only the IPv4, ARP and IPv6 EtherTypes. A configuration BPDU, as the bytes above show, is an 802.2 LLC frame and has no at all, so the policy leaves no room for one on a participant's port. The policy also requires discovery protocols to be switched off on the interface facing the exchange.

The operational side is visible in NIC.br's own presentations. At the IX Forum of December 2015, the activation team described its quarantine, the test period before a new participant joins the production fabric, as a check of "the conditions of the transport" and "the router's configuration", with the warnings "Number of MAC addresses, VLANs, " (maximum transmission unit) and "Unwanted/unnecessary protocols and announcements", and listed MAC changes among the requests it handles as tickets (IX.br, IX Forum 9, ativação). The scale of the exchange's tables, and what the same forum learned from them, is in the MAC address table.

What defenders can do

  • Limit learning on every access port. One address for a desk, two or three for a desk with a phone, the default shutdown action where someone will come when a port goes dark, restrict where they will not; and alert on the violation.
  • Set limits on software bridges too. A hypervisor or container bridge with untrusted guests needs its learning limit set; on Linux the default is no limit.
  • Put BPDU guard on every port that faces a host, with PortFast or the edge setting, and decide in advance how an error-disabled port comes back.
  • Put root guard on every port that faces a switch you do not want as root, such as downlinks to meeting rooms, labs and customers; consider restricting topology changes from the same ports.
  • Choose your root on purpose, with priority on the core, and remember that priority decides among your own switches, not against a stranger.
  • Never filter BPDUs to make a warning go away, and never disable spanning tree to stop an attack.
  • Count addresses and topology changes. A port with hundreds of addresses, or a tree whose root changes, is an incident until proved otherwise.

What to remember

  • A full address table cannot learn; traffic to addresses it does not hold is flooded, which is what the attacker sees. Established entries keep forwarding normally.
  • The 2002 Cisco and @stake test filled a 131,052-entry table in 70 seconds at 155,000 addresses a minute; a 2023 Linux analysis put the unlimited software case at 256 GiB of memory.
  • Port security or MAC limiting stops table overflow at the port; the default Cisco response, shutdown, is the one that holds under load.
  • The spanning tree root is whoever announces the lowest identifier, and nothing in a BPDU is authenticated; a root priority of 0 does not stop a stranger with a lower MAC address.
  • A root claim causes reconvergence and floods even from a single port; seeing traffic in transit needs a path through the claimant.
  • BPDU guard on host ports, root guard on downlinks, restricted topology change at the edge of the core; BPDU filtering and switching STP off are not defences.

Sources