DEBRE BERHAN UNIVERSITY
COLLEGE OF COMPUTING
DEPARTMENT OF INFORMATION TECHNOLOGY
Advanced Computer Networking and
Communications
Course Code: CNS 6112
CHAPTER FIVE
DATA LINK LAYER
Binyam Tekalign
[Link]@[Link]
2018
Outline
• Link Layer Introduction
• Main Function of Link Layer
• Network interface card
• Point-to-Point Protocol
• Link Layer Switches
Data Link Layer
• Second layer
• Performs functions such as
1. Framing,
2. Physical addressing,
3. Flow control.
4. Access control
5. Error detection,
1. Framing
• Process of encapsulating a packet of data with additional information
• It helps in its transmission across a physical medium.
• The goal of framing is to define the boundaries of individual frames within the
stream of bits transmitted over the network.
• This process is essential for the receiver to correctly identify the start and end of
each frame and extract the payload for further processing.
• Frame Start and End Delimiters:
• The frame begins with a start delimiter and ends with an end delimiter.
• These delimiters are specific bit patterns that signify the start and end points of a
frame.
1. Framing
1. Framing
• Addressing Information:
• Source and destination MAC (Media Access Control) addresses will be added.
• Help to directing the frame to the intended recipient.
• Frame Length or Type
• Indicates the size of the frame or specifies the type of payload it carries.
• Payload
• The payload contains the actual data being transmitted
• Frame Check Sequence (FCS)
• Value computed over the frame's contents.
• It is used for error detection,
• Allows the receiver to verify the integrity of the received frame.
2. MAC Address / Physical addressing
• A MAC address is a unique identifier assigned to the network interface
controller (NIC) of a device.
• It is also known as a hardware address or physical address.
• MAC addresses are assigned by the manufacturer and are intended to be
globally unique.
• 48 bits in length
• Help devices on a local network segment to identify each other.
• Address Resolution Protocol (ARP):
• Used to map an IP address to its corresponding MAC address within a local network
3. Flow Control
• Managing and controlling of the rate of data transmission
between a sender and a receiver
• Speed matching mechanism
• To prevent congestion and ensure reliable communication.
• Sliding Window Protocol:
• Allows a sender to transmit multiple frames before receiving acknowledgment
from the receiver.
• It helps optimize data transfer efficiency by keeping the network pipeline full.
• Stop-and-Wait Protocol:
• Sender transmits one frame and waits for acknowledgment from the receiver before
sending the next frame.
4. Access Control
• Refers to the mechanisms that are used to regulate which devices are allowed to transmit
data over the physical communication link.
• The goal is to avoid collisions, manage contention, and ensure fair and efficient use of the
network resources.
• Carrier Sense Multiple Access (CSMA)
• Before transmitting, a device listens to the communication medium to determine if it is
idle (no ongoing transmissions).
• If the medium is sensed as idle, the device starts transmitting its data.
• However, collisions can still occur if two devices start transmitting simultaneously
4. Access Control
• Carrier Sense Multiple Access /Collision Detection (CSMA/CD)
• In CSMA/CD networks, if devices detects a collision during transmission, it
immediately stop sending data.
• After a collision, a backoff mechanism is often employed,
• Devices wait for a random period before attempting to retransmit.
• CSMA/CD is most effective in shared Ethernet networks where devices can detect
collisions.
• Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA)
• CSMA/CA is commonly used in wireless networks to avoid collisions in the absence of
collision detection.
• Devices using CSMA/CA listen to the medium and wait for it to be clear before
transmitting to reduce the chances of collisions
4. Access Control
• Token Passing
• In token-passing networks, a token (a special control frame)
circulates among devices.
• Only the device possessing the token is allowed to transmit data.
• After transmitting, the device releases the token,
allowing the next device in line to use it.
• Reservation-based Protocols
• Some networks use reservation-based protocols where devices request and reserve the
right to use the communication medium for a specified duration.
• This helps avoid contention by allowing devices to plan their transmissions.
5. Error Control
• Error detection and Error correction
• Error Detection
• Parity Bits: Parity bits are simple error detection mechanisms.
• An extra bit is added to each byte or group of bits, making the
total number of ones either even (even parity) or odd (odd
parity).
• Differences in the parity bit indicate the presence of errors.
• Cyclic Redundancy Check (CRC): CRC is a more
sophisticated error detection method.
5. Error Control
• Automatic Repeat reQuest (ARQ)
• ARQ is a set of protocols that allows the receiver to detect errors and request
retransmission of corrupted frames.
• Stop-and-Wait ARQ: the sender transmits one frame and waits for acknowledgment
from the receiver before sending the next frame.
• If acknowledgment is not received, the sender assumes that the frame was lost or
corrupted and retransmits it.
• Sliding Window ARQ: Sliding Window protocols allow multiple frames to be in transit
simultaneously.
• The sender maintains a window of frames awaiting acknowledgment, and the receiver
acknowledges frames in sequence.
• This allows for more efficient use of network bandwidth.
5. Error Control
• Forward Error Correction (FEC)
• FEC involves adding redundant bits to the transmitted data to allow the receiver to
detect and correct errors without the need for retransmission.
• Selective Repeat ARQ
• The receiver individually acknowledges correctly received frames and requests
retransmission only for frames with errors.
• Frame Check Sequence (FCS)
• FCS is a field in the frame that contains a checksum or hash value computed over the
frame's contents.
• The receiver uses the FCS to verify the integrity of the received frame.
Network interface card NIC
• NIC is a hardware component that enables a device to connect to a
network and send/receive data.
• The NIC is the boundary between the computer and the network.
• A NIC primarily operates at Layer 1 and Layer 2 of the OSI model.
• Layer 1 (Physical)
• Signal transmission (electrical, optical, radio)
• Layer 2 (Data Link)
• Framing
• MAC addressing
• Error detection (CRC)
Network interface card NIC
• Every NIC has a unique MAC address
• 48-bit address (e.g., [Link])
• Burned into hardware (can be spoofed in software)
• MAC Address Structure
• First 24 bits → OUI (manufacturer)
• Last 24 bits → Device-specific
• Teaching analogy:
• IP address = logical address
MAC address = physical identity of the NIC
Function of a NIC
• Transmission Side
• Encapsulates data into frames
• Adds source & destination MAC
• Converts bits into signals
• Reception Side
• Receives signals
• Checks destination MAC
• Performs error checking
• Passes data to OS/network stack
Network interface card NIC
• In each and every host link layer
implemented in “adaptor”
• Network interface card NIC
application
• Ethernet card, transport
network cpu memory
• 802.11 card; link
• Combination of hardware, software, host
bus
firmware link
controller (e.g., PCI)
physical
physical
transmission
network adapter
card
PPP : Point-to-Point Protocol
• Primarily designed for establishing a direct communication link between
two network devices
• Usually connecting two routers
• Often used for connecting routers to an Internet Service Provider (ISP) via
a dial-up or broadband connection.
• PPP frames have a specific structure comprising a header, payload, and
trailer.
• The header includes control and address fields, and the trailer may contain
a Frame Check Sequence (FCS) for error detection
• PPP uses a flag sequence to mark the beginning and end of frames.
PPP
• Has high speed
• Link Control Protocol (LCP):
• Responsible for establishing, configuring, and testing the data link connection
between two devices.
• Negotiates parameters such as authentication methods, maximum frame size,
and options for error detection.
• PPP supports various authentication protocols to ensure secure
communication between devices.
• Password Authentication Protocol (PAP) and
• Challenge Handshake Authentication Protocol (CHAP).
Link Layer Switches
• Devices that operate at the Link Layer and facilitate communication within a
local network
• Use MAC addresses to forward frames selectively to the appropriate destination
device.
• Unlike hubs, switches create separate collision domains for each port, reducing
the likelihood of collisions and improving network efficiency.
Link Layer Switches
• Switches can be configured
to support VLANs,
• Allowing the segmentation
of a network into logically
isolated broadcast domains.
• Devices within the same
VLAN can communicate as
if they were on the same
physical network.
Link Layer Switches
• Switches maintain MAC address tables, associating MAC addresses with the
corresponding switch ports.
• When a frame arrives, the switch consults its table to determine the port to
which the frame should be forwarded.
• Managed switches offer additional features like VLAN support, Quality of
Service (QoS), and port mirroring.
Multimedia