HomeSubjectsUniversityBlogAbout

Data Link Layer

Topic in Computer Networks & Cloud Computing

210 total MCQsShowing 30 with explanations10 Easy10 Medium10 Hard

About This Topic

The data link layer is layer 2 of the OSI model, responsible for framing bits, physical (MAC) addressing, and error and flow control across a single link. Practice items test error detection with parity bits, checksums and CRC, and correction with Hamming codes. Flow-control questions cover stop-and-wait, Go-Back-N and Selective Repeat sliding windows, including window size limits. Medium access topics include ALOHA, CSMA/CD with binary exponential backoff, the 64-byte minimum Ethernet frame and why it depends on propagation delay, plus frame headers and trailers, ARP and RARP, and the split between the LLC and MAC sublayers.

Below are 30 practice questions from a pool of 210 Data Link Layer MCQs, one of 10 topics in Computer Networks & Cloud Computing. Each shows the correct answer with an explanation; when you are ready, take a timed quiz to test recall under exam conditions.

Practice Questions

Each question below shows the correct answer with a full explanation. Use these to build conceptual understanding before attempting a timed quiz.

Data Link LayerEasy

Q1. What is a MAC address?

  1. A.A port number for applications
  2. B.A physical address burned into a NIC✓ Correct
  3. C.An IP address used for routing
  4. D.A logical address assigned by software

Explanation

A MAC (Media Access Control) address is a 48-bit physical address burned into the network interface card (NIC) by the manufacturer.

Report an error in this question

Data Link LayerEasy

Q2. Which error detection method appends a calculated value at the end of the data?

  1. A.All of the above✓ Correct
  2. B.Parity check only
  3. C.Hamming code only
  4. D.CRC method only

Explanation

All three methods (parity check, CRC, and Hamming code) append redundant bits at the end of data for error detection or correction.

Report an error in this question

Data Link LayerEasy

Q3. How many bits are in a MAC address?

  1. A.32 bits
  2. B.48 bits✓ Correct
  3. C.128 bits
  4. D.64 bits

Explanation

A MAC address is 48 bits (6 bytes) long, typically represented as six pairs of hexadecimal digits (e.g., AA:BB:CC:DD:EE:FF).

Report an error in this question

Data Link LayerEasy

Q4. What is the main function of the data link layer?

  1. A.Node-to-node delivery of frames✓ Correct
  2. B.Routing packets between networks
  3. C.Physical signal encoding
  4. D.End-to-end message delivery

Explanation

The data link layer is responsible for node-to-node (hop-to-hop) delivery of frames between directly connected devices.

Report an error in this question

Data Link LayerEasy

Q5. What does CSMA/CD stand for?

  1. A.Carrier Sense Media Access with Collision Detection
  2. B.Central Station Multiple Access with Collision Detection
  3. C.Carrier Sense Multiple Access with Collision Detection✓ Correct
  4. D.Carrier Signal Multiple Access with Collision Division

Explanation

CSMA/CD stands for Carrier Sense Multiple Access with Collision Detection. It is the access method used in traditional Ethernet networks.

Report an error in this question

Data Link LayerEasy

Q6. Which sublayer of the data link layer controls access to the shared medium?

  1. A.Physical sublayer
  2. B.Network sublayer
  3. C.LLC sublayer
  4. D.MAC sublayer✓ Correct

Explanation

The MAC sublayer controls how devices share access to the transmission medium. It defines protocols like CSMA/CD and token passing.

Report an error in this question

Data Link LayerEasy

Q7. What is framing in the data link layer?

  1. A.Assigning IP addresses to each host
  2. B.Dividing data into units called frames✓ Correct
  3. C.Converting digital signals to analog form
  4. D.Encrypting data for secure transfer

Explanation

Framing is the process of dividing a stream of bits from the network layer into manageable data units called frames.

Report an error in this question

Data Link LayerEasy

Q8. Simple parity check can detect which type of errors?

  1. A.Only even number of bit errors
  2. B.Only odd number of bit errors✓ Correct
  3. C.All types of errors in data
  4. D.Only burst errors in frames

Explanation

Simple (single-bit) parity check can only detect an odd number of bit errors. If an even number of bits are flipped, the error goes undetected.

Report an error in this question

Data Link LayerEasy

Q9. Which protocol is used to resolve an IP address to a MAC address?

  1. A.DNS
  2. B.RARP
  3. C.DHCP
  4. D.ARP✓ Correct

Explanation

ARP (Address Resolution Protocol) is used to map a known IP address to a MAC address on a local network.

Report an error in this question

Data Link LayerEasy

Q10. In Ethernet, what happens when a collision is detected?

  1. A.Data is retransmitted right away immediately
  2. B.The entire network shuts down completely
  3. C.Devices wait a random time then retransmit✓ Correct
  4. D.The frame is discarded permanently by all

Explanation

When a collision is detected in CSMA/CD Ethernet, the devices stop transmitting, send a jam signal, and wait a random time (backoff) before retrying.

Report an error in this question

Data Link LayerHard

Q11. If the generator polynomial for CRC is x^3 + 1, what is the binary divisor?

  1. A.1001✓ Correct
  2. B.1101
  3. C.1111
  4. D.1011

Explanation

The polynomial x^3 + 1 = x^3 + x^0 corresponds to binary 1001 (bit positions 3 and 0 are set).

Report an error in this question

Data Link LayerMedium

Q12. In Selective Repeat ARQ, what is the maximum window size if the sequence number has m bits?

  1. A.2^(m-1)✓ Correct
  2. B.2^m
  3. C.2^m - 1
  4. D.2^m + 1

Explanation

In Selective Repeat, the maximum window size for both sender and receiver is 2^(m-1) to avoid ambiguity between new and retransmitted frames.

Report an error in this question

Data Link LayerMedium

Q13. Which access method does IEEE 802.11 (Wi-Fi) use?

  1. A.CSMA/CD method
  2. B.Token passing
  3. C.CSMA/CA method✓ Correct
  4. D.FDMA technique

Explanation

IEEE 802.11 uses CSMA/CA (Carrier Sense Multiple Access with Collision Avoidance) because collision detection is impractical in wireless networks.

Report an error in this question

Data Link LayerMedium

Q14. What is the minimum frame size in standard Ethernet (IEEE 802.3)?

  1. A.64 bytes✓ Correct
  2. B.46 bytes
  3. C.32 bytes
  4. D.128 bytes

Explanation

The minimum Ethernet frame size is 64 bytes (including header and trailer). This ensures that collisions are detected before the entire frame is transmitted.

Report an error in this question

Data Link LayerMedium

Q15. What is the purpose of bit stuffing in HDLC?

  1. A.To prevent the flag pattern in data✓ Correct
  2. B.To compress the transmitted data
  3. C.To encrypt the frame contents
  4. D.To increase available bandwidth

Explanation

Bit stuffing inserts a 0 after five consecutive 1s in the data to prevent the flag pattern (01111110) from accidentally appearing within the frame content.

Report an error in this question

Data Link LayerMedium

Q16. In the Go-Back-N ARQ protocol, what happens when an error is detected in frame n?

  1. A.The entire connection is terminated
  2. B.Only frame n is retransmitted alone
  3. C.All frames from n onward are resent✓ Correct
  4. D.Frame n is skipped and ignored

Explanation

In Go-Back-N, when an error is detected in frame n, the receiver discards all subsequent frames, and the sender retransmits frame n and all following frames.

Report an error in this question

Data Link LayerMedium

Q17. What is a VLAN (Virtual LAN)?

  1. A.A logical group of devices on a network✓ Correct
  2. B.A wireless LAN using access points
  3. C.A LAN without any switch devices
  4. D.A LAN that uses virtual machine hosts

Explanation

A VLAN is a logical grouping of network devices that functions as a separate LAN segment, regardless of the physical location of the devices.

Report an error in this question

Data Link LayerMedium

Q18. What is the window size at the receiver in the Go-Back-N protocol?

  1. A.Same as sender window size
  2. B.Equal to N minus 1
  3. C.Always exactly 1 only✓ Correct
  4. D.Equal to 2^(m-1)

Explanation

In Go-Back-N, the receiver window size is always 1, meaning it can only accept frames in order. Out-of-order frames are discarded.

Report an error in this question

Data Link LayerMedium

Q19. What is the purpose of the LLC sublayer?

  1. A.Collision detection on the wire
  2. B.Signal encoding and modulation
  3. C.Physical addressing of devices
  4. D.Flow and error control for frames✓ Correct

Explanation

The LLC (Logical Link Control) sublayer provides flow control and error control services. It also provides multiplexing for network layer protocols.

Report an error in this question

Data Link LayerMedium

Q20. In the Hamming code, how many redundancy bits are needed for a 4-bit data word?

  1. A.3✓ Correct
  2. B.2
  3. C.5
  4. D.4

Explanation

Using the formula 2^r >= m + r + 1 where m=4: 2^3 = 8 >= 4 + 3 + 1 = 8. So 3 redundancy bits are needed.

Report an error in this question

Data Link LayerMedium

Q21. What is the exponential backoff algorithm used for in Ethernet?

  1. A.Increasing the link bandwidth
  2. B.Performing error correction tasks
  3. C.Determining wait time after collision✓ Correct
  4. D.Assigning MAC addresses to NICs

Explanation

The binary exponential backoff algorithm determines how long a station should wait before retransmitting after a collision. The wait time increases exponentially with each successive collision.

Report an error in this question

Data Link LayerHard

Q22. What is the purpose of the IEEE 802.1Q tag in Ethernet frames?

  1. A.Quality of Service marking
  2. B.VLAN identification tagging✓ Correct
  3. C.Frame payload encryption
  4. D.Error correction coding

Explanation

IEEE 802.1Q adds a 4-byte tag to Ethernet frames to identify which VLAN the frame belongs to. The tag includes a 12-bit VLAN ID field.

Report an error in this question

Data Link LayerHard

Q23. What is the difference between persistent and non-persistent CSMA?

  1. A.There is no functional difference between the two modes
  2. B.Non-persistent is significantly faster than persistent always
  3. C.Persistent transmits when idle; non-persistent waits randomly before sensing✓ Correct
  4. D.Persistent CSMA relies on a token passing mechanism

Explanation

In persistent CSMA, a station continuously senses the channel and transmits immediately when idle. In non-persistent CSMA, a station waits a random interval before sensing again if the channel is busy.

Report an error in this question

Data Link LayerHard

Q24. What is the Hamming distance needed to correct t errors?

  1. A.2t
  2. B.t + 1
  3. C.2t + 1✓ Correct
  4. D.t

Explanation

To correct t errors, the minimum Hamming distance must be 2t + 1. This ensures that even with t bit errors, the received codeword is closer to the original than any other valid codeword.

Report an error in this question

Data Link LayerHard

Q25. In the PPP (Point-to-Point Protocol) frame, what is the role of the LCP (Link Control Protocol)?

  1. A.Establishing and maintaining the link✓ Correct
  2. B.Resolving domain names for hosts
  3. C.Assigning IP addresses to endpoints
  4. D.Routing packets across the network

Explanation

LCP is responsible for establishing, configuring, maintaining, and terminating the point-to-point link. It handles authentication, compression negotiation, and link quality monitoring.

Report an error in this question

Data Link LayerHard

Q26. In Ethernet, why is there a minimum frame size requirement of 64 bytes?

  1. A.To reduce processing overhead on devices
  2. B.To support VLAN tagging in the header
  3. C.To maintain backward compatibility with hubs
  4. D.To ensure collision detection within the network✓ Correct

Explanation

The minimum frame size ensures that a frame is still being transmitted when the collision signal returns from the farthest point on the network (collision domain). This is based on the round-trip propagation delay.

Report an error in this question

Data Link LayerHard

Q27. In the HDLC protocol, what type of frame is used for flow and error control without carrying any data?

  1. A.U-frame
  2. B.P-frame
  3. C.I-frame
  4. D.S-frame✓ Correct

Explanation

S-frames (Supervisory frames) in HDLC are used for flow and error control. They carry ACK, NAK, and flow control information but no user data.

Report an error in this question

Data Link LayerHard

Q28. What is the maximum number of VLANs supported by IEEE 802.1Q?

  1. A.65535
  2. B.1024
  3. C.4094✓ Correct
  4. D.256

Explanation

IEEE 802.1Q uses a 12-bit VLAN ID field, supporting 2^12 = 4096 VLANs. VLAN 0 and 4095 are reserved, leaving 4094 usable VLANs.

Report an error in this question

Data Link LayerHard

Q29. CRC-32 used in Ethernet can detect all burst errors of length up to how many bits?

  1. A.32✓ Correct
  2. B.64
  3. C.24
  4. D.16

Explanation

CRC-32 can detect all burst errors of length 32 or fewer bits. It can also detect most burst errors longer than 32 bits with very high probability.

Report an error in this question

Data Link LayerHard

Q30. In a sliding window protocol with a window size of 7 and sequence numbers 0-7, what is the maximum sender window size in Go-Back-N?

  1. A.7✓ Correct
  2. B.8
  3. C.3
  4. D.4

Explanation

In Go-Back-N with m-bit sequence numbers (2^m = 8 here), the maximum sender window size is 2^m - 1 = 7 to prevent ambiguity.

Report an error in this question

Ready to test yourself on Data Link Layer?

Take a timed quiz drawn from 210+ questions on this topic. No signup required — your progress saves in your browser.

Start Data Link Layer Quiz