📝 Routers network layer functionality (12 MCQs)
Routing Between Distinct IP Networks
A router is a network-layer device that connects different IP networks and forwards packets toward their destinations. It examines the destination IP address, consults its routing table, and selects an outgoing interface or next hop. Unlike a Layer 2 switch, a router makes forwarding decisions using network-layer prefixes rather than relying solely on destination MAC addresses across interconnected local and wide area networks.
Routing Tables, Interfaces and Next-Hop Selection
A routing table contains destination network prefixes and associated forwarding information, such as an outgoing interface, next-hop address, and metric. Routes may be connected, configured statically, or learned through routing protocols. The router generally uses the most specific matching prefix, known as longest-prefix matching, to choose a route for each arriving packet.
Packet Reception, Header Processing and Re-encapsulation
The router receives a frame, verifies its link-layer integrity, and removes the incoming data-link header and trailer. It examines the IP header, decreases the IPv4 Time To Live value or IPv6 Hop Limit, selects a route, and encapsulates the packet in a new frame appropriate for the outgoing link, as required.
Forwarding a Packet to a Remote Subnet
A computer on 192.168.1.0/24 sends a packet to 192.168.2.20. Its subnet mask shows that the destination is remote, so it sends the frame to its default gateway. The router selects the connected 192.168.2.0/24 route and forwards the packet onto that network.
Connecting LANs, WAN Links and Internet Networks
Routers interconnect LANs, wide area links, and Internet service provider networks. They support communication between IP subnets and may provide functions such as packet filtering, NAT, and routing protocol participation. Routing determines available paths, while forwarding applies the selected route to each arriving packet at the device in enterprise and service-provider environments.
Incorrect Assumptions About Router Forwarding
'A router forwards using only MAC addresses' is incorrect because it selects routes using IP addresses, then uses link-layer addressing on each link. 'A router preserves the incoming Ethernet frame' is incorrect because it re-encapsulates the packet. 'A default route is the best route for every destination' is incorrect when a more specific matching route exists.
Solving Router Table and Packet Path Questions
Students should calculate whether a destination is local or remote, identify the default gateway, and select the longest matching routing-table prefix. Trace the outgoing interface and next hop, explain IP TTL or Hop Limit processing, and distinguish routing-table selection from the link-layer frame forwarding performed on each network segment for every forwarding decision.
Routing and Packet Forwarding Terms
- Router - Forwards packets between IP networks.
- Routing table - Stores prefixes and forwarding paths.
- Next hop - Immediate router toward destination.
- Prefix - Identifies network bits in an address.
- TTL - Limits IPv4 packet lifetime in hops.
- Gateway - Connects a host to remote networks.
📝 All Routers network layer functionality MCQs
Q1. When a router receives a frame belonging to VLAN 10 but its routing table has no entry for that VLAN, what is the most likely action?
📖 Explanation: The router cannot forward a frame for an unknown VLAN, so it discards the frame and typically sends an ICMP Destination Unreachable message back to the source. This prevents the frame from propagating incorrectly and preserves network integrity.
Q2. If a switch creates a loop and a router is connected to the looped network, which protocol helps the router to avoid forwarding duplicate packets?
📖 Explanation: Spanning Tree Protocol (STP) detects network loops and disables redundant paths, ensuring that only a single active route exists. By doing so, it prevents the router from receiving and retransmitting duplicate frames caused by the loop, maintaining efficient and loop‑free forwarding.
Q3. A router interfaces with two LANs using subnets 192.168.1.0/24 and 192.168.1.0/25. A host in the /25 network sends a packet to a host in the /24 network. Which rule does the router use to select the appropriate route?
📖 Explanation: Routers perform longest‑prefix matching during route lookup. Although the destination belongs to the larger /24 network, the router evaluates all available routes and selects the one with the most specific (longest) matching prefix. In this case, the /24 route is chosen because it directly matches the destination address.
Q4. Which statement best distinguishes a hub from a switch regarding traffic handling?
📖 Explanation: A switch operates at the data‑link layer and maintains a MAC address table, allowing it to forward frames only to the intended destination port. In contrast, a hub is a physical layer device that simply repeats incoming electrical signals to all other ports, resulting in a single collision domain.
Q5. Replacing a traditional router with a layer‑3 switch in a VLAN‑rich environment primarily affects which of the following?
📖 Explanation: Layer‑3 switches integrate routing functions into switch ASICs, providing hardware‑based forwarding that is typically faster than software routing on a conventional router. This reduction in processing delay can improve overall network performance, especially in environments with many VLANs that require frequent inter‑VLAN traffic.
Q6. Compared to static routing, dynamic routing protocols improve scalability because they
📖 Explanation: Dynamic routing protocols such as OSPF or EIGRP automatically exchange topology information among routers, enabling them to compute optimal paths without human intervention. This automation allows networks to grow and change without the overhead of updating static routes on every device, thereby enhancing scalability.
Q7. Why does a router maintain a MAC address table even though its primary function is layer‑3 routing?
📖 Explanation: Routers must encapsulate routed packets into Ethernet frames before sending them out an interface. To do this, they need the MAC address of the next‑hop or final destination on that LAN segment. The router therefore learns and stores MAC addresses in a table, enabling efficient ARP resolution and frame forwarding.
Q8. How does a router separate broadcast domains?
📖 Explanation: A router creates a distinct broadcast domain for each of its interfaces, typically by assigning each interface a unique IP subnet. Broadcast frames received on one interface are not forwarded to another, thereby isolating broadcast traffic and preventing it from crossing between separate logical networks.
Q9. What is the relationship between VLAN trunking and the router‑on‑a‑stick configuration?
📖 Explanation: In a router‑on‑a‑stick design, a single physical link between the switch and router is configured as a trunk, carrying traffic for several VLANs. The router then creates a sub‑interface for each VLAN, enabling inter‑VLAN routing while using only one physical connection.
Q10. Enabling inter‑VLAN routing on a router impacts security segmentation in which way?
📖 Explanation: Inter‑VLAN routing permits traffic to move between VLANs, but the router can enforce access‑control lists (ACLs) to restrict which flows are allowed. This selective control preserves the logical separation of VLANs while still providing necessary communication, thereby balancing connectivity and security requirements.
Q11. A router has three physical interfaces, each assigned to a different VLAN. How many distinct broadcast domains exist in this configuration?
📖 Explanation: Each router interface defines its own broadcast domain because broadcast frames are not forwarded between interfaces. With three interfaces each on separate VLANs, there are exactly three independent broadcast domains, represented mathematically as . This isolation is a core reason routers are used to segment networks.
Q12. What is the primary function of a router in an IP network?
📖 Explanation: The essential role of a router is to examine the destination IP address of incoming packets and forward them toward the appropriate next‑hop or network. By doing so, routers enable communication across separate IP subnets and connect disparate networks, forming the backbone of the Internet.