Sunteți pe pagina 1din 63

Multiple – access Protocols

RANDOM ACCESS METHODS

In random access or contention methods, no station is superior to another station and none is assigned
the control over another. No station permits, or does not permit, another station to send. At each
instance, a station that has data to send uses a procedure defined by the protocol to make a decision on
whether or not to send.

ALOHA
Carrier Sense Multiple Access
Carrier Sense Multiple Access with Collision Detection
Carrier Sense Multiple Access with Collision Avoidance
ALOHA
ALOHA
 Aloha is a packet-switching system. The time interval required to transmit one packet is called a slot.
 When transmissions from two or more users overlap, they destroy each other, whether it is
complete overlap or partial overlap – collision takes place.
 The maximum interval over which two packets can overlap and destroy each other is called the
vulnerable period.
 The mode of random access in which users can transmit at anytime is called pure Aloha. In this case,
the vulnerable period is two slot times.
 A version in which users are restricted to transmit only from the instant corresponding to the slot
boundary is referred to as slotted Aloha. The alignment of transmission to coincide with the slot
boundary means that packets can only experience complete overlap, so the vulnerable period is
only one slot time.
Frames in Pure ALOHA

5
ALOHA – vulnerable time
Procedure for pure ALOHA protocol
Backoff time

A collision involves 2 or more stations.


If all stations try to resend their frames after the time-out, the frames will collide again.
In pure Aloha, when the time-out period passes, each station waits a random time before resending its frame.
This random time is known as “back-off” time T B .
Time out period is equal to maximum possible round trip propagation delay
ie., RTT=2xTp.
Back-off time is a random value that depends on “K” (no of attempted unsuccessful transmission).
Tb= RxTp or Tb= R x Tfr
Where, R= 0 to 2K-1.
This is called binary exponential back-off time.
EXAMPLE

A pure ALOHA network transmits 200-bit frames on a shared


channel of 200 kbps. What is the requirement to make this frame
collision-free?

Solution
Average frame transmission time :
Tfr is 200 bits/200 kbps or 1 ms. The vulnerable time is 2 × 1 ms = 2 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.
Throughput versus offered traffic for ALOHA systems.
The throughput for pure ALOHA is
S = G × e −2G .
The maximum throughput
Smax = 0.184 when G= (1/2).

WHERE,
G is the average number of frames generated by the system during one frame transmission time.
ie., if one-half a frame is generated during one frame transmission time, then 18.4 percent of these frames reach their
destination successfully.
EXAMPLE
A pure ALOHA network transmits 200-bit frames on a shared channel of 200 kbps. What is
the throughput if the system (all stations together) produces
a. 1000 frames per second b. 500 frames per second
c. 250 frames per second.

SOLUTION
The frame transmission time is 200/200 kbps or 1 ms.
a. If the system creates 1000 frames per second, this is 1 frame per millisecond. The load is 1.
In this case S=G×e−2G or S=0.135(13.5%)
This means that the throughput is 1000 × 0.135 = 135 frames. Only 135 frames out of 1000 will
probably survive.
b. If the system creates 500 frames per second, this is (1/2) frame per millisecond. The load is (1/2).
In this case ,
S = G × e −2G or S = 0.184 (18.4%).
This means that the throughput is 500 × 0.184 = 92 and that only 92 frames out of 500 will probably
survive.
Note that this is the maximum throughput case, percentagewise.

c. If the system creates 250 frames per second, this is (1/4) frame per millisecond.
The load is G=(1/4).
In this case ,
S = G × e −2G or S = 0.152 (15.2 %).
This means that the throughput is 250 × 0.152 = 38. Only 38 frames out of 250 will probably survive.
Slotted ALOHA
• Divide time into slots of Tfr seconds and force the station to send only at the beginning of the time slot.
• If a station misses the beginning of the time slot, it must wait for the next slot, for it to send its frame.
VULNERABLE PERIOD OF SLOTTED ALOHA
Throughput of slotted Aloha

