0% found this document useful (0 votes)
3 views15 pages

Medium Access Control Protocols Explained

Medium Access Sub Layer
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views15 pages

Medium Access Control Protocols Explained

Medium Access Sub Layer
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Chapter 2: Medium Access Sub Layer

2.1 Channel Allocation Problem


There are two types of network links: point-to-point and broadcast links. A point-to-point
link consists of a single sender at one end of the link and a single receiver at the other end of
the link. A broadcast link (multipoint link) can have multiple sending and receiving nodes
all connected to the same, single, shared broadcast channel. The term broadcast is used because
when any node transmits a frame, the channel broadcasts the frame and each other node
receives a copy (ex: ethernet, wireless).

The multiple access problem: How to coordinate the access of multiple sending and receiving
nodes to a shared broadcast channel? Computer networks have multiple access protocols by
which nodes regulate their transmission into the shared broadcast channel. More than two
nodes can transmit frames at the same time, which will result in all of the nodes receiving
multiple frames at the same time: the frames collide at all of the receivers. Typically, in case
of collision, none of the receiving nodes can make any sense of any of the frames, they become
inextricably tangled together and are therefore lost, the channel being wasted during collision.
Thus, it is necessary to coordinate the transmission of the active nodes. We can classify
multiple access protocols in three categories: channel partitioning protocols, random access
protocols, taking-turns protocols.

2.2. Channel Partitioning Protocols


TDM and FDM (from circuit switching) are in this category. A third channel partitioning tool
is code division multiple access (CDMA) which assigns a different code to each node. Each
node then uses its unique code to encode the data bits it sends. If the codes are chosen carefully,
then all nodes can transmit simultaneously and yet have their respective receivers correctly
receive a sender's encoded data bits. Originally used in military systems, it's now widely used
for civilian use, particularly in cellular telephony.

2.3 Random Access Protocols


A transmitting node always transmits at the full rate of the channel, R bps. When there is a
collision, each node involved in the collision repeatedly retransmits its frame until the frame
gets through without a collision. But when a node experiences a collision, it waits a random
delay before retransmitting the frame. The delay is chosen independently. Here a few of the
most commonly used random access protocols:

2.3.1. 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, whenever the system has a data frame to send, it transmits the data frame
continuously. Due to which the risk of collision is very high in this aloha method. Shown in
below pure aloha.

When a station sends data it waits for an acknowledgement. If the acknowledgement doesn’t
come within the allotted time, then the station waits for a random amount of time called back-
off time (Tb) and re-sends the data.

Vulnerable Time = 2 x Frame transmission time


Maximum throughput = 0.184
The maximum efficiency is 1/(2e) =18.4 %
Pure Aloha is overall efficiency is very less due to a large number of collisions.

Slotted ALOHA

Slotted aloha was developed to increase the performance of the pure aloha, as there are very
high chances of collision in pure aloha. In this Aloha, the time of the systems is divided into
slots so that the system can send only one frame to a slot, and this frame can only be sent at the
beginning of the slot. If a system cannot send a frame at the beginning of the slot, then it has
to wait for the next slot to start. If two systems try to transmit the frame at the beginning of a
time slot. But it is better than pure Aloha because it has less chance of collision. Shown in
below slotted aloha.
Vulnerable Time = Frame transmission time
Maximum throughput = 0.368
The maximum efficiency is 1/(e) = 36.8 %

Differences between Pure ALOHA and Slotted ALOHA


Pure ALOHA Slotted ALOHA
In Pure Aloha, any station can transmit data In Slotted Aloha, any station can transmit
at any time. data only at the beginning of a time slot.
In Pure Aloha, time is continuous and is not In Slotted Aloha, time is discrete and is
globally synchronized. globally synchronized.
The vulnerable time or susceptible time in The vulnerable time or susceptible time in
Pure Aloha is equal to two times of the Slotted Aloha is equal to the frame
frame transmission time (2Tf) transmission time (Tf)
The maximum throughput (efficiency) The maximum throughput (Efficiency)
obtained is obtained is
18.4 % 36.8 %
Pure Aloha doesn’t reduce the frame Slotted Aloha reduces the number of
collisions. collisions to half, thus doubles the
efficiency.
2.3.2. Carrier Sense Multiple Access (CSMA)

CSMA and CSMA/CD (collision detection) embody two rules:

