0% found this document useful (0 votes)
40 views22 pages

Unit 2 (DCN) v1

Communication notes

Uploaded by

Karan nawani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views22 pages

Unit 2 (DCN) v1

Communication notes

Uploaded by

Karan nawani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 22

Medium Access Control in Computer Network

What is Medium Access Control?


A sublayer of the Data Link Layer (Layer 2) in the OSI (Open
Systems Interconnection) model of computer networking is
called Medium Access Control (MAC).
Its main duty is to control access to a network's shared
communication medium, ensuring that various devices can
transmit data effectively and fairly over a common
communication path like a wired Ethernet or wireless Wi-Fi
network.
Function of Medium Access Control
A computer network's Medium Access Control (MAC) layer
performs several crucial tasks to control access to the shared
communication medium.
Its main responsibility is preventing collisions while ensuring
multiple devices can transmit data fairly and efficiently over a
shared communication channel.
The MAC layer performs the following primary tasks:
1. Random Access Protocol
In this, all stations have same superiority that is no station
has more priority than another station.
Any station can send data depending on medium’s state( idle
or busy). It has two features:
 There is no fixed time for sending data
 There is no fixed sequence of stations sending data
The Random access protocols are further subdivided as:
ALOHA
It was designed for wireless LAN but is also applicable for
shared medium. In this, multiple stations can transmit data at
the same time and can hence lead to collision and data being
garbled.

Pure ALOHA
• In pure ALOHA, the stations transmit frames whenever they
have data to send.
• When two or more stations transmit simultaneously, there
is collision and the frames are destroyed.
• In pure ALOHA, whenever any station transmits a frame, it
expects the acknowledgement from the receiver.
• If acknowledgement is not received within specified time,
the station assumes that the frame (or acknowledgement)
has been destroyed.
• If the frame is destroyed because of collision the station
waits for a random amount of time and sends it again. This
waiting time must be random otherwise same frames will
collide again and again.
• Therefore pure ALOHA dictates that when time-out period
passes, each station must wait for a random amount of time
before re-sending its frame. This randomness will help avoid
more collisions.
• Figure shows an example of frame collisions in pure ALOHA.

In fig there are four stations that .contended with one


another for access to shared channel. All these stations are
transmitting frames. Some of these frames collide because
multiple frames are in contention for the shared channel.
Only two frames, frame 1.1 and frame 2.2 survive. All other
frames are destroyed.
• Whenever two frames try to occupy the channel at the
same time, there will be a collision and both will be damaged.
If first bit of a new frame overlaps with just the last bit of a
frame almost finished, both frames will be totally destroyed
and both will have to be retransmitted.

Slotted ALOHA
• Slotted ALOHA was invented to improve the efficiency of
pure ALOHA as chances of collision in pure ALOHA are very
high.
• In slotted ALOHA, the time of the shared channel is divided
into discrete intervals called slots.
• The stations can send a frame only at the beginning of the
slot and only one frame is sent in each slot.

• In slotted ALOHA, if any station is not able to place the


frame onto the channel at the beginning of the slot i.e. it
misses the time slot then the station has to wait until the
beginning of the next time slot.
• In slotted ALOHA, there is still a possibility of collision if two
stations try to send at the beginning of the same time slot as
shown in fig.
• Slotted ALOHA still has an edge over pure ALOHA as
chances of collision are reduced to one-half.
Protocol Flow Chart for ALOHA
Fig. shows the protocol flow chart for ALOHA
CSMA
Carrier Sense Multiple Access ensures fewer collisions as the
station is required to first sense the medium (for idle or
busy) before transmitting data. If it is idle then it sends data,
otherwise it waits till the channel becomes idle.
However there is still chance of collision in CSMA due to
propagation delay. For example, if station A wants to send
data, it will first sense the medium.
If it finds the channel idle, it will start sending data. However,
by the time the first bit of data is transmitted (delayed due to
propagation delay) from station A, if station B requests to
send data and senses the medium it will also find it idle and
will also send data.
This will result in collision of data from station A and B.
 1-Persistent: The node senses the channel, if idle it
sends the data, otherwise it continuously keeps on
checking the medium for being idle and transmits
unconditionally(with 1 probability) as soon as the
channel gets idle.
 Non-Persistent: The node senses the channel, if idle it
