Module 4

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 108

MODULE 4

Link Layer communication


ERROR DETECTION AND CORRECTION
Error Detection
INTRODUCTION

➔ At the data-link layer, if a frame is corrupted between the two nodes, it


needs to be corrected before it continues its journey to other nodes. However,
most link-layer protocols simply discard the frame and let the upper-layer
protocols handle the retransmission of the frame.
➔ For reliablecommunication, error must be detected and corrected .Error
Detection and Correction are implemented either at the data link layer or the
transport layer of the OSI model
Types of Errors
Single bit error and Burst error
The term single-bit error means that The term burst error means that 2 or
only 1 bit of a given data unit (such more bits in the data unit have
as a byte, character, or packet) is changed from 1 to 0 or from 0 to 1.
changed from 1 to 0 or from 0 to 1.
Redundancy
➔ The central concept in detecting or correcting errors is redundancy.
➔ To be able to detect or correct errors, we need to send some extra bits with
our data.
➔ These redundant bits are added by the sender and removed by the
receiver. Their presence allows the receiver to detect or correct corrupted
bits.
➔ In error detection, we are only looking to see if any error has occurred. The
answer is a simple yes or no. We are not even interested in the number of
corrupted bits. A single-bit error is the same for us as a burst error.
➔ In error correction, we need to know the exact number of bits that are
corrupted and, more importantly, their location in the message. The number of
errors and the size of the message are important factors.
ERROR DETECTION
1. Parity-Check Code
A parity bit is added to every
data unit so that the total
number of 1s(including the
parity bit) becomes even for
even-parity check or odd
for odd-parity check.
➔ This code is a linear
block code.
➔ A k-bit dataword is
changed to an n-bit
codeword
➔ where n = k + 1.
➔ The extra bit, called the
parity bit
Two –Dimensional Parity Check

In this method, block of


bits is organized as a table
(rows and columns).
Two-dimensional Parity
check bits are calculated for
each row, which is equivalent to
a simple parity check bit. Parity
check bits are also calculated
for all columns, then both are
sent along with the data. At the
receiving end, these are
compared with the parity bits
calculated on the received
Advantages of Two-Dimensional Parity Check

● can detect and correct all single bit error.


● can detect two or three bit error that occur anywhere in the matrix.

Disadvantages of Two-Dimensional Parity Check

● can not correct two or three bit error. It can only detect two or three bit error.
● If we have a error in the parity bit then this scheme will not work.
2. Cyclic Redundancy Check
which is used in networks such as LANs and WANs.
CRC- Encoder
➔ In the encoder, the dataword has k bits (4 here); the codeword has m bits
(7 here).
➔ The size of the dataword is augmented by adding n bits (3 here) 0s to the
right-hand side of the word.
➔ The m-bit result is fed into the generator.

➔ The generator uses a divisor of size (n + 1) (4 here), predefined and


agreed upon.
➔ The generator divides the augmented dataword by the divisor .
➔ The quotient of the division is discarded;the remainder (r2,r1,r0) is
appended to the dataword to create the codeword.
CRC-Decoder
➔ The decoder receives the codeword (possibly corrupted in transition).
➔ Fed to the checker, which is a replica of the generator.
➔ The remainder produced by the checker is a syndrome of n (3 here) bits,
which is fed to the decision logic analyzer.
➔ The analyzer has a simple function. If the syndrome bits are all 0s, the
codeword are accepted as the dataword (interpreted as no error); other-wise,
discarded (error).
➔ CRC generator- uses modular-2 division.
CRC-Divisor
POLYNOMIALS-A pattern of 0s and 1s can be represented as a polynomial with
coefficients of 0 and 1. The power of each term shows the position of the bit; the
coefficient shows the value of the bit.