The throughput for slotted ALOHA is


S = G × e−G .
The maximum throughput
Smax = 0.368 when G = 1.
where G is the average number of frames requested per frame-time
EXAMPLE

A slotted ALOHA network transmits 200-bit frames on a shared channel of 200 kbps.
What is the throughput if the system (all stations together) produces a. 1000 frames per
second b. 500 frames per second c. 250 frames per second.

Solution:
The frame transmission time is 200/200 kbps or 1 ms.
a.
If the system creates 1000 frames per second, this is 1 frame per millisec. The load is 1. In this
case S = G× e −G or S = 0.368 (36.8 percent). This means that the throughput is 1000 × 0.0368
= 368 frames. Only 386 frames out of 1000 will probably survive.
EXAMPLE- SOLUTION
b. If the system creates 500 frames per second, this is (1/2) frame per millisec.
The load is (1/2). In this case S = G × e −G or S = 0.303 (30.3 percent).
This means that the throughput is 500 × 0.0303 = 151.
Only 151 frames out of 500 will probably survive.

c. If the system creates 250 frames per second, this is (1/4) frame per millisec. The
load is (1/4). In this case S = G × e −G or S = 0.195 (19.5 percent).
This means that the throughput is 250 × 0.195 = 49.
Only 49 frames out of 250 will probably survive
Carrier Sense Multiple Access

• CSMA protocol was developed to overcome the problem found in ALOHA i.e. to minimize the
chances of collision.
• The station senses the carrier or channel before transmitting a frame. It means the station checks
the state of channel, whether it is idle or busy.

There Are Three Different Type of CSMA Protocols


1. 1- Persistant CSMA
2. Nonpersistant CSMA
3. P- Persistant CSMA
Vulnerable time in CSMA
1-Persistent CSMA

• In this method, station that wants to transmit data continuously senses the channel to check whether the
channel is idle or busy.
• If the channel is busy, the station waits until it becomes idle.
• When the station detects an idle-channel, it immediately transmits the frame with probability 1. Hence it
is called I-persistent CSMA.
• This method has the highest chance of collision because two or more stations may find channel to be idle
at the same time and transmit their frames.
• When the collision occurs, the stations wait a random amount of time and starts all over again.
Non Persistent CSMA
• A station that has a frame to send senses the channel.
• If the channel is idle, it sends immediately.
• If the channel is busy, it waits a random amount of time and then senses the channel again.

Advantage of non-persistent
• It reduces the chance of collision because the stations wait a random amount of time. It is unlikely that two or
more stations will wait for same amount of time and will retransmit at the same time.
Disadvantage of non-persistent
• It reduces the efficiency of network because the channel remains idle when there may be stations with frames
to send. This is due to the fact that the stations wait a random amount of time after the collision.
P- Persistent CSMA
This method is used when channel has time slots such that the time slot duration is equal to or greater than the
maximum propagation delay time.
• Whenever a station becomes ready to send, it senses the channel.
• If channel is busy, station waits until next slot.
• If channel is idle, it transmits with a probability p.
• With the probability q=l-p, the station then waits for the beginning of the next time slot.
• If the next slot is also idle, it either transmits or waits again with probabilities p and q.
• This process is repeated till either frame has been transmitted or another station has begun transmitting.
• In case of the transmission by another station, the station acts as though a collision has occurred and it waits a
random amount of time and starts again.
CSMA/CD
• Station monitors the medium after it sends a frame to see if the transmission was successful.
• If there is a collision, the frame is retransmitted.
• As soon as a collision is detected, the stations abort the transmission of the subsequent bits/frames and
retransmit after a certain backoff time.
• A small jamming signal is sent over the channel, to intimate all stations that a collision just took place.
• The minimum frame transmission time must be atleast two times maximum propagation time. Ie.,
Tfr=2xTp
Flowchart for CSMA/CD
Example
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, 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.
Energy levels of the channel

