SystemTutor
About
Sign in
Loading course documentation…
SystemTutor

COURSES

  • Data Structures & Algorithms
  • CSS MasterclassNew course
  • System DesignNew course

PRACTICE

  • Algorithm practice
  • CSS practice

LEGAL

  • Privacy Policy
  • Terms of Service
  • About

© 2026 SystemTutor. All rights reserved.

Built with 🫶 by Shatlyk

System design
How a Request Crosses a NetworkIPTCPUDP Routing, streams, and datagramsDNSHTTP Requests and Responses From a hostname to an HTTP response
Networking

IP

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.

Read an address

VersionSizeExampleHow to read it
IPv432 bits192.0.2.1Four decimal numbers separated by dots. Each number represents eight bits and ranges from 0 to 255.
IPv6128 bits2001:db8::1Groups 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.

Follow a packet out of a private network

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.

Several private devices access the internet through a router with one public IP address.

  1. The laptop sends a packet addressed to a public service. On the home network its source is its private address.
  2. The home router performs network address translation (NAT). In a common home setup, it substitutes a public source address and keeps a mapping that includes transport ports. Connections from several devices can now share that public address.
  3. The service replies to the translated address and port. The router uses the mapping to forward the reply to the laptop.

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.

Separate scope from assignment

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.

Deliver the payload to the right program

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.

An HTTP message uses TCP for transport in this example. IP routes the resulting packets.

Check your understanding

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?

Compare your reasoning

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.

Key Takeaways

  • Addresses let routers forward packets toward a destination within the appropriate network scope.
  • NAT lets devices share a public IPv4 address by tracking translations for their traffic.
  • Ports help the destination’s transport layer deliver incoming data to the right endpoint.

How is this lesson?

Previous lessonHow a Request Crosses a NetworkNext lessonTCP
Edit on GitHubReport on GitHub
On this page
%

On this page

Read an addressFollow a packet out of a private networkSeparate scope from assignmentDeliver the payload to the right programCheck your understandingKey Takeaways