Networking fundamentals

How IP networks work: packets, routers, DNS, and ports

When a browser opens a site, it does not talk to “the internet” in one jump. It sends packets to a local router, then through a series of networks until they reach the server. IP handles the addressing and routing; DNS, ports, switches, and routers each have their own job.

From browser to server

Packets carry a destination, not a full route

Data is split into packets. Each one includes a source IP address and a destination IP address. A router looks at the destination, checks its routing table, and sends the packet to the next useful hop. The next router repeats that process.

Routers are not keeping a list of every device online. They work with network ranges and prefixes. A route for a large prefix can cover many addresses, which is why CIDR notation matters in routing tables.

your device local router provider network internet routers destination server

Same network

Same subnet? No router needed

When the destination is on the same subnet, a device can send traffic straight across the local link. Ethernet or Wi-Fi delivers the frame locally, while the IP addresses still describe who is talking to whom at the network layer.

Another network

Outside the subnet, use the gateway

For anything outside the local subnet, the device hands the packet to its default gateway, normally the local router. From there it may pass through an ISP, transit providers, and a destination network before it arrives.

Names and applications

Names point to addresses; ports point to services

People type names such as example.com; machines need addresses. DNS returns one or more IPv4 and IPv6 addresses for that name. The client then connects using an address family it can reach.

Getting to an IP address is only half the story. The port identifies the service on that host. HTTPS commonly listens on port 443; other services have different ports. TCP or UDP tells the operating system how that traffic should be handled.

Modern addressing

Same routing model, much more address space

IPv6 keeps the same basic routing model. The practical difference is the address space and the way prefixes are handed out. A normal IPv6 LAN is often a /64, which gives that link plenty of room for interface addresses.

For troubleshooting, look at the prefix before drawing conclusions. A link-local fe80::/10 address belongs on one local link. A globally routed address may travel much further, provided the routes and firewall rules allow it.

Technical references: RFC 8200 and RFC 791.