Short answer: your modem connects your home to your provider. Your router then runs the home network: it gives each device a local address (DHCP), lets them all share one public internet address (NAT), and helps them look up websites by name (DNS).

Modem and router

The modem speaks your provider’s technology. On cable internet, for example, the modem in your home talks to the operator’s equipment at its hub site using DOCSIS. The router connects to the modem and manages everything inside your home. Some providers combine both in one gateway; see modem vs router.

Addresses

Every device needs an address. Inside your home, devices use private addresses from ranges set aside for local networks: 192.168.0.0/16, 172.16.0.0/12 and 10.0.0.0/8. That’s why so many routers use addresses like 192.168.1.1. Your home as a whole has a public address from your provider.

DHCP: handing out addresses

When a device joins, the router’s DHCP service gives it an address and the settings it needs. DHCP passes configuration to devices and allocates reusable addresses, so a device may get a different local address another day. That’s why you reserve an address before setting up port forwarding.

NAT: sharing one public address

NAT translates between your private addresses and your one public address. Connections start from inside your home, and incoming ones are allowed only by exception. That’s the source of most “open ports” and NAT-type problems in games. Some providers add another layer, carrier-grade NAT, which uses the 100.64.0.0/10 range, and two routers in a row cause double NAT.

DNS: finding websites

You type a name, but devices connect to addresses. DNS does the lookup: the system lets software use names to retrieve host addresses, with resolvers fetching that information from name servers. Your router usually passes these lookups to your provider’s DNS servers.

IPv6

IPv6, the successor to IPv4, increases addresses from 32 to 128 bits, enough for every device to have its own public address. Many providers now run IPv4 and IPv6 side by side. To manage any of these settings, log in to your router.