L19 - U2 - 17 April 2024

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

PSIT-Pranveer Singh Institute of Technology

Kanpur-Delhi National Highway (NH-2), Bhauti, Kanpur-209305 (U.P.), India

CSMA/CA and Controlled Accessed

Prof. (Dr.) Brijesh Kumar Chaurasia


Department of Computer Science and Engineering
PSIT-Pranveer Singh Institute of Technology, Kanpur, India
Pre-Requisites

Students need an introductory course in


probability, a strong understanding of binary
numbers, bits and bytes, and knowledge of how
computers lay out data in memory.

Queuing theory
Physical Layer
Syllabus

Computer Networks (KCS603)


Unit-I :
Introductory Concepts: Goals and applications of networks,
Categories of networks, Organization of the Internet, ISP,
Network structure and architecture (layering principles,
services, protocols and standards), The OSI reference model,
TCP/IP protocol suite, Network devices and components.

Physical Layer: Network topology design, Types of


connections, Transmission media, Signal transmission and
encoding, Network performance and transmission
impairments, Switching techniques and multiplexing.
Syllabus
Computer Networks (KCS603)
Unit-II :
Link layer: Framing, Error Detection and Correction, Flow
control (Elementary Data Link Protocols, Sliding Window
protocols). Medium Access Control and Local Area Networks:
Channel allocation, Multiple access protocols, LAN
standards, Link layer switches & bridges (learning bridge and
spanning tree algorithms).
Unit-III :
Network Layer: Point-to-point networks, Logical addressing,
Basic internetworking (IP, CIDR, ARP, RARP, DHCP, ICMP),
Routing, forwarding and delivery, Static and dynamic routing,
Routing algorithms and protocols, Congestion control
algorithms, IPv6.
Syllabus
Computer Networks (KCS603)
Unit-VI :
Transport Layer: Process-to-process delivery, Transport
layer protocols (UDP and TCP), Multiplexing, Connection
management, Flow control and retransmission, Window
management, TCP Congestion control, Quality of service.
Unit-V :
Application Layer: Domain Name System, World Wide
Web and Hyper Text Transfer Protocol, Electronic mail,
File Transfer Protocol, Remote login, Network
management, Data compression, Cryptography – basic
concepts.
Books
Text Books & Reference Books:
1. Behrouz Forouzan, “Data Communication and
Networking”, McGraw Hill
2. Andrew Tanenbaum “Computer Networks”, Prentice Hall.
3. William Stallings, “Data and Computer Communication”,
Pearson.
4. Kurose and Ross, “Computer Networking- A Top-Down
Approach”, Pearson.
5. Peterson and Davie, “Computer Networks: A Systems
Approach”, Morgan Kaufmann
6. W. A. Shay, “Understanding Communications and
Networks”, Cengage Learning.
7. D. Comer, “Computer Networks and Internets”, Pearson.
8. Behrouz Forouzan, “TCP/IP Protocol Suite”, McGraw Hill.
References
References
To provide the knowledge of basics of computer networking, and
Objective(s) protocols used by the advanced communication systems.

Level of Bloom's Taxonomy


Level of Bloom's Taxonomy
L1:Remember and L2:Understand
L3:Apply and L4:Analyze
L5:Evaluate and L6:Create
After completion of this course the students are expected to be able to demonstrate following
knowledge, skills and attitudes towards:
CO No. Course Outcomes According to Bloom's Cognitive Level
KCS- Define [L1: Remember] different protocols, switching methodology,
603.1(CO1) communication techniques available for voice and data network.

KCS- Describe [L2: Understand] different Network Protocols and components of


603.2(CO2)) networks.

KCS- Apply [L3: Apply] different methodologies, cryptographic and error handling
603.3(CO3) mechanisms to implement a secure, fast, error free and congestion free network.

KCS- Analyze [L4: Analyze] and measure the performance of different network
603.4(CO4) protocols.
Disclaimers

All the pictures used in this presentation are taken


from freely available websites.

If there is a reference on a slides all of the


information on that slide is attributed to that source
whether quotation marks are used or not.
Disclaimers

Any mention of commercial products or reference