Benefit: we have a polynomial such as X23 + x3 + 1. Here the bit pattern is 24 bits
in length (three 1s and twenty-one 0s) while the polynomial is just three terms.
Binary Division
in a CRC Generator
(Uses modular 2division)
Binary Division
in a
CRC Checker
3. CHECKSUM-Checksum is an error-detecting technique that can be applied to a message of any length.
Traditionally, the Internet has used a 16-bit checksum. The sender and the
receiver follow the steps depicted in Table 10.5. The sender or the receiver uses
five steps.
Eg
at sender
ERROR CORRECTION
Error correction
~ can be handled in two ways:
➔ when an error is discovered, the receiver can have the sender retransmit the
entire data unit.
➔ a receiver can use an error-correcting code, which automatically corrects
certain errors.
➔ Error correction method: Hamming Code
Hamming Code
~ developed by R.W.Hamming in the 1950s
➔ an error-correcting code used to ensure data accuracy during transmission
➔ helps to improve the reliability of communication
➔ It adds extra bits to the original data, allowing the system to detect and
correct single-bit errors.

What is Redundant Bits?


Redundant bits are extra binary bits that are generated and added to the
information-carrying bits of data transfer to ensure that no bits were lost during the
data transfer.
Steps:
1. Find the number of redundant bits
The number of redundant bits can be calculated using the following
formula:
2r ≥ m + r + 1
where m is the number of bits in input data, and r is the number of
redundant bits.
Suppose the number of data bits is 7, then the number of redundant bits can
be calculated using: = 16 ≥ 7 + 4 + 1 . Thus, the number of redundant bits is 4.
2. Determining The Position of Redundant Bits
A redundancy bits are placed at positions that correspond to the power of
2.

Example:

● The number of data bits = 7


● The number of redundant bits = 4
● The total number of bits = 7+4=>11
● The redundant bits are placed at positions corresponding to power of 2 that is 1, 2, 4, and 8 etc.
● Suppose the data to be transmitted is 1001101 from sender to receiver, the bits will be placed as
follows:
3. Determining The Parity Bits According to Even Parity
each r bit is the combination of data bits

r1 = bits 1, 3, 5, 7, 9, 11

r2 = bits 2, 3, 6, 7, 10, 11

r4 = bits 4, 5, 6, 7

r8 = bits 8, 9, 10, 11

etc.
R1 bit is calculated using parity check at all the
bits positions whose binary representation
includes a 1 in the least significant position. R1:
bits 1, 3, 5, 7, 9, 11

R2 bit is calculated using parity check at all the


bits positions whose binary representation
includes a 1 in the second position from the least
significant bit. R2: bits 2,3,6,7,10,11

R3 bit is calculated using parity check at all the


bits positions whose binary representation
includes a 1 in the third position from the least
significant bit. R4: bits 4, 5, 6, 7
Error detection and Correction :At receiver end
Suppose in the above example the 7th bit is changed from 1 to 0 during data
transmission, then it gives new parity values in the binary number:
For all the parity bits we will check the number of 1’s in their respective bit
positions.

● For R1: bits 1, 3, 5, 7, 9, 11. We can see that the number of 1’s in these bit
positions are 3 and that’s odd so we get a 1 for this.
● For R2: bits 2,3,6,7,10,11 . we get a 1 for this.
● For R4: bits 4, 5, 6, 7 . we get a 1 for this.
● For R8: bit 8,9,10,11 . so we get a 0 for this.
● The bits give the binary number 0111 whose decimal representation is 7.
Thus, bit 7 contains an error. To correct the error the 7th bit is changed from
0 to 1.
FLOW AND ERROR CONTROL
FLOW AND ERROR CONTROL
➔ The most important responsibilities of the data link layer are flow control and
error control. Collectively, these functions are known as data link control.
➔ Flow control refers to a set of procedures used to restrict the amount of data
that the sender can send before waiting for acknowledgment.
➔ Error control in the data link layer is based on automatic repeat
request,which is the retransmission of data.
Simple Stop and Wait
At Sender

● 1. Send one data packet at a time.


● 2. Send the next packet only after
receiving acknowledgment for the previous.

At Receiver

● 1: Send acknowledgement after receiving


and consuming a data packet.
● 2: After consuming packet
acknowledgement need to be sent (Flow
Control)
1. Stop and Wait for ARQ (Automatic Repeat Request)

➔ The Stop-and-Wait Automatic Repeat Request (Stop-and-Wait ARQ), adds a


