DATA LINK AND PHYSICAL LAYERS
• In the OSI model, the data link layer is the 2nd layer from the bottom.
• It is responsible for transmitting frames from one node to next node.
• The main responsibility of the Data Link Layer is to transfer the datagram across an individual
link.
• An important characteristic of a Data Link Layer is that datagram can be handled by different
link layer protocols on different links in a path.
The other responsibilities of this layer are :
1. Framing - Divides the stream of bits received into data units called frames.
2. Physical addressing – If frames are to be distributed to different systems on the same
network, data link layer adds a header to the frame to define the sender and receiver.
3. Flow control- If the rate at which the data are absorbed by the receiver is less than the rate
produced in the sender ,the Data link layer imposes a flow control mechanism.
o
4. Error control- Used for detecting and retransmitting damaged or lost frames and to prevent
duplication of frames. This is achieved through a trailer added at the end of the frame.
5. Medium Access control - Used to determine which device has control over the link at any
given time.
Two Categories of Links
Point- to-Point link and Broadcast link.
• In a point-to-point link, the link is dedicated to the two devices
• In a broadcast link, the link is shared between several pairs of devices.
Sublayers in Data Link layer
• We can divide the data-link layer into two sublayers: data link control(DLC) and media access
control (MAC).
• The data link control sublayer deals with all issues common to both point-to-point and
broadcast links
• The media access control sublayer deals only with issues specific to broadcast links.
DLC SERVICES
• The data link control (DLC) deals with procedures for communication between two adjacent
nodes—node-to-node communication—no matter whether the link is dedicated or broadcast.
• Data link control service include
(1) Framing (2) Flow Control (3) Error Control
1. FRAMING
• The process of dividing the bit stream received from the network layer into manageable
frames for transmission.
• The data-link layer packs the bits of a message into frames, so that each frame is
distinguishable from another.
• Although the whole message could be packed in one frame, that is not normally done.
• One reason is that a frame can be very large, making flow and error control very inefficient.
Methods of Framing:
[Link] Count
•Frame starts with a field specifying the number of characters in the frame.
•Problem: Errors in count field can cause loss of synchronization.
[Link] Stuffing
•Uses special start and end characters (e.g., FLAG = DLE STX and DLE ETX).
•If same character appears in data, extra escape character is stuffed.
[Link] Stuffing
•Frames start and end with a special flag pattern (e.g., 01111110 in HDLC).
•Sender inserts a 0 after every sequence of 5 consecutive 1s in data.
[Link] Layer Coding Violations
•Special signal patterns are used that cannot occur in normal data encoding.
Character Stuffing
Bit Stuffing
Flow Control
Definition: Mechanism to regulate the amount of data sender transmits so that receiver is not
overwhelmed.
Techniques:
1. Stop-and-Wait
Sender transmits one frame at a time and waits for acknowledgment (ACK).
Simple but inefficient for long-distance links.
The acknowledgement may not arrive because of the following threescenarios :
1. Original frame is lost
2. ACK is lost
3. ACK arrives after the timeout
PIGGYBACKING
• A method to combine a data frameA method to combine a data frame
• Piggybacking saves bandwidth
• Station A and B both have data toStation A and B both have data to
• Instead of sending separately,station A sends a data frame thatInstead of
sending separately,station A sends a data frame that
• Station B does the same thing.
2. Sliding Window Protocol
Allows multiple frames to be in transit before ACK is received.
Window size defines maximum number of outstanding unacknowledged frames.
Variants:
Go-Back-N ARQ: If an error occurs, retransmit that frame and all following frames.
Selective Repeat ARQ: Only retransmit the erroneous frame.
ERROR CONTROL
Data can be corrupted during transmission. For reliable communication, errors must be detected
and corrected. Error Control is a technique of error detection and retransmission.
TYPES OF ERRORS
SINGLE-BIT ERROR
The term Single-bit error means that only one bit of a given data unit (such as byte, character,
data unit or packet) is changed from 1 to 0 or from 0 to 1.
BURST ERROR
The term Burst Error means that two or more bits in the data unit have changed from 1 to 0 or
from 0 to 1.
ERROR DETECTION TECHNIQUES /METHODS
The basic idea behind any error detection scheme is to add additional information to a frame
that can be used to determine if errors have been introduced.
PARITY CHECK
• One bit, called parity bit is added to every data unit so that the total number of 1‘s in the data
unit becomes even (or) odd.
• The source then transmits this data via a link, and bits are checked and verified at the
destination.
1. Even parity – Maintain even number of 1s
E.g., 1011 → 1011 1
2. Odd parity – Maintain odd number of 1s
E.g., 1011 → 1011 0
CYCLIC REDUNDANCY CHECK
• Cyclic codes refers to encoding messages by adding a fixed-length check value.
• CRCs are popular because they are simple to implement, easy to analyze mathematically and
particularly good at detecting common errors caused intransmission channels.
Ethernet Basics
Ethernet is the most widely used Local Area Network (LAN) technology. It uses
frames to transport data, typically over bus or star topologies, and operates using
MAC addresses for device identification. The Ethernet protocol governs how
devices transmit frames and communicate, ensuring reliable node-to-node
delivery.
Ethernet supports both half-duplex and full-duplex transmission, with speeds
ranging from 10 Mbps to 10 Gbps or more.
It uses a unique frame format with headers for addressing and error detection.
CSMA/CD
Carrier Sense Multiple Access with Collision Detection (CSMA/CD) is the MAC
protocol used in traditional Ethernet LANs.
Devices listen (“carrier sense”) for transmissions before sending their data
(“multiple access”); if the channel is busy, they wait.
If two devices transmit simultaneously, a collision occurs. Both devices detect
this (“collision detection”), stop transmitting, and wait a random time before
retrying.
Modern high-speed Ethernets (like Gigabit Ethernet) often use switching and
full-duplex links that no longer require CSMA/CD.
Virtual LAN (VLAN)
A Virtual LAN (VLAN) segments a physical network into multiple logical networks.
Each VLAN is treated as a separate network—devices in the same VLAN can
communicate directly, even if on different switches.
VLANs improve security and management by isolating traffic and controlling
broadcast domains.
Configuration is managed on switches, typically using protocols like IEEE 802.1Q
for VLAN tagging.
Wireless LAN (802.11)
Wireless LANs (WLANs) are LANs that use wireless technology for connectivity,
commonly based on the IEEE 802.11 standards.
Devices communicate via radio frequencies, typically using protocols like Wi-Fi
(802.11a/b/g/n/ac/ax).
The main components are access points and wireless clients, and topologies can
be infrastructure-based or ad hoc.
WLANs feature their own MAC-level protocols for collision avoidance,
authentication, and encryption.
Physical Layer: Data and Signals
The Physical Layer defines the electrical, mechanical, and procedural means to
activate, maintain, and deactivate physical connections.
It deals with data transmission as signals: these can be analog or digital,
representing bits via voltage, light, or radio waves.
Key functions include specifying pin layouts, cable types, transmission rates, and
modulation schemes.
Transmission modes: simplex (one-way), half-duplex (two-way, not
simultaneous), and full-duplex (two-way, simultaneous).
Performance
Performance in networking describes the speed, reliability, and efficiency of data
transmission.
Key metrics include bandwidth, latency, throughput, and error rates.
Optimizing performance involves reducing collisions, using efficient protocols,
and selecting suitable transmission media.
Transmission Media
Transmission media are the physical pathways for data transfer:
Guided Media: Twisted pair cables, coaxial cables, fiber optics.
Unguided Media: Wireless (radio waves, microwaves, infrared).
Characteristics affect bandwidth, attenuation, noise, and security.
Switching
Switching enables communication between different network devices and
segments:
A switched network uses switches to connect devices dynamically and facilitate
efficient communication.
Switching architectures solve the problem of direct pairwise connections
becoming impractical as network size grows.
Circuit Switching
Circuit Switching establishes a dedicated path between sender and receiver for the
duration of a communication session.
Used in traditional telephony: a fixed circuit is reserved and released after
communication ends.
Advantages: consistent and predictable quality.
Disadvantages: resource inefficiency when channels are idle and
setup/teardown overhead for each connection.