UNIT - II
MAC SUB-Layer
What is MAC SUB-layer?
• The Media Access Control (MAC) data communication Networks protocol sub-layer,
also known as the Medium Access Control, is a sub-layer of the data link layer specified
in the seven-layer OSI model.
• The medium access layer was made necessary by systems that share a common
communications medium. Typically these are local area networks. The MAC layer is the
“low” part of the second OSI layer, the layer of the “data link”.
• In fact, the IEEE divided this layer into two layers “above” is the control layer the
logical connection (Logical Link Control, LLC) and “down” the control layer The
medium access (MAC).
MULTIPLE ACCESS PROTOCOLS
• The upper sublayer of the data link layer is mainly responsible for the flow control
and error control and is also referred to as Logical link control(LLC); while the lower
layer is mainly responsible for the multiple-access resolution and thus is known as
Media Access control (MAC) layer.
• The main objectives of the multiple access protocols are the optimization of the
transmission time, minimization of collisions, and avoidance of the crosstalks.
• Multiple Access protocols mainly allow a number of nodes to access the shared
network channel. Several data streams originating from several nodes are transferred
via the multi-point transmission channel.
MULTIPLE ACCESS PROTOCOLS
RANDOM ACCESS PROTOCOLS
• In the random access, there is no such station that is superior to another station and none is
assigned control over the other. No station permits another station to send.
• Each station can transmit whenever it desires on the condition that it follows the predefined
procedure that includes the testing state of the medium.
• Given below are the protocols that lie under the category of Random Access protocol:
1. ALOHA
2. CSMA(Carrier sense multiple access)
3. CSMA/CD(Carrier sense multiple access with collision detection)
4. CSMA/CA(Carrier sense multiple access with collision avoidance)
ALOHA
• The earliest method used for random access was ALOHA and it was developed at
the University of Hawaii in early 1970.ALOHA was mainly designed for
radio/Wireless LAN but it can also be used for shared mediums.
• As the medium is shared between the stations, when a station sends the data then the
other station may attempt to do so at the same time. Thus the data from the two
stations collide.
• Original ALOHA is simply termed as "Pure ALOHA”
Pure ALOHA
• This protocol is very simple but elegant at the same time.
• The main idea behind this protocol is that each station sends a frame whenever it has
a frame to send.
• As we have already discussed that the medium is shared among different stations,
thus there is a possibility of collision between frames from the different stations.
Pure ALOHA
Slotted ALOHA
• As the name suggests, in the slotted ALOHA the time of the shared channel is simply
divided into discrete intervals that are commonly known as Time Slots.
• In Slotted ALOHA it is imposed on each station to send the data only at the
beginning of the time slot.
• As a station is allowed to send the data only at the beginning of the time slot, in case
if any station misses this moment then it must have to wait until the beginning of the
next time slot.
• In case if two stations try to send at the beginning of the same time slot then there are
chances for the occurrence of the collision.
Slotted ALOHA
CSMA
CSMA (Carrier Sense Multiple Access)
• It is a carrier sense multiple access based on media access protocol to sense the
traffic on a channel (idle or busy) before transmitting the data. It means that if the
channel is idle, the station can send data to the channel.
• Otherwise, it must wait until the channel becomes idle. Hence, it reduces the chances
of a collision on a transmission medium.
CSMA Access Modes
• Non-Persistent: It is the access mode of CSMA that defines before transmitting the data,
each node must sense the channel, and if the channel is inactive, it immediately sends the
data. Otherwise, the station must wait for a random time (not continuously), and when the
channel is found to be idle, it transmits the frames.
CSMA Access Modes
• 1-Persistent: In the 1-Persistent mode of CSMA that defines each node, first sense the shared
channel and if the channel is idle, it immediately sends the data. Else it must wait and keep
track of the status of the channel to be idle and broadcast the frame unconditionally as soon
as the channel is idle.
CSMA Access Modes
• p-Persistent: It is the combination of 1-Persistent and Non-persistent modes. The P-
Persistent mode defines that each node senses the channel, and if the channel is inactive, it
sends a frame with a P probability. If the data is not transmitted, it waits for a (q = 1-p
probability) random time and resumes the frame with the next time slot.
CSMA Access Modes
• O-Persistent: It is an O-persistent method that defines the superiority of the station before
the transmission of the frame on the shared channel. If it is found that the channel is inactive,
each station waits for its turn to retransmit the data.
CSMA/CD
There are two methods for avoiding these so-called collisions, listed here :
• CSMA/CD : It is a carrier sense multiple access/ collision detection network protocol to
transmit data frames. The CSMA/CD protocol works with a medium access control layer.
• It first senses the shared channel before broadcasting the frames, and if the channel is idle,
it transmits a frame to check whether the transmission was successful. If the frame is
successfully received, the station sends another frame.
• If any collision is detected in the CSMA/CD, the station sends a jam/ stop signal to the
shared channel to terminate data transmission. After that, it waits for a random time before
sending a frame to a channel.
CSMA/CA
• CSMA/CA : It is a carrier sense multiple access/collision avoidance network
protocol for carrier transmission of data frames. It is a protocol that works with a
medium access control layer.
• When a data frame is sent to a channel, it receives an acknowledgment to check whether
the channel is clear. If the station receives only a single (own) acknowledgments, that
means the data frame has been successfully transmitted to the receiver.
• But if it gets two signals (its own and one more in which the collision of frames), a
collision of the frame occurs in the shared channel. Detects the collision of the frame
when a sender receives an acknowledgment signal.
CSMA/CA
Following are the methods used in the CSMA/ CA to avoid the collision:
• Interframe space: In this method, the station waits for the channel to become idle, and if it
gets the channel is idle, it does not immediately send the data. Instead of this, it waits for some
time, and this time period is called the Interframe space or IFS. However, the IFS time is
often used to define the priority of the station.
• Contention window: In the Contention window, the total time is divided into different slots.
When the station/ sender is ready to transmit the data frame, it chooses a random slot number
of slots as wait time. If the channel is still busy, it does not restart the entire process, except
that it restarts the timer only to send data packets when the channel is inactive.
• Acknowledgment: In the acknowledgment method, the sender station sends the data frame to
the shared channel if the acknowledgment is not received ahead of time.