sends the data, otherwise it checks the medium after a
random amount of time (not continuously) and
transmits when found idle.
 P-Persistent: The node senses the medium, if idle it
sends the data with p probability. If the data is not
transmitted ((1-p) probability) then it waits for some
time and checks the medium again, now if it is found
idle then it send with p probability. This repeat continues
until the frame is sent. It is used in Wifi and packet radio
systems.
 O-Persistent: Superiority of nodes is decided beforehand
and transmission occurs in that order. If the medium is
idle, node waits for its time slot to send data.
CSMA/CD
Carrier sense multiple access with collision detection.
Stations can terminate transmission of data if collision is
detected

CSMA/CD (Collision Detection) – Used in Wired Networks:


 How It Works:
o Carrier Sense: Before transmitting, a node listens to
the channel to see if it is free (i.e., no other node is
transmitting).
o Multiple Access: Multiple nodes share the same
communication medium.
o Collision Detection: If two nodes transmit
simultaneously, a collision occurs. The collision is
detected because the signals interfere with each
other, causing a significant disturbance in the signal
that both transmitting nodes can detect. Upon
detecting a collision, each node stops transmitting
and waits for a random period before trying again.
o Used In: Wired networks like Ethernet.
The Maximum Time C can wait for collision
signal to reach is equal to 20 minutes from
12 pm i.e. 12 20
If a signal reaches after 12 20 it will be
discarded
 How It Works:
o Carrier Sense: Similar to CSMA/CD, a node first
checks if the channel is free before attempting to
transmit.
o Collision Avoidance: Instead of just transmitting as
soon as the channel is free (like in CSMA/CD), the
node waits for a random backoff time after sensing
the channel is idle. This random delay reduces the
chances of multiple nodes transmitting at the same
time, which would lead to a collision.
o Acknowledgment: After transmitting the data, the
sender waits for an acknowledgment from the
receiver. If the acknowledgment is received, the
transmission is considered successful. If no
acknowledgment is received, the sender assumes a
collision occurred and retries after a backoff period.
o Collision Detection: In wireless networks, detecting
collisions is more challenging because the
transmitter may not be able to sense a collision if it
occurs at the receiver’s end (due to the hidden
node problem or signal attenuation). Therefore,
CSMA/CA focuses on avoiding collisions rather than
detecting them.
o Used In: Wireless networks like Wi-Fi (IEEE 802.11).
Why CSMA/CA is Used in Wireless Networks:
 Hidden Node Problem: In wireless networks, not all
nodes can hear each other due to obstacles or distance.
This can lead to collisions that the sender can't detect,
as it may not be aware that another node is
transmitting.
 Collision Avoidance: To mitigate this, CSMA/CA uses
techniques like random backoff and acknowledgment to
reduce the likelihood of collisions.
 Collision Detection Challenge: Unlike wired networks,
where a collision can easily be detected due to
significant changes in voltage levels on the wire, wireless
networks involve radio signals, where such changes are
not as easily detected by the transmitting node.
CSMA/CD (Collision Detection) is used in wired networks like
Ethernet. It detects collisions after they occur and handles
them by retransmitting the data after a random delay.
CSMA/CA (Collision Avoidance) is used in wireless networks
like Wi-Fi. It focuses on avoiding collisions in the first place by
using random backoff times and waiting for
acknowledgments, as collisions are harder to detect in
wireless environments.
CSMA/CA Avoids Collision By
 Interframe Space: Station waits for medium to become
idle and if found idle it does not immediately send data
(to avoid collision due to propagation delay) rather it
waits for a period of time called Interframe space or IFS.
After this time it again checks the medium for being idle.
The IFS duration depends on the priority of station.
 Contention Window: It is the amount of time divided
into slots. If the sender is ready to send data, it chooses
a random number of slots as wait time which doubles
every time medium is not found idle. If the medium is
found busy it does not restart the entire process, rather
it restarts the timer when the channel is found idle
again.
 Acknowledgement: The sender re-transmits the data if
acknowledgement is not received before time-out.