to commercial organizations is for information
only;

it does not imply recommendation or


endorsement nor does it imply that the products
mentioned are necessarily the best available for
the purpose.
Networks

CSMA/CA, Reservation
Controlle
T1/CH12/12.3/ Protocols, Polling, Token
19 d Access Passing 2 CO4
344
Protocol
Revision
CSMA/CD
CSMA/CD

It is similar to the one for the ALOHA protocol, but there


are differences.

The first difference is the addition of the persistence


process.

We need to sense the channel before we start sending the


frame by using one of the persistence processes we
discussed previously (nonpersistent, 1-persistent, or p-
persistent).
CSMA/CD

The second difference is the frame transmission.

In ALOHA, we first transmit the entire frame and then wait


for an acknowledgment.

In CSMA/CD, transmission and collision detection is a


continuous process.

We do not send the entire frame and then look for a


collision.
Brainstorming
CSMA/CD

The station transmits and receives continuously and simultaneously


(using two different ports).

We use a loop to show that transmission is a continuous process.

We constantly monitor in order to detect one of two conditions: either


transmission is finished or a collision is detected.

Either event stops transmission.

When we come out of the loop, if a collision has not been detected, it
means that transmission is complete; the entire frame is transmitted.

Otherwise, a collision has occurred.


Brainstorming
CSMA/CD

The first difference is the addition of the persistence


process.

The second difference is the frame transmission.

The third difference is the sending of a short jamming


signal that enforces the collision in case other stations
have not yet sensed the

collision.
CSMA/CD – Energy Level

The level of energy in a channel can have three values:


zero, normal, and abnormal.

At the zero level, the channel is idle.

At the normal level, a station has successfully captured


the channel and is sending its frame.

At the abnormal level, there is a collision and the level of


the energy is twice the normal level.
CSMA/CD – Energy Level

A station that has a frame to send or is sending a frame


needs to monitor the energy level to determine if the
channel is idle, busy, or in collision mode.
CSMA/CD – Throughput

The throughput of CSMA/CD is greater than that of pure


or slotted ALOHA.

The maximum throughput occurs at a different value of G


and is based on the persistence method and the value of
p in the p-persistent approach.

For 1-persistent method the maximum throughput is


around 50 percent when G =1.

For nonpersistent method, the maximum throughput can


go up to 90 percent when G is between 3 and 8.
Binary exponential back off

Random waiting period but consecutive collisions increase


the mean waiting time
 mean waiting time doubles in the first 10 retransmission attempts

 after first collision, waits 0 or 1 slot time (selected at random)

 if collided again (second time), waits 0, 1, 2 or 3 slots (at random)

 if collided for the ith time, waits 0, 1, …, or 2i-1 slots (at random)

 the randomization interval is fixed to 0 … 1023 after 10th collision

 station tries a total of 16 times and then gives up if cannot transmit


Binary exponential back off

Random waiting period but consecutive collisions increase


the mean waiting time

Low delay with small amount of waiting stations

Large delay with large amount of waiting stations

One slot time = max. round trip delay


 50 microsecs in 10 Mbps Ethernet
CSMA/CA
Brainstorming
CSMA/CA

The basic idea behind CSMA/CD is that a station needs to be able to


receive while transmitting to detect a collision.

When there is no collision, the station receives one signal: its own
signal.

When there is a collision, the station receives two signals: its own
signal and the signal transmitted by a second station.

To distinguish between these two cases, the received signals in these


two cases must be significantly different.

In other words, the signal from the second station needs to add a
significant amount of energy to the one created by the first station.
Brainstorming
CSMA/CA

In a wired network, the received signal has almost the same energy
as the sent signal because either the length of the cable is short or
there are repeaters that amplify the energy between the sender and
the receiver.

This means that in a collision, the detected energy almost doubles.

However, in a wireless network, much of the sent energy is lost in


transmission.

The received signal has very little energy.

Therefore, a collision may add only 5 to 10 percent additional energy.

CSMA/CD is not useful for effective collision detection.


CSMA/CA

Carrier sense multiple access with


collision avoidance
CSMA/CA

It is used in wireless networks because they cannot detect the


