Medium Access Control (MAC)
Sublayer
• Medium Access Control (MAC) Sublayer
• The Data Link Layer of the OSI model is
divided into two sublayers:
– Logical Link Control (LLC)
– Medium Access Control (MAC)
• The MAC sublayer decides how devices share
the communication channel (like Wi-Fi,
Ethernet, etc.) without collisions.
• The biggest challenge here is the Channel
Allocation Problem.
Channel Allocation Problem
• In a network, many computers (or nodes) share a
common channel (like a wire or wireless medium).
• If two or more try to send data at the same time →
their signals collide.
• When a collision happens, the data is destroyed and
must be sent again.
• This causes wasted bandwidth (channel is used but
nothing useful delivered) and longer delays for
users.
• Therefore, the MAC sublayer’s job is to make rules
for using the channel.
• Requirements of Channel Allocation
• Efficiency
– Maximum data should pass through the channel.
– Minimum wastage due to collisions or unused slots.
• Fairness
– Every node (computer, device) must get a chance to send data.
– No node should be left waiting forever.
• Low Delay
– Data should not wait too long before being transmitted.
– Important for real-time applications (like video calls, online
gaming).
• Stability
– The system should work properly even when many users send data
at the same time.
– Performance should not collapse due to heavy load.
• Solution: Use channel allocation strategies.
• Static Allocation Fixed division of channel (time/frequency).
• Example: TDMA, FDMA.
• No collisions
• Wastage if user idle.
• Dynamic Allocation Channel assigned on demand.
• Example: ALOHA, CSMA.
• Efficient
• Collisions possible.
Allocation Method Example Pros Cons
Simple, no
Static Fixed slots TDMA, FDMA Wastage
collisions
ALOHA,
Dynamic On demand Efficient Collisions
CSMA
Static Channel Allocation
• Static Channel Allocation
• In Static Allocation, the channel is divided in advance among users.
• Each user gets a fixed portion of the channel → either by time or
frequency.
• If a user is not sending data, their portion remains unused (wastage).
• Best suited when number of users is small and traffic is predictable.
• Methods of Static Allocation:
• FDMA (Frequency Division Multiple Access) → each user gets a fixed
frequency band. Example: Like radio stations, each station has its own
frequency.
• TDMA (Time Division Multiple Access) → each user gets a fixed time slot
in every frame.
• Advantages:
Simple to implement.
No collisions between users.
Provides guaranteed bandwidth to each user.
•
• Frequency Division Multiple Access (FDMA)
• Content:
• FDMA is a channel allocation method in the MAC
sublayer.
• The available bandwidth is divided into separate
frequency bands.
• Each user is assigned a unique frequency band for
communication.
• All users can transmit simultaneously, but on different
frequencies.
• A guard band (small unused frequency gap) is kept
between users to avoid interference.
• Diagram | User A | Guard | User B | Guard | User C |
Guard | User D |
• Features:
• Each user has a dedicated frequency band.
• Users can transmit at the same time without collision.
• Guard bands prevent overlapping.
• Advantages:
• Simple to implement.
• No collisions since users use different frequencies.
• Works well for continuous traffic (like radio, telephone).
• Disadvantages:
• Guard bands waste some bandwidth.
• Fixed frequency may be underutilized if a user has no
data.
• Not flexible for varying (bursty) traffic.
• Time Division Multiple Access (TDMA)
• TDMA is a channel allocation technique used in the MAC
sublayer.
• The available channel (frequency) is divided into time slots.
• Each user is assigned a specific time slot in every frame.
• During its slot, the user can transmit data exclusively (no
other user transmits).
• After the slot ends, the next user gets the chance.
• This process repeats in a round-robin fashion.
• Frame 1 → [User A] [User B] [User C] [User D]
• Frame 2 → [User A] [User B] [User C] [User D]
• Features:
• Fixed time slots are assigned to each user.
• Works in a cyclic manner (slots repeat in every frame).
• No collision occurs since only one user transmits at a time.
• Advantages:
• Fairness: Every user gets a fixed slot.
• Collision-free: No overlapping transmissions.
• Efficient for predictable traffic.
• Disadvantages:
• If a user has no data, its slot is wasted.
• Delay: A user must wait for its turn even if the channel is
free.
• Dynamic Channel Allocation
• In Dynamic Allocation, the channel is not fixed for each user.
• Users get the channel on demand whenever they need to send data.
• If the channel is free → user can transmit.
• If two users transmit at the same time → collision occurs, which
must be handled.
• Works better when many users have bursty traffic (irregular
sending).
• Types of Dynamic Allocation Methods:
• ALOHA – Users send anytime; collisions may happen.
• CSMA (Carrier Sense Multiple Access) – User first listens to channel;
sends only if free.
• Advantages:
Efficient for large, bursty networks (like Internet/Wi-Fi).
No fixed slots or frequencies → flexible usage.
• Disadvantages:
Collisions may waste bandwidth.
• Multiple Access Protocols
• When many devices share a single channel →
collisions may occur.
• To manage this, Multiple Access Protocols are
used.
• Main ones: ALOHA & CSMA.
ALOHA Protocol
• ALOHA is a basic communication method used by many users.
• It allows all users to send data using the same channel.
• There is no need to wait for permission to send data.
• Any user can send data at any time.
• This makes it easy and fast for users to communicate.
• However, problems happen when two or more users send data at
once.
• When this happens, the data collides and gets lost.
• A collision means that the receiver cannot understand the messages.
• After a collision, each user stops sending data.
• Then, each user waits for a random amount of time.
• The random waiting time helps reduce the chance of another
collision.
• After waiting, the user tries to send the data again.
• This process continues until the data is sent successfully.
• ALOHA is simple but not very efficient because collisions
happen often.
• It works best when there are fewer users on the channel.
• If too many users send data, collisions increase, and
performance drops.
• ALOHA was one of the first methods used in wireless
communication.
• Types of ALOHA
– Pure ALOHA
– Slotted ALOHA
• Pure ALOHA
• In Pure ALOHA, users can send data at any time.
• There is no fixed time slot or schedule.
• Users just send data whenever they have it.
• If two users send data at the same time, a collision
happens.
• After the collision, users wait for a random time before
trying again.
• Because users can send data anytime, collisions are
more frequent.
• The efficiency of Pure ALOHA is about 18%.
• This means only 18% of the time the channel is used
successfully.
• Slotted ALOHA
• Slotted ALOHA divides time into equal slots.
• Users can only send data at the beginning of each time slot.
• This reduces the chance of collisions because transmissions
are synchronized.
• If two users send data in the same slot, a collision still
happens.
• But collisions are less frequent than in Pure ALOHA.
• After a collision, users wait for a random time and try again
in the next slot.
• The efficiency of Slotted ALOHA is about 37%.
• This means it uses the channel more effectively than Pure
ALOHA.
• CSMA
• CSMA is a network protocol used for sharing a
communication channel.
• Before sending data, each user checks if the channel is free.
• This process is called “carrier sensing.”
• If the channel is busy, the user waits before trying again.
• If the channel is free, the user starts sending data.
• However, if two users sense the channel free at the same
time, a collision can still happen.
• After a collision, users stop sending data.
• Then they wait for a random time before trying again.
• CSMA reduces the chances of collisions compared to ALOHA.
• It is widely used in Ethernet and wireless networks.
1. CSMA/CD (Collision Detection)
2. CSMA/CA (Collision Avoidance)
• 1. CSMA/CD (Collision Detection)
• It is used in wired networks like Ethernet cables.
• A computer sends data only if the line is free.
• While sending, it keeps checking if another computer is sending data at
the same time.
• If it finds a collision (two computers sending data together), it stops
sending.
• It waits for some random time and then tries to send again.
• 2. CSMA/CA (Collision Avoidance)
• It is used in wireless networks like Wi-Fi.
• Computers try to avoid collisions before they send data.
• They wait for a random time and check if the line is free.
• They also send signals to other devices to let them know that they are
about to send data.
• This helps reduce collisions and makes communication smoother.
• What is Collision?
• In a network, a collision happens when two or more
devices try to send data at the same time on the same
communication channel. This causes data packets to
interfere with each other, and the information is lost or
corrupted.
• What are Collision-Free Protocols?
• Collision-free protocols are methods used in computer
networks to completely prevent collisions by controlling
when each device can send data.
• ✔ They ensure that only one device sends data at a time.
✔ They are carefully organized so that collisions do not
occur.
• Types of Collision-Free Protocols
• Polling
• A central controller asks devices one by one if they want
to send data.
• Only the device being polled can transmit at that time.
• Example: Teacher asking students one by one if they have
something to say.
• Advantages:
✔ Simple to manage
✔ Prevents collisions completely
• Disadvantages:
Can be slow if there are many devices
Wastes time if devices have nothing to send
• Token Passing
• A small control packet called a "token" circulates
between devices.
• Only the device holding the token can transmit
data.
• Advantages:
✔ Fair and orderly
✔ Prevents collisions
• Disadvantages:
If the token is lost, communication is disrupted
Requires more complex control mechanisms
• Introduction to Limited Contention Protocols
• Limited contention protocols are special methods used
in computer networks to manage how multiple devices
share the same communication channel.
They combine the best features of both
• contention protocols (like ALOHA or CSMA)
• collision-free protocols (like polling or Token Passing).
•
The main idea is that when there are only a few users,
contention is allowed, but when the number of users
increases, contention is reduced using controlled access.
This makes limited contention protocols more efficient
and fair compared to pure contention protocols.
• Why Limited Contention is Needed
• In contention-based methods, if too many users try
to send data at the same time, there will be many
collisions, which wastes bandwidth.
On the other hand, in collision-free methods, the
channel is divided strictly, which can waste
bandwidth when some users are idle.
Limited contention protocols solve this problem by
dividing time into slots and allowing only a certain
group of users to compete for the channel at a time.
This reduces collisions, increases efficiency, and
ensures fair access for all users.
• Examples of Limited Contention Protocols
• Several protocols are designed using the principle of
limited contention:
• Tree Protocol: Devices are arranged in a logical tree
structure. When a collision happens, only the branch with
collisions is further divided, which reduces wasted time.
• Binary Countdown Protocol: Each device has a binary
address. Devices broadcast their addresses bit by bit, and
the one with the highest priority continues, while others
back off.
• Adaptive Tree Walk Protocol: This improves the tree
protocol by dynamically adjusting how users are divided
depending on traffic.
Advantages and Applications
• Limited contention protocols are very useful because
they balance efficiency and fairness.
They minimize collisions compared to pure
contention protocols, and they also avoid wasted
slots compared to collision-free protocols.
These protocols are especially suitable for networks
where the number of active users changes frequently.
They are used in situations such as satellite
communication, wireless LANs, and other shared
channel systems where efficient access is important.
• Introduction to IEEE 802 Standards
• The IEEE (Institute of Electrical and Electronics Engineers) has developed a
family of standards called IEEE 802.
These standards define how Local Area Networks (LANs) and Metropolitan
Area Networks (MANs) work at the data link layer and the physical layer of
the OSI model.
The purpose of these standards is to make sure that different devices and
technologies can communicate with each other smoothly.
The IEEE 802 standards are the foundation of both wired networks (like
Ethernet) and wireless networks (like Wi-Fi and Bluetooth).
• The IEEE 802 standards are divided into two parts:
• Logical Link Control (LLC) – This is defined by IEEE 802.2. It provides services
like flow control and error control that are common to all LAN protocols.
• Medium Access Control (MAC) – This is defined by different IEEE 802
standards such as 802.3, 802.5, and 802.11. It describes how devices access
the shared channel.
Together, the LLC and MAC sublayers ensure reliable communication across
the network.
• Introduction to Bridges
• A bridge is a networking device that connects two or
more Local Area Networks (LANs) or segments of a
LAN.
It works at the Data Link Layer (Layer 2) of the OSI
model.
The main function of a bridge is to forward data frames
from one network to another only when necessary.
By doing this, bridges reduce unnecessary traffic and
improve network performance.
• Important IEEE 802 Standards for LANs
• IEEE 802.3 – Ethernet: This uses CSMA/CD for channel
access and is the most widely used LAN technology today.
• IEEE 802.5 – Token Ring: This uses a token passing
method where only the device with the token can send
data. It was popular in IBM networks but is now obsolete.
• IEEE 802.11 – Wireless LAN (Wi-Fi): This uses CSMA/CA to
avoid collisions in wireless communication. It is widely
used in homes, offices, and public places.
• mportant IEEE 802 Standards for MANs and Other Networks
• IEEE 802.6 – MAN (DQDB – Distributed Queue Dual Bus): This
standard was designed for Metropolitan Area Networks and
used two unidirectional buses for communication.
• IEEE 802.15 – Wireless Personal Area Networks (WPANs): This
includes technologies such as Bluetooth and ZigBee, which are
used for short-range communication.
• IEEE 802.16 – WiMAX: This was developed for providing high-
speed wireless internet over long distances in Metropolitan Area
Networks.
• IEEE 802.17 – Resilient Packet Ring: This was designed for
reliable and efficient packet transport in MANs.
• How a Bridge Works
• A bridge receives a data frame from one side of the
network and checks the MAC address of the
destination device.
• If the destination is in the same network segment,
the bridge discards the frame (no need to send it).
• If the destination is in a different segment, the bridge
forwards the frame only to that segment.
Bridges use a MAC address table to remember which
devices are connected to which network segment.
This helps them make smart forwarding decisions and
reduce collisions.
• Types of Bridges
• Transparent Bridge:
– Used in Ethernet networks.
– Automatically builds a MAC address table by
learning addresses.
• Source Routing Bridge:
– Used in Token Ring networks.
– The sending computer decides the entire route of
the frame.
• Translational Bridge:
– Connects different types of networks (e.g.,
Ethernet to Token Ring).
• Advantages and Limitations of Bridges
• ✅ Advantages:
• Reduces traffic by filtering frames.
• Connects different LAN segments.
• Improves overall performance compared to a simple hub.
• Easy to install and use.
• ❌ Limitations:
• Works only at Data Link Layer (Layer 2), so cannot
understand IP addresses.
• Slower than switches, since bridges process each frame
in software.
• Not suitable for very large networks with heavy traffic.
• What is a VLAN?
• A Virtual Local Area Network (VLAN) is a method of
creating separate logical networks within a single physical
network.
Even if all devices are connected to the same physical
switch, they can be grouped into different VLANs.
This allows administrators to organize devices based on
function, department, or security needs instead of physical
location.
For example, computers in the Accounts department can be
grouped into one VLAN, and computers in HR can be
grouped into another VLAN.
• Why VLANs are Needed
• In a traditional LAN, all devices share the same
broadcast domain, which creates unnecessary traffic
and reduces performance.
VLANs solve this problem by dividing a network into
smaller, isolated broadcast domains.
This reduces congestion, improves security, and makes
network management easier.
VLANs also allow flexibility because devices can be
moved to another group without changing physical
connections.
• How VLANs Work
• VLANs are implemented using network switches.
Each port on a switch can be assigned to a specific
VLAN.
When a frame enters the switch, the VLAN tag tells the
switch which VLAN the frame belongs to.
Devices in the same VLAN can communicate directly,
but devices in different VLANs need a router or Layer 3
switch to communicate.
This separation increases both security and control over
network traffic.
• Advantages of VLANs
• ✅ Improved Security: Sensitive data is kept separate by
isolating departments or user groups.
✅ Reduced Traffic: Broadcasts are limited to only the
devices within the same VLAN.
✅ Flexibility: Devices can be grouped logically instead of
by physical location.
✅ Better Network Management: VLANs make it easy to
control and organize large networks.
✅ Cost-Effective: No need for extra cabling or hardware;
configuration is done in software.