What Is a Router?
- A router is a networking device that connects different networks together.
- It routes (forwards) data packets from one network to another, ensuring the data reaches its destination.
How Does a Router Work?
- Receives a Packet: When a data packet arrives at a router, the router checks the destination IP address.
- Looks in Its Routing Table: It consults its routing table to decide where to forward the packet.
- Forwards the Packet: Based on the routing table, the packet is sent to the next hop (another router or the destination network).
Key Features of a Router:
- Gateway: A router acts as a gateway between networks (e.g., between your home network and the internet).
- IP Addressing: It works at Layer 3 (Network Layer) of the OSI model and relies on IP addresses.
- NAT (Network Address Translation): Converts private IPs (e.g.,
192.168.1.1
) to a public IP for internet access.
Example:
- If your computer sends data to a website, the router forwards it to your ISP’s network, and eventually to the website’s server.