📝 Data Link Layer basics (12 MCQs)
The Data Link Layer’s Role in Node-to-Node Delivery
The data link layer is the second layer of the OSI model and provides node-to-node delivery across a single link. It takes network-layer packets and organizes them into frames suitable for the underlying medium. Its responsibilities commonly include framing, physical addressing, media access, and error detection. The exact services vary with the link technology, such as Ethernet or Wi-Fi on a particular transmission medium.
Framing, Physical Addressing and Link Control
A frame contains a header, payload, and usually a trailer. The header carries link-layer control information, often including source and destination MAC addresses; the trailer may contain an error-detection value such as a frame check sequence. Link protocols also define how devices share a medium and whether flow control or reliable delivery is provided.
How a Packet Becomes a Link-Layer Frame
At the sender, the network layer passes a packet to the link layer. The sender places it in a frame, adds required addressing and control fields, and transmits the resulting bit sequence. The receiving interface recognizes the frame boundary, checks its integrity where supported, processes its header, and delivers the enclosed packet upward.
An Ethernet Frame Crossing a Local Network
A computer sends an IPv4 packet to another host on its Ethernet LAN. The network layer supplies the packet to Ethernet, which adds destination and source MAC addresses and a frame check sequence. A switch forwards the frame toward the destination port; the receiving network interface accepts it and passes the packet to IP.
How the Link Layer Connects Network and Physical Layers
The link layer sits between the network layer and the physical layer. It uses the physical layer to send bits over copper, fibre, or radio, while presenting a frame-delivery service to IP. Routers remove an incoming link frame and create a new one for the next link, even when the IP packet continues toward the same destination.
Clarifying the Scope of Link-Layer Services
'The link layer delivers packets across the entire internet' confuses local-link delivery with network-layer routing. 'Every link protocol guarantees retransmission' is incorrect because reliability is optional and technology-dependent. 'A MAC address replaces an IP address' is also false: MAC addresses support local frame delivery, while IP addresses identify network-layer endpoints across interconnected networks.
Recognizing Frames, Addresses and Layer Responsibilities
For examinations, identify the data link layer as OSI Layer 2 and distinguish its frames from network-layer packets and physical-layer bits. Trace encapsulation and decapsulation, identify MAC fields and frame checks, and explain why a router changes link-layer framing at each hop. Compare link services without assuming every technology implements them identically.
Core Data Link Layer Terminology
- Frame - A link-layer packet container.
- MAC address - Local interface identifier.
- Framing - Creating frames from packets.
- Trailer - Frame ending error-check fields.
- FCS - Error-check value in a frame.
- Link - Connection between adjacent nodes.
📝 All Data Link Layer basics MCQs
Q1. In the scenario described, how many separate logical connections exist between the data‑link layers along the path from Alice’s host to the destination host?
📖 Explanation: The passage explicitly mentions that communication at the data‑link layer consists of five separate logical connections. Each connection links the data‑link layer of one device to the next, yielding a total of five logical links from Alice’s computer through the routers to the final host. Therefore, the correct answer is five.
Q2. If a packet encounters a failure at router R2’s data‑link layer, what is the immediate effect on end‑to‑end communication?
📖 Explanation: When the data‑link layer at R2 cannot forward the frame, the segment that follows R2 (R2 to the next hop) becomes unavailable. The portion of the path before R2 can still operate, but the packet cannot progress beyond the failure point, so only the downstream segment is affected.
Q3. Given that each link in the path uses a distinct MAC addressing scheme, what can be inferred about the need for address translation?
📖 Explanation: Each link’s MAC addressing scheme is local to that link, so when a frame moves from one link to the next, the router must replace the source and destination MAC addresses with those appropriate for the new segment. This per‑hop replacement constitutes address translation at every router.
Q4. A store‑and‑forward switch forwards a frame of 1500 bytes over a link of 10 Mbps. Using the formula , what is the minimum per‑hop latency?
📖 Explanation: First convert 1500 bytes to bits: 1500 × 8 = 12 000 bits. Divide by the bandwidth: 12 000 bits ÷ 10 × 10⁶ bits/s = 0.0012 s, which equals 1.2 ms. Hence the minimum latency for a single hop is 1.2 ms.
Q5. Which of the following best compares the role of the data‑link layer in a LAN versus a WAN?
📖 Explanation: Within a LAN, the data‑link layer is responsible for framing, error detection, and using MAC addresses for local delivery. In a WAN, the layer still frames data but must also consider logical addressing (e.g., VLAN IDs) to traverse multiple network segments, extending its responsibilities beyond pure local delivery.
Q6. What is a primary advantage of using switches instead of routers for intra‑network traffic at the data‑link layer?
📖 Explanation: Switches operate at Layer 2, making forwarding decisions solely on MAC addresses. This avoids the overhead of IP‑level routing performed by routers, allowing faster frame forwarding and lower latency for traffic that remains within the same broadcast domain.
Q7. How does a logical connection at the data‑link layer differ from a physical connection?
📖 Explanation: Logical connections are established by the data‑link protocols that manage frame exchange between devices, independent of the underlying medium. Physical connections are the tangible media—copper, fiber, or wireless—that carry the electrical or optical signals. Thus, the distinction lies in software‑defined links versus hardware pathways.
Q8. If a new router R3 is inserted between R2 and the destination host, how does the number of logical data‑link connections change?
📖 Explanation: Adding R3 splits the existing link between R2 and the destination into two separate segments: R2‑R3 and R3‑destination. Consequently, the original logical connection is replaced by two, but the total count of logical connections along the path increases by one, not decreases. Therefore the correct choice reflects the addition of a new logical link.
Q9. Which header is added by the data‑link layer when a packet is prepared for transmission over an Ethernet network?
📖 Explanation: At the data‑link layer, the protocol encapsulates the network‑layer packet within an Ethernet frame, which includes an Ethernet header containing source and destination MAC addresses, type field, and other control information. Higher‑layer headers such as IP and TCP remain above this layer.
Q10. How does the Address Resolution Protocol (ARP) relate to MAC addresses at the data‑link layer?
📖 Explanation: ARP operates at the boundary of the network and data‑link layers. When a host knows the IP address of a destination on the same LAN, it broadcasts an ARP request to discover the corresponding MAC address. The reply provides the MAC address, enabling the sender to construct a correctly addressed Ethernet frame.
Q11. When each hop in a path uses a different frame format, what mechanism ensures end‑to‑end compatibility of the transmitted data?
📖 Explanation: The source host typically encapsulates the payload in a format that is recognized by every intermediate device, such as using a standard Ethernet frame. This universal encapsulation allows each hop to forward the frame without needing to understand higher‑layer specifics, preserving end‑to‑end compatibility.
Q12. What is the primary function of a router in a network?
📖 Explanation: Routers operate at Layer 3, examining the destination IP address in each packet and making forwarding decisions to move the packet toward its final network. They interconnect distinct network segments, enabling communication across disparate LANs, WANs, or the Internet.