Network hardware (3)
Resources |
Revision Questions |
Computer Science
Login to see all questions
Click on a question to view the answer
1.
Describe how a router uses a routing table to determine the path for a data packet. Include the terms 'destination IP address', 'next hop', and 'routing table'.
A router uses a routing table to determine the best path for a data packet to reach its destination. The routing table is a fundamental component of a router's operation.
The routing table contains entries that map destination networks (or individual hosts) to the next hop – the next router or network to which the packet should be sent. Each entry typically includes the destination network, the next hop IP address, and a 'metric' or cost associated with that path. The metric indicates the desirability of using that path; lower metrics are generally preferred.
When a data packet arrives at the router, the router examines the packet's destination IP address. It then searches its routing table for an entry that matches the destination network. If a match is found, the routing table entry specifies the next hop – the IP address of the next router or network to which the packet should be forwarded. The router then modifies the packet's header to reflect this next hop and forwards the packet accordingly. If no exact match is found, the router will use a best-match algorithm to select the most appropriate route based on the destination IP address.
2.
Describe the role of a router in a network. Your answer should include a description of how it forwards data packets.
A router is a crucial networking device that connects multiple networks together. Its primary role is to forward data packets between these networks. Essentially, a router acts as a traffic director for data travelling across a network.
When a data packet arrives at a router, the router examines the packet's destination IP address. It then consults its routing table, which contains information about the best paths to reach different networks. The routing table is built and maintained using routing protocols. Based on the routing table, the router determines the next hop – the next device or network to send the packet to.
The router then forwards the packet to the determined next hop. This process is repeated at each hop until the packet reaches its final destination network. Routers can also perform other functions such as Network Address Translation (NAT) and Quality of Service (QoS) to optimize network performance.
3.
Explain the difference between a router and a switch. Consider their functions and the layers of the OSI model they operate at.
class="answer">
Both routers and switches are networking devices, but they operate at different layers of the OSI model and have distinct functions.
Switch: A switch operates primarily at Layer 2 (the Data Link Layer) of the OSI model. Its main function is to forward data frames between devices within the same network (LAN). It uses MAC addresses to identify devices and direct traffic only to the intended recipient. Switches create a local network segment.
Router: A router operates at Layer 3 (the Network Layer) of the OSI model. Its primary function is to forward data packets between different networks (e.g., your home network and the internet). Routers use IP addresses to identify networks and determine the best path for packets to reach their destination. Routers connect multiple networks together, enabling communication between them. They perform routing based on IP addresses and routing tables.
Here's a table summarizing the key differences:
| Device | OSI Layer | Function |
| Switch | Layer 2 | Forwards data frames within a LAN using MAC addresses. |
| Router | Layer 3 | Forwards data packets between different networks using IP addresses. |