0% found this document useful (0 votes)
114 views12 pages

Unit 3 Contention-Based Media Access Protocols: Structure Page Nos

This document discusses contention-based media access protocols. It introduces the ALOHA protocol, which uses a random access approach where any station can transmit at any time. This often leads to collisions when two frames overlap. The document defines the "vulnerable period" as the time interval during which a transmitted frame could collide with another frame. It also introduces slotted ALOHA, which divides time into slots to reduce collisions compared to pure ALOHA. Finally, it discusses carrier sensing protocols like CSMA and CSMA/CD that further improve performance by having nodes listen first before transmitting.

Uploaded by

sukhvinders
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)
114 views12 pages

Unit 3 Contention-Based Media Access Protocols: Structure Page Nos

This document discusses contention-based media access protocols. It introduces the ALOHA protocol, which uses a random access approach where any station can transmit at any time. This often leads to collisions when two frames overlap. The document defines the "vulnerable period" as the time interval during which a transmitted frame could collide with another frame. It also introduces slotted ALOHA, which divides time into slots to reduce collisions compared to pure ALOHA. Finally, it discusses carrier sensing protocols like CSMA and CSMA/CD that further improve performance by having nodes listen first before transmitting.

Uploaded by

sukhvinders
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

Contention-based Media

UNIT 3 CONTENTION-BASED MEDIA Access Protocols

ACCESS PROTOCOLS
Structure Page Nos.
3.0 Introduction 35
3.1 Objectives 36
3.2 Advantages of Multiple Access Sharing of Channel Resources 36
3.3 Pure ALOHA 37
3.4 Slotted ALOHA 39
3.5 Carrier Sense Multiple Access (CSMA) 40
3.6 CSMA with Collision Detection (CSMA/CD) 41
3.7 Ethernet Frame Format (IEEE 802.3) 43
3.8 Summary 45
3.9 Solutions/Answers 45
3.10 Further Readings 45

3.0 INTRODUCTION

As discussed in first unit of this block, the Data Link Layer (DLL) is divided into two
sub layers i.e., the Media Access Control (MAC) layer and the Logical Link Control
(LLC) layer. In a network nodes are connected to or use a common transmission
media. Based on the connection of nodes, a network can be divided into two
categories, that is, point-to-point link and broadcast link. In this unit, we will discuss,
broadcast link and their protocols. If, we talk about broadcast network then, a control
process for solving the problem of accessing a multi access channel is required. Many
protocols are available for solving the problem of multi-access channel. These
protocols can control an access on shared link as in broadcast network. It is an
important issue to be taken into consideration that is, how to who gets access to the
channel while, many nodes are in competition as shown in Figure 1.

Shared Multiple
C access medium A

D
E

Figure 1: Shared media

The protocol which decides who will get access to the channel and who will go next
on the channel belongs to MAC sub-layer of DLL. Channel allocation is categorised
into two, based on the allocation of broadcast among competeting users that is Static
channel allocation problem and Dynamic Channel allocation problem as shown in
Figure 2. In this unit, we will also discuss whether some access conflict or collision
comes in the network, and how to deal with these conflicts. This is an important
issue for LAN.

35
Media Access Control and
Data Link Layer Channel Allocation

Static Channel Dynamic Channel

Figure 2: Channel allocation technique

Here the transmission of frames can occupy the medium or any arbitrary time or in
slotted time intervals (time is divided into slots). When the transmission station senses
whether the channel is busy or free, this is called carrier sensing.

3.1 OBJECTIVES
After going through this unit, you should be able to learn:

• the need for accessing multi-access channel;


• common methods for accessing multi-access channel like FDM, TDM;
• the need for Dynamic channel allocation method;
• pure ALOHA method for channel allocation;
• slotted ALOHA method for channel allocation;
• carrier sensing method CSMA to improve performance;
• carrier sensing with collision detection method CSMA/CD;
• IEEE 802.3 standard and their Different Cabling types, and
• basics of Giga Bit Ethernet.