1. Zero : The channel is idle.


2. Normal level : A station has successfully captured the channel and is sending its Frame.
3. Abnormal level : There is a collision and the level of energy is twice the normal level.

A station that has a frame to transmit, or is sending a frame, needs to monitor the energy level to
determine if the channel is idle, busy or in collision mode.
CSMA/CA
• Carrier Sense Multiple Access with Collision Avoidance
• Used frequently in wireless networks.
Frame Exchange Time Line

DIFS- DCF (Distributed Coordination Function) interframe Space


SIFS- Short Interframe Space
CTS-Clear To Send
RTS- Request to send
NAV- Network Allocation Vector
Collision During Handshaking
• If there is a collision during the time RTS and CTS control frames are in transition (handshaking
period).
• Two or more stations may try to send RTS frames at the same time and these frames collide !

• Since there is no mechanism for collision detection, the sender assumes there has been a collision if it
has not received a CTS frame from the receiver.
• The backoff strategy is employed, and the sender tries again.

Network Allocation Vector


• When a station sends an RTS frame, it includes the duration of time that it needs to occupy the
channel.
• The stations that are affected by this transmission create a timer called Network Allocation Vector.,
that shows how much time must pass before these stations are allowed to check the channel for
idleness.
Handshaking in CSMA/CA
Hidden-Station Problem
Suppose nodes A and B are on the same 12 Mbps broadcast channel, and the propagation delay between the two nodes is 316
bit times. Suppose CSMA/CD and Ethernet packets are used for this broadcast channel. Suppose node A beings transmitting a
frame and, before it finishes, node B begins transmitting a frame. Can A finish transmitting before it detects that B has
transmitted? Why or why not? If the answer is yes, then A incorrectly believes that its frame was successful transmitted without
a collision.

Hint: Suppose at time t = 0 bits, A begins transmitting a frame. In the worst case, A transmits a minimum-sized frame of 512 +
64 bit times. So A would finish transmitting the frame at t =512 + 64 bit times. Thus, the answer is no, if B’s signal reaches A
before bit time t =512 + 64 bits. In the worst case, when does B’s signal reach A?

Answer:
At t = 0 , A transmits. At t = 576 , A would finish transmitting. In the worst case, B begins transmitting at time t=315, which is the
time right before the first bit of A’s frame arrives at B. At time t=315+316=631, B 's first bit arrives at A . Because 631 > 576, A
finishes transmitting before it detects that B has transmitted. So A incorrectly thinks that its frame was successfully transmitted
without a collision.
In a csma/cd lan of 2 km running at 100 megabits per second, what would be the minimum
frame size to hear all collisions?"

• propagation delay =(2000/(2*3*10^8/3)) =10us


• round trip time is the time taken for message to travel from sender to
receiver and back from receiver to sender.
• round trip time =2*propagation delay =20us
• minimum frame size =bandwidth *delay (rtt)
• frame size = bandwidth *rtt =100Mbps*20us=2000bits
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.

1. Reservation
2. Polling
3. Token passing
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 in that interval.
• If there are N station 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 made reservations can send their data frames after the reservation frame.
Polling
• Polling works with topologies in which one device is designated as a primary station, and
the other devices are secondary devices.
• All data exchanges must be made through the primary device.
• This device controls the link and the secondary devices follow the instructions.

• This method uses two functions: Poll and Select.


TOKEN RING (IEEE 802.5)

802.5 Physical Layer Characteristics:

 Date rate: 4 Mbps or 16 Mbps


 Encoding: Differential Manchester
 Max. No. of Stations : 250
 Transmission Medium: STP, UTP