• carrier sensing: if a node is transmitting, the others wait until they detect no
transmission for a short amount of time and begin transmission.
• collision detection: a transmitting node listens to the channel while it's transmitting, if
it detects that another node is transmitting, it stops transmitting and waits for a random
amount of time before repeating the sense-and-transmit-when-idle-cycle.

It is evident that the propagation delay of the channel plays a crucial role: the longer, the
larger the chance that a carrier sensing node is not yet able to sense a transmission that has
already begun.

Carrier Sense Multiple Access with Collision Detection (CSMA/CD)

Carrier Sense Multiple Access with Collision Detection (CSMA/CD) is a network protocol for
carrier transmission that operates in the Medium Access Control (MAC) layer. It senses or
listens whether the shared channel for transmission is busy or not, and defers transmissions
until the channel is free. The collision detection technology detects collisions by sensing
transmissions from other stations. On detection of a collision, the station stops transmitting,
sends a jam signal, and then waits for a random time interval before retransmission.

How CSMA/CD works?

➢ When a frame is ready, the transmitting station checks whether the channel is idle or
busy.
➢ If the channel is busy, the station waits until the channel becomes idle.
➢ If the channel is idle, the station starts transmitting and continually monitors the channel
to detect collision.
➢ If a collision is detected, the station starts the collision resolution algorithm.
➢ The station resets the retransmission counters and completes frame transmission.

How does a station know if its data collide?

Consider two stations on shared transmission media sends their data frame at the same time
that is shown in figure.
Consider the above situation. Two stations, A & B. Propagation Time: Tp = 1 hr (Signal takes
1 hr to go from A to B)

✓ At time t=0, Both A & B transmits its data frame


✓ At t=30 minutes, frame collisions occur

After the collision occurs, a collision signal is generated and sent to both A & B to inform the
stations about the collision. Since the collision happened midway, the collision signal also takes
30 minutes to reach A & B.

✓ Therefore, at t=1 hour: A & B receive the collision signals

This collision signal is received by all the stations on that link. Then, how to ensure that it is
our station’s data that collided?

For this,

✓ Transmission time (Tt) > Propagation Time (Tp) [Rough bound]

This is because we want that before we transmit the last bit of our data from our station, we
should at least be sure that some of the bits have already reached their destination. This ensures
that the link is not busy and collisions will not occur. But, above is a loose bound. We have not
taken the time taken by the collision signal to travel back to us. For this consider the worst-
case scenario. Consider the above system again.

Let us consider another scenario shown in the following figure

At time t=0, A transmits its data and at t=59 min, B transmits its data. At t= 60 min, frame
collision occurs. This collision occurs just before the data reaches B. Now the collision signal
takes 60 minutes again to reach A. Hence, A receives the collision information approximately
after 2 hours, that is, after 2 x Tp.

✓ Hence, to ensure tighter bound, to detect the collision completely, Tt > > = 2 * Tp

This is the maximum collision time that a system can take to detect if the collision was of its
own data.
What should be the minimum length of the packet to detect the collisions in transmission
media?

✓ Transmission Time (Tt) = Length of the frame (number of bits) / Bandwidth of the link
(Number of bits transmitted by sender per second)
✓ Substituting above, we get, Length of the packet / Bandwidth of the link>= 2 * Tp
✓ Length of the packet >= 2 * Tp * Bandwidth of the link

Padding helps in cases where we do not have such long packets. We can pad extra characters
to the end of our data to satisfy the above condition.

Collision detection in CSMA/CD involves the following features:

Carrier sense: Before transmitting data, a device listens to the network to check if the
transmission medium is free. If the medium is busy, the device waits until it becomes free
before transmitting data.

Multiple Access: In a CSMA/CD network, multiple devices share the same transmission
medium. Each device has equal access to the medium, and any device can transmit data when
the medium is free.

Collision detection: If two or more devices transmit data simultaneously, a collision occurs.
When a device detects a collision, it immediately stops transmitting and sends a jam signal to
inform all other devices on the network of the collision. The devices then wait for a random
time before attempting to transmit again, to reduce the chances of another collision.

Backoff algorithm: In CSMA/CD, a backoff algorithm is used to determine when a device


can retransmit data after a collision. The algorithm uses a random delay before a device
retransmits data, to reduce the likelihood of another collision occurring.

Minimum frame size: CSMA/CD requires a minimum frame size to ensure that all devices
have enough time to detect a collision before the transmission ends. If a frame is too short, a
device may not detect a collision and continue transmitting, leading to data corruption on the
network.

Advantages of CSMA/CD:

➢ Simple and widely used: CSMA/CD is a widely used protocol for Ethernet networks,
and its simplicity makes it easy to implement and use.
➢ Fairness: In a CSMA/CD network, all devices have equal access to the transmission
medium, which ensures fairness in data transmission.
➢ Efficiency: CSMA/CD allows for efficient use of the transmission medium by
preventing unnecessary collisions and reducing network congestion.
Disadvantages of CSMA/CD:

➢ Limited scalability: CSMA/CD has limitations in terms of scalability, and it may not
be suitable for large networks with a high number of devices.
➢ Vulnerability to collisions: While CSMA/CD can detect collisions, it cannot prevent
them from occurring. Collisions can lead to data corruption, retransmission delays, and
reduced network performance.
➢ Inefficient use of bandwidth: CSMA/CD uses a random backoff algorithm that can
result in inefficient use of network bandwidth if a device continually experiences
collisions.
➢ Susceptibility to security attacks: CSMA/CD does not provide any security features,
and the protocol is vulnerable to security attacks such as packet sniffing and spoofing.

Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA)

Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA) is a network protocol
for carrier transmission that operates in the Medium Access Control (MAC) layer. In contrast
to CSMA/CD (Carrier Sense Multiple Access/Collision Detection) that deals with collisions
after their occurrence, CSMA/CA prevents collisions prior to their occurrence.

Steps in CSMA/CA is:

➢ When a frame is ready, the transmitting station checks whether the channel is idle or
busy.
➢ If the channel is busy, the station waits until the channel becomes idle.
➢ If the channel is idle, the station waits for an Inter-frame gap (IFG) amount of time and
then sends the frame.
➢ After sending the frame, it sets a timer.
➢ The station then waits for acknowledgement from the receiver. If it receives the
acknowledgement before expiry of timer, it marks a successful transmission.
➢ Otherwise, it waits for a back-off time period and restarts the algorithm.

Advantages of CMSA/CA

➢ CMSA/CA prevents collision.


➢ Due to acknowledgements, data is not lost unnecessarily.
➢ It avoids wasteful transmission.
➢ It is very much suited for wireless transmissions.

Disadvantages of CSMA/CA

➢ The algorithm calls for long waiting times


