Unicast, broadcast, and flooding
On this page
If the switch does not know where phone is, it cannot choose phone’s cable from its table. Does the frame stop there? You will compare three deliveries while phone listens. The destination address stays separate from the switch’s knowledge about that destination.
Before you start
Section titled “Before you start”Finish How switches learn. Use two VM terminals. Terminal 1 starts at the VM prompt; terminal 2 enters laptop. Before each case, leave machine shells and run netlab reset from the VM terminal. Keep modes off. Do not carry a learned table from one case into another.
Keep the same listener in all three cases. arp or icmp keeps frames asking who has an address as well as ping traffic. Here arp selects those address questions and answers; Reaching Another Device explains them. The word or keeps either kind. Keep -n for numeric addresses and -e for link headers. Stop with Ctrl+C after terminal 2 finishes.
Send to a learned destination
Section titled “Send to a learned destination”First send a ping from laptop to router. Read the table from the VM: laptop and router are learned. Only then enter phone and start its listener. The second ping uses the learned destination.
Predict whether phone will see that second echo request.
learner@rootvolt:~$ netlab shell laptop -- ping -c 1 10.77.10.1[sudo] password for learner: PING 10.77.10.1 (10.77.10.1) 56(84) bytes of data.
64 bytes from 10.77.10.1: icmp_seq=1 ttl=64 time=0.349 ms
--- 10.77.10.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.349/0.349/0.349/0.000 mslearner@rootvolt:~$ netlab shell sw-home -- bridge fdb show br sw-home dynamic02:77:10:00:00:10 dev laptop master sw-home
02:77:10:00:00:01 dev router master sw-home learner@rootvolt:~$ netlab shell phonelearner@phone:~$ sudo tcpdump -i eth0 -n -e arp or icmp[sudo] password for learner: tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes^C0 packets captured
0 packets received by filter
0 packets dropped by kernellearner@phone:~$ exitlogoutlearner@rootvolt:~$ Steps (23)
- Type
netlab shell laptop -- ping -c 1 10.77.10.1 - Press Enter
- Output:
[sudo] password for learner: - Type the password (the terminal shows nothing)
- Press Enter
- Output:
PING 10.77.10.1 (10.77.10.1) 56(84) bytes of data. 64 bytes from 10.77.10.1: icmp_seq=1 ttl=64 time=0.349 ms --- 10.77.10.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.349/0.349/0.349/0.000 ms - Type
netlab shell sw-home -- bridge fdb show br sw-home dynamic - Press Enter
- Output:
02:77:10:00:00:10 dev laptop master sw-home 02:77:10:00:00:01 dev router master sw-home - Type
netlab shell phone - Press Enter
- Type
sudo tcpdump -i eth0 -n -e arp or icmp - Press Enter
- Output:
[sudo] password for learner: - Type the password (the terminal shows nothing)
- Press Enter
- Output:
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes - Terminal 2 on laptop finished sending. Return to terminal 1.
- Press Ctrl + C
- Output:
0 packets captured 0 packets received by filter 0 packets dropped by kernel - Type
exit - Press Enter
- Output:
logout
learner@laptop:~$ ping -c 1 10.77.10.1PING 10.77.10.1 (10.77.10.1) 56(84) bytes of data.
64 bytes from 10.77.10.1: icmp_seq=1 ttl=64 time=0.075 ms
--- 10.77.10.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.075/0.075/0.075/0.000 mslearner@laptop:~$ Steps (3)
- Type
ping -c 1 10.77.10.1 - Press Enter
- Output:
PING 10.77.10.1 (10.77.10.1) 56(84) bytes of data. 64 bytes from 10.77.10.1: icmp_seq=1 ttl=64 time=0.075 ms --- 10.77.10.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.075/0.075/0.075/0.000 ms
Check your answer
Phone’s listener reports zero captured frames. The switch sends the request through its router port. Router’s reply uses the laptop port. Neither frame needs phone’s cable.
A unicast frame names one destination interface. When that destination is learned, the switch can send it through the matching port. This is the delivery that made phone’s earlier web capture quiet.
Send after the destination has aged out
Section titled “Send after the destination has aged out”Repeat the setup, then wait for aging as in the previous lesson. sleep 310 leaves the VM idle for slightly longer than the 300-second aging time. Read the empty table before starting phone’s listener. Laptop still remembers router’s address in this run, so it sends directly to router’s MAC address.
Predict: does phone act on a flooded frame that is not addressed to it?
learner@rootvolt:~$ netlab shell laptop -- ping -c 1 10.77.10.1[sudo] password for learner: PING 10.77.10.1 (10.77.10.1) 56(84) bytes of data.
64 bytes from 10.77.10.1: icmp_seq=1 ttl=64 time=0.488 ms
--- 10.77.10.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.488/0.488/0.488/0.000 mslearner@rootvolt:~$ netlab shell sw-home -- bridge fdb show br sw-home dynamic02:77:10:00:00:10 dev laptop master sw-home
02:77:10:00:00:01 dev router master sw-home learner@rootvolt:~$ netlab shell sw-home -- cat /sys/class/net/sw-home/bridge/ageing_time30000learner@rootvolt:~$ sleep 310learner@rootvolt:~$ netlab shell sw-home -- bridge fdb show br sw-home dynamiclearner@rootvolt:~$ netlab shell phonelearner@phone:~$ sudo tcpdump -i eth0 -n -e arp or icmp[sudo] password for learner: tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes18:17:43.682341 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 98: 10.77.10.10 > 10.77.10.1: ICMP echo request, id 203, seq 1, length 64^C1 packet captured
1 packet received by filter
0 packets dropped by kernellearner@phone:~$ exitlogoutlearner@rootvolt:~$ Steps (31)
- Type
netlab shell laptop -- ping -c 1 10.77.10.1 - Press Enter
- Output:
[sudo] password for learner: - Type the password (the terminal shows nothing)
- Press Enter
- Output:
PING 10.77.10.1 (10.77.10.1) 56(84) bytes of data. 64 bytes from 10.77.10.1: icmp_seq=1 ttl=64 time=0.488 ms --- 10.77.10.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.488/0.488/0.488/0.000 ms - Type
netlab shell sw-home -- bridge fdb show br sw-home dynamic - Press Enter
- Output:
02:77:10:00:00:10 dev laptop master sw-home 02:77:10:00:00:01 dev router master sw-home - Type
netlab shell sw-home -- cat /sys/class/net/sw-home/bridge/ageing_time - Press Enter
- Output:
30000 - Type
sleep 310 - Press Enter
- Type
netlab shell sw-home -- bridge fdb show br sw-home dynamic - Press Enter
- Type
netlab shell phone - Press Enter
- Type
sudo tcpdump -i eth0 -n -e arp or icmp - Press Enter
- Output:
[sudo] password for learner: - Type the password (the terminal shows nothing)
- Press Enter
- Output:
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes - Terminal 2 on laptop finished sending. Return to terminal 1.
- Output:
18:17:43.682341 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 98: 10.77.10.10 > 10.77.10.1: ICMP echo request, id 203, seq 1, length 64 - Press Ctrl + C
- Output:
1 packet captured 1 packet received by filter 0 packets dropped by kernel - Type
exit - Press Enter
- Output:
logout
learner@laptop:~$ ping -c 1 10.77.10.1PING 10.77.10.1 (10.77.10.1) 56(84) bytes of data.
64 bytes from 10.77.10.1: icmp_seq=1 ttl=64 time=0.134 ms
--- 10.77.10.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.134/0.134/0.134/0.000 mslearner@laptop:~$ Steps (3)
- Type
ping -c 1 10.77.10.1 - Press Enter
- Output:
PING 10.77.10.1 (10.77.10.1) 56(84) bytes of data. 64 bytes from 10.77.10.1: icmp_seq=1 ttl=64 time=0.134 ms --- 10.77.10.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.134/0.134/0.134/0.000 ms
Check your answer
The frame reaches phone’s cable, but phone does not act on it. Phone’s system drops a frame whose destination is neither its own address nor broadcast. Tcpdump asks to see everything on the cable by default. That is why its output can show the flooded frame anyway.
Flooding sends a frame through every other switch port when the destination’s port is unknown. The incoming port is excluded. This capture shows one echo request to 02:77:10:00:00:01. It does not show the reply. The request taught laptop’s location again, so the returning frame can go only toward laptop.
Send a frame meant for everyone nearby
Section titled “Send a frame meant for everyone nearby”In a fresh lab, start phone’s listener before laptop’s first ping to router. Laptop first sends a question to ff:ff:ff:ff:ff:ff. All its bits are ones. A broadcast frame uses this destination to address everyone on the local network.
learner@rootvolt:~$ netlab shell phone[sudo] password for learner: learner@phone:~$ sudo tcpdump -i eth0 -n -e arp or icmp[sudo] password for learner: tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes18:13:40.789304 02:77:10:00:00:10 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 10.77.10.1 tell 10.77.10.10, length 28^C1 packet captured
1 packet received by filter
0 packets dropped by kernellearner@phone:~$ exitlogoutlearner@rootvolt:~$ Steps (18)
- Type
netlab shell phone - Press Enter
- Output:
[sudo] password for learner: - Type the password (the terminal shows nothing)
- Press Enter
- Type
sudo tcpdump -i eth0 -n -e arp or icmp - Press Enter
- Output:
[sudo] password for learner: - Type the password (the terminal shows nothing)
- Press Enter
- Output:
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes - Terminal 2 on laptop finished sending. Return to terminal 1.
- Output:
18:13:40.789304 02:77:10:00:00:10 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 10.77.10.1 tell 10.77.10.10, length 28 - Press Ctrl + C
- Output:
1 packet captured 1 packet received by filter 0 packets dropped by kernel - Type
exit - Press Enter
- Output:
logout
learner@laptop:~$ ping -c 1 10.77.10.1PING 10.77.10.1 (10.77.10.1) 56(84) bytes of data.
64 bytes from 10.77.10.1: icmp_seq=1 ttl=64 time=0.131 ms
--- 10.77.10.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.131/0.131/0.131/0.000 mslearner@laptop:~$ Steps (3)
- Type
ping -c 1 10.77.10.1 - Press Enter
- Output:
PING 10.77.10.1 (10.77.10.1) 56(84) bytes of data. 64 bytes from 10.77.10.1: icmp_seq=1 ttl=64 time=0.131 ms --- 10.77.10.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.131/0.131/0.131/0.000 ms
Phone captures only the broadcast question. Router answers directly to laptop. That answer teaches router’s port, so the later echo request also avoids phone. A ping command can therefore cause frames with different delivery rules.
Mistakes to recognize
Section titled “Mistakes to recognize”“A broadcast goes to the whole Internet.” This capture concerns the home network. The next lesson checks the router boundary directly.
“Flooding is an attack.” The quiet table expired during an ordinary wait. Flooding delivered the next request without any attack. A flooded unicast keeps its original destination; it does not become broadcast.
Good to know
Section titled “Good to know”A capture’s visibility and a program’s reception are different questions. First ask whether the frame reached the interface, then read its destination. Times and ping identifiers change between runs; compare direction and delivery instead.
Try it yourself
Section titled “Try it yourself”Suppose the table knows only phone. Predict receivers for four frames: laptop to phone, laptop to router, router to laptop, then phone to broadcast. Carry source learning forward after every frame; do not restart the table between them. Write your answers, then repeat the unknown-destination and broadcast replays above, resetting before each. Capture on phone and compare the destination addresses. Explain why both frames reached phone’s cable.
Solution
The receivers are phone; phone and router; laptop; then laptop and router. The first frame teaches laptop. The second still lacks router’s location. The third teaches router and uses laptop’s learned entry.
The unknown-destination capture shows router’s unicast address, while the broadcast capture shows the all-ones address. Flooding and broadcast delivery both send a copy toward phone.
Leave for later
Section titled “Leave for later”The broadcast question is an ARP request. Reaching Another Device explains what it asks and how its answer is used.
- Known unicast uses the destination’s learned port.
- Unknown unicast is flooded without changing its destination.
- Broadcast addresses everyone within its local boundary.
Next, Broadcast domains and boundaries finds where that boundary lies.
Further reading
Section titled “Further reading”- Ubuntu: tcpdump manual, for promiscuous capture.
- Ubuntu: bridge manual, for learned destinations and flooding.