TOKEN RING (IEEE 802.5)
• To transmit a frame, a station must wait for a “free” token to arrive at the interface card.
• When the token arrives, a frame is transmitted and the frame travels along the ring over every point-
to-point link.
• Each station examines the destination address in each passing frame to match with its own address.
• If not, it forwards the frame to the next station.
• The sending station must remove the frame from the ring and reinsert a free token into the ring.
IEEE 802.5 Token and data frame structure
Token Frame Format SD AC ED Token Size: 24 bits

1 1 1 2 or 6 2 or 6 4 1 1
SD AC Destination Source FS
FC
FC Address Information FCS
FCS ED
Address

Starting
J K 0 J K 0 0 0 J, K non-data symbols (line code)
delimiter

Access PPP Priority; T Token bit


control PPP T M RRR M Monitor bit; RRR Reservation

Data Frame Format FF frame type


Frame
FF Z Z Z Z Z Z ZZZZZZ control bit
control
Ending I intermediate-frame bit
J K 1 J K 1 I E E error-detection bit
delimiter
A address-recognized bit
Frame xx undefined
A C xx A C x x
status C frame-copied bit
7/27/19
Starting Delimiter :
J starts with a 0 but has no transition in the middle.
J K 0 J K 0 0 0 J, K non-data symbols (line code)
K starts with a 1 but has no transition in the middle.
Signals the start of a token or packet.

Second byte :Access Control field:


PPP T M RRR
The ‘T’ bit here is the token bit.
‘T’=0 indicates a token frame 00 01 02 03 04 05 06 07
‘T’=1 indicates a data frame. P2 P1 P0 TI M PR2 PR1 PR0
*A station can convert an available token frame (T=0) into a data frame (T=1) by simply flipping the T bit.
• PPP and RRR bits implement 8 levels of priority in access to the ring.
• Monitor M bit is used by a designated monitor station to identify and remove “orphan” frames that are not removed in the
ring by their sending stations.
TOKEN RING 802.5

FRAME CONTROL (FC)


Field indicates whether a frame contains data or MAC information.
FF Z Z Z Z Z Z
Data Frames are identified by FF=00
Z bits then indicate the type of MAC control frame.

FCS-FRAME CHECK SEQUENCE


Contains CRC checksum.

ENDING DELIMITER
ED field contains an E bit – indicates that a station interface has detected an error such as a line code violation or
FCS error.
I bit indicates the last frame in a sequence of frames exchanged between two stations. J K 1 J K 1 I E
FRAME STATUS (FS)
Allows the receiving station to convey transfer status information to the sending station through A and C bits that are
repeated in the field.
A=1 indicates that the destination address was recognized by the receiving station.
C=1 bit indicates the frame was copied onto the receiving station’s buffer.
A=1 and C=1 indicates, the frame was received by the intended destination station.

A C xx A C x x
00 01 02 03 04 05 06 07
ARI FCI 0 0 ARI FCI 0 0
00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15
Source and Destination Address
Destination Address

Source Address

Data :::

Destination Addresses. 6 bytes.


Some specific format variations in MAC addressing scheme.
•Group addresses when the group/specific bit is set to 1. Broadcast addresses go to entire group on a
network. Multicast addresses go to a subset group.
•Functional/nonfunctional addresses.
•Global/Local assigned addresses.
Source Addresses. 6 bytes.
Token Ring - Priority
PPP T M RRR

• Token Ring networks use a sophisticated priority system that permits certain user-designated, high-
priority stations to use the network more frequently.
• Token Ring frames have two fields that control priority: the priority field and the reservation field.
• Only stations with a priority equal to or higher than the priority value contained in a token can seize that
token.
• After the token is seized and changed to an information frame, only stations with a priority value higher
than that of the transmitting station can reserve the token for the next pass around the network.
• When the next token is generated, it includes the higher priority of the reserving station.
• Stations that raise a token's priority level must reinstate the previous priority after their transmission is
complete.
Token Ring - Priority
PPP T M RRR
• Initially the reservation bits are set to 000.
• When a node wants to transmit a priority n frame, it must wait until it can capture a token whose
priority is less than or equal to n.
• Furthermore, when a data frame goes by, a station can try to reserve the next token by writing the
priority of the frame it wants to send into the frame's Reservation bits.
• However, if a higher priority has already been reserved there, the station cannot make a
reservation.
• When the current frame is finished, the next token is generated at the priority that has been
reserved.
EXAMPLE
Three stations A, B, C. Token is by A, A has one PDU addressed to B to transmit. Enter the occurring
steps beginning with the arrival of the token at the station A until all stations have sent all their data
and a new free token is generated.

