MAC flooding

term

networkingsecurity

Kept in this browser · My desk

Sending a switch frames from a stream of invented source MAC addresses until its address table is full, so that it can no longer learn real hosts and floods their traffic to every port of the VLAN.

The tool that made it routine, macof, began as about 100 lines of Perl by Ian Vitek in May 1999 and was ported to C for Dug Song's dsniff; its manual says it causes some switches to fail open in repeating mode. In the Cisco and @stake tests of 2002 it generated 155,000 addresses a minute and filled a Catalyst 6506 table of 131,052 entries in 70 seconds. Established entries keep forwarding; what leaks is traffic to new hosts and to hosts whose entries age out while the table is held full.

What it is. MAC flooding is an attack on a switch's MAC (media access control) address table: the attacker sends frames from a stream of invented source addresses until the table is full, so that the switch can no longer learn real hosts and floods their traffic to every port of the VLAN (virtual local area network), the attacker's included. Juniper's port security overview calls it an Ethernet switching table overflow attack and names both effects, disrupted traffic and broadcast traffic the attacker may be able to sniff. It turns a switch, for the traffic it can no longer place, back into a hub.

The tool and its numbers. The tool that made it routine, macof, began as about 100 lines of Perl by Ian Vitek in May 1999 and was ported to C for Dug Song's dsniff; its manual says it floods the local network with random MAC addresses, causing some switches to fail open in repeating mode and facilitating sniffing. In the Cisco and @stake tests of 2002 it generated 155,000 addresses a minute and filled a Catalyst 6506 table of 131,052 entries in 70 seconds. Worked by hand: 155,000 a minute is about 2,580 a second, so a perfect table of 131,052 entries would fill in about 51 seconds; Convery's slides explain the extra time by the hash function, which is not perfect, and the same reason means some buckets fill before others. Tables of the era, in Bhaiji's 2005 slides, held about 16,000 entries on Catalyst 3000-series switches, 32,000 on the 4000 series and 128,000 on the 6000 series.

What leaks and what does not. Established entries keep forwarding; what leaks is traffic to new hosts and to hosts whose entries age out while the table is held full. Convery's slides add that the attack also fills the tables of adjacent switches, since the invented addresses are flooded to them as well. With a 300-second ageing time, an attacker must keep sending to hold the table full, so the attack is loud: thousands of new source addresses a second on one access port. In Convery's combined example, an attacker first fills the access switch's table and then claims the spanning tree root, so that even chatty servers with static ARP (Address Resolution Protocol) entries, which macof alone would not displace, have their traffic flooded past the attacker.

The defence. Limiting how many addresses a port may teach the switch stops it at the port: Cisco's port security (default maximum one, default action shutdown), Juniper's MAC limiting with allowed addresses, Extreme's MAC security. In 2002 Cisco warned that the restrict mode could fail under the tool's load and recommended shutdown; Bhaiji's 2006 slides measured up to 99 per cent processor load in restrict mode. Cisco's current guide lists four violation modes, protect (drop silently), restrict (drop, trap, log, count), shutdown (error-disable the port, the default) and shutdown vlan, keeps secure address ageing disabled by default, and does not support port security on EtherChannel ports. Fortinet's FortiSwitchOS sets a learning limit of 1 to 128 addresses per interface or VLAN (0, the default, means no limit), does not count static addresses against it, can shut the interface on a violation since FortiSwitchOS 7.0.2, and keeps a violation log recording the first address over the limit; it can also warn when the layer-2 table first passes 75 per cent full.

In software. A Linux bridge's table lives in kernel memory: a 2023 patch series calculated 2^31 entries of 128 bytes, 256 GiB, for an unlimited table, and added fdb_max_learned, which is 0, no limit, by default. Exchange points such as IX.br avoid the problem by contract, with at most two registered MAC addresses per participant.

Not only attackers. Overflow happens without malice: Request for Comments (RFC) 7348 (VXLAN, Virtual eXtensible Local Area Network, 2014) describes top-of-rack switches that must learn hundreds of virtual machine addresses per server and may stop learning until idle entries age out, flooding unknown destinations meanwhile. And a full table can defeat other controls: the National Vulnerability Database (NVD) record CVE-2025-20316 notes that a full table, like a flushed one, let flooded traffic bypass an egress access control list (ACL) on Cisco Catalyst 9500X and 9600X switches.

Neighbours, kept apart. The MAC address table is the target; unknown unicast flooding is the effect; port security and MAC limiting are the defence; ARP poisoning lies to hosts rather than to the switch, and port security does not stop it; MAC flapping is what the table shows when one address appears on two ports, not when thousands of new ones arrive; storm control bounds broadcast and unknown unicast but not the learning of new sources.

Also known as: mac flooding, cam table overflow, cam overflow, mac table overflow, macof, ethernet switching table overflow, estouro da tabela mac

Sources

← Back to M Back to the glossary