DC CH - 12

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

Data Communication By: Judy Zox

Chapter 12

Media Access Control


Random Access
In random-access or contention methods, no station has control over others. Each station decides
whether to send data based on the medium's state (idle or busy). This method is named for its
random transmission and station competition. Stations can access the medium freely but risk
collisions if multiple stations transmit simultaneously. To address this, stations follow protocols for
accessing the medium, sensing its state, and handling collisions. These methods evolved from
ALOHA to CSMA, which includes CSMA/CD for collision detection and CSMA/CA for collision
avoidance.

➢ Aloha
ALOHA, developed at the University of Hawaii in the early 1970s, was the earliest random-access
method, initially designed for a radio LAN but applicable to any shared medium. This method faces
potential collisions when multiple stations attempt to send data simultaneously, causing garbled
transmissions.
Pure Aloha:
The original ALOHA protocol is called pure ALOHA. It allows each station to send a frame
whenever it has one to send, but collisions can occur since there's only one shared channel. In the
example with four stations, some frames collide, and only two survive. If any part of a frame
overlaps with another frame, it's considered a collision. The protocol relies on acknowledgments
from the receiver; if an acknowledgment doesn't arrive, the sender assumes the frame was lost
and resends it. Collisions can lead to retransmissions, so after a timeout, stations wait a random
amount of time (backoff time TB) before resending to avoid further collisions.
In Pure ALOHA, stations give up after a maximum number of
retransmission attempts (Kmax) and try again later. The time-out
period is twice the round-trip propagation delay (2 × Tp), and the
backoff time (TB) is a random value determined by a formula like
binary exponential backoff. For each retransmission, a random
multiplier R is chosen from 0 to 2K − 1 and multiplied by Tp or Tfr.
The range of R increases after each collision. Kmax is typically 15.
In a wireless ALOHA network with stations up to 600 km apart and
a signal propagation speed of 3 × 108 m/s, Tp is 2 ms. For K = 2,
the range of R is {0, 1, 2, 3}, resulting in TB values of 0, 2, 4, or 6 ms.
• Tp = Maximum propagation time
• Tfr = The Average time required to send out a frame
• TB = It's the amount of time a station waits after a collision before attempting to retransmit
a frame.(backoff time)

1
Vulnerable time
Let's find the vulnerable time for potential collisions. Assuming
fixed-length frames taking Tfr seconds to send, station B starts
sending a frame at time t. If station A starts sending its frame
after t - Tfr, there will be a collision between A and B's frames.
Similarly, if station C starts sending before t + Tfr, there will be a
collision between B and C's frames. In pure ALOHA, the
vulnerable time for collisions is 2 times the frame transmission
time. Therefore, Pure ALOHA's vulnerable time = 2 x Tfr.

Throughput
Let's use G to represent the average number of frames generated by the system during one
frame transmission time. For pure ALOHA, the average number of successfully transmitted
frames, S, can be calculated as S = G × e-2G. The maximum throughput, Smax, is 0.184 when
G = 1/2. This means that if half a frame is generated during one frame transmission time (or
one frame during two frame transmission times), then 18.4% of these frames reach their
destination successfully. G = 1/2 produces the maximum throughput because the vulnerable
time is 2 times the frame transmission time. Therefore, if a station generates only one frame in
this vulnerable time (and no other stations generate a frame during this time), the frame will
reach its destination successfully.

Slotted Aloha
Pure ALOHA's vulnerability lasts for 2 × Tfr because stations can
send at any time. Slotted ALOHA divides time into Tfr-second slots,
allowing stations to send only at slot beginnings, reducing
vulnerability to Tfr. If a station misses a slot, it waits for the next,
potentially colliding with another station. However, vulnerability is
halved to Tfr due to slot synchronization. Slotted ALOHA vulnerable
time = Tfr

Throughput
The average number of successful transmissions for slotted ALOHA
is given by S = G × e^-G. The maximum throughput Smax is 0.368, achieved when G = 1. This
means that if one frame is generated during one frame transmission time, then 36.8% of these
frames reach their destination successfully. This maximum throughput occurs when the
vulnerable time is equal to the frame transmission time (G = 1), allowing a frame generated
during this time to reach its destination successfully if no other station generates a frame
simultaneously.

2
➢ CSMA
CSMA (Carrier Sense Multiple Access) was developed to reduce collisions and improve performance in
network communication. It requires stations to listen to the medium before transmitting, based on the
principle of "sense before transmit" or "listen before talk." However, collisions can still occur due to
propagation delays, where a station might sense an idle medium because it hasn't yet received the first
bit sent by another station. This can lead to collisions and the destruction of frames, despite CSMA's
efforts to minimize them.

Vulnerable time:
The vulnerable time for CSMA is the propagation time
(Tp), the time it takes for a signal to travel from one end
of the medium to the other. If a station sends a frame
and another station attempts to send during this time, a
collision occurs. However, once the first bit of the frame reaches the end of the medium, all stations
have received it and won't send. Station A sends at t1, reaching station D at t1 + Tp, with the gray
area representing the vulnerable time and space.

Persistence Methods
When a station finds the channel busy, it waits for the
channel to become idle. There are three methods to
handle this:
1. 1-Persistent: After finding the channel idle, the
station sends its frame immediately (with
probability 1), which can lead to collisions due to
multiple stations sending frames simultaneously.
Ethernet uses this method.
2. Nonpersistent: The station checks the channel; if it's idle, it sends
immediately. If not, it waits a random time before checking again. This
method reduces collisions but lowers network efficiency as the medium
might remain idle unnecessarily.
3. p-Persistent: Used with time-slotted channels. After finding the channel
idle, the station either sends its frame with probability *p* or waits for the
next slot with probability *q = 1 - p*. If the next slot is idle, it repeats the
process; if busy, it assumes a collision and uses a back-off procedure.
This method combines the advantages of the other two methods.

➢ CSMA/CD
CSMA does not address what happens after a collision, but
CSMA/CD does. With CSMA/CD, a station checks if its
transmission succeeded; if not, it resends after a collision.
For example, in a collision between stations A and C, A starts
transmitting at t1, and C starts after t2. The collision is
detected when C receives A's first bit at t3 and aborts, with A
aborting when it gets C's first bit at t4.

3
Minimum Frame Size
For CSMA/CD to work, the frame size must be restricted. Before sending the last bit of the frame, the
sending station must detect any collisions and abort the transmission. This is because once the entire
frame is sent, the station doesn't keep a copy of it or monitor the line for collisions. Therefore, the
frame transmission time (Tfr) must be at least two times the maximum propagation time (Tp). In the
worst-case scenario, if two stations involved in a collision are at maximum distance, the signal from
the first takes time Tp to reach the second, and the collision's effect takes another Tp to reach the
first. Hence, the first station must still be transmitting after 2Tp.
Procedure
The CSMA/CD flow diagram differs from the ALOHA protocol in
several ways.
• First, it includes the addition of a persistence process, which
involves sensing the channel before sending a frame.
• Second, unlike ALOHA's method of transmitting the entire
frame and then waiting for acknowledgment, CSMA/CD
involves continuous transmission and collision detection. This
means that transmission and reception occur simultaneously,
and a loop is used to represent this continuous process.
• Third, in the event of a collision, CSMA/CD sends a short jamming signal to ensure that all other
stations are aware of the collision.
Energy Levels
In a channel, energy levels can be zero (idle), normal (station
sending), or abnormal (collision, twice normal level). Stations
monitor energy to know if the channel is idle, busy, or in
collision.
Throughput
CSMA/CD has higher throughput than pure or slotted ALOHA. The maximum throughput varies with
the persistence method and the value of p in p-persistent approach. In 1-persistent, max throughput is
around 50% at G=1, while in non-persistent, it can reach 90% at G between 3 and 8.
Traditional Ethernet
Traditional Ethernet, with a 10 Mbps data rate, used CSMA/CD. It was a broadcast LAN employing the
1-persistence method for media access control. Later Ethernet versions moved away from CSMA/CD.

➢ CSMA/CA
CSMA/CA was created for wireless networks to avoid collisions. It uses
three strategies: Interframe Space (IFS), Contention Window, and
Acknowledgment. IFS introduces a wait time before sending to avoid
interference. The Contention Window is a time divided into slots, with a
random number chosen as the wait time. This window changes
dynamically. Acknowledgment and a time-out timer help ensure data is
received correctly despite potential collisions or corruption.

4
Frame Exchange Timeline
1. Before sending a frame, the source station checks the carrier frequency
for activity. It uses a persistence strategy with backoff until the channel is
idle. Then, it waits for a DCF interframe space (DIFS) and sends a
request to send (RTS) control frame.
2. Upon receiving the RTS, the destination station waits for a short
interframe space (SIFS) and sends a clear to send (CTS) control frame,
indicating readiness to receive data.
3. The source station sends data after waiting for an amount of time equal to
SIFS.
4. The destination station, after waiting for an amount of time equal to SIFS, sends an acknowledgment
to confirm the receipt of the frame. This acknowledgment is necessary since the protocol lacks a
means to check successful data arrival, unlike CSMA/CD where lack of collision indicates successful
data transmission.
Network Allocation Vector
When one station accesses the channel, other stations defer sending their data using a feature called
NAV. When a station sends a request-to-send (RTS) frame, it includes the duration it needs to occupy
the channel. Stations affected by this transmission set a timer called the network allocation vector
(NAV), which indicates how much time must pass before they can check the channel for idleness.
Before sensing the medium for idleness, each station checks its NAV to see if it has expired.
Collision During Handshaking
During the handshaking period of RTS or CTS control frames, collisions can occur if two or more
stations attempt to send RTS frames simultaneously. However, since there is no collision detection
mechanism for these frames, the sender assumes a collision if it doesn't receive a CTS frame. In such
cases, a backoff strategy is used, and the sender retries the transmission.
Hidden-Station Problem
To solve the hidden station problem, handshake frames like RTS and CTS are used. When B sends an
RTS to A, C doesn't receive it. However, when A responds with a CTS, containing the data
transmission duration, C gets it. This lets C know a hidden station is using the channel, so C waits until
that transmission ends.
CSMA/CA and Wireless Networks
CSMA/CA was designed for wireless networks, but it doesn't handle certain issues like hidden or
exposed terminals. Adding handshaking features can solve these problems.
Controlled Access
In controlled access, the stations consult one another to find which station has the right to send. A
station cannot send unless it has been authorized by other stations. We discuss three controlled-
access methods.
➢ Reservation
In the reservation method, each station needs to reserve a
slot before sending data. Time is divided into intervals, with
a reservation frame preceding data frame in each interval. If
there are N stations, there are N reservation minislots in the
frame, each belonging to a station. When a station needs to
send data, it reserves its minislot. Stations with reservations can send data after the reservation frame.
In Figure 12.18, with five stations and a five-minislot reservation frame, stations 1, 3, and 4 have
reserved slots in the first interval, and only station 1 has reserved a slot in the second interval.

5
➢ Polling
Polling involves a primary station and secondary stations. All
data goes through the primary device, even if the destination is
a secondary device. The primary device controls the link and
instructs secondary devices. It decides which device can use
the channel. However, if the primary station fails, the system
goes down.
Select
The select function is used when the primary device has data to send. The primary controls the link
and knows it's available when not sending or receiving data. Before sending, the primary alerts the
secondary and waits for acknowledgment. It then creates and sends a select (SEL) frame with the
secondary's address.
Poll
The poll function allows the primary device to request transmissions from secondary devices. The
primary device asks each secondary device in sequence if it has data to send. If a secondary device
has nothing to send, it responds with a NAK frame. If it has data, it responds with a data frame. If a
NAK frame is received, the primary device polls the next secondary device until it finds one with data to
send. When a data frame is received, the primary device reads it and sends an acknowledgment (ACK
frame) to confirm receipt.

➢ Token Passing
In the token-passing method, network stations form a logical ring with each station having a
predecessor and a successor. The current station accessing the channel holds the token, which
passes from predecessor to successor. This token gives the right to access the channel and send data.
When a station has data, it waits for the token, sends its data, then passes the token to the next
station. Token management is crucial to limit station time with the token, monitor token status, prioritize
stations and data, and ensure low-priority stations yield to high-priority ones.

Logical Ring
In a token-passing network, stations can form a logical ring without being physically connected in a
ring. Four physical topologies can create this logical ring:

• In the physical ring topology, a station sends the token to its successor
without other stations seeing it, but if a link fails, the whole system fails.
• The dual ring topology has a backup ring for emergencies, combining
with the main ring if needed.
• The bus ring topology connects stations to a single cable, forming a
logical ring, with each station knowing the address of its successor.
• The star ring topology uses a hub to connect stations in a star-shaped
physical layout, making the network less prone to failure and facilitating
station additions and removals.

6
Channelization
Channelization (or channel partition, as it is sometimes called) is a multiple-access method in which
the available bandwidth of a link is shared in time, frequency, or through code, among different
stations. In this section, we discuss three channelization protocols: FDMA, TDMA, and CDMA.

➢ FDMA
FDMA divides available bandwidth into frequency bands, each reserved for a specific station's data
transmission. Stations use bandpass filters to confine their transmissions to their allocated bands,
preventing interference. Guard bands separate the allocated bands to avoid station interference.

FDMA (Frequency Division Multiple Access) allocates a frequency


band for the entire communication, making it ideal for continuous data
like analog voice. This method ensures smooth data flow without
needing packetization because each station keeps its frequency band
throughout the session.

Unlike FDM (Frequency Division Multiplexing), which combines low-


bandwidth channels into a higher-bandwidth one at the physical layer,
FDMA works at the data-link layer. Each station's data-link layer tells
its physical layer to create a bandpass signal within the allocated
band. This eliminates the need for a physical multiplexer, simplifying the process. Signals are naturally
mixed on the shared channel, letting multiple stations communicate simultaneously if their bands are
adequately separated.

➢ TDMA
In time-division multiple access (TDMA), stations share the
channel's bandwidth in time, each allocated a specific time slot
for data transmission (as shown in Figure 12.22). However,
achieving synchronization between stations is challenging due to
propagation delays, which can be compensated for by inserting
guard times. Synchronization is typically achieved using
preamble bits at the beginning of each slot. It's important to note
that while TDMA and time-division multiplexing (TDM) may seem
similar, they are different. TDM is a physical layer technique that
combines data from slower channels onto a faster channel using a physical multiplexer, whereas
TDMA is an access method in the data-link layer where each station's data-link layer instructs its
physical layer to use the allocated time slot without a physical multiplexer.

You might also like