Solution

A transmit its own frame


B copies and repeats the frame
C repeats the frame
A receives its own frame
A generates a new token
Token management
Lost Token:
• Monitor station knows the number of stations on the ring and so calculates
maxTHT = n * THT (n is the number of stations on the ring).
• It keeps a timer of how long it has been since it last saw the token pass by.
• If this is more than maxTRT, it drains the ring and inserts a new token in the ring.
*THT – Token Holding Time
*TRT – Token Rotation Time ≤ Active nodes * THT + Ring Latency
Orphan frame:
• A frame can get orphaned if the sending station goes down before it can drain it’s frame.
• As a frame passes by the monitor, it sets the "monitor" bit in the header of the frame. If it sees a frame
with this bit already set, it knows it is an orphan frame. Then the monitor drains the ring and inserts a new
token in the ring.
IEEE 802.5 Token Ring

Priorities in IEEE 802.5

• Supports different levels of priority


– 3 bits
– each station waiting to send, sets priority for packet packet’s priority as high
current token
– then token can be seized
– Intending to send station – sets the priority on currently passing data frame
– releasing station sets priority of token to n.
– Lower priority packets circulate for long in ring

Token Release

– Early release
• After transmitting packet
– Delayed release
• After removing packet when it returns to the sender
• Let, A  Priority Access is ‘1’(Lowest)
B, D  2;
C, E  3 (highest)
• Assume, ‘A’ has already seized the ring and transmitted the data frames.
So, Token is BUSY.

D
2 C3

E
3

B2
A1
1. Station B receives the frame. It has data to send. So, it places its priority of 2 in
the reservation field and sends the frame to C.
2. Station C also determines the ring is BUSY . It also has data to send. It places ‘3’
in the reservation field, displacing ‘2’ that was already inserted by ‘B’.
3. Station C then passes the frame to ‘D’
4. Station D cannot place its priority of ‘2’ since a higher priority value(‘3’) is
already present in the reservation field, that was inserted by ‘C’. D
2 C3
5. Therefore it passes the frame to ‘E’.
6. ‘E’ checks for the priority field. Finding a value of ‘3’,it does nothing since its
E
own priority value is equal to the value present in the frame. 3
7. Eventually, ‘A’ is going get back the frame it sent.
8. It frees the ring by clearing the token and passing it to ‘B’. B2
9. ‘B’ , though receives the token, is not allowed to send because the token has a A1
reservation value of ‘3’ which is higher than its own priority value.
10. So, it just passes on the token to ‘C’.
11. ‘C’, is now allowed to send. Therefore it places its data and transmits the frame to ‘D’.
12. Also, the reservation bits are now reset.
13. So, now, ‘D’ is allowed to places its priority value=2 and pass on the frame to ‘E’.
14. ‘E’ displaces the priority value of ‘2’ by its own priority of ‘3’ and passes the frame on to ‘A’.
15. ‘A’ and ‘B’ forego their priority allocation since their values are less than the existing value(2).
16. C’ receives its transmission back. Therefore it frees the ring and forwards the token to station ‘D’.

D
2 C3

E
3

B2
A1
TIME CONVERSIONS

meters seconds bits


∕velocity /bandwidth
‘LENGTH’ OF A RING

