Data Link Layer MCQs for NSCT
The data link layer moves frames reliably from one node to the next over a single link. It handles framing, error detection, flow control and access to a shared medium, and it uses MAC addresses. It is the third topic in the Computer Networks and Cloud Computing area, which carries 10% of the NSCT according to HEC's Areas of Competencies. In 2026 Networks accuracy was 39.6%, per the HEC NSCT report and APP.
IEEE 802 splits the layer into two sublayers: LLC (logical link control: flow and error control) and MAC (media access control: who may transmit, plus frame format and addressing).
Framing
Framing marks where each frame starts and ends. There are three main methods:
- Character count: a header field gives the frame length. One corrupted count throws off every later frame.
- Byte stuffing: a flag byte marks each end, and an escape (ESC) byte is inserted before any flag or ESC byte inside the data.
- Bit stuffing: HDLC uses the flag 01111110 and inserts a 0 after every five consecutive 1s in the data.
Example: the data 0111111011111100 is sent as 011111010111110100. The receiver deletes each 0 that follows five 1s.
Exam angle: count runs of 1s carefully, because the count restarts after each stuffed 0.
Error detection
Every error-detection scheme adds redundant bits.
- Parity: one even-parity bit makes the number of 1s even. It detects any odd number of flipped bits but misses an even number.
- Hamming distance is the number of positions in which two words differ. For a code with minimum distance d_min, it can detect s errors if d_min = s + 1, and correct t errors if d_min = 2t + 1.
- Hamming code: single-error correction needs r parity bits with 2^r ≥ m + r + 1. Seven data bits need 4 parity bits.
- Checksum: the Internet checksum adds 16-bit words in one's complement and sends the complement of the sum. It is used mainly at higher layers, such as in IP, TCP and UDP headers.
Exam angle: d_min = 4 detects 3 errors but corrects only 1.
CRC
The cyclic redundancy check divides the data, with r zeros appended (r is the degree of the generator), by a generator polynomial using modulo-2 (XOR) division. The r-bit remainder is appended. The receiver divides the whole frame; a remainder of zero means no error was detected.
| Step | Value |
|---|---|
| Dataword | 1001 |
| Generator | 1011 (x^3 + x + 1), so append 3 zeros |
| Dividend | 1001000 |
| Remainder | 110 |
| Codeword | 1001110 |
If the codeword arrives as 1011110, dividing by 1011 leaves 110, which is non-zero, so the frame is discarded. CRC detects all burst errors no longer than r bits. Ethernet uses CRC-32 in its frame check sequence.
Exam angle: the remainder always has exactly r bits; keep leading zeros (001, not 1).
MAC and flow control
When many stations share one medium, a multiple-access protocol decides who sends.
| Protocol | Idea | Peak throughput / use |
|---|---|---|
| Pure ALOHA | Send whenever ready | 18.4% (1/2e) |
| Slotted ALOHA | Send only at slot starts | 36.8% (1/e) |
| CSMA/CD | Sense first, stop and back off on collision | Classic half-duplex Ethernet |
| CSMA/CA | Sense, wait a random backoff, optional RTS/CTS | Wi-Fi, where collisions cannot be detected |
Flow control stops a fast sender from flooding a slow receiver. Stop-and-wait sends one frame, then waits for an ACK, so utilisation = Tt / (Tt + 2Tp). Sliding windows keep several frames in flight. With m-bit sequence numbers, Go-Back-N allows up to 2^m - 1 frames and resends everything from a lost frame onward. Selective Repeat allows up to 2^(m-1) and resends only the lost frame.
Exam angle: these window-size limits are easy to swap. Go-Back-N with 3 bits allows 7 frames; Selective Repeat with 3 bits allows 4.
Ethernet
An Ethernet frame has a 7-byte preamble and a 1-byte start frame delimiter. These are followed by the 6-byte destination and 6-byte source MAC addresses, a 2-byte type/length field, 46 to 1,500 bytes of data, and a 4-byte CRC. That makes a frame of 64 to 1,518 bytes, not counting the preamble and SFD. Short data is padded up to 46 bytes. The 64-byte minimum exists so a sender is still transmitting when a collision from the far end reaches it (2 x propagation delay). A MAC address is 48 bits, and FF:FF:FF:FF:FF:FF is the broadcast address. Switches learn which MAC address sits on which port from source addresses, and flood frames whose destination is still unknown.
Exam angle: payload sizes (46 to 1,500 bytes) and frame sizes (64 to 1,518 bytes) are different numbers.
Common traps
- Dropping leading zeros from a CRC remainder, or appending the wrong number of zeros.
- Thinking parity catches two-bit errors.
- Swapping the Go-Back-N (2^m - 1) and Selective Repeat (2^(m-1)) window limits.
- Using one-way instead of round-trip propagation in stop-and-wait utilisation.
- Saying Wi-Fi uses CSMA/CD.
- Mixing up Ethernet's 1,500-byte data limit with its 1,518-byte frame size.
Worked examples
1. Understanding. Which data link sublayer decides when a station may transmit on a shared medium? Answer: the MAC sublayer. LLC handles flow and error control and the interface to the network layer. MAC handles medium access, framing format and addressing.
2. Application. Find the CRC codeword for dataword 1001 with generator 1011. Answer: 1001110. Append three 0s (1001000), divide by 1011 using XOR, and the remainder is 110.
3. Analysis. A 10 Mbps link carries 1,500-byte frames with a one-way propagation delay of 5 ms. What is the stop-and-wait utilisation, and how large a window keeps the link busy? Answer: about 10.7%, and a window of 10 frames. Tt = 12,000 / 10^7 = 1.2 ms, so utilisation = 1.2 / (1.2 + 10) = 10.7%. A full cycle is 11.2 ms, which covers 11.2 / 1.2 = 9.33 frame times, so 10 frames are needed. Go-Back-N then needs 4-bit sequence numbers (2^4 - 1 = 15 ≥ 10).
Practise
The quiz below has 100 questions on this topic, filterable by tier and difficulty.
Practise: 100 questions
FAQs
What is the difference between error detection and error correction?
Detection only tells the receiver that something is wrong, and the frame is then discarded and resent. Parity, checksums and CRC do this. Correction finds and fixes the bad bits without resending, which needs more redundancy. Hamming codes correct single-bit errors and need d_min = 2t + 1 to correct t errors.
Why does Ethernet have a minimum frame size of 64 bytes?
With CSMA/CD, a sender only learns about a collision if it is still transmitting when the collision signal comes back from the far end of the cable. At 10 Mbps the round trip is budgeted at 51.2 µs, which equals 512 bits, or 64 bytes. Shorter frames are padded to reach this size.
How is CRC different from a checksum?
A checksum adds data words in one's complement arithmetic. It is simple, but misses some errors, such as reordered words. CRC uses polynomial division and catches all burst errors up to the generator's degree, plus most longer ones. That is why link layers like Ethernet use CRC, while IP, TCP and UDP use checksums.
Next step
Move on to the Network Layer MCQs (IP addressing and routing), or go deeper with CRC and error-detection practice. See all topics on the Networks & Cloud hub, and finish with an NSCT mock test.