Special-purpose addresses
On this page
Laptop answers 127.0.0.1. Phone can answer that same address, but it answers as phone, not laptop. The number means “this machine” wherever you use it. Here you will distinguish that self connection from three other special meanings that cannot replace an ordinary interface address.
Before you start
Section titled “Before you start”Finish Private and public addressing after Practice: Ethernet and Local Delivery. Keep the starting lab running with modes off. Start at the VM prompt for the first replay. For the exercise, have two terminals ready and wait for the listener before sending.
Reach the machine you are already using
Section titled “Reach the machine you are already using”Repeat the two commands below. The first selects lo with show lo, rather than listing all interfaces. The second sends one ping request to the address shown there.
learner@rootvolt:~$ netlab shell laptop -- ip address show lo[sudo] password for learner: 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft foreverlearner@rootvolt:~$ netlab shell laptop -- ping -c 1 127.0.0.1PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.067 ms
--- 127.0.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.067/0.067/0.067/0.000 mslearner@rootvolt:~$ Steps (9)
- Type
netlab shell laptop -- ip address show lo - Press Enter
- Output:
[sudo] password for learner: - Type the password (the terminal shows nothing)
- Press Enter
- Output:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever - Type
netlab shell laptop -- ping -c 1 127.0.0.1 - Press Enter
- Output:
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data. 64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.067 ms --- 127.0.0.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.067/0.067/0.067/0.000 ms
A loopback address sends traffic back inside the same machine. The whole 127.0.0.0/8 range is loopback; the captured lo line uses 127.0.0.1/8. The ::1/128 on the other address line is IPv6’s loopback. Neither line describes a cable leading to router.
The ping summary reports 1 received. This proves a local reply, without testing a switch or another machine.
Recognize a device that chose a local address
Section titled “Recognize a device that chose a local address”An IPv4 link-local address belongs to 169.254.0.0/16 and is usable only on its own link. A device may give itself one when nobody gave it settings. Seeing such an address usually means the device did not get the settings it expected. It can still talk to compatible neighbors on that link; it cannot use that address to reach through a router.
This is a concept here, not an address observed in the lab. The fe80:: value on earlier interface lines is IPv6’s own link-local address, a different thing in a different address family. Do not use that IPv6 line as evidence that a device failed to obtain IPv4 settings.
Read no particular address and everyone nearby
Section titled “Read no particular address and everyone nearby”0.0.0.0 means no particular IPv4 address. One place it appears is as a source before a device has an address. Its meaning depends on where it is used. Do not read it as the ordinary address of a machine you should ping.
255.255.255.255 addresses everyone on this network: the limited broadcast. A device with no address asking for settings is one place it appears. It does not name one ordinary interface, and routers do not carry this limited broadcast onto other networks.
It is the IPv4 counterpart of the all-ones MAC address ff:ff:ff:ff:ff:ff from Unicast, broadcast, and flooding. They are two different fields in two different headers. That earlier frame did not contain 255.255.255.255; it asked who had an address and carried no IPv4 header at all.
Keep the meanings separate
Section titled “Keep the meanings separate”- Loopback,
127.0.0.0/8: this machine. - Link-local,
169.254.0.0/16: this link only. - Unspecified,
0.0.0.0: no particular address. - Limited broadcast,
255.255.255.255: everyone on this network.
These values are not interchangeable. A self test cannot test router. A link-local address cannot supply a path to other networks. An unspecified address does not identify a particular neighbor. A limited broadcast does not reach every machine on the Internet.
Mistakes to recognize
Section titled “Mistakes to recognize”“127.0.0.1 is my router.” The reply came from laptop itself. Its lo block reads link/loopback, not a link to router.
“A link-local address means the network is working.” It shows a local address is present. It does not prove the device received its expected settings or can reach another network.
Good to know
Section titled “Good to know”Ping times and identifiers vary. Compare the interface, direction and packet count, rather than copying the timing numbers.
Try it yourself
Section titled “Try it yourself”Name the address or range for five situations: a program contacts itself; a device selects an IPv4 address after receiving no settings; a sender has no particular address yet; a message addresses everyone on this network; a second computer runs its own self test.
Then predict which interface carries laptop’s self ping and how many packets a listener on lo sees. Write your answers. In terminal 1 run netlab shell laptop, then sudo tcpdump -i lo -n -c 2 icmp. In terminal 2 enter laptop with netlab shell laptop and run ping -c 1 127.0.0.1. Wait for terminal 1’s prompt, compare, then exit.
Solution
The situations use 127.0.0.1, 169.254.0.0/16, 0.0.0.0, 255.255.255.255, and 127.0.0.1 on the second computer. The loopback listener sees two packets: an echo request and an echo reply, both 127.0.0.1 > 127.0.0.1. Compare the 2 packets captured line; the “received by filter” count can be larger, and this lesson does not use it.
learner@rootvolt:~$ netlab shell laptop[sudo] password for learner: learner@laptop:~$ sudo tcpdump -i lo -n -c 2 icmp[sudo] password for learner: tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on lo, link-type EN10MB (Ethernet), snapshot length 262144 bytes15:24:52.391764 IP 127.0.0.1 > 127.0.0.1: ICMP echo request, id 176, seq 1, length 64
15:24:52.391796 IP 127.0.0.1 > 127.0.0.1: ICMP echo reply, id 176, seq 1, length 64
2 packets captured
4 packets received by filter
0 packets dropped by kernellearner@laptop:~$ exitlogoutlearner@rootvolt:~$ Steps (16)
- Type
netlab shell laptop - Press Enter
- Output:
[sudo] password for learner: - Type the password (the terminal shows nothing)
- Press Enter
- Type
sudo tcpdump -i lo -n -c 2 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 lo, link-type EN10MB (Ethernet), snapshot length 262144 bytes - Terminal 2 on laptop finished its loopback ping. Return to terminal 1 and wait for the prompt.
- Output:
15:24:52.391764 IP 127.0.0.1 > 127.0.0.1: ICMP echo request, id 176, seq 1, length 64 15:24:52.391796 IP 127.0.0.1 > 127.0.0.1: ICMP echo reply, id 176, seq 1, length 64 2 packets captured 4 packets received by filter 0 packets dropped by kernel - Type
exit - Press Enter
- Output:
logout
learner@laptop:~$ ping -c 1 127.0.0.1PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.122 ms
--- 127.0.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.122/0.122/0.122/0.000 mslearner@laptop:~$ Steps (3)
- Type
ping -c 1 127.0.0.1 - Press Enter
- Output:
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data. 64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.122 ms --- 127.0.0.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.122/0.122/0.122/0.000 ms
Leave for later
Section titled “Leave for later”Getting Network Settings Automatically shows the settings request and failed-settings cases.
- Loopback stays inside its own machine.
- IPv4 link-local stays on its own link.
- Unspecified and limited broadcast have different jobs.
Next, Practice: Understanding IPv4 Addresses combines format, prefix and address kind.