3.2 ADVANTAGES OF MULTIPLE ACCESS


SHARING OF CHANNEL RESOURCES
MAC sub layer’s primary function is to manage the allocation of one broadcast
channel among N competing users. For the same, many methods are available such as
static, and dynamic allocation method.
In the static channel allocation method, allocating a single channel among N
competing users can be either FDM (Frequency division multiplexing) or TDM (Time
division multiplexing). In FDM the total bandwidth will be divided into N equal parts
for N users. This way, every user will have their own frequency band so no conflict or
collision will occur among user in the network. But, this is feasible only when the
number of users are small and traffic is also limited. If, the number of users becomes
large this system has face many problems like either one user is gets one frequency
band that is not used at all or the other user does not get a frequency band for
transmission. Hence, it is simple and efficient for a small number of users. Similarly,
in TDM (Time Division Multiplexing), discussed with first Block every user will get a
fixed Nth time slot.

In the dynamic channel allocation the important issues to be considered are whether,
time is continuous or discrete or whether the station is carrier sensing large number of
stations each with small and bursty traffic.

36
Many methods are available for multiple access channel like ALOHA, CSMA etc. Contention-based Media
that we will discuss in the following section. Access Protocols

3.3 PURE ALOHA

As we have discussed earlier in the previous unit, if, one node sends a frame to
another node, there can be some error in the frame. For the same we discussed some
retransmission strategies to deal with the error. But, in case of allocating a single
channel among N uncoordinated competing users, then the probability of collision
will be high. Station accesses the channel and when their frames are ready. This is
called random access. In an ALOHA network one station will work as the central
controller and the other station will be connected to the central station. If, any of
stations want to transmit data among themselves, then, the station sends the data first
to the central station, which broadcast it to all the stations.

Station 1

Station 2

Station 3

Figure 3: ALOHA

Here, the medium is shared between the stations. So, if two stations transmit a frame
at overlapping time then, collision will occur in the system. Here, no station is
constrained, any station that has data /frame to transmit can transmit at any time. Once
one station sends a frame (when it receives its own frame and assumes that the
destination has received it) after 2 times the maximum propagation time. If the sender
station does not receive the its own frame during this time limit then, it retransmit this
frame by using backoff algorithm that we will discuss later on. And if, after a number
of repeats if it does receive own pocket then the station gives up and stops
retransmitting the same frame.

Let R be the bit rate of the transmission channel and L be the length of the frame.
Here, we are assuming that the size of frame will be constant and hence, it will take
constant time t= L/R for transmission of each packet.

As in the case of Pure ALOHA protocol frames can be sent any time so, the
probability of collision will be very high. Hence, to present a frame from colliding, no
other frame should be sent within its transmission time. We will explain this with the
help of the concept of vulnerable period as shown in Figure 4. Let a frame is that
transmitted at time t0 and t be the time required for its transmission. If, any other
station sends a frame between t0 and t0+t then the end of the frame will collide with
that earlier sent frame. Similarly, if any other station transmits a frame between the
time interval t0+t and t0+2t again, it will result in a garbage frame due to collision with
the reference frame. Hence, 2t is the vulnerable interval for the frame. In case a frame
meets with collision that frame is retransmitted after a random delay.

37
Media Access Control and
Data Link Layer

Reference frame
Collision with Collision
the start of the with the end
reference of the
frame reference
frame
Vulnerable interval

t0 t0+t t0+2t t0+3t

Figure 4: Vulnerable Period

Hence, for the probability of successful transmission, no additional frame should be


transmitted in the vulnerable interval 2t.

To find the probability of no collision with a reference a frame, we assume that a


number of users are generating new frames according to Poisons distribution. Let S be
the arrival rate of new frames per frame time. As we find probability of no collision, S
will represent the throughput of the system. Let G be the total arrival rate of frames
including retransmission frames (also called load of the system). For finding the
probability of transmission from the new and retransmitted frame. It is assumed that
frames arrival is Poisson distributed with an average number of arrivals of G frames/
frame time. The probability of k frames transmission in 2t seconds is given by the
Poisson distribution as follows:

The throughput of the system S is equal to total arrival rate G times the probability of
successful transmission with no collision,

That is S = G * P
S=G * P (zero frame transmission in the vulnerable interval i.e.,2t seconds)
Since
P [K frame in vulnerable interval 2t] = (2G) e–2G , K = 0, 1, 2,3
K!

Thus
P [K = 0 in 2t] = – 2G
Hence, S = G * P = G . e–2G
Note that the averages load is G. Hence it is 2G in 2t
S=G * e-2G

The relationship between S vs. G can be shown in Figure 5.

38
Contention-based Media
Access Protocols

0.2 18%
Pure Aloha
S 0.15

0.10
S = G e -2G
0.05

0.5 1.0 1.5 2.0

Figure 5: Throughput vs. load graph of pure ALOHA

As G is increasing, S is also increasing for small values of G. At G=1/2, S attains its


peak value i.e., S=1/2e i.e., 0.18(approx). After that, it starts decreasing for increasing
values of G. Here, the average number of successful transmission attempts/frames can
be given as G/S = e2G.

An average number of unsuccessful transmission attempts/frame is


G/S – 1 = e2G − 1.

By this, we know that the performance of ALOHA is not good as unsuccessful


transmission are increasing exponentially with load G. So, we will discuss Slotted
ALOHA in the next section to see how performance can be improved.

3.4 SLOTTED ALOHA


In this, we can improve the performance by reducing the probability of collision. In
the slotted ALOHA stations are allowed to transmit frames in slots only. If more than
one station transmit in the same slot, it will lead to collision This reduces the
occurrence of collision in the network system. Here, every station has to maintain the
record of time slot. The process of transmission will be initiated by any station at the
beginning of the time slot only. Here also, frames are assumed to be of constant length
and with the same transmission time. Here the frame will collide with the reference
frame only if, it arrives in the interval t0-t to t0. Hence, here the vulnerable period is
reduced that is to t seconds long.

The throughput of the system S is equal to the total arrival rate G times the probability
of successful transmission with no collision
That is S = G * P
S=G * P (zero frame transmission in t seconds)

The probability of k frames transmission in t seconds and is given by the Poisson


distribution as follows:
P[ k ]= (G)k * e-G/k!, k=0,1,2,3……
Here average load in the vulnerable interval is G (one frame time)
Hence, the probability of zero frames in t seconds = e-G

S= G * e-G

39
Media Access Control and The relationship between S vs G can be shown in Figure 6.
Data Link Layer

36%
0.4
S=G e -G
S 0.3

0.2

0.1

0.5 1.0 1.5 2.0

Figure 6: Throughput vs. load graph of slotted ALOHA

From the figure we can see that the system is exhibiting its performance. Maximum
throughput that can be achieved with Slotted ALOHA S=1/e= 36 % (Approx.)

However, with this performance also we are not able to utilise the medium in an
efficient manner. Due to the high rate of collision systems the bandwidth is which was
designed to implement random access in LANs. So, we will discuss a new protocol
called CSMA in the next section.

3.5 CARRIER SENSE MULTIPLE ACCESS


(CSMA)
As we have seen in previous section, the Slotted ALOHA maximum throughput that
can be achieved is 1/e only, though, the stations do not keep track of what the other
station is doing or what’s going on in the medium. Then also, many frames meet and
collide. So in LANs we will observe the behavior of other station as well and try to
reduce the number of collision to achieve better throughput of the network. To
achieve maximum throughput here, we will try to restrict transmission that will cause
collision by sensing whether the medium has some data or not. Protocols in which
station senses the channel before starting transmission are in the category of CSMA
protocols (also known as listen before talk protocols).

CSMA have many variants available that are to be adapted according to the behaviour
of the station that has frames to be transmitted when the channel is busy or that some
transmission is going on. The following are some versions of CSMA protocols:

• 1-Persistent CSMA
• Non-Persistent CSMA
• p-Persistent CSMA

1-Persistent CSMA
In this protocol a station i.e., who wants to transmit some frame will sense the channel
first, if it is found busy than that some transmission is going on the medium, then, this
station will continuously keep sensing that the channel. And as soon as this station
finds that the channel has become idle it will transmit its frame. But if more than one
station is in waiting state and keeps track of the channel then a collision will occur in
the system because both waiting station will transmit their frames at the same time.
The other possibility of collision can be if the frame has not reached any other station

40
then, it indicates to the second station that the channel is free. So the second station Contention-based Media
also starts its transmission and that will lead to collision. Thus 1-persistent CSMA a Access Protocols
greedy protocol as to capture the channel as soon as it finds it idle. And, hence, it has
a high frequency of collision in the system. In case of collision, the station senses the
channel again after random delay.

Non-Persistent CSMA
To reduce the frequency of the occurrence of collision in the system then, another
version of CSMA that is non-persistent CSMA can be used. Here, the station who has
frames to transmit first sense whether the channel is busy or free. If the station finds
that channel to be free it simply transmits its frame. Otherwise, it will wait for a
random amount of time and repeat the process after that time span is over. As it does
not continuously senses the channel to be, it is less greedy in comparison of
1-Persistent CSMA. It reduces the probability of the occurrence of collision as the
waiting stations will not transmit their frames at the same time because the stations are
waiting for a random amount of time, before restarting the process. Random time may
be different for different stations so, the likelihood waiting station will start their
transmission at the same time is reduced. But, it can lead to longer delays than the
1-Persistent CSMA.

p-Persistent CSMA
This category of CSMA combines features of the above versions of CSMA that is
1-persistent CSMA and non-persistent CSMA. This version is applicable for the
slotted channel. The station that has frames to transmit, senses the channel and if
found free then simply transmits the frame with p probability and with probability 1-p
it, defers the process. If the channel is found busy then, the station persists sensing the
channel until it became idle. Here value of p is the controlling parameter.

After studying the behaviour of throughput vs load for persistent CSMA it is found
that Non-Persistent CSMA has maximum throughput. But we can using collision
detection mechanism improve upon this to achieve more throughput in the system
using collision defection mechanism and for the same we will discuss CSMA/CD in
the next section.

3.6 CSMA WITH COLLISION DETECTION


(CSMA/CD)
As before here also any transmission in the system needs to sense the channel to see
whether it is busy or free. The stations ensure that the transmission will start only
when it finds that the channel is idle. In CSMA/CD the station aborts the process of
transmission as soon as they detect some collision in the system. If two stations sense
that the channel is free at the same time, then, both start transmission process
immediately. And after that, both stations get information that collision has occurred
in the system. Here, after the station detecting the collision, the system aborts the
process of transmission. In this way, time is saved and utilisation of bandwidth is
optimised. This protocol is known as CSMA/CD and, this scheme is commonly used
in LANs. Now, we will discuss the basic operation of CSMA/CD. Let, t be the
maximum transmission time between two extreme ends of a network system (LAN).
At t0 station A, at one extreme end of the LAN begins the process of transmitting a
frame FA. This frame reaches the station E which at another extreme end of the same
network system in t propagation delay away. If no other station in between has started
its frame transmission, it implies that A has captured the channel successfully. But, in
case EF station E starts its frame transmission just before the arrival of frame from
station A frame then, collision will take place. Station A will get the signal of

41
Media Access Control and collision after 2t time. Hence, 2t time is required to ensure that station A has captured
Data Link Layer the channel successfully as shown with the help of Figure 8.

Time= t0 Time=t
A E

A E

A E

Figure 8: Collision detection

Collision of frames will be detected by looking at the strength of electric pulse or


signal received after collision. After a station detects a collision, it aborts the
transmission process and waits for some random amount of time and tries the
transmission again with the assumption that no other station has started its
transmission in the interval of propagation time. And hence, in CSMA/CD the channel
can be any of the following three states as it can be shown with the Figure 9.