simple error control mechanism to the Stop-and-Wait Protocol.
➔ Error correction in Stop-and-Wait ARQ is done by keeping a copy of the sent
frame and retransmitting of the frame when the timer expires.
➔ Problems Associated with Simple Stop and Wait
◆ Lost data
◆ Lost Ack
◆ Delayed Ack
1. Lost Data TIME OUT:The duration
for which the sender
1. Sender transmits the waits for an
data packet and it is lost. acknowledgment (ACK)
from the receiver after
2. The receiver has been transmitting a data
waiting for the data for packet.
infinite time. If the sender does not
receive an ACK within
3. The sender does not this timeout period, it
assumes that the frame
receive an
was lost or corrupted
acknowledgment, it will and retransmits the
not send the next packet. frame.
2. Lost Acknowledgement Sequence Number (Data)

1. Sender sends the data, which is The sender assigns sequence numbers
also received by the receiver. to each data frame it sends.
2. The receiver sends an This allows the receiver to identify and
acknowledgment after receiving acknowledge each frame individually,
the packet. ensuring reliable delivery of data
packets. After sending a frame, the
3. The acknowledgment is lost in
sender waits for an acknowledgment
the network.
before sending the next frame.
4. The sender does not send the
next data packet because it
does not receive
acknowledgement,
Fig:Sequence number(Data)
3. Delayed Acknowledgement/Data

1. Sender sends the data, which Sequence Number(Acknowledgement)


is also received by the sequence numbers are also used in
receiver. acknowledgments (ACKs) sent by the
receiver to acknowledge received data
2. The receiver then transmits
frames. When the receiver successfully
the acknowledgment, which is receives a data frame, it sends an ACK
received after the sender’s back to the sender, indicating the
timeout period. sequence number of the next expected
3. After a timeout on the sender frame. The sender uses this ACK to
side, a long-delayed determine whether the transmission was
acknowledgement might be successful and whether it can proceed to
send the next frame.
wrongly considered as
acknowledgement of some
other recent packet.
Working of Stop and Wait for ARQ

1. The sender has a control variable, which we call Sn (sender, next frame to
send), that holds the sequence number for the next frame to be sent (0 or 1).
2. The receiver has a control variable, which we call Rn (receiver,next frame
expected), that holds the number of the next frame expected.
3. Sender sends a data frame with sequence number 0.
4. Receiver , after receiving the data frame, sends an acknowledgement with
sequence number 1 (the sequence number of the next expected data frame
or packet)
2. Go-Back -N ARQ
➔ Frames from a sending station are numbered sequentially. If the header of the
frame allows m bits for the sequence number, the sequence numbers range
from 0 to 2m - 1.
➔ The sliding window is an abstract concept that defines the range of sequence
numbers that is the concern of the sender and receiver.
➔ The range which is the concern of the sender is called the send sliding window;
➔ the range that is the concern of the receiver is called the receive sliding window.
➔ The size of the send window must be less than 2m; the size of the receiver
window is always 1.

Eg, Where m=2, 2m - 1=24 - 1=3

Size of send window=0 to 2


➔ Sf : the sequence number of the first outstanding frame.
➔ Sn: the sequence number that will be assigned to the next frame to be sent.
➔ Ssize : the size of the window

➔ The receive window makes sure that the correct data frames are received and
that the correct acknowledgments are sent.

➔ The size of the receive window is always 1.


➔ Rn :receive window, next frame expected.
➔ Only a frame with a sequence number matching the value of Rn is accepted
and acknowledged.
Send window for Go-Back -N
Receive window for Go-back-N
3. Selective Repeat Automatic Repeat Request
The receive window in Selective Repeat is totally different from the one in Go
Back- N. The size of the receive window is the same as the size of the send
window (2m- 1).

In Selective Repeat ARQ, the size of the sender and receiver window must be at
most one-half of 2m.

Those slots inside the window that are coloured define frames that have arrived
out of order and are waiting for their neighbours to arrive before delivery to the
network layer.
Figure: Send window for Selective Repeat ARQ
Figure:Receive window for Selective Repeat ARQ
Media Access Protocols
Introduction:
Data Link Layer - LLC & MAC sublayers

