# Flooding in Networking
## What is Flooding
Flooding is a routing technique in which a router forwards every incoming packet out all outgoing interfaces except the interface from which the packet was received. In flooding, no routing table is consulted and no path selection is performed. Every packet is simply sent everywhere. Because flooding sends packets on every possible path, it guarantees that the packet will reach every device on the network, including the destination. Flooding is simple and robust but highly inefficient because it generates a large number of duplicate packets.
## How Flooding Works
When a router receives a packet and flooding is enabled, it creates copies of the packet and transmits one copy out each interface except the one on which the packet was received. Each neighboring router that receives a copy does the same, forwarding copies out all its interfaces. This continues until every router in the network has received at least one copy of the packet. In a network without loops, every router receives exactly one copy. In a network with loops, routers would receive the same packet multiple times and continue forwarding it indefinitely without some mechanism to prevent this.
## Controlling Flooding
Several techniques are used to prevent flooding from consuming unlimited network resources. Sequence numbers are added to packets and routers keep track of which packets they have already forwarded. If a router receives a packet it has already forwarded, it discards the duplicate. Time to live fields limit the number of hops a packet can traverse. Reverse path forwarding checks whether the incoming interface is on the shortest path back to the source. If it is, the packet is forwarded; otherwise, it is discarded as a likely duplicate.
## Uses of Flooding
Flooding is not used for normal unicast data traffic because of its inefficiency. However, it is used in specific situations where other methods are impractical. Link state routing protocols use controlled flooding to distribute link state advertisements to every router in the network. When a switch does not know the MAC address of a destination device, it floods the frame out all ports. ARP requests are broadcast, which is a limited form of flooding within a subnet. In wireless sensor networks with no fixed infrastructure, flooding may be used to propagate data when nodes have no routing information.Back to Subject