➢ It has high power consumption.
2.4. Ethernet (IEEE 802.3)
It has pretty much taken over the wired LAN market. Since its invention in the 70's, it has
grown and become faster. At the beginning the original Ethernet LAN used a coaxial bus to
interconnect the nodes, creating a broadcast LAN. By the late 90s, most companies and
universities had replaced their LANs with Ethernet installation using a hub-based star topology:
hosts and routers are directly connected to a hub with twisted-pair copper wire. A hub is a
physical layer device that acts on individual bits rather than frames. When a hub receives a bit,
it simply recreates it boosting its energy strength and transmits the bit onto all the other
interfaces (it's still a broadcast LAN). In the early 2000s, the star topology evolved: the hub
was replaced with a switch, allowing a collision-less LAN.

Ethernet Frame Structure

The main fields of a frame of classic Ethernet are -


• Preamble: It is the starting field that provides alert and timing pulse for transmission.
In case of classic Ethernet, it is an 8-byte field and in case of IEEE 802.3 it is of 7 bytes.
• Start of Frame Delimiter: It is a 1-byte field in an IEEE 802.3 frame that contains an
alternating pattern of ones and zeros ending with two ones.
• Destination Address: It is a 6-byte field containing physical address of destination
stations.
• Source Address: It is a 6-byte field containing the physical address of the sending
station.
• Length: It a 7 bytes field that stores the number of bytes in the data field.
• Data: This is a variable sized field carries the data from the upper layers. The maximum
size of data field is 1500 bytes.
• Padding: This is added to the data to bring its length to the minimum requirement of
46 bytes.
• CRC: CRC stands for cyclic redundancy check. It contains the error detection
information.
All of the Ethernet technologies provide connectionless service (no handshaking, similar to
UDP) and unrealizable service to the network layer (no ACK, drop in case of errors) which
help to make Ethernet simple and cheap. If there are gaps due to discarded Ethernet frames, the
fact that the application sees the gaps or not depends on the transport layer protocol used: not
with TCP (reliable data transfer), yes with UDP.
Ethernet Technologies

What are the Ethernet Standards?

An Ethernet standard describes the properties, functions, and implementation of a specific


media type. There are various types of media. A media type can provide different speeds of
transmission on different types of implementations. An Ethernet standard specifies a specific
implementation of a particular media type. Ethernet standards are defined by IEEE.

Ethernet Terminology: The name of an Ethernet standard consists of three parts. The first part
contains a number, the second part contains a word (mostly Base), and the third part contains
a number or letters.

Ethernet standards are expressed by using the following terminology.

100 Base T

First part describes transmission speed: 100 Mbps,

Second part describes type of transmission: Baseband,

and third part describes length or type of cabling: Twisted pair cables

Ethernet is defined in a number of IEEE 802.3 standards. These standards define


the physical and data-link layer specifications for Ethernet. The most important
802.3 standards are:
➢ 10Base-T (IEEE 802.3) – 10 Mbps with category 3 unshielded twisted pair (UTP)
wiring, up to 100 meters long.
➢ 100Base-TX (IEEE 802.3u) – known as Fast Ethernet, uses category 5, 5E, or 6 UTP
wiring, up to 100 meters long.
➢ 100Base-FX (IEEE 802.3u) – a version of Fast Ethernet that uses multi-mode optical
fiber. Up to 412 meters long.
➢ 1000Base-CX (IEEE 802.3z) – uses copper twisted-pair cabling. Up to 25 meters long.
➢ 1000Base-T (IEEE 802.3ab) – Gigabit Ethernet that uses Category 5 UTP wiring. Up
to 100 meters long.
➢ 1000Base-SX (IEEE 802.3z) – 1 Gigabit Ethernet running over multimode fiber-optic
cable.
➢ 1000Base-LX (IEEE 802.3z) – 1 Gigabit Ethernet running over single-mode fiber.
➢ 10GBase-T ([Link]) – 10 Gbps connections over category 5e, 6, and 7 UTP cables.

Fast Ethernet examples


Gigabit Ethernet examples

10-Gigabit Ethernet examples

2.5. Wireless LANS (Wi-Fi)


Wireless LANs are increasingly popular, and homes, offices, cafes, libraries, airports, zoos,
and other public places are being outfitted with them to connect computers, packet digital
assistants, and smart phones to the Internet. Wireless LANs can also be used to let two or more
nearby computers communicate without using the Internet. The main wireless LAN standard
is 802.11.

The IEEE 802.11 standard, lays down the architecture and specifications of wireless local area
networks (WLANs). WLAN or Wi-Fi uses high frequency radio waves instead of cables for
connecting the devices in LAN. Users connected by WLANs can move around within the area
of network coverage.
The 802.11 MAC sublayer provides an abstraction of the physical layer to the logical link
control sublayer and upper layers of the OSI network. It is responsible for encapsulating frames
and describing frame formats.
The 802.11 Architecture and Protocol Stack: 802.11 networks can be used in two modes.
The most popular mode is to connect clients, such as laptops and smart phones, to another
network, such as a company intranet or the Internet. In infrastructure mode, each client is
associated with an AP (Access Point) that is in turn connected to the other network. The client
sends and receives its packets via the AP. Several access points may be connected together,
typically by a wired network called a distribution system, to form an extended 802.11 network.
In this case, clients can send frames to other clients via their APs.
The other mode is an ad hoc network. This mode is a collection of computers that are associated
so that they can directly send frames to each other. There is no access point. Since Internet
access is the killer application for wireless, ad hoc networks are not very popular.

Now we will look at the protocols. A view of the 802.11 protocol stack is given below

Several transmission techniques have been added to the physical layer as 802.11 has evolved
since it first appeared in 1997. Two of the initial techniques, infrared in the manner of television
remote controls and frequency hopping in the 2.4-GHz band, are now defunct. The third initial
technique, direct sequence spread spectrum at 1 or 2 Mbps in the 2.4-GHz band, was extended
to run at rates up to 11 Mbps and quickly became a hit. It is now known as 802.11b. To give
wireless junkies a much-wanted speed boost, new transmission techniques based on the OFDM
(Orthogonal Frequency Division Multiplexing) scheme were introduced in 1999 and 2003. The
first is called 802.11a and uses a different frequency band, 5 GHz. The second stuck with 2.4
GHz and compatibility. It is called 802.11g. Both give rates up to 54 Mbps. Most recently,
transmission techniques that simultaneously use multiple antennas at the transmitter and
receiver for a speed boost were finalized as 802.11n in Oct. 2009. With four antennas and wider
channels, the 802.11 standard now defines rates up to a startling 600 Mbps.
The 802.11 Frame Structure: MAC Sublayer Frame Structure of IEEE 802.11 The main
fields of a frame in WLANs as laid down by IEEE 802.11 are as depicted in the following
diagram

• Frame Control −It is 2 bytes starting field composed of 11 subfields. It contains


control information of the frame. The 11 subfields are −
• Protocol version − The first sub-field is a two – bit field set to 00. It has been included
to allow future versions of IEE 802.11 to operate simultaneously.
• Type − It is a two-bit subfield that specifies whether the frame is a data frame, control
frame or a management frame.
• Subtype − it is a four – bit subfield states whether the field is a Request to Send (RTS)
or a Clear to Send (CTS) control frame. For a regular data frame, the value is set to
0000.
• To DS − A single bit subfield indicating whether the frame is going to the access point
(AC), which coordinates the communications in centralised wireless systems.
• From DS − A single bit subfield indicating whether the frame is coming from the AC.
• More Fragments − A single bit subfield which when set to 1 indicates that more
fragments would follow.
• Retry − A single bit subfield which when set to 1 specifies a retransmission of a
previous frame.
• Power Management − A single bit subfield indicating that the sender is adopting
power-save mode.
• More Data − A single bit subfield showing that sender has further data frames for the
receiver.
• Protected Frame − A single bit subfield indicating that this is an encrypted frame.
• Order − The last subfield, of one – bit, informs the receiver that to the higher layers
the frames should be in an ordered sequence.
• Duration − It is a 2-byte field that specifies the time period for which the frame and its
acknowledgement occupy the channel.
• Address fields - There are three 6-byte address fields containing addresses of source,
immediate destination and final endpoint respectively.
• Sequence − It a 2 bytes field that stores the frame numbers. It detects duplicate frames
and determines the order of frames for higher layers. Among the 16 bits, the first 4 bits
provides identification to the fragment and the rest 12 bits contain the sequence number
that increments with each transmission.
• Data − This is a variable sized field that carries the payload from the upper layers. The
maximum size of data field is 2312 bytes.
• Frame Check Sequence (FCS) − It is a 4-byte field containing error detection
information.
2.6. Bluetooth:
Bluetooth is a standardized protocol for sending and receiving data via a 2.4GHz wireless link.
It's a secure protocol, and it's perfect for short-range, low-power, low-cost, wireless
transmissions between electronic devices.
Bluetooth Architecture

The basic unit of a Bluetooth system is a piconet, which consists of a master node and up to
seven active slave nodes within a distance of 10 meters. Multiple piconets can exist in the same
(large) room and can even be connected via a bridge node that takes part in multiple piconets,
as shown in the Figure below. An interconnected collection of piconets is called a scatternet.
The Bluetooth network technology connects mobile devices wirelessly using short-wavelength,
ultra-high frequency (UHF) radio waves over a short range to form a personal area network
(PAN). Data is transferred between the Bluetooth devices as data frames. Two basic frame
formats are defined, for transmitting data at basic data rate and for transmitting data at enhanced
data rate.

A Bluetooth frame with basic rate has three parts, access code, header and data as shown in the
following diagram

Access Code: A 72-bit field containing synchronization bits to identify the master.

Header: A 54-bit field containing 18-bit patterns repeated thrice, having the following
subfields

➢ Address: A 3 bit-field that can identify a maximum of seven slaves numbered 1 to 7.


An address 0 depicts broadcast.
➢ Type: A 4-bit field that identifies the type of data from upper layers. It identifies
whether the frame is ACL, SCO, poll or null.
➢ F: A bit for flow control. When the device cannot receive more frames, F is set to 1.
➢ A: A bit for acknowledgement, for piggybacking an ACK to the end of the frame.
➢ S: A bit denoting sequence number of the frame for detect retransmission. Only a single
bit suffices since stop and wait protocol is used.
➢ Checksum: An 8-bit field containing checksum for error detection.

Data: A variable length field ranging from 0 to 2744 bits that contains data or control
information from upper layers.
ZigBee:
ZigBee is an open, global, packet-based protocol designed to provide an easy-to-use
architecture for secure, reliable, low power wireless networks. Flow or process control
equipment can be place anywhere and still communicate with the rest of the system. It can also
be moved, since the network doesn’t care about the physical location of a sensor, pump or
valve. ZigBee is the Personal Area Network of task group 4 so it is based on IEEE 802.15.4
and is created by Zigbee Alliance.
IEEE802.15.4 developed the PHY and MAC layer whereas, the ZigBee takes care of upper
higher layers (For more details refer the text Book).

You might also like