1. What is the Data Link Layer?
Layer 2 of the OSI model
Bridge between Physical and Network layers
Converts packets (from Layer 3) into frames (for Layer 1)
Uses physical (MAC) addresses, NOT logical (IP) addresses
Provides error detection (not correction)
Handles flow control and message delivery on LANs
2. Core Functions
Framing: Converts packets into frames
Physical Addressing: Uses MAC addresses for device identification
Error Detection: Uses CRC checksums to detect errors
Flow Control: Manages data transmission rate
Media Access Control: Determines how devices share network bandwidth
3. Two Sublayers (Critical for Exam!)
MAC Sublayer (Media Access Control) - IEEE 802.3:
Bottom sublayer of Layer 2
Controls how devices transmit on the network
Defines hardware (MAC) addressing
Handles physical topologies
Provides error notification (not correction)
Manages signal path
Ensures correct frame delivery
First come/first served bandwidth sharing
LLC Sublayer (Logical Link Control) - IEEE 802.2:
Upper sublayer of Layer 2
Error checking and packet synchronization
Locates Network Layer protocols
Encapsulates packets from Layer 3
Tells Data Link Layer how to process received frames
Recalculates checksums at receiving end
Manages acknowledgements
✓ Serves Network Layer (Layer 3) - provides services to layer above ✓ Error Handling - detects errors, doesn't correct them ✓ Flow Control - manages transmission rate ✓ Physical Addressing - uses MAC addresses (48-bit) ✓ Frame Creation - adds header with source/destination MAC, CRC ✓ LAN Communication - ensures messages reach correct device on local network ✓ Encapsulation/De-encapsulation - adds/removes Layer 2 headers
SENDING (Encapsulation):
Layer 3 Packet
↓
Layer 2 adds header (MAC addresses, CRC)
Layer 2 Frame created
Sent to Layer 1 for transmission
RECEIVING (De-encapsulation):
Layer 1 receives signals
Layer 2 receives frame
LLC recalculates checksum
If valid: Send ACK, pass to Layer 3
If invalid: Request retransmission
[Header | Payload | Trailer]
↓ ↓ ↓
MAC Network CRC
addresses Layer (error
(src/dst) packet checking)
Layer 2
Layer 3
Physical addressing (MAC)
Logical addressing (IP)
Frames
Packets
Switch
Router
Local delivery (LAN)
End-to-end delivery (routing)
Error detection
Error correction possible
Hardware address
Software address
Term
Definition
Data Link Layer
Layer 2 of OSI model; handles node-to-node communication and physical addressing
Frame
Layer 2 Protocol Data Unit (PDU); packet with Layer 2 header/trailer added
MAC Address
48-bit (6-byte) physical hardware address; unique identifier for network devices
Encapsulation
Process of adding Layer 2 header/trailer to Layer 3 packet
De-encapsulation
Process of removing Layer 2 header/trailer from frame
CRC (Cyclic Redundancy Check)
Error detection method using mathematical calculation
Checksum
Value calculated from frame data to detect transmission errors
Acknowledgement (ACK)
Signal sent by receiver confirming successful frame receipt
Flow Control
Mechanism to manage data transmission rate between sender/receiver
Physical Address
Hardware address (MAC address) burned into network interface
Logical Address
Software-assigned address (IP address) - Layer 3 concern
Sublayer
IEEE Standard
Function
MAC (Media Access Control)
802.3
Controls physical transmission; defines MAC addressing; error notification
LLC (Logical Link Control)
802.2
Error checking; protocol identification; packet synchronization
Physical Addressing:
Uses MAC addresses (e.g., 00:1A:2B:3C:4D:5E)
Hardware address burned into NIC (Network Interface Card)
48 bits = 6 bytes = 12 hexadecimal digits
First 3 bytes = OUI (Organizationally Unique Identifier) - vendor ID
Last 3 bytes = Device-specific identifier
Error Detection Process:
Sender: Calculates CRC from frame data, adds to trailer
Transmission: Frame sent across network
Receiver: Recalculates CRC from received data
Comparison: If calculated CRC = received CRC → Valid frame (send ACK)
If mismatch: Frame corrupted → Request retransmission
Media Access Control:
First come/first served: All devices share bandwidth
Determines when a device can transmit
Prevents/detects collisions
No priority system (everyone waits their turn)
Standard
Description
Exam Importance
IEEE 802.2
LLC sublayer standard
HIGH
IEEE 802.3
MAC sublayer standard (Ethernet)
IEEE 802.11
Wireless LAN (Wi-Fi)
MEDIUM
Protocol
Full Name
Type
Status
Exam Relevance
PPP
Point-to-Point Protocol
WAN
Current
HDLC
High-Level Data Link Control
Legacy/Current
Ethernet
LAN
VERY HIGH
Frame Relay
-
Legacy
LOW
ATM
Asynchronous Transfer Mode
FDDI
Fiber Distributed Data Interface
Item
Value
MAC Address Length
48 bits / 6 bytes
Physical address size
MAC Address Format
XX:XX:XX:XX:XX:XX
Hexadecimal notation
OUI Length
24 bits / 3 bytes
Vendor identifier portion
Layer Number
2
Data Link Layer position
PPP (Point-to-Point Protocol):
Used for WAN connections
Supports authentication (PAP, CHAP)
Provides error detection
Common for dial-up, DSL
HDLC (High-Level Data Link Control):
Cisco's default WAN protocol
Bit-oriented protocol
Cisco version is proprietary
Synchronous serial connections
Ethernet (802.3):
Most common LAN technology
Uses CSMA/CD (Carrier Sense Multiple Access/Collision Detection)
Supports various speeds (10 Mbps to 100 Gbps)
❌ WRONG: "Routers use MAC addresses to route packets"
✅ CORRECT: "Routers use IP addresses (Layer 3); switches use MAC addresses (Layer 2)"
❌ WRONG: "MAC addresses are assigned by network administrator"
✅ CORRECT: "MAC addresses are burned into hardware by manufacturer"
❌ WRONG: "Data Link Layer corrects errors"
✅ CORRECT: "Data Link Layer DETECTS errors; higher layers handle correction"
❌ WRONG: "LLC corrects corrupted frames"
✅ CORRECT: "LLC detects corruption and requests retransmission"
❌ WRONG: "LLC handles physical transmission"
✅ CORRECT: "MAC handles physical transmission; LLC handles error checking and protocol identification"
❌ WRONG: "802.3 is LLC standard"
✅ CORRECT: "802.2 = LLC; 802.3 = MAC (Ethernet)"
❌ WRONG: "Switches operate at Layer 3"
✅ CORRECT: "Switches operate at Layer 2 (some multilayer switches do both Layer 2 and 3)"
❌ WRONG: "Hubs are Layer 2 devices"
✅ CORRECT: "Hubs are Layer 1 devices; switches are Layer 2 devices"
❌ WRONG: "Data Link Layer processes packets"
✅ CORRECT: "Data Link Layer creates FRAMES from packets"
❌ WRONG: "Frames are used at Layer 3"
✅ CORRECT: "Packets = Layer 3; Frames = Layer 2; Bits = Layer 1"
❌ WRONG: "Layer 2 cares about IP addresses"
✅ CORRECT: "Layer 2 only cares about MAC addresses (physical addressing)"
❌ WRONG: "Routers care about actual physical location of devices"
✅ CORRECT: "Data Link Layer cares about physical location on LAN; routers care about logical network addresses"
❌ WRONG: "Data Link Layer handles end-to-end communication"
✅ CORRECT: "Data Link Layer handles node-to-node (hop-by-hop) communication; Network Layer handles end-to-end"
❌ WRONG: "I need to know all details of Frame Relay and ATM"
✅ CORRECT: "Know they exist and are legacy; focus on Ethernet, PPP, HDLC for CCNA"
Scenario: PC1 wants to send data to PC2 on the same LAN
LAYER 3 (Network Layer):
- Creates packet with:
- Source IP: 192.168.1.10
- Destination IP: 192.168.1.20
- Data payload
↓ Pass to Layer 2
LAYER 2 (Data Link Layer):
- Receives packet from Layer 3
- MAC sublayer adds header:
- Source MAC: AA:BB:CC:DD:EE:01
- Destination MAC: AA:BB:CC:DD:EE:02
- Calculates CRC, adds trailer
- Frame created: [Header | Packet | CRC]
↓ Pass to Layer 1
LAYER 1 (Physical Layer):
- Converts frame to electrical signals
- Transmits on cable
Scenario: Frame transmission with error checking
SENDER (PC1):
1. Creates frame with data
2. Calculates CRC: 0xA3F2
3. Adds CRC to frame trailer
4. Sends: [Header | Data | CRC: 0xA3F2]
TRANSMISSION:
Frame travels across network...
RECEIVER (PC2):
1. Receives: [Header | Data | CRC: 0xA3F2]
2. Extracts data portion
3. Recalculates CRC: 0xA3F2
4. Compares: Received CRC (0xA3F2) = Calculated CRC (0xA3F2)
5. Match! ✓ Send ACK to sender
6. Pass packet up to Layer 3
CORRUPTED SCENARIO:
Receiver calculates CRC: 0xB4E1
Compares: 0xA3F2 ≠ 0xB4E1
Mismatch! ✗ Discard frame, request retransmission
Scenario: Switch forwarding decision
SWITCH receives frame on Port 1:
- Reads destination MAC: BB:BB:BB:BB:BB:BB
- Checks MAC address table:
Port | MAC Address
-----|------------------
1 | AA:AA:AA:AA:AA:AA
2 | BB:BB:BB:BB:BB:BB
3 | CC:CC:CC:CC:CC:CC
- Finds MAC on Port 2
- Forwards frame ONLY to Port 2
- Does NOT forward to Ports 3, 4, 5...
Note: Switch ONLY looks at Layer 2 (MAC) addresses!
Scenario: Data traveling through network
PC1 → Switch1 → Router → Switch2 → PC2
Hop 1 (PC1 to Switch1):
- Source MAC: PC1's MAC
- Dest MAC: Router's MAC (port facing PC1)
- Source IP: PC1's IP
- Dest IP: PC2's IP
(MAC changes, IP stays same)
Hop 2 (Router to Switch2):
- Source MAC: Router's MAC (port facing Switch2)
- Dest MAC: PC2's MAC
(MAC changes AGAIN, IP still stays same)
KEY POINT: MAC addresses change at each hop (Layer 2)
IP addresses remain constant (Layer 3 end-to-end)
Scenario: Frame arrives at destination
FRAME ARRIVES:
[MAC Header | LLC Header | Network Layer Data | Trailer]
LLC Header contains:
- DSAP (Destination Service Access Point)
- SSAP (Source Service Access Point)
- Control information
LLC reads header:
"This frame contains an IPv4 packet"
Pass to IPv4 processing
OR
"This frame contains an IPv6 packet"
Pass to IPv6 processing
"This frame contains an ARP packet"
Pass to ARP processing
LLC's job: Identify what type of Layer 3 protocol is encapsulated
Scenario: Fast sender, slow receiver
SENDER (Fast Server):
- Can send 1000 frames/second
RECEIVER (Slow PC):
- Can only process 100 frames/second
WITHOUT FLOW CONTROL:
- Receiver overwhelmed
- Frames dropped
- Data lost
WITH FLOW CONTROL:
- Receiver signals sender: "Slow down!"
- Sender reduces transmission rate
- All frames successfully received
Problem: PC can't communicate on network
LAYER 1 CHECK:
✓ Cable plugged in
✓ Link lights on
Layer 1 is working!
LAYER 2 CHECK:
Command: show mac address-table
Result: No MAC address for this device
Problem: Layer 2 issue!
Possible causes:
- MAC address filtering enabled
- Port security violation
- VLAN mismatch
- Spanning tree blocking
Layer 2 is the problem layer!
MAC Address: 00:1A:2B:3C:4D:5E
Breaking it down:
00:1A:2B = OUI (Organizationally Unique Identifier)
Vendor: This identifies manufacturer
3C:4D:5E = Device-specific identifier
Unique to this particular device
Example Vendors:
00:1A:2B = Might be Cisco
00:50:56 = VMware
08:00:27 = Oracle VirtualBox
Total: 48 bits = 6 bytes = 12 hex digits
What is the Data Link Layer?
Layer 2 of the OSI model; responsible for node-to-node communication, physical addressing, error detection, and frame creation
What layer number is the Data Link Layer?
What does the Data Link Layer receive from the Network Layer?
What does the Data Link Layer create from packets?
What type of addressing does Layer 2 use?
Physical addressing (MAC addresses)
Does Layer 2 care about logical (IP) addresses?
No, Layer 2 only cares about physical (MAC) addresses
What is the Layer 2 Protocol Data Unit (PDU) called?
What layer does the Data Link Layer provide services to?
Network Layer (Layer 3)
What layer does the Data Link Layer receive services from?
Physical Layer (Layer 1)
Does the Data Link Layer correct errors?
No, it only DETECTS errors; it doesn't correct them
What are the two sublayers of the Data Link Layer?
MAC (Media Access Control) and LLC (Logical Link Control)
What does MAC stand for?
Media Access Control
What does LLC stand for?
Logical Link Control
Which IEEE standard defines the MAC sublayer?
Which IEEE standard defines the LLC sublayer?
Which sublayer is closer to the Physical Layer: MAC or LLC?
MAC (it's the lower sublayer)
Which sublayer is closer to the Network Layer: MAC or LLC?
LLC (it's the upper sublayer)
What is the MAC sublayer responsible for?
How packets are transmitted, hardware addressing, error notification, signal path, physical topologies, frame delivery
What is the LLC sublayer responsible for?
Error checking, packet synchronization, locating network layer protocols, encapsulation, telling Data Link how to process frames
Which sublayer handles error notification?
MAC sublayer
Which sublayer handles error checking?
LLC sublayer
What is a MAC address?
A 48-bit physical hardware address unique to each network device
How many bits is a MAC address?
48 bits (6 bytes)
How is a MAC address typically written?
12 hexadecimal digits in 6 pairs (e.g., 00:1A:2B:3C:4D:5E)
What does OUI stand for in MAC address context?
Organizationally Unique Identifier
How many bytes does the OUI occupy in a MAC address?
3 bytes (first half of MAC address)
What does the OUI identify?
The manufacturer/vendor of the network device
How many bytes are device-specific in a MAC address?
3 bytes (last half of MAC address)
Who assigns MAC addresses to devices?
The manufacturer (burned into the NIC at factory)
Can MAC addresses be changed?
Physically no (burned in), but can be spoofed in software
Where is a MAC address stored?
In the Network Interface Card (NIC) ROM
Are MAC addresses unique?
Yes, each MAC address should be globally unique
What type of address is a MAC address: logical or physical?
Physical address
What is a frame?
The Protocol Data Unit (PDU) at Layer 2; a packet with Layer 2 header and trailer added
What three main parts make up a frame?
Header, Payload (data), and Trailer
What information is in the frame header?
Source and destination MAC addresses, control information
What information is in the frame trailer?
CRC (Cyclic Redundancy Check) for error detection
What is encapsulation at Layer 2?
The process of adding a Layer 2 header and trailer to a Layer 3 packet to create a frame
What is de-encapsulation at Layer 2?
The process of removing the Layer 2 header and trailer from a frame to extract the packet
When a frame is created, what is added around the packet?
A header (containing MAC addresses) and trailer (containing CRC)
What happens to a frame when it reaches the destination device?
The Layer 2 header/trailer are removed (de-encapsulated), and the packet is passed to Layer 3
What does CRC stand for?
Cyclic Redundancy Check
What is the purpose of CRC?
To detect errors in frame transmission
Where is the CRC value placed in a frame?
n the trailer (end of frame)
How is error detection accomplished at Layer 2?
Sender calculates CRC, adds to frame; receiver recalculates CRC and compares with received value
What happens if the received CRC matches the calculated CRC?
Frame is valid; receiver sends acknowledgement (ACK) and passes data to Layer 3
What happens if the received CRC doesn't match the calculated CRC?
Frame is corrupted; receiver discards it and requests retransmission
Does Layer 2 correct errors?
No, it only DETECTS errors; correction is handled by higher layers
Which sublayer recalculates the checksum at the receiving end?
LLC (Logical Link Control) sublayer
What is an acknowledgement (ACK)?
A signal sent by the receiver confirming successful frame receipt
What does the LLC do if checksums don't match?
The transmitting device will retransmit the frame
What is flow control at Layer 2?
A mechanism to manage the rate of data transmission between sender and receiver
Why is flow control necessary?
To prevent a fast sender from overwhelming a slow receiver
What layer is responsible for flow control?
Layer 2 (Data Link Layer) - also Layer 4 has flow control
What happens without flow control?
Receiver may be overwhelmed, causing frame loss and data corruption
What is the primary Layer 2 device?
What does a switch use to make forwarding decisions?
MAC addresses
What does a switch maintain to track device locations?
MAC address table (CAM table)
At what layer does a switch operate?
Layer 2 (Data Link Layer)
At what layer does a hub operate?
Layer 1 (Physical Layer) - NOT Layer 2!
At what layer does a router operate?
Layer 3 (Network Layer)
What is a multilayer switch?
A switch that can operate at both Layer 2 and Layer 3
Do switches care about IP addresses?
No (unless it's a multilayer switch); Layer 2 switches only use MAC addresses
What is a bridge?
A Layer 2 device that connects network segments (predecessor to switches)
What is a NIC (Network Interface Card)?
A hardware component that connects a device to a network; contains the MAC address
Name three current Data Link Layer protocols.
Ethernet (802.3), PPP (Point-to-Point Protocol), HDLC
Name three legacy Data Link Layer protocols.
Frame Relay, ATM (Asynchronous Transfer Mode), FDDI
What does PPP stand for?
What type of connections does PPP support?
WAN point-to-point connections (dial-up, DSL)
What does HDLC stand for?
What is Cisco's default WAN protocol?
HDLC (Cisco proprietary version)
What does FDDI stand for?
What does ATM stand for in networking?
Is Frame Relay still commonly used?
No, it's a legacy technology (mostly replaced by MPLS, VPNs)
What is the most common LAN Data Link protocol?
Ethernet (IEEE 802.3)
What's the difference between Layer 2 and Layer 3 addressing?
Layer 2 uses physical (MAC) addresses; Layer 3 uses logical (IP) addresses
When troubleshooting, link lights are on but no communication. What layer should you check next?
Layer 2 (Physical Layer is working if link lights are on)
A device shows in the MAC address table but can't communicate. What could be wrong?
VLAN mismatch, port security, ACL, spanning tree blocking, Layer 3 issue
How can you view a switch's MAC address table?
Use command: show mac address-table
What happens when a switch receives a frame with an unknown destination MAC?
It floods the frame out all ports except the port it was received on
What is MAC address learning?
Process where switches learn which MAC addresses are on which ports by examining source MAC addresses
How long does a switch keep MAC addresses in its table?
Typically 300 seconds (5 minutes) - aging time
What is a broadcast frame?
A frame sent to all devices (destination MAC: FF:FF:FF:FF:FF:FF)
What is a unicast frame?
A frame sent to a single specific device
What is a multicast frame?
A frame sent to a group of devices
Difference between error detection and error correction?
Detection identifies errors; correction fixes them. Layer 2 only detects, doesn't correct.
Difference between MAC and IP address?
MAC = physical/hardware (Layer 2); IP = logical/software (Layer 3)
Difference between switch and router?
Switch = Layer 2 (uses MAC); Router = Layer 3 (uses IP)
Difference between frame and packet?
Frame = Layer 2 PDU; Packet = Layer 3 PDU
Difference between MAC and LLC sublayers?
MAC = physical transmission, addressing; LLC = error checking, protocol ID
What does "physical addressing" mean?
Using hardware MAC addresses (as opposed to logical IP addresses)
"What layer does a switch operate at?" → Layer 2
"What address does Layer 2 use?" → MAC (physical) address
"What are the two sublayers of Layer 2?" → MAC and LLC
"Does Layer 2 correct errors?" → No, only detects
"What is the Layer 2 PDU called?" → Frame
"Which IEEE standard defines Ethernet?" → 802.3
"Which sublayer handles error checking?" → LLC
"How many bits is a MAC address?" → 48 bits
"Switch" → Think Layer 2, MAC addresses
"MAC address" → Physical, Layer 2, doesn't change by admin
"Frame" → Layer 2 PDU
"CRC" → Error detection, not correction
"802.3" → MAC/Ethernet
"802.2" → LLC
"Error correction" → NOT Layer 2 (higher layers)
"End-to-end" → Layer 3, not Layer 2
LAYER 2 QUICK REF:
- Switch = L2 (MAC addresses)
- Frame = L2 PDU
- MAC = 48 bits (physical address)
- 802.2 = LLC (error check)
- 802.3 = MAC (Ethernet)
- Detect errors, don't correct
- MAC sublayer = bottom
- LLC sublayer = top
Watch out for:
Questions saying switches use IP addresses (wrong!)
Questions saying Layer 2 corrects errors (only detects!)
Confusing hub (L1) with switch (L2)
Thinking MAC addresses are assigned by admin (they're burned in)
Mixing up 802.2 and 802.3
If question mentions MAC address → Answer is Layer 2
If question mentions IP address → Answer is Layer 3
If question says "error correction" → NOT Layer 2
If device is "switch" → Layer 2
If device is "router" → Layer 3
Last changeda month ago