Controlled Access
Controlled access protocols ensure that only one device uses
the network at a time. Think of it like taking turns in a
conversation so everyone can speak without talking over
each other.
In this, the data is sent by that station which is approved by
all other stations.
The three controlled-access methods are:
 Reservation
 Polling
 Token Passing

Channelization
In this, the available bandwidth of the link is shared in time,
frequency and code to multiple stations to access channel
simultaneously.
Frequency Division Multiple Access (FDMA): The available
bandwidth is divided into separate bands, each allocated to a
different station. Guard bands are added to prevent overlap,
reducing crosstalk and noise.
Time Division Multiple Access (TDMA): The bandwidth is
shared by dividing time into slots, with each station assigned
a specific slot for data transmission. Synchronization
overhead is managed by adding synchronization bits, and
guard bands address propagation delays.
Code Division Multiple Access (CDMA): All transmissions
share the same channel simultaneously, using different codes
(like languages) to differentiate between signals. This allows
multiple stations to transmit simultaneously without dividing
bandwidth or time.
Orthogonal Frequency Division Multiple Access (OFDMA):
The available bandwidth is split into small subcarriers to
improve performance. Data is transmitted through these
subcarriers, making it a key technology in 5G networks.
Features of Multiple Access Protocols
 Contention-Based Access: Multiple access protocols are
typically contention-based, meaning that multiple
devices compete for access to the communication
channel. This can lead to collisions if two or more
devices transmit at the same time, which can result in
data loss and decreased network performance.
 Carrier Sense Multiple Access (CSMA): CSMA is a widely
used multiple access protocol in which devices listen for
carrier signals on the communication channel before
transmitting. If a carrier signal is detected, the device
waits for a random amount of time before attempting to
transmit to reduce the likelihood of collisions.
 Collision Detection (CD): CD is a feature of some
multiple access protocols that allows devices to detect
when a collision has occurred and take appropriate
action, such as backing off and retrying the transmission.
 Collision Avoidance (CA): CA is a feature of some
multiple access protocols that attempts to avoid
collisions by assigning time slots to devices for
transmission.
 Token Passing: Token passing is a multiple access
protocol in which devices pass a special token between
each other to gain access to the communication
channel. Devices can only transmit data when they hold
the token, which ensures that only one device can
transmit at a time.
 Bandwidth Utilization: Multiple access protocols can
affect the overall bandwidth utilization of a network. For
example, contention-based protocols may result in lower
bandwidth utilization due to collisions, while token
passing protocols may result in higher bandwidth
utilization due to the controlled access to the
communication channel.
In the IEEE 802 reference model of computer networking,
the logical link control (LLC) data communication
protocol layer is the upper sublayer of the data link
layer (layer 2) of the seven-layer OSI model. The LLC sublayer
acts as an interface between the medium access
control (MAC) sublayer and the network layer.
A MAC address consists of six hexadecimal numbers. The
highest possible hexadecimal number is FF:FF:FF:FF:FF:FF,
which is a broadcast address. The first three bytes contain a
manufacturer code and the last three bytes contain a unique
station ID. You can view the MAC address on most systems
with the following commands.
Windows ME, 9x: winipcfg (navigate the graphical user
interface (GUI) to find the MAC address)
Windows NT, XP, Vista, 2000, 2003, 2008: ipconfig/all

Data Link
The Data Link layer, also known as Layer 2, starts moving
towards more logical concepts versus the physical
layer below it.
These concepts include identifying individual systems on a
network based on some form of addressing scheme,
definitions of how packets of data should be formed for
network communications, and how the integrity of the
communication should be maintained through error
correction routines. The Data Link layer has two
sublayers, logical link control (LLC) and media access
control (MAC).
Media Access Control
The MAC sublayer is the interface between the Physical
layer and the LLC sublayer. At this sublayer, every device is
assigned an address. In today’s common use, this is a MAC
address. On any given network, each device must have a
unique MAC address that can be factory set when the device
is manufactured or set manually.
Logical Link Control
The LLC is the Data Link layer closest to the Network layer.
The LLC header will contain the protocol stack of the
packet. For example, if you are on a TCP/IP (Transmission
Control Protocol/Internet Protocol) network and request
access to a resource, the LLC sublayer will identify that
the Network layer protocol being used is IP.

You might also like