collision so the only solution is collision avoidance.
Whenever the channel is found idle, the station does
not transmit immediately.
Interframe space (IFS)
Contention window
Acknowledgement
CSMA/CA

Interframe space (IFS)


Whenever the channel is found idle, the station does
not transmit immediately.
It waits for a period of time called interframe space
(IFS).

When channel is sensed to be idle, it may be possible


that same distant station may have already started
transmitting and the signal of that distant station has not
yet reached other stations.
CSMA/CA

Interframe space (IFS)


Therefore the purpose of IFS time is to allow this
transmitted signal to reach other stations.

If after this IFS time, the channel is still idle, the station
can send, but it still needs to wait a time equal to
contention time.

IFS variable can also be used to define the priority of a


station or a frame.
CSMA/CA

Contention window
Contention window is an amount of time divided into
slots.
A station that is ready to send chooses a random
number of slots as its wait time.
The number of slots in the window changes according to
the binary exponential back-off strategy.
It means that it is set of one slot the first time and then
doubles each time the station cannot detect an idle
channel after the IFS time.
CSMA/CA

Contention window
This is very similar to the p-persistent method except
that a random outcome defines the number of slots
taken by the waiting station.

In contention window the station needs to sense the


channel after each time slot.
If the station finds the channel busy, it does not restart
the process. It just stops the timer & restarts it when the
channel is sensed as idle.
CSMA/CA

Acknowledgement

Despite all the precautions, collisions may occur and


destroy the data.

The positive acknowledgment and the time-out timer


can help guarantee that receiver has received the
frame.
CSMA/CA

Contention window?

The contention window is an amount of time divided


into slots.
CSMA/CA
Performance Comparison of all protocols

1.0 0.01-persistent CSMA


0.9 Non-persistent CSMA
0.8
0.7 0.1-persistent CSMA
0.6
0.5-persistent CSMA
S

0.5
1-persistent CSMA
0.4
0.3
0.2
Slotted
Aloha Aloha
0.1
0
0 1 2 3 4 5 6 7 8 9

G
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.

Three controlled-access methods.


Reservation
Polling
Token Passing
Reservation

In the reservation method, a station needs to make a


reservation before sending data.

Time is divided into intervals.

In each interval, a reservation frame precedes the data


frames sent in that interval.

If there are N stations in the system, there are exactly N


reservation minislots in the reservation frame.
Reservation

When a station needs to send a data frame, it makes a


reservation in its own minislot.

The stations that have made reservations can send their


data frames after the reservation frame.
CSMA

Five-minislot reservation frame.

In the first interval, only stations 1, 3, and 4 have made reservations.

In the second interval, only station 1 has made a reservation.


Polling

Polling works with topologies in which one device is


designated as a primary station and the other devices are
secondary stations.

All data exchanges must be made through the primary


device even when the ultimate destination is a secondary
device.

The primary device controls the link; the secondary


devices follow its instructions.
Select and poll functions in polling access method.
Polling
Polling
Select and poll functions in polling access method.

The select function is used whenever the primary device has


something to send.

The poll function is used by the primary device to solicit


transmissions from the secondary devices.

When the primary is ready to receive data, it must ask (poll) each
device in turn if it has anything to send.
Token Passing
In the token-passing method, the stations in a network are
organized in a logical ring.

In other words, for each station, there is a predecessor and a


successor.

The predecessor is the station which is logically before the station


in the ring; the successor is the station which is after the station in
the ring.

The current station is the one that is accessing the channel now.
Token Passing
Token Passing

Token management is needed for this access method.

Stations must be limited in the time they can have


possession of the token.

The token must be monitored to ensure it has not been


lost or destroyed.

For example, if a station that is holding the token fails,


the token will disappear from the network.
Token Passing

Another function of token management is to assign


priorities to the stations and to the types of data being
transmitted.

And finally, token management is needed to make low-


priority stations release the token to high-priority
stations.
Channel Allocation
Data Link Layer Problem

Dynamic Approach Dynamic Approach Static Approach


Channel Allocation
Channel Allocation Approaches

Static

With a static approach, the channel’s capacity is essentially


divided into fixed portions; each user is then allocated a
portion for all time.

If the user has no traffic to use in its portion, then it goes


unused.
Techniques
Channelization

Channelization is a multiple-access method in which the


available bandwidth of a link is shared in time, frequency, or
through code, between different stations.

FDMA,

TDMA, and

CDMA
Techniques
Static Channel Allocation

Frequency Division Multiple Access (FDMA)

With FDMA the available frequency bandwidth is divided


into disjoint frequency bands.

A fixed band is allocated to each user.

FDMA requires a guard band between user frequency


bands to avoid cross-talk.
Techniques
Static Channel Allocation

Frequency Division Multiple Access (FDMA)


Techniques
Static Channel Allocation

Frequency Division Multiple Access (FDMA)


Techniques
Static Channel Allocation

Time Division Multiple Access (TDMA)

With TDMA the time axis is divided into time slots of a fixed
length.

Each user is allocated a fixed set of time slots at which it


can transmit.

TDMA requires that users be synchronized to a common


clock.

Typically extra overhead bits are required for


synchronization.
Techniques
Static Channel Allocation

Time Division Multiple Access (TDMA)


Techniques
Static Channel Allocation

Time Division Multiple Access (TDMA)


Techniques
Static Channel Allocation

Code Division Multiple Access (CDMA)


Another static allocation technique is (CDMA), this technique is used in
many wireless networks.

In CDMA, one channel carries all transmissions


simultaneously.
Techniques
Static Channel Allocation

Code Division Multiple Access (CDMA)

CDMA, simply means communication with different codes.

For example, in a large room with many people, two people can talk in
English if nobody else understands English.

Another two people can talk in Chinese if they are the only ones who
understand Chinese, and so on.

In other words, the common channel, the space of the room in this case,
can easily allow communication between several couples, but in
different languages (codes).
Techniques
Static Channel Allocation

Code Division Multiple Access (CDMA)


Techniques
Static Channel Allocation

Code Division Multiple Access (CDMA)

Data representation in CDMA

Chip sequences
Techniques
Static Channel Allocation

Code Division Multiple Access (CDMA)


Techniques
Static Channel Allocation
General rule and examples of creating Walsh tables
Techniques
Static Channel Allocation
The number of sequences in a Walsh table needs to be N = 2m
Walsh codes are the most common orthogonal codes used
in CDMA applications.

A set of Walsh codes of length n consists of the n rows of


an n×n Walsh matrix.

The matrix is defined recursively in previous diagram


where n is the dimension of the matrix and the overscore
denotes the logical NOT of the bits in the matrix.

The Walsh matrix has the property that every row is


orthogonal to every other row and to the logical NOT of
every other row.
Techniques
Static Channel Allocation
The number of sequences in a Walsh table needs to be N = 2m
It is easily seen that a bitwise multiplication of any two
rows produces 0.

For example, in the 8×8 matrix, row 3 multiplied by row 4


equals 1+(-1)+1+(-1)+1+(-1)+1+(-1)=0.
What is the number of sequences if we have 90 stations in our
network?

Solution
The number of sequences needs to be 2m.
We need to choose m = 7
and
N (Number of Stations) = 27 or 128.

We can then use 90 of the sequences as the chips.


FDMA vs TDMA vs CDMA
Approach TDMA FDMA CDMA
Divide sending time into Divide the
disjoint time slots frequency band Spread the spectrum using
Idea
demand driven or fixed into disjoint orthogonal codes.
patterns. subbands
All terminals can be active
All terminals are active Every terminal has
at the same place at the
Terminals for short periods of time its own frequency
same moment
on same frequency. uninterrupted
uninterrupted.
Signal Synchronization in time Filtering in the Code plus special
separation domain frequency domain. receivers.
Transmission
Discontinuous Continuous Continuous
scheme
Flexible, less frequency
Established fully digital, Simple,
Advantages planning needed, soft
flexible established, robust
handover
Guard space needed
Inflexible, Complex receivers, needs
(multipath
Disadvantages frequencies are more complicated power
propagation),
limited resource control for senders
synchronization difficult

You might also like