Module-4[1]
Module-4[1]
1. ALOHA
2. CSMA-Carrier Sense Multiple Access
3. CSMA/CD-Carrier Sense Multiple Access with Collision
Detection
4. CSMA/CA- Detection Carrier Sense Multiple Access with
Collision Avoidance
12.5
ALOHA
• ALOHA, the earliest random access method, was developed
at the University of Hawaii in early 1970. It was designed for
a radio (wireless) LAN, but it can be used on any shared
medium.
• Pure ALOHA
– each station sends a frame whenever it has a frame to send
(multiple access). However, since there is only one channel to share,
there is the possibility of collision between frames from different
stations
• Slotted ALOHA
– divide the time into slots
PURE ALOHA
• It allows users to transmit whenever they have data to be sent.
• Senders wait to see if a collision occurred (after whole message has been sent).
• If collision occurs, each station involved waits a random amount of time then tries again.
• Systems in which multiple users share a common channel in a way that can lead to
conflicts are widely known as contention systems.
• Whenever two frames try to occupy the channel at the same time, there will be a collision
and both will be garbled.
• If the first bit of a new frame overlaps with just the last bit of a frame almost finished,
both frames will be totally destroyed and both will have to be retransmitted later.
Frames in a pure ALOHA
network
Procedure for pure ALOHA protocol
Vulnerable time(Time in which possibility of Collision)
for pure ALOHA protocol
12.13
Note
Solution
Step-1 : Transmission time Tfr = 200 bits/200 kbps = 1 ms.
This means no station should send later than 1 ms before this station starts transmission and no
station should start sending during the one 1-ms period that this station is sending.
12.16
Slotted ALOHA
• Pure ALOHA has a vulnerable time of 2 x Tfr . This is so because there is
no rule that defines when the station can send.
• A station may send soon after another station has started or soon before
another station has finished. Slotted ALOHA was invented to improve the
efficiency of pure ALOHA.
• In slotted ALOHA we divide the time into slots of Tfr s and force the
station to send only at the beginning of the time slot.
Frames in a slotted ALOHA network
12.18
Vulnerable time for slotted ALOHA protocol
12.19
Note
Solution
Step 1- Frame transmission time(Tfr) = 200bits/200 kbps =1 ms.
Step 2- Find Average number of frame generated(G) by the system during one frame
transmission
1 Second ---------- > 1000 Frame G = 1000 * 1 milisecond = 1
1 milisecond -------> ? 1 Second
Step 3- Calculate Maximum throughput(S)
S = G * e-2G S = 1 * e-(1) S = 0.368 S = 36.8%
S = 0.368 * 1000 = 368 out off 1000 frame successfully send to receiver 12.16
CSMA(Carrier Sense Multiple Access)
• To minimize the chance of collision and, therefore,
increase the performance, the CSMA method was
developed.
• The chance of collision can be reduced if a station senses
the medium before trying to use it.
• Carrier sense multiple access (CSMA) requires that
each station first listen to the medium (or check the state
of the medium) before sending.
• In other words, CSMA is based on the principle “sense
before transmit” or “listen before talk.”
Space/time model of the collision in CSMA
12.23
Vulnerable time in CSMA
12.24
Persistence Methods
• What should a station do if the channel is busy? What
should a station do if the channel is idle?
• Three methods have been devised to answer these
questions: the 1-persistent method, the nonpersistent
method, and the p-persistent method
Behavior of three persistence methods
12.26
Flow diagram for three persistence methods
12.27
1-Persistent
12.33
Collision and abortion in CSMA/CD
12.34
Figure Flow diagram for the CSMA/CD
12.35
Figure Energy level during transmission, idleness or collision
12.36
Minimum Frame Size
• For CSMA/CD to work, we need a restriction on the
frame size. Before sending the last bit of the frame, the
sending station must detect a collision, if any, and abort
the transmission.
• This is so because the station, once the entire frame is sent,
does not keep a copy of the frame and does not monitor
the line for collision detection.
• Therefore, the frame transmission time Tfr must be at
least two times the maximum propagation time Tp.
A network using CSMA/CD has a bandwidth of 10 Mbps. If the maximum
propagation time (including the delays in the devices and ignoring the time
needed to send a jamming signal, as we see later) is 25.6 μs, what is the
minimum size of the frame?
Solution
The frame transmission time is Tfr = 2 × Tp = 51.2 μs. This means, in the worst
case, a station needs to transmit for a period of 51.2 μs to detect the
collision. The minimum size of the frame is 10 Mbps × 51.2 μs = 512 bits or
64 bytes. This is actually the minimum size of the frame for Standard
Ethernet.
12.38
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 the 1-persistent method, the maximum throughput
is around 50 percent when G = 1.
• For the nonpersistent method,the maximum throughput
can go up to 90 percent when G is between 3 and 8
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.
12.42
Interframe Space (IFS)
• First collisions are avoided by deferring transmission
• If channel ideal but it still needs to wait a time equal
to the contention time
• In CSMA/CA, the IFS can also be used to define the
priority of a station or a frame.
Contention Window
• The contention window is an amount of time
divided into slots.
• This is very similar to the p-persistent method
• In CSMA/CA, if the station finds the channel busy, it
does not restart the timer of the contention
window; it stops the timer and restarts it when the
channel becomes idle.
Acknowledgment
• The data may be corrupted during the
transmission.
• The positive acknowledgment and the time-out
timer can help guarantee that the receiver has
received the frame.
Flow
Diagram
for
CSMA/CA
12.46
Exercises
1. Assume the propagation delay in a broadcast network is 5
μs and the frame transmission time is 10 μs.
• How long does it take for the first bit to reach
the destination?
• How long does it take for the last bit to reach the
destination after the first bit has arrived?
• How long is the network involved with this
frame (vulnerable to collision)?
Exercises
2. Stations in a slotted Aloha network send frames of size
1000 bits at the rate of 1 Mbps. What is vulnerable time for
this network?
Exercises
3. In a CSMAlCD network with a data rate of 10 Mbps, the
minimum frame size is found to be 512 bits for the correct
operation of the collision detection process. What should
be the minimum frame size if we increase the data rate to
100 Mbps? To 1 Gbps? To 10 Gbps?
4. In a CSMAlCD network with a data rate of 10 Mbps, the
maximum distance between any station pair is found to be
2500 m for the correct operation of the collision detection
process. What should be the maximum distance if we
increase the data rate to 100 Mbps? To 1 Gbps? To 10
Gbps?
5. In a bus CSMA/CD network with a data rate of 10 Mbps, a
collision occurs 20 μs after the first bit of the frame leaves
the sending station. What should the length of the frame be
so that the sender can detect the collision?
6. Assume that there are only two stations, A and B, in a bus
CSMA/CD network. The distance between the two stations
is 2000 m and the propagation speed is 2 × 108 m/s. If
station A starts transmitting at time t1:
a. Does the protocol allow station B to start transmitting at
time
t1 + 8 μs? If the answer is yes, what will happen?
a. Does the protocol allow station B to start transmitting at
time t1 + 11 μs? If the answer is yes, what will happen?
Exercises
7. To understand why we need to have a minimum frame size Tfr = 2 ×
Tp in a CSMA/CD network, assume we have a bus network with only
two stations, A and B, in which Tfr = 40 μs and Tp = 25 μs. Station A
starts sending a frame at time t = 0.0 μs and station B starts sending a
frame at t = 23.0 μs. Answer the following questions:
a. Do frames collide?
b. If the answer to part a is yes, does station A detect collision?
c. If the answer to part a is yes, does station B detect collision?
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 popular controlled-access methods.
1. Reservation
2. Polling
3. Token Passing
12.53
Reservation
• 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. Each
minislot belongs to a station.
• 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
Reservation access method
• Figure shows a situation with five stations and a 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.
12.55
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. It is up to the primary
device to determine which device is allowed to use the
channel at a given time
Select and poll functions in polling access method
• If the primary wants to receive data, it asks the secondaries if they have anything to
send; this is called poll function.
• If the primary wants to send data, it tells the secondary to get ready to receive; this is
called select function. 12.57
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 station having the token can access the channel and
send the data.
• When a station has some data to send, it waits until it
receives the token from its predecessor. It then holds
the token and sends its data.
Logical ring and physical topology in token-passing access method
12.59
CHANNELIZATIO
N
Channelizationis multiple-access method in which
a
bandwidth of a the
link available
is shared in time,
frequency,
between or
different through
In this code,
section, we
stations.protocols.
channelization discuss three
12.60
Frequency-division multiple access (FDMA)
12.61
Frequency-division multiple access (FDMA)
12.62
Note
12.63
Time-division multiple access (TDMA)
• Suppose the channel supports N nodes and that the transmission rate of
the channel is R bps.
• TDM divides time into time frames and further divides each time frame
into N time slots.
• Each time slot is then assigned to one of the N nodes.
• Example: 6-station LAN, 1,3,4 have packet, slots 2,5,6 idle
12.64
Time-division multiple access (TDMA)
12.65
Time-division multiple access (TDMA)
12.66
Note
12.67
Code-division multiple access (CDMA)
• CDMA assigns a different code to each node, While TDM and FDM assign
time slots and frequencies respectively.
• Each node then uses its unique code to encode the data bits it sends.
• If the codes are chosen carefully, CDMA networks have the wonderful
property that different nodes can transmit simultaneously.
• Their respective receivers correctly receive a sender’s encoded data bits in
spite of interfering transmissions by other nodes.
• Example: Used in military and widespread civilian use, particularly in
cellular telephony.
• Because CDMA’s use is so tightly tied to wireless channels.
12.68
Note
12.69
Simple idea of communication with
code
12.70
Chip
sequences
Data representation in
CDMA
Sharing channel in CDMA
General rule and examples of creating Walsh tables
Note
The number of sequences in a Walsh table needs to be
N = 2m .
Example
Solution
We can use the rows of W2 and W4 in Figure:
a. For a two-station network, we have
[+1 +1] and [+1 −1].
Solution
The number of sequences needs to be 2m. We need to choose m = 7 and
N = 27or 128. We can then use 90
of the sequences as the chips.
Example 12.8
Prove that a receiving station can get the data sent by a specific sender if it
multiplies the entire data on the channel by the sender’s chip code and then
divides it by the number of stations.
Solution
Let us prove this for the first station, using
example.
our can
previous four-stationthe data on
We D say the channel c2 +
=
The receiver which wants tothat c1+ data sent d3
get the c3 1 multiplies
by station + these
data by(d1
c1. d2 d4 c4).
Example
(continued)
• Ethernet is a set of technologies and protocols that are used primarily in LANs. It was first
standardized in 1980s as IEEE 802.3 standard.
• Ethernet is classified into two categories:
• Classic Ethernet : which solves the multiple access problem using the techniques we have
studied previously.
• Switched Ethernet : In which devices called switches are used to connect different
computers.
• It is important to note that, while they are both referred to as Ethernet, they are quite
different.
• Classic Ethernet is the original form and ran at rates from 3 to 10 Mbps.
• Switched Ethernet is what Ethernet has become and runs at 100, 1000, and 10,000 Mbps,
in forms called fast Ethernet, gigabit Ethernet, and 10 gigabit Ethernet.
• In practice, only switched Ethernet is used nowadays. 12.80
Ethernet
12.81
Classic Ethernet
12.82
Switched Ethernet
• Ethernet soon began to evolve away from the single long cable
architecture of classic Ethernet.
• The problems associated with finding breaks or loose connections drove it
toward a different kind of wiring pattern, in which each station has a
dedicated cable running to a central hub.
• A hub simply connects all the attached wires electrically, as if they were
soldered together.
12.83