➔ The upper sublayer that is responsible for flow and error control is called the
logical link control (LLC) layer.
➔ The lower sublayer that is mostly responsible for multiple access resolution is
called the media access control (MAC) layer.
➔ When nodes or stations are connected and use a common link, called a
multipoint or broadcast link, we need a multiple-access protocol to
coordinate access to the link.
➔ Many protocols have been devised to handle access to a shared link.
➔ All of these protocols belong to a sublayer in the data-link layer called media
access control (MAC).
➔ We categorize them into three groups,
RANDOM ACCESS
Random Access /Contention Protocols
Features:
➔ Random access:There is no scheduled time for a station to transmit.
Transmission is random among the stations.
➔ Contention methods:no rules specify which station should send next. Stations
compete with one another to access the medium.

➔ No station is superior to another station and none is assigned control over another.
➔ 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.
➔ This decision depends on the state of the medium (idle or busy).
➔ if more than one station tries to send, there is an access conflict—collision—and
the frames will be either destroyed or modified.
➔ The random-access methods have evolved from protocol known as ALOHA,
which used a very simple procedure called multiple access (MA).

➔ The method was improved with the addition of a procedure that forces the
station to sense the medium before transmitting. This was called carrier
sense multiple access (CSMA).

➔ This method later evolved into two parallel methods:


◆ carrier sense multiple access with collision detection (CSMA/CD),
which tells the station what to do when a collision is detected
◆ carrier sense multiple access with collision avoidance (CSMA/CA),
which tries to avoid the collision.
1. 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.
➔ There are potential collisions in this arrangement.
➔ The medium is shared between the stations. When a station sends
data, another station may attempt to do so at the same time. The data
from the two stations collide and become garbled.
➔ Methods:
◆ Pure ALOHA
◆ Slotted ALOHA
1.a PURE ALOHA
➔ The original ALOHA protocol is called 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.
➔ The pure ALOHA protocol relies on acknowledgments from the
receiver.
➔ When a station sends a frame, it expects the receiver to send an
acknowledgment. If the acknowledgment does not arrive after a time-
out period, the station assumes that the frame (or the
acknowledgment) has been destroyed and resends the frame.
Method to prevent congesting the channel with retransmitted frames.

1. A collision involves two or more stations. If all these stations try to resend
their frames after the time-out, the frames will collide again.

Pure ALOHA dictates that when the time-out period passes, each station
waits a random amount of time before resending its frame. The randomness
will help avoid more collisions. This time known as backoff time TB.

2. After a maximum number of retransmission attempts Kmax, a station must give


up and try later.

The value of Kmax is usually chosen as 15.


➔ The time-out period is equal to the maximum possible round-trip propagation
delay,which is twice the amount of time required to send a frame between the two
most widely separated stations (2 × T p).

Time-out period or wait= 2xTp

➔ The backoff time TB is a random value that normally depends on K (the number of
attempted unsuccessful transmissions).

➔ Binary exponential backoff: In this method, for each retransmission, a multiplier


R = 0 to 2K − 1 is randomly chosen and multiplied by Tp (maximum propagation time)
or Tfr (the average time required to send out a frame) to find T B. Note that in this
procedure, the range of the random numbers increases after each collision.
TB=R x Tfr

or
Vulnerable time: The length of time in which there is a possibility of collision.

➔ We assume that the stations send fixed-length frames with each frame taking Tfr
seconds to send.
➔ Figure shows the vulnerable time for station B.
Station B starts to send a frame at
time t. Now imagine station A has
started to send its frame after t − Tfr.
This leads to a collision between the
frames from station B and station A.
On the other hand, suppose that
station C starts to send a frame
before time t + Tfr. Here, there is also
a collision between frames from
station B and station C.
The vulnerable time during which a
collision may occur in pure ALOHA is
Pure ALOHA vulnerable time = 2 x Tfr 2 times the frame transmission time.
Throughput: the average number of successfully transmitted frames
➔ Let us call G the average number of frames generated by the system during one frame
transmission time.

