Read IP addresses and trace a packet from a private network to a public service.
Lesson goal
Explain what a router does with a destination address and how private devices can share a public IPv4 address.
Before you begin — How a request crosses a network.
When your laptop requests a page, it sends packets toward the service’s Internet Protocol (IP) address. Each router uses the destination address to choose a next hop. The address identifies a network interface in a particular network context. A device can have several addresses, and an address can be reassigned.
| Version | Size | Example | How to read it |
|---|---|---|---|
| IPv4 | 32 bits | 192.0.2.1 | Four decimal numbers separated by dots. Each number represents eight bits and ranges from 0 to 255. |
| IPv6 | 128 bits | 2001:db8::1 | Groups of hexadecimal digits separated by colons. A double colon can stand for a run of zero groups. |
IPv4 has about 4.3 billion possible addresses. IPv6 provides a much larger address space. Both protocols carry packets with a source and destination address.
A phone and a laptop on your home network can have different private IPv4 addresses. Another home can reuse those same addresses because Internet routers do not forward traffic to private ranges across the public Internet.
A public address can be routed on the Internet. Whether a client can actually reach a service at that address also depends on routing and firewall rules.
Public and private describe where an address is usable. Static and dynamic describe how the address is assigned. A private database address can be static. A router’s public address can be dynamically assigned and may change. Dynamic assignment does not require the address to change at every renewal.
An IP header identifies the source, destination, and the protocol carried inside. For a web request using TCP, IP routes the packets to the host, and TCP uses connection information including ports to deliver the bytes to the right endpoint. The server can then interpret the HTTP message.
Two laptops on different home networks both use 192.168.1.10. Why can they each open the same public website and receive the right reply?
Each private address belongs to a separate network. Each home gateway translates the outgoing connection and records where its replies belong. The website replies to the translated endpoint.