TCN (topology change notification)

acronym

networking

Kept in this browser · My desk

Stands for: topology change notification

The spanning tree message by which a bridge reports that the active topology has changed, causing bridges to age out or flush learned MAC addresses so that traffic finds its new path.

In the original protocol a TCN is a four-byte BPDU of type 0x80, sent on the root port and repeated every hello time until the designated bridge upstream answers with the acknowledgement flag (0x80) set in a configuration BPDU; each bridge passes the notification on towards the root, which then sets the topology change flag (0x01) in its configuration BPDUs for the forward delay plus the max age. Bridges then age their address tables in the forward delay, 15 seconds by default, instead of 300; in the rapid protocol a topology change flushes the learned addresses on the affected ports at once.

What it is. A topology change notification (TCN) is the spanning tree message by which a bridge reports that the active topology has changed, a port having moved to forwarding or out of it, so that every bridge ages out or flushes the MAC (media access control) addresses it has learned and traffic finds its new path. Without it, tables would keep pointing at ports that no longer lead to a station until the normal 300-second ageing removed the entry.

The bytes. Spanning tree BPDUs (bridge protocol data units) travel in 802.2 LLC (Logical Link Control) frames with service access point 0x42 to the Bridge Group Address 01-80-C2-00-00-00. In the original protocol a TCN is a four-byte BPDU of type 0x80: protocol identifier 00 00, version 00, type 80, and nothing else, which the Linux kernel builds byte by byte. A configuration BPDU is 35 bytes, and its fifth byte holds the flags: 0x01 is topology change and 0x80 topology change acknowledgement. Phrack's 2003 capture shows a quiet tree, 42 42 03 for the LLC header, then 00 00 00 00 for protocol, version and type, then a flags byte of 00, then the root identifier 80 00 00 50 e2 bd 58 40; the timers that follow, max age 14 00, hello 02 00 and forward delay 0f 00, are in units of 1/256 second, so they read 20, 2 and 15 seconds. During a topology change the same frame carries flags 01. In Wireshark the bit is the field stp.flags.tc, and the filter stp.flags.tc == 1 shows every BPDU announcing one.

The 802.1D procedure. A bridge that detects a change sends TCNs towards the root through its root port; the notification is acknowledged with the acknowledgement flag (0x80) in a configuration BPDU and relayed upward until it reaches the root; the root then sets the topology change flag (0x01) in its configuration BPDUs, and every bridge that sees it ages its address table in the forward delay, 15 seconds by default, instead of 300. Cisco's 2002 tests put it as an attacker would read it: the TCN makes the table age every entry in 15 seconds if it does not communicate, against the default of 300.

The rapid version. In RSTP (Rapid Spanning Tree Protocol, 802.1w), as Cisco's document 24062 describes it, the BPDU is type 2, version 2, only the TC (topology change) and TCA (topology change acknowledgement) flags keep their 802.1D meaning and the other six bits carry role, state, proposal and agreement. Only non-edge ports moving to forwarding cause a topology change; the bridge that detects it starts a tcWhile timer of twice the hello time on its non-edge designated ports and root port, flushes the MAC addresses learned on them, and sends BPDUs with the TC flag; a bridge receiving one clears the learned addresses on all ports except the one it arrived on. The flush is immediate rather than a shortened ageing, and the change spreads hop by hop instead of travelling to the root first.

Why it matters for performance. Every flush makes the switch flood traffic for quiet hosts until they are relearned. A worked case: a PC on an access port that is not configured as an edge port reboots ten times a day; each link change is a topology change, each one empties or shortens every table in the VLAN (virtual local area network), and for seconds afterwards unicast to silent servers is flooded everywhere. Configuring host ports as edge ports (Cisco's PortFast) removes them from the calculation, which is why Cisco lists topology changes among the causes of unicast flooding.

Why it matters for security. A host that can trigger topology changes, by claiming the root or by sending change notifications, makes the network leak traffic past its own port and, repeated, keeps it reconverging; Cisco's 2002 tests combined this with MAC flooding, and the 2003 Phrack analysis treated endless reconfiguration as a denial of service. The IEEE (Institute of Electrical and Electronics Engineers) model's restricted-tcn setting stops topology changes received on a port from propagating and from flushing addresses, with a warning about temporary loss of connectivity; root guard and BPDU guard limit who can trigger them in the first place.

Finding the source. The IEEE model records the last topology change time (when tcWhile was last running on any port), the Linux bridge counts TCNs sent per port, and a capture filtered on the TC flag shows which bridge started announcing. Following the change back port by port, to the switch whose own port went up or down, often ends at a host port that should have been an edge port. Neighbours: BPDU, spanning tree, STP (Spanning Tree Protocol), RSTP, root guard, MAC flooding and the MAC address table.

Also known as: tcn, topology change notification, tcn bpdu, topology change, restricted tcn, tcn guard

Sources

← Back to T Back to the glossary