➔ In other words, if one-half a frame is generated during one frame transmission time (one frame
during two frame transmission times), then 18.4 percent of these frames reach their destination
successfully.
➔ We expect G = 1/2 to produce 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.
1.b. Slotted ALOHA
➔ invented to improve the efficiency of pure ALOHA.
➔ In slotted ALOHA we divide the time into slots of Tfr seconds and force the
station to send only at the beginning of the time slot.
Vulnerable time:
➔ Because a station is allowed to send only at the beginning of the synchronized
time slot, if a station misses this moment, it must wait until the beginning of the
next time slot.
➔ This means that the station which started at the beginning of this slot has already
finished sending its frame.
➔ There is still the possibility of collision if two stations try to send at the beginning
of the same time slot. However, the vulnerable time is now reduced to one-half,
equal to Tfr.
Throughput:

➔ The average number of successful transmissions for slotted ALOHA is,

➔ In other words, if one frame is generated during one frame transmission time, then
36.8 percent of these frames reach their destination successfully. We expect G = 1 to
produce maximum throughput because the vulnerable time is equal to the frame
transmission time. Therefore, if a station generates only one frame in this vulnerable
time (and no other station generates a frame during this time), the frame will reach
its destination successfully.
2. CSMA

➔ To minimize the chance of collision and, therefore, increase the


performance, the CSMA method was developed.
➔ Based on the principle “sense before transmit”
◆ each station first listen to the medium (or check the state of
the medium) before sending.
➔ can reduce the possibility of collision, but it cannot eliminate it.
➔ The possibility of collision still exists because of propagation
delay; when a station sends a frame, it still takes time (although
very short) for the first bit to reach every station and for every
station to sense it.
At time t1, station B senses the medium and finds it idle, so it sends a frame. At time t2 (t2 > t1), station
C senses the medium and finds it idle because, at this time, the first bits from station B have not
reached station C. Station C also sends a frame. The two signals collide and both frames are destroyed.
Vulnerable Time
The vulnerable time for CSMA is the propagation time Tp. This is the time needed for a signal to
propagate from one end of the medium to the other. When a station sends a frame and any other
station tries to send a frame during this time, a collision will result. But if the first bit of the frame
reaches the end of the medium, every station will already have heard the bit and will refrain from
sending. Figure shows the worst case. The leftmost station, A, sends a frame at time t1, which
reaches the rightmost station, D, at time t1 + Tp. The gray area shows the vulnerable area in time
and space.
Persistence Methods
Persistence method describe “What should a station do if the channel is
busy/idle?

1. 1-persistent method
2. non-persistent method
3. p-persistent method.
1-Persistent
➔ The 1-persistent method is simple and straightforward.
➔ If the line is idle, it sends its frame immediately (with probability 1).
➔ otherwise it continuously keeps on checking the medium for being idle.
➔ This method has the highest chance of collision because two or more stations
may find the line idle and send their frames immediately.
➔ Ethernet uses this method.
Nonpersistent
➔ In the non persistent method, a station that has a frame to send senses the
line.
➔ If the line is idle, it sends immediately.
➔ If the line is not idle, it waits a random amount of time and then senses the
line again.
➔ Reduces the chance of collision because it is unlikely that two or more
stations will wait the same amount of time and retry to send simultaneously.
➔ However, this method reduces the efficiency of the network because the
medium remains idle when there may be stations with frames to send.
p-Persistent
➔ The p-persistent method is used if the channel has time slots with a slot duration
equal to or greater than the maximum propagation time.
➔ The p-persistent approach combines the advantages of the other two
strategies. It reduces the chance of collision and improves efficiency.
➔ In this method, after the station finds the line idle it follows these steps:

1. With probability p, the station sends its frame.

2. With probability q = 1 − p, the station waits for the beginning of the next
time slot and checks the line again.

a. If the line is idle, it goes to step 1.

b. If the line is busy, it acts as though a collision has occurred and uses
the back-off procedure.
3. CSMA/CD
➔ Carrier sense multiple access with collision detection (CSMA/CD)
➔ In this method, a station monitors the medium after it sends a frame to see if
the transmission was successful. If so, the station is finished. If, however,
there is a collision, the frame is sent again.
➔ At time t1, station A has executed its persistence procedure and starts
sending the bits of its frame.
➔ At time t2, station C has not yet sensed the first bit sent by A. Station C
executes its persistence procedure and starts sending the bits in its frame,
which propagate both to the left and to the right.
➔ The collision occurs some- time after time t2.
➔ Station C detects a collision at time t3 when it receives the first bit of A’s
frame.
➔ Station C immediately (or after a short time, but we assume immediately)
aborts transmission.
➔ Station A detects collision at time t4 when it receives the first bit of C’s frame;
it also immediately aborts transmission.
➔ A transmits for the duration t4 − t1; C transmits for the duration t3 − t2.
Minimum Frame Size:
➔ 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.
➔ To understand the reason, let us think about the worst-case scenario.
If the two stations involved in a collision are the maximum distance
apart, the signal from the first takes time Tp to reach the second, and
the effect of the collision takes another time TP to reach the first. So
the requirement is that the first station must still be transmitting
ALOHA vs CSMA/CD
1. The persistence process. We need to sense the channel before we start sending the
frame by using one of the persistence processes (nonpersistent, 1-persistent, or p-
persistent).
2. The frame transmission. In ALOHA, we first transmit the entire frame and then wait
for an acknowledgment. In CSMA/CD, transmission and collision detection are
continuous processes. We do not send the entire frame and then look for a collision.
The station transmits and receives continuously and simultaneously (using two
different ports or a bidirectional port). 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.
Energy Level: The level of energy in a channel can have three values:
◆ 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.

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.
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 non persistent method,the maximum throughput can go up to 90
percent when G is between 3 and 8.

Traditional Ethernet
➔ One of the LAN protocols that used CSMA/CD is the traditional Ethernet with
the data rate of 10 Mbps. the traditional Ethernet was a broadcast LAN that
used the 1-persistence method to control access to the common media.
3. CSMA/CA:Carrier sense multiple access with collision avoidance
➔ Specially designed for wireless networks
➔ Collisions are avoided through the use of CSMA/CA’s three strategies:
◆ the interframe space,
◆ the contention window,
◆ Acknowledgments.
1. Interframe space

• Station waits for medium to become idle and if found idle it does not immediately send data (to avoid
collision due to propagation delay) rather it waits for a period of time called Interframe space or IFS.

After this time it again checks the medium for being idle. The IFS can also be used to define the priority
of a station or frame.

• For eg, a station assigned a shorter IFS has a higher priority.

2. Contention Window

• It is the amount of time divided into slots. If the sender is ready to send data, it chooses a random
number of slots (according to binary back-off strategy)as wait time which doubles every time medium is
not found idle .

• If the medium is found busy it does not restart the entire process, rather it restarts the timer when the
channel is found idle again.

3. Acknowledgement

• The sender re-transmits the data if acknowledgement is not received before time-out.
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.
● The three popular controlled-access methods are as follows.

1. Reservation

2. Polling

3. 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.
● 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.
● The following 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.
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.
● The primary device, therefore, is always the initiator of a session.
● 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.
Polling - select
● The select function is used whenever the primary device has something to
send.
● If it has something to send, the primary device sends it.It has to know whether
the target device is prepared to receive or not.
● So the primary must alert the secondary to the upcoming transmission and
wait for an acknowledgment of the secondary's ready status.
● Before sending data, the primary creates and transmits a select (SEL) frame,
one field of which includes the address of the intended secondary.
Polling - poll
● 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.
● When the first secondary is approached, it responds either with a NAK frame
if it has nothing to send or with data (in the form of a data frame) if it does.
● If the response is negative (a NAK frame), then the primary polls the next
secondary in the same manner until it finds one with data to send.
● When the response is positive (a data frame), the primary reads the frame
and returns an acknowledgment (ACK frame), verifying its receipt.
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.
● The right to this access has been passed from the predecessor to the current
station.
● The right will be passed to the successor when the current station has no
more data to send.
● In this method, a special packet called a token circulates through the ring.
● The possession of the token gives the station the right to access the channel
and send its 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.
● When the station has no more data to send, it releases the token, passing it
to the next logical station in the ring.
● The station cannot send data until it receives the token again in the next
round.
● 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.
○ To make low-priority stations release the token to high priority stations.

You might also like