• The length of a ring LAN, measured in bits, gives the total number of bits which can be in
transmission on the ring at a time
Note: Frame size is not limited to the “length” of the ring since entire frame may not appear on
the ring at one time.

• Bit length = (length / propagation speed) . rate + No. of stations · bit delay at repeater
IEEE 802.5 Token Ring
Let, speed of ring, R = 4 Mbps,
No.of stations, M = 20
Distance b/w stations = 100 meters, and b = 2.5 bits

b  delay that each station interface introduces between when the


interface receives a frame and forwards it along the output line.

Ring Latency ( in bits) = 20 X 100 X 4 X 106/ (2 X 108) + 20(2.5) = 90 bits

Let, speed of ring, R = 16 Mbps,


No.of stations, M = 80
Distance b/w stations = 100 meters, and b = 2.5 bits

Ring Latency ( in bits) = 80 X 100 X 16 X 106/ (2 X 108) + 80(2.5) = 840 bits


FDDI – Fiber Distributed Data Interface

Token-based LAN/MAN standard.


Uses ring –topology network in which network interfaces are interconnected by optical fibre transmission links.

• Topology: Ring
• Type of Fiber: multimode or single mode
• Distance: 200 kms
• No. of stations: up to 500 stations.
• Data is encoded using a 4B/5B encoder.
• Line Encoding : NRZ-I
• Local clock is 125MHz.
• Data Rate : 100 Mbps.
• Modulation : ASK{ or Intensity Modulation}
• Wavelength: 1300 nm
• Dual rings (primary and secondary) –transmit in opposite directions
• Normally, second ring is idle and used for redundancy for automatic repair
(self-healing).
• Maximum Frame Size : 4500bytes= 36000 bits.
FDDI frame structure

Token Frame Format PRE SD FC ED

8 1 1 2 or 6 2 or 6 4 1 1

Data Frame Destination Source


PRE SD FC Information FCS ED FS
Format Address Address

Preamble

Frame CLFFZZZZ C = Synch/Asynchrnous


Control L = Address length (16 or 48 bits)
FF = LLC/MAC control/reserved frame type

7/27/19
FDDI frame structure

• Frame begins with 16 or more idle control bits that generate a square wave signal – serves to synchronize
the receiver.
• FC bit is used to indicate the presence of a token also provides information about the type of the frame.
• To indicate the Token; has bit format 10000000 or 11000000
• FDDI MAC protocol can handle two types of traffic:
• Synchronous: has a tight transfer delay requirement such as voice or video.
• Asynchronous : has a greater delay tolerance as in other types of data traffic.
FDDI
• FDDI uses a timed token protocol which determines how long a station can transmit
• Each station has timers to measure the time elapsed since a token was last received
• TTRT: Target Token Rotation Time
• Value of TTRT is negotiated during initialization (default is 8 ms)
• Set to the maximum desired rotation time
FDDI TIMERS
• Each station has two timers: TRT (Token Rotation Time) and THT (Token Holding Time)
• TRT -Time elapsed since the station last received a token.
• When a station receives a token, it calculates THT(Token Holding Time) given by :
THT=TTRT-TRT
• If TRT < TTRT, then token is “early”, asynchronous traffic can be transmitted
• If TRT > TTRT then token is “late”, asynchronous traffic cannot be transmitted.
• Controls the time that a station may transmit asynchronous traffic.
• Percentage of the TTRT that is allocated for synchronous traffic at station i.
FDDI TIMERS

• If THT>0, then station can transmit all its synchronous traffic.


• If the THT timer has not expired after Si seconds, the station is allowed to transmit its
asynchronous traffic for the balance of its THT time.
• The station must then release the token.

• If THT<0, then the station is allowed to transmit only its synchronous traffic and must then
release the token.
If,
No of stations=500, latency =10 bits.
Maximum length of ring =200km
ring latency =?
500x10+100Mbpsx(200km)/
(2x10^8m/s)
=105000bits.

S-ar putea să vă placă și