Routers
Introduction to routers
A router is a networking device that forwards data packets between networks. It connects multiple networks together - for example, your home network and the internet. It has 3 main functions:
- Directs data to the correct destination using IP addresses.
- Acts as the gateway to/from the internet.
- Helps create a LAN (Local Area Network).
How Routers Work
- Uses routing tables to decide where to send packets.
- Reads the destination IP address in each packet.
- Sends packets along the most appropriate path.
What is the primary function of a router in a network?
How Routers Route Data
1. Data Packet Arrives
When a router receives a data packet from a connected device, it examines the packet's destination IP address.
2. Lookup in Routing Table
The router looks up the destination IP address in its routing table. It searches for the most specific matching route (longest prefix match) in the table.
3. Matching Route Found
If a matching route is found in the routing table, the router determines the next hop or gateway to which the data packet should be sent, as well as the outgoing network interface. If no specific matching route is found for the destination IP address, the router sends the packet to a default gateway.
4. Forwarding the Packet
The router forwards the data packet to the next hop router or directly to the destination network through the specified network interface.
5. Repeat for Each Hop
If the destination is not in the same local network, the process repeats at each hop until the packet reaches its final destination.
What action does a router take when it receives a data packet?
Other Router functions
Network Segmentation
Routers segment larger networks into smaller subnets, which is crucial for optimizing network performance, enhancing security, and simplifying network management.
IP Address Assignment
Routers can assign IP addresses to devices within a local network, typically using DHCP (Dynamic Host Configuration Protocol).
Network Address Translation (NAT)
Routers often perform NAT, which allows multiple devices on a local network to share a single public IP address when communicating with external networks, such as the internet.
Quality of Service (QoS)
Some routers support QoS features, allowing administrators to prioritize certain types of network traffic, such as streaming data or VOIP
Routers vs Switches
Students often get confused between between routers and swithes. Here are the key differences:
| Router | Switch |
|---|---|
| Connects different networks | Connects devices within one network |
| Uses IP addresses | Uses MAC addresses |
| Forwards packets between networks | Forwards frames within a LAN |
Review: Fill in the Blanks
Routers are responsible for forwarding data packets between networks. When a router receives a packet, it examines the destination IP address and makes routing decisions to determine the most path for the packet to reach its destination. Routing is the core function of a router, where routers use routing tables and to determine the best path for data packets to travel. They maintain these routing tables, which contain information about network destinations and associated next-hop routers or .
A routing table contains information about network routes and is used to determine the best path for forwarding data packets from the source to the destination within a . When a router receives a data packet from a connected device, it examines the packet's destination IP address, then looks up the destination IP address in its routing table. If a matching route is found, the router determines the or gateway to which the data packet should be sent, and the outgoing network . If no specific matching route is found for the destination IP address, the router may use a default route (0.0.0.0/0) to send the packet to a default gateway or the .
Complete! Ready to test your knowledge?
Router
- Introduction to routers
- How Routers Route Data
- Other Router functions
- Routers vs Switches