• Transmission of frame is going on.


• Idle slot.
• Contention period/slot.

Frame Frame Frame Frame

Transmission Contention Contention Idle


interval interval interval interval

Figure 9: Transmission states

In CSMA/CD a station with a frame ready to begin transmission senses the channel
and starts transmission if it finds that the channel is idle. Otherwise, if it finds it busy,
the station can persist and use backoff algorithm which will be discussed in the next
paragraph.

Backoff Algorithm
With the help of backoff algorithm we will see how the randomisation process occurs
as soon as collision detection takes place. Time is divided into discrete slots with the
length of worst case propagation time (propagation time between two extreme ends of
LAN) 2t. After the first collision in the system, each station waits for 0 or 1 slot time
before trying transmission for the next time. If, two stations that collide is select the
same random number then collision will be repeated. After the second collision, the
station will select 0,1,2 or 3 randomly and wait for these many number of slots. If, the
process of collision will occur repeatedly, then, the random number interval would be

42
between 0 and 2i-1 for ith collision and this number of slots will be the waiting time Contention-based Media
for the station. This algorithm is known as the binary exponential algorithm. Access Protocols

 Check Your Progress 1


1) Why is DLL divided into two sub layers? What are the key functions of those
sub layers?

……………………………………………………………………………………
……………………………………………………………………………………
……………………………………………………………………………………

2) How does Slotted ALOHA improve the performance of the system over Pure
ALOHA?
……………………………………………………………………………………
……………………………………………………………………………………
……………………………………………………………………………………

3) How has non-persistent reduced the probability of collision?


……………………………………………………………………………………
……………………………………………………………………………………
……………………………………………………………………………………
4) Explain Back off Algorithm and give one example of where it is used.
……………………………………………………………………………………
……………………………………………………………………………………
……………………………………………………………………………………

3.7 ETHERNET FRAME FORMAT (IEEE 802.3)


Ethernet protocol is a MAC sublayer protocol. Ethernet stands for cable and IEEE
802.3 Ethernet protocol was designed to operate at 10 Mbps. Here, we will begin
discussing the Ethernet with various types of cabling. With the help of Figure 9, we
will try to summarise the cabling used for baseband 802.3 LANs.

Characteristic\Cable 10Base5 10Base2 10BaseT 10BaseF


Medium Thick Thin Coaxial Twisted Pair Optical
Coaxial Cable Fiber
Cable
Maximum Length of 500 m 200 m 100 m 2 Km
segment
Topology Bus Bus Star Star
Advantages Used for Low cost Existing Good noise
connecting environment immunity
workstation can use Hub and good to
with tap on and connect use
the cable the stations

Figure 9: Characteristics ethernet cable

43
Media Access Control and IEEE 802.3 Ethernet accesses the channel using 1-persistent CSMA/CD method in
Data Link Layer LAN. Now we will discuss MAC frame structure for IEEE 802.3 with the
help of Figure 10.

Preamble Start Destination Source Length Data Pad Frame


Delimiter Address Address of Data Check
of frame Field Sum

Figure 10: Ethernet Frame Format

Each frame has seven fields explained as follows:


Preamble: The first field of 802.3 frame is 7 byte (56 bits) long with a sequence of
alternate 1 and 0 i.e., 10101010. This pattern helps the receiver to synchronise and get
the beginning of the frame.

Starting Delimiter (SD): The second field start delimiter is 1 byte (8 bit) long. It has
pattern 10101011. Again, it is to indicate the beginning of the frame and ensure that
the next field will be a destination address. Address, here, can be a single address or a
group address.
Destination Address (DA): This field is 6 byte (48 bit) long. It contains the physical
address of the receiver.
Source Address (SA): This filed is also 6 byte (48 bit) long. It contains the physical
address of the sender.

Length of Data Field: It is 2 byte (16 bit) long. It indicates the number of bytes in the
information field. The longest allowable value can be 1518 bytes.

Data: This field size will be a minimum of 46 bytes long and a maximum of 1500
bytes as will be explained later.

Pad: This field size can be 0 to 46 bytes long. This is required if, the data size is less
than 46 bytes as a 802.3 frame must be at least 64 bytes long.

Frame Checksum (FCS): This field is 4 bytes (32 bit) long. It contains information
about error detection. Here it is CRC-32.
Minimum and Maximum Length of Frame

Minimum frame length = 64 bytes = 512 bits


Maximum frame length= 1518 bytes = 12144 bits

Minimum length or lower limit for frame length is defined for normal operation of
CSMA/CD. This is required so that, the entire frame is not transmitted completely
before its first bit has been received by the receiver. If, this happens then the
probability of the occurrence of collision will be high (the same has been explained
earlier in the previous section CSMA/CD).

Hence, Ethernet frame must be of 64 bytes long. Some of the bytes are header and
trailer parts of the frame. If, we consider 6 bytes destination address, 6 bytes source
address, 2 bytes length and 4 bytes FCS (6+6+2+4=18) then, the minimum length of
data will be 64-18= 46 bytes. If, frame is less than 46 bytes then, padding bits fill up
this difference.

As per 802.3 standard, the frames maximum length or upper limit of frame is = 1518
bytes (excluding preamble and SD). If we subtract 18 bytes of header and trailer then,
the maximum length will be 1500 bytes.

44
Contention-based Media
3.8 SUMMARY Access Protocols

In some networks, if a single channel and many users use that channel, then,
allocation strategy is required for the channel. We have discussed FDM and TDM
allocation method. They are the simplest methods for allocation. They work
efficiently for a small number of user. For a large number of users the ALOHA
protocol is considered. There are two versions of ALOHA that is Pure ALOHA and
Slotted ALOHA. In Pure ALOHA no slotting was done but the efficiency was poor.
In Slotted ALOHA, slots have been made, so that every frame transmission starts at
the beginning of the slot and throughput is increased by a factor of 2. For avoiding
collision and to increase efficiency in sensing the channel, CSMA is used. Many
versions of CSMA are persistent and non-persistent. In CSMA/CD collision detection
process is added so that process can be aborted just after a collision is detected.
Ethernet is a commonly used protocol for LAN. IEEE 802.3 Ethernet uses 1 persistent
CSMA/CD access method.

3.9 SOLUTIONS/ANSWERS

Check Your Progress 1

1) DLL is divided into two sub layers LLC and MAC as IEEE has defined
LLC for standard LANs and MAC for avoiding the conflict and collision on a
network to access to the medium at any time. LLC does error flow control and
MAC deals with channel allocation problem.

2) Slotted ALOHA follows synchronization for transmitting the frames that


reduces the probability of collision and hence improves the efficiency.

3) In non persistent strategy, station waits for random amount of time after sensing
the collision on multiple access channels. Hence are stations attempts for
retransmission after random time that reduces the probability of collision.

4) After a collision is sensed by the channel, time is divided up into discrete slots.
For example, if first collision identified then each station waits for either 0 or 1
slot time. Similarly, if third collision occurs then random interval will be 0 to 7
and for ith collision random number interval will be 0 to 2i-1. Subsequently,
these many numbers of slots will be skipped before retransmission. This is
called as binary exponential back off algorithm. CSMA/CD uses back off
algorithm.

3.10 FURTHER READINGS

1) Computer Networks, Andrew S. Tanenbaum, 4th Edition, Prentice Hall of India,


New Delhi.

2) Data and Computer Communications, William Stalling, 5th Edition, Pearson


Education, New Delhi.

3) Data Communications and Networking, Behrouz A. Forouzan, 3rd Edition,


Tata McGraw Hill, New Delhi.

4) Communication Networks− Fundamental Concepts and Key Architectures,


Leon Garcia and Widjaja 3rd Edition, Tata McGraw Hill, New Delhi.

45
Media Access Control and
Data Link Layer

46

You might also like