Unit 3: Data link layer and Ethernet
Computer Networks-I notes · PTU syllabus (UGCC2517)
On this page
Unit summary
The data link layer moves frames between devices on the same network and handles errors. Ethernet is the most common LAN technology. This unit covers framing, error detection and correction, flow control, Ethernet standards and frames, MAC addresses, ARP and switching.
After this unit you can
- Explain the functions of the data link layer and framing
- Detect and correct errors using parity, checksum, CRC and Hamming code
- Explain stop-and-wait and sliding-window flow control
- Describe Ethernet frames, MAC addressing, ARP and switching
PTU syllabus topics
- Functions of the data link layer
- framing
- error detection and correction
- flow control
- Ethernet standards and frame structure
- MAC addressing and ARP
- Ethernet switching
- Framing
- Splitting data into frames
- MAC address
- 48-bit hardware address of a network card
- ARP
- Finds the MAC address for an IP address
- CRC
- Detects transmission errors
- Flow control
- Stops a fast sender overwhelming a slow receiver
Topic 1
Functions of the data link layer
The data link layer provides framing, physical (MAC) addressing, error control, flow control and access control (who may use the shared medium). It has two sublayers: LLC (logical link control) and MAC (media access control). Framing methods: character count, byte stuffing (flag bytes with escape characters), bit stuffing (insert a 0 after five 1s) and physical-layer coding violations.
Topic 2
Error detection and correction
Parity check
Adds one bit to make the number of 1s even (or odd)
Single-bit errors
Checksum
Adds data segments; sends the complement of the sum
Most errors; used in IP, TCP
CRC
Divides data by a generator polynomial; sends the remainder
Burst errors; used in Ethernet
Hamming code both detects and corrects single-bit errors by placing parity bits at positions 1, 2, 4, 8 … The Hamming distance between two codewords is the number of bit positions in which they differ.
Example
Hamming distance between 10110 and 11100 is 2 (positions 2 and 4 differ). A code with minimum distance d detects d − 1 errors and corrects (d − 1)/2.
Topic 3
Flow control
- Stop-and-wait: the sender sends one frame and waits for an acknowledgement (ACK). Simple but slow.
- Sliding window: the sender may send several frames (the window size) before needing ACKs. Error recovery uses Go-Back-N (resend from the lost frame) or Selective Repeat (resend only the lost frame).
Topic 4
Ethernet, MAC addressing and ARP
Ethernet (IEEE 802.3) is the standard LAN technology: 10BASE-T (10 Mbps), Fast Ethernet (100 Mbps), Gigabit Ethernet (1 Gbps) and 10 Gigabit Ethernet. Classic Ethernet uses CSMA/CD (carrier sense multiple access with collision detection).
| Ethernet frame field | Size |
|---|---|
| Preamble + SFD | 8 bytes |
| Destination MAC | 6 bytes |
| Source MAC | 6 bytes |
| Type/Length | 2 bytes |
| Data | 46–1500 bytes |
| FCS (CRC) | 4 bytes |
A MAC address is a 48-bit hardware address burnt into a NIC, written in hex (00:1A:2B:3C:4D:5E). ARP (Address Resolution Protocol) finds the MAC address for a known IP address on the local network by broadcasting a request. Ethernet switching: a switch learns which MAC address is on which port, builds a MAC address table, and forwards frames only to the right port (flooding unknown destinations).
Key terms
- Frame
- A unit of data at the data link layer
- CRC
- Cyclic redundancy check, an error-detection method
- Hamming distance
- Number of differing bit positions between codewords
- MAC address
- A 48-bit hardware address of a network interface
- ARP
- Protocol mapping IP addresses to MAC addresses
Quick revision
- DLL: framing, MAC addressing, error and flow control.
- Parity (single bit), checksum, CRC (burst errors); Hamming corrects.
- Stop-and-wait vs sliding window (Go-Back-N, Selective Repeat).
- MAC = 48 bits; ARP: IP → MAC; Ethernet uses CSMA/CD.
Important exam questions
Practice questions written to the PTU exam pattern for this unit's syllabus: short answers (Section A style) and long answers (Sections B and C style).
Short-answer questions
- Q1.List the functions of the data link layer.
- Q2.What is bit stuffing?
- Q3.Differentiate between error detection and error correction.
- Q4.Find the Hamming distance between 1101 and 1000.
- Q5.What is a MAC address?
- Q6.What is the role of ARP?
Long-answer questions
- Q1.Explain error detection methods: parity, checksum and CRC, with examples.
- Q2.Explain Hamming code for error correction.
- Q3.Explain stop-and-wait and sliding window protocols.
- Q4.Explain the Ethernet frame format and how a switch forwards frames.
Stuck on this unit?
Message SBS on WhatsApp for help with Computer Networks-I, or to ask about studying BCA at Synetic.
