0% found this document useful (0 votes)
4 views

Module III

The document discusses the concept of framing in data communication networks, detailing fixed and variable size framing methods, as well as flow and error control mechanisms. It explains various protocols used in the data link layer, including Stop-and-Wait and Go-Back-N ARQ protocols, emphasizing their assumptions, designs, and algorithms. Additionally, it covers the importance of syntax, semantics, and timing in protocols, alongside the handling of noisy and noiseless channels.
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)
4 views

Module III

The document discusses the concept of framing in data communication networks, detailing fixed and variable size framing methods, as well as flow and error control mechanisms. It explains various protocols used in the data link layer, including Stop-and-Wait and Go-Back-N ARQ protocols, emphasizing their assumptions, designs, and algorithms. Additionally, it covers the importance of syntax, semantics, and timing in protocols, alongside the handling of noisy and noiseless channels.
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
You are on page 1/ 33

Computer Communication Networks 06EC71

2.1 Framing:

Framing in the data link layer separates a message from one source to a destination by adding a
sender address & a destination address. The destination address defines where the packet is to
go; the sender address helps the recipient acknowledge the receipt. Although the whole message
could be packed in one frame, that is not normally done. One reason is that a frame can be very
large, making flow & error control very inefficient. When a message is carried in one very large
frame, even a single-bit error would require the retransmission of the whole message. When a
message is divided into smaller frames, a single-bit error affects only that small frame.

Frames can be of fixed or variable size.

i) Fixed-size framing:

In this there is no need for defining the boundaries of the frames, the size itself can be used as a
delimiter.
Ex: ATM wide area network which uses frames of fixed size called cells.

ii) Variable-size framing:

In this, we need a way to define the end of the frame and the beginning of the next.
Ex: LAN

Historically 2 approaches were used for variable size framing: Character-oriented & bit-oriented.

a) Character-oriented approach:

Data from upper layer


Variable no. of characters
Flag Header .... Trailer Flag

Character oriented protocol – Byte Stuffing & De-stuffing

SJBIT/Dept of ECE Page 13


Computer Communication Networks 06EC71

Data from upper layer


Flag ESC

Stuffed
Frame sent
Fla Header ESC Flag ESC ESC Trailer Flag
g
Extra 2 bytes
Frame received
Fla Header ESC Flag ESC ESC Trailer Flag
g
Unstuffed

Flag ESC

Data to upper layer

b) Bit-oriented approach:

Data from upper layer


Variable no. of bits
01111110 Header 01111010110……11011110 Trailer 01111110

Bit oriented protocol – Bit Stuffing & De-stuffing

Bit stuffing is the process of adding one extra 0 whenever five consecutive 1s follow a 0 in the
data, so that the receiver doesn’t mistake the pattern 01111110 for a flag

Data from upper layer


0001111111001111101000

Frame sent Stuffed


01111110 Header 000111110110011111001000 Trailer 01111110

Frame received Extra 2 bits


01111110 Header 000111110110011111001000 Trailer 01111110

Unstuffed
0001111111001111101000

Data to upper layer

2.2 Flow & Error Control:

SJBIT/Dept of ECE Page 14


Computer Communication Networks 06EC71

Flow Control:

• Any receiving device has a limited speed at which it can process incoming data and a
limited amount of memory in which to store incoming data.
• The flow of data must not be allowed to overwhelm the receiver.
• The receiver must be able to tell the sender to halt transmission until it is once again able
to receive.
• Flow control refers to a set of procedures used to restrict the amount of data that the
sender can send before waiting for acknowledgement.

Error Control:
• Errors occur due to noises in the channel.
• Error control is both error detection & error correction.
• In the data link layer error control refers to methods of error detection and retransmission.
• To sender should add certain amount of redundant bits to the data, based on which the
receiver will be able to detect errors.

2.3 PROTOCOLS:

• A protocol is a set of rules that govern data communication.


• A protocol defines what, how it is communicated, and when it is communicated.
• The key elements of a protocol are syntax, semantics & timing.
• Syntax refers to the structure or format of the data, i.e., the order in which they are
presented.
• Semantics refers to the meaning of each section of bits.
• Timing refers to when data should be sent & how fast they can be sent.
• Protocols are implemented in software by using any of the common programming
languages.

The protocols in the data link layer are classified as

Protocols

For noiseless For noisy


channel channel
Simplest Stop-and-wait
ARQ
Stop-and-wait Go-Back-N ARQ
Selective repeat
ARQ
2.4 Noiseless channels:

i) Simplest protocol:

Assumptions in this protocol are:

SJBIT/Dept of ECE Page 15


Computer Communication Networks 06EC71

• Data transfer is unidirectional.


• Both sender & receiver network layers are always ready.
• Processing time can be ignored.
• Infinite buffer space is available.
• Frames are never damaged or lost.

Design:

Sender Receiver

Network Get data Deliver data Network

Data link Data link

Send frame Receive


Physical Physical
frame
Data frames

Request from
Event: network layer

Repeat forever Repeat forever

Algorithm for Algorithm for


sender site receiver site

Notification from
Event: physical layer

Sender-site algorithm for the Simplest Protocol:


While(true) //Repeat forever
{
waitForEvent(); //Sleep until an event occurs
if(event(requestTosend)) //there is a packet to send
{
GetData(); //get data from n/w layer
MakeFrame(); //make a frame
SendFrame(); //send the frame
}
}

Receiver-site algorithm for the Simplest Protocol:

While(true) //Repeat forever


{
waitForEvent(); //Sleep until an event occurs
if(event(ArrivalNotification)) //data frame arrived
{
ReceiveFrame(); //receive frame from the physical layer
ExtractData(); //extract data from a frame
deliverData(); //deliver the data to the n/w layer
}
}

SJBIT/Dept of ECE Page 16


Computer Communication Networks 06EC71

Flow diagram to illustrate simplest protocol:

Sender Receiver

A B
Request Frame
Arrival
Request
Frame
Arrival
Request Frame
Arrival

Time Time

ii) Stop - & - Wait Protocol:

Assumptions in this protocol are:

• Data transfer is unidirectional.


• Both sender & receiver network layers are always ready.
• Receiver doesn’t have enough storage space.
• Receiver is slower than sender in processing.
• Frames are never damaged or lost.

Design:

Sender Receiver

Network Get Deliver Network


data data

Data link Data link

Receive Send Receive Send


Physical frame frame frame frame Physical
Data frames

ACK Frame

Request from
Event:
network layer

Repeat forever Repeat forever

Algorithm for Algorithm for


sender site receiver site

Notification from Notification from


Event: Event: physical layer
physical layer

SJBIT/Dept of ECE Page 17


Computer Communication Networks 06EC71

Sender-site algorithm for the Stop-&-wait Protocol:

While(true) //Repeat forever


Cansend = true //Allow the first frame to go
{
waitForEvent(); //Sleep until an event occurs
if(event(requestTosend) AND cansend) //there is a packet to send
{
GetData(); //get data from n/w layer
MakeFrame(); //make a frame
SendFrame(); //send the frame
cansend = false; //can’t send until ACK arrives
}
waitForEvent(); //Sleep until an event occurs
if(Event(ArrivalNotification))//an ACK has arrived
{
ReceiveFrame(); //Receive the ACK frame
cansend = true;
}
}

Receiver-site algorithm for the Stop-&-Wait Protocol:


While(true) //Repeat forever
{
waitForEvent(); //Sleep until an event occurs
if(event(ArrivalNotification)) //data frame arrived
{
ReceiveFrame(); //receive frame from the physical layer
ExtractData(); //extract data from a frame
deliverData(); //deliver the data to the n/w layer
SendFrame(); //Send an ACK frame
}
}

Flow diagram to illustrate Stop-&-Wait protocol:


Sender Receiver

A B
Request Frame
Arrival
Arrival ACK
Request Frame
Arrival
Arrival ACK

Time Time

SJBIT/Dept of ECE Page 18


Computer Communication Networks 06EC71

2.5 Noisy channels:

Assumptions are:

• Data transfer is unidirectional, but half-duplex link.


• Both sender & receiver network layers are always ready.
• Receiver doesn’t have enough storage space.
• Receiver is slower than sender in processing.
• Frames are damaged or lost because of the noises in the channel.

i) Stop - & - Wait Automatic Repeat Request (ARQ):

• Adds a simple error control mechanism to the Stop-&-Wait protocol.


• Error detection & retransmission is used for error control.
• Sending device keeps a copy of the last frame transmitted until acknowledgement for that
frame is received.
• Data frames uses Sequence numbers, to avoid duplication of frames.
• Range of sequence numbers = 2m – 1.
• ACK frame uses Acknowledgement number, & always announces the sequence number
of the next frame expected.
• Timers are used in case of loss of ACK frames.
Design:

Sn Next Rn Next
frame to frame to
send receive
0 1 0 1 0 0 1 0 1 0
Sender Receiver
Data frames
Network Get Deliver Network
data data
seqNo
Data link ACK Frame Data link

Receiv Send Receive Send


Physical frame fram Physical
e frame ackNo
frame e

Event Repeat Repeat


: from
Request forever for
Algorithm forever for
Algorithm
network layer sender site
Time receiver site
Out
Event
:
Event Notification Event Notification
: from physical : from physical
layer layer

Sender-site algorithm:

SJBIT/Dept of ECE Page 19


Computer Communication Networks 06EC71

Sn = 0; //Frame 0 should be sent first


Cansend = true //Allow the first request to go
While(true) //Repeat forever
{
waitForEvent(); //Sleep until an event occurs
if(event(requestTosend) AND cansend) //there is a packet to send
{
GetData(); //get data from n/w layer
MakeFrame(Sn); //make a frame
StoreFrame(Sn); //copy of frame
SendFrame(Sn); //send the frame
StartTimer();
Sn = Sn + 1; //Mod-2 addition
cansend = false; //can’t send until ACK arrives
}
waitForEvent(); //Sleep until an event occurs
if(Event(ArrivalNotification)) //an ACK has arrived
{
ReceiveFrame(ackNo); //Receive the ACK frame
if( not corrupted AND ackNo == Sn) // valid ACK
{
Stoptimer();
purgeframe(Sn-1);
cansend = true;
}
}
If(Event(Timeout))
{
StartTimer();
ResendFrame(Sn-1);
}
}

Receiver-site algorithm:

Rn = 0; //Frame 0 expected to arrive first


While(true) //Repeat forever
{
waitForEvent(); //Sleep until an event occurs
if(event(ArrivalNotification)) //data frame arrived
{
ReceiveFrame(); //receive frame from the physical layer
if(Corrupted(Frame))
sleep();
if(seqNo == Rn)
{
ExtractData(); //extract data from a frame
DeliverData(); //deliver the data to the n/w layer
Rn = Rn +1;
}
SendFrame(); //Send an ACK frame
}
}

SJBIT/Dept of ECE Page 20


Computer Communication Networks 06EC71

Flow diagram:
Sender Receiver
Rn
A B
Sn
0 1 0 1 0 Initially
Start Request Frame 0
0 1 0 1 0 Rn
Sn
Stop Arrival
ACK 1 0 1 0 1 0 Arrival
0 1 0 1 0
Sn
Start Request Frame 1
0 1 0 1 0
Timer-out
Sn Lost
restart Timeout Frame 1
0 1 0 1 0 Rn
Sn resent
Stop
ACK 0 0 1 0 1 0 Arrival
Arrival 0 1 0 1 0
Sn
Start Request Frame 0 Rn
0 1 0 1 0
Sn
ACK 1 0 1 0 1 0 Arrival
Timer-out
Timeout Frame 0 Lost
restart 0 1 0 1 0 Rn
Sn
resent
ACK 1 0 1 0 1 0 Arrival
Stop Arrival 0 1 0 1 0 Discard, Duplicate

Time Time

ii) Go-Back-N ARQ Protocol:

• Bandwidth-Delay product.
• Pipelining.
• Sequence numbers range from 0 to 2m – 1.
• Sliding window is an abstract concept that defines the range of sequence numbers that is
the concern of the Sender & Receiver.
• Timers – timer for the first outstanding frame always expires first, we resend all
outstanding frames when this timer expires.
• Acknowledgement – sends ACK for safe and in order frames, receiver will be silent for
corrupted & out of order frames.
• Resending a frame – when the timer expires, the sender resends all the outstanding
frames.

Send window for Go-Back-N ARQ

SJBIT/Dept of ECE Page 21


Computer Communication Networks 06EC71

a) Send window before sliding


Sf Send window, First SnSend window,
outstanding frame Next frame to
send
1 1 1 0 1 2 3 4 5 6 7 8 9 1 1 1 1 1 1 0 1
3 4 5 0 1 2 3 4 5
Frames Frames sent, but not Frames that can be sent, Frames that
already acknowledged but not received from can’t be sent
acknowledged (outstanding) upper layer
Send window, size Ssize = 2m – 1

b) Send window after sliding


Sf Sn

1 1 1 0 1 2 3 4 5 6 7 8 9 1 1 1 1 1 1 0 1
3 4 5 0 1 2 3 4 5

Sf Sn

1 1 1 0 1 2 3 4 5 6 7 8 9 1 1 1 1 1 1 0 1
3 4 5 0 1 2 3 4 5

Receive window for Go-Back-N ARQ

a) Receive window
Rn Receive window, next frame expected

13 14 15 0 1 2 3 4 5 6 7 8 9 10 11 12 13 1 15 0 1
4
Frames already Frames that can’t be received until the
received & window slides
acknowledged

b) Window after sliding


Rn

13 14 15 0 1 2 3 4 5 6 7 8 9 10 11 12 13 1 15 0 1
4

Design:

SJBIT/Dept of ECE Page 22


Computer Communication Networks 06EC71

Sf First Sn Next Rn Next


outstandi frame to frame to
ng send receive

Sender Receiver
Data frames
Network Get Deliver Network
data data
seqNo
ACK Frame
Data link Data link

Receiv Send Receive Send


ackNo
Physical e frame frame frame Physical
frame

Event: Repeat Repeat


Request from forever
Algorithm for forever
Algorithm for
network layer
sender site receiver site
Time
Out
Event:

Event: Notification Event: Notification


from physical from physical
layer layer

Window size for Go-Back-N ARQ:

SJBIT/Dept of ECE Page 23


Computer Communication Networks 06EC71

Sender-site algorithm:

Sw = 2m – 1;
Sf = 0;
Sn = 0; //Frame 0 should be sent first
While(true) //Repeat forever
{
waitForEvent(); //Sleep until an event occurs
if(event(requestTosend)) //there is a packet to send
{
if(Sn – Sf >= Sw) //If window is full
Sleep();
GetData(); //get data from n/w layer
MakeFrame(Sn); //make a frame
StoreFrame(Sn); //copy of frame
SendFrame(Sn); //send the frame
StartTimer();
Sn = Sn + 1; //Mod-2 addition
if(timer not running); //can’t send until ACK arrives
StartTimer();
}
if(Event(ArrivalNotification)) //an ACK has arrived
{
Receive (ACK); //Receive the ACK frame
if(corrupted (ACK))
Sleep();
if((ackNo > Sf && (ackNo <= Sn)))
While(Sf <= ackNo)
{
Purgeframe(Sn-1);
Sf = Sf + 1;
}
StopTimer();
}
If(Event(Timeout))
{
StartTimer();
Temp = Sf;
While(Temp < Sn)
{
SendFrame(Sf); //sendframe(temp);
Sf = Sf + 1; //temp = temp+1;
}
}
}

Receiver-site algorithm :

Rn = 0; //Frame 0 expected to arrive first


While(true) //Repeat forever
{
SJBIT/Dept of ECE Page 24
Computer Communication Networks 06EC71

waitForEvent(); //Sleep until an event occurs


if(event(ArrivalNotification)) //data frame arrived
{
ReceiveFrame(); //receive frame from the physical layer
if(Corrupted(Frame))
sleep();
if(seqNo == Rn)
{
DeliverData(); //deliver the data to the n/w layer
Rn = Rn +1; //Slide window
SendACK(Rn);
}
}
}

Stop-and-Wait ARQ is actually a Go-Back-N ARQ in which there are only two sequence
numbers and the send window size is 1.
i.e., m = 1; 2m – 1 = 1

iii) Selective Repeat ARQ Protocol:

• In a noisy link frame has a higher probability of damage, means resending of multiple
frames.
• This uses more bandwidth & slows down the transmission.
• Instead of sending N frames when just one frame is damaged, a mechanism is required to
resend only the damaged frame.
• Sequence numbers range from 0 to 2m – 1.
• Both send & receive window size = 2(m – 1).

Send window for Selective Repeat ARQ:


Sf Send window, FirstSn Send window,
outstanding frame Next frame to
send
1 1 1 0 1 2 3 4 5 6 7 8 9 1 1 1 1 1 1 0 1
3 4 5 0 1 2 3 4 5
Frames already Frames sent, but Frames that
Frames that can be
acknowledged not acknowledged sent can’t be sent
Send window, size Ssize = 2m – 1

Receive window for Selective Repeat ARQ:

SJBIT/Dept of ECE Page 25


Computer Communication Networks 06EC71

Rn Receive window, Next


frame expected

1 14 1 0 1 2 3 4 5 6 7 8 9 1 1 1 1 1 1 0 1
3 5 Frames that can be received and stored 0 1 2 3 4 5
Frames already for later delivery. Colored boxes, already Frames that
received
received can’t be
Rsize = 2m – 1 received

Design:

Sf First Sn Next Rn Next


outstandi frame to frame to
ng send receive

Sender Receiver
Data frames
Network Get Deliver Network
data ACK or NAK data
seqNo
Data link Data link
ackNo
or Receive Send
Receiv Send
Physical e frame nakNo frame frame Physical
frame

Event:
Repeat Repeat
Request from forever
Algorithm for forever for
Algorithm
network layer
sender site receiver site
Time
Out
Event:

Event: Notification Event: Notification


from physical from physical
layer layer

Window size for Selective Repeat ARQ:

SJBIT/Dept of ECE Page 26


Computer Communication Networks 06EC71

Sender-site algorithm:

Sw = 2m-1 ;
Sf = 0;
Sn = 0; //Frame 0 should be sent first
While(true) //Repeat forever
{
waitForEvent(); //Sleep until an event occurs
if(event(requestTosend)) //there is a packet to send
{
if(Sn – Sf >= Sw) //If window is full
Sleep();
GetData(); //get data from n/w layer
MakeFrame(Sn); //make a frame
StoreFrame(Sn); //copy of frame
SendFrame(Sn); //send the frame
Sn = Sn + 1;
StartTimer(Sn);
}
if(Event(ArrivalNotification)) //an ACK has arrived
{ Receive (frame); //Receive the ACK frame
if (corrupted (frame))
Sleep();
if (FrameType == NAK)
if (nakNo between Sf & Sn)
{ resend(nakNo);
StartTimer(nakNo);
}
if (FrameType == ACK)
if (ackNo between Sf & Sn)
SJBIT/Dept of ECE Page 27
Computer Communication Networks 06EC71

{ While (Sf <= ackNo)


{
Purge (Sf);
StopTimer (Sf);
Sf = Sf + 1;
}
}
}
If (Event (Timeout (t)))
{
StartTimer(t);
SendFrame(t);
}
}

Receiver-site algorithm :

Rn = 0; //Frame 0 expected to arrive first


Naksent = false;
AckNeeded = false;
Repeat( for all slots)
Marked (slot) = false;

While(true) //Repeat forever


{
waitForEvent(); //Sleep until an event occurs
if(event(ArrivalNotification)) //data frame arrived
{
ReceiveFrame();
if(Corrupted(Frame) && NOT NakSent)
{
SendNAK(Rn);
Naksent = true;
sleep();
}
if(seqNo < > Rn && NOT Naksent)
{ SendNAK(Rn);
Naksent = true;
if((seqno in window) && (!Marked(seqno)))
{ StoreFrame(seqNo);
Marked(seqNo) = true;
while(Marked(Rn))
{ DeliverData(Rn); //deliver the data to the n/w layer
purge(Rn);
Rn = Rn +1; //Slide window
AckNeeded = true; }
if(AckNeeded)

SJBIT/Dept of ECE Page 28


Computer Communication Networks 06EC71

{ SendACK(Rn);
AckNeeded = false;
NakSent = false; }
}
}
}
}

Piggybacking

• When the data transfer is bidirectional, i.e., from node A to node B and from node B to
node A, the control information also needs to flow in both the directions.
• Efficiency can be improved if the control information can be passed to the other end
along with the data itself which is flowing to that end. This concept is called as
piggybacking.

Flow diagram:

Rn
Initial Sf Sn Sender Receive Initial
r 0 1 2 3 4 5 6 7
0 1 2 3 4 5 6 7 0 A B
0 Sf Sn

Request Frame 0 Rn
0 1 2 3 4 5 6 7 0 Initial
Sf Sn
ACK 1
0 1 2 3 4 5 6 7
Arrival
Arrival
0 1 2 S3 4 5 6 7 0 Frame 0
1 Sf n

Frame 1 delivered
Request
0 1 2 3 4 5 6 7 0
Sf Sn Lost
2 Request Frame 2 Rn
0 1 2 3 4 5 6 7 0
Sf Sn
3 NAK 1 0 1 2 3 4 5 6 7
Arrival
Request Frame 3
0 1 2 3 4 5 6 7 0 Rn
Sf Sn
Frame 1 0 1 2 3 4 5 6 7 Arrival
1 Arrival 0 1 2 3 4 5 6 7 0 resent Rn
ACK 4
Sf Sn
0 1 2 3 4 5 6 7 Arrival
Arrival 0 1 2 3 4 5 6 7 0 Frames 1, 2, 3
delivered

Time Time

SJBIT/Dept of ECE Page 29


Computer Communication Networks 06EC71

2.6 High-level Data Link Control (HDLC):

• HDLC is a bit-oriented protocol for communication over point-to-point and multipoint


links.
• It implements the ARQ mechanisms.
• HDLC provides two common transfer modes.

Frame format :

Information frames (I-Frames) :

Supervisory frames (I-Frames) :

SJBIT/Dept of ECE Page 30


Computer Communication Networks 06EC71

Unnumbered frames (I-Frames) :

Code Command Response Meaning


00 001 Set normal response mode
11 011 SNRME Set normal response mode (extended)
11 100 SABM DM Set asynchronous balanced mode or disconnect mode
11 110 SABME Set asynchronous balanced mode (extended)
00 000 UI UI Unnumbered information
00 110 UA Unnumbered acknowledgment
00 010 DISC RD Disconnect or request disconnect
10 000 SIM RIM Set initialization mode or request information mode
00 100 UP Unnumbered poll
11 001 RSET Reset
11 101 XID XID Exchange ID
10 001 FRMR FRMR Frame reject

Recommended questions:

1. What are the three protocols considered for noisy channels?


2. Define framing and the reason for its need.
3. Compare and contrast the G0-Back-N ARQ protocol with Selective repeat ARQ.
4. Briefly describe the services provided by the data link layer.
5. Define piggybacking and its uses.
6. Compare and contrast byte-stuffing and bit-stuffing. Which technique is used in
byte-oriented protocols? Which technique is used in bit-oriented protocols?
7. Which all the protocols of data link layer uses pipelining concept?
8. Compare and contrast flow control and error control.
9. Compare and contrast HDLC with PPP. Which one is byte-oriented; which one is
bit-oriented?
10. Explain the reason for moving from stop-and-wait ARQ protocol to the Go-Back-
N ARQ protocol.

SJBIT/Dept of ECE Page 31


Computer Communication Networks 06EC71

Unit 3: Multiple Accesses Hrs: 06

Syllabus:

Random access, Controlled access, channelization

Recommended readings:

Text Book: Data Communication & Networking, B Forouzan, 4e, TMH

Chapter 12 – page 363 to 396

SJBIT/Dept of ECE Page 32


Computer Communication Networks 06EC71

3.1 Introduction:

• Data link layer has two sub layers: Upper sub layer – Data link Control & Lower sub
layer – Multiple access Control.
• The upper sub layer is responsible for flow and error control.
• The lower sub layer is responsible for multiple access resolution.
• When the nodes are connected using a dedicated link, lower sub layer is not required, but
when the nodes are connected using a multipoint link (broadcast), multiple access
resolution is required.

Taxonomy of Multiple access protocols

3.2 RANDOM ACCESS


• No station is superior to another station and none is assigned 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.
• Transmission is random among the stations.
• Each station has the right to the medium without being controlled by any other station.
All stations compete with one another to access the medium. Random access methods are
also called as contention methods.
• If more than one station tries to send, there is an access conflict – collision, frames will
be either destroyed or modified.

SJBIT/Dept of ECE Page 33


Computer Communication Networks 06EC71

i) 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.
• 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.

a) PURE ALOHA

• The original ALOHA protocol is called pure ALOHA.


• Each station sends a frame whenever it has a frame to send.
• Since there is only one channel to share, there is possibility of collision between frames
from different stations.

Frames in a pure ALOHA network

Station 1 Frame 1.1 Frame 1.2


Time

Frame 2.1 Frame 2.2


Station 2
Time

Frame 3.1 Frame 3.2


Station 3
Time

Frame 4.1 Frame 4.2


Station 4
Time
Collision Collision
duration duration

• Even if one bit of a frame coexists on the channel with one bit from another frame, there
is a collision and both will be destroyed.

SJBIT/Dept of ECE Page 34


Computer Communication Networks 06EC71

• Retransmission of frames are required for the destroyed frames.


• The pure ALOHA protocol relies on acknowledgements from the receiver. When a
station sends a frame, it expects the receiver to send an acknowledgement.
• If the acknowledgement does not arrive after a time-out period, the station assumes that
the ACK has been destroyed and resends a frame.
• 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. This time is called back-off time TB. This
randomness will help avoid more collisions.
• To prevent congesting the channel with retransmitted frames, pure ALOHA dictates that
after a maximum number of retransmission attempts Kmax, a station must give up and try
later.

Procedure for pure ALOHA protocol


Station has a
Start frame to send

K=0
Wait TB time
(TB = R * Tp or R *
Tfr Send the
frame

Choose a random Wait time-


number R out time (2 *
between 0 & 2k – Tp)
1 No

Kmax is K> K=K+1 No ACK


normally Kmax received
?
15
Yes Yes
Abort Success

Vulnerable time for pure ALOHA


B’ s end A’ s end
collides with collides with
A’s beginning C’s beginning

Be E
gi B nd
n
Be E
gi A nd
n
Be E
gi C nd
n
t – Tfr t t + Tfr time

Vulnerable time = 2 * Tfr

Throughput
SJBIT/Dept of ECE Page 35
Computer Communication Networks 06EC71

G = average number of frames generated by the system during one frame transmission time.

Successful transmissions for pure ALOHA is


S = G * e-2G

The maximum throughput, Smax is for G = ½. i.e., Smax = 0.184 = 18.4%.

b) SLOTTED ALOHA

Frames in a slotted ALOHA network

Collision Collision
duration duration

Frame 1.1 Frame 1.2


Station 1
Time

Frame 2.1 Frame 2.2


Station 2
Time

Frame 3.1 Frame 3.2


Station 3
Time

Frame 4.1 Frame 4.2


Station 4
Time
Slot 1 Slot 2 Slot 3 Slot 4 Slot 5 Slot 6 Slot 7

Slotted ALOHA Vulnerable time = Tfr

Vulnerable time for slotted ALOHA


A collides with C

Be En
gi B d
n
Be En
gi A d
n
Be En
gi C d
n
t – Tfr t t + Tfr time

Vulnerable time = Tfr

SJBIT/Dept of ECE Page 36


Computer Communication Networks 06EC71

Throughput

G = average number of frames generated by the system during one frame transmission time.

Successful transmissions for pure ALOHA is


S = G * e-G

The maximum throughput, Smax is for G =1 i.e., Smax = 0.368 = 36.8%.

C) Carrier Sense Multiple Access (CSMA)

The chance of collision can be reduced if a station senses the medium before trying to use
it. CSMA requires that each station first listen to the medium before sending. CSMA is
based on the principle “ sense before transmit” or “listen before talk”.

CSMA can reduce the possibility of collision, but it can’t eliminate it. The reason for this
is shown in the above figure, a space and time model of a CSMA network. Stations are
connected to a shared channel. The possibility of collision still exists because of the
propagation delay.

Persistence strategies

C) Carrier Sense Multiple Access with collision detection (CSMA/CD)


SJBIT/Dept of ECE Page 37
Computer Communication Networks 06EC71

The CSMA method does not specify the procedure following the collision. CSMA with
collision detection augments the algorithm to handle the collision.

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.

D) Carrier Sense Multiple Access with collision avoidance (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 the second station.

Collisions are avoided by deferring transmissions even if the channel is found idle. When
an idle channel is found, the station does not send immediately. It waits for a period of
time called the interframe space or IFS. Even though the channel may appear idle when it
is sensed, a distant station’s signal has not yet reached this station. The IFS time allows
the front of the transmitted signal by the distant station to reach this station.

SJBIT/Dept of ECE Page 38


Computer Communication Networks 06EC71

3.3 CONTROLLED ACCESS

In controlled access, the stations consult one another to find which station has the right to
send. A station can’t send unless it has been authorized by other stations.

a) Reservation:

In the reservation method, a station needs to make a reservation before sending the data.
Time is divided into intervals. In each interval, a reservation frame precedes the data
frames sent in the interval.

b) 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.

SJBIT/Dept of ECE Page 39


Computer Communication Networks 06EC71

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

c) Token Passing:

In the token-passing method, the stations in a network are organized in a logical ring.
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.

SJBIT/Dept of ECE Page 40


Computer Communication Networks 06EC71

3.4 CHANNELIZATION

a) Frequency Division Multiple Access (FDMA)

In FDMA, the bandwidth is divided into channels. Each station is allocated a band to
send its data. Each station also uses a band pass filter to confine the transmitter
frequencies. To prevent station interferences, the allocated bands are separated from one
another by small guard bands.

b) Time Division Multiple Access (TDMA)

In TDMA, the stations share the bandwidth of the channel in time. Each station is
allocated a time slot during which it can send data. Each station transmits its data in its
assigned time slot.

SJBIT/Dept of ECE Page 41


Computer Communication Networks 06EC71

c) Code Division Multiple Access (CDMA)

CDMA differs from FDMA because only one channel occupies the entire bandwidth of
the link and it differs from TDMA because all stations can send data simultaneously.

Chip sequences

SJBIT/Dept of ECE Page 42


Computer Communication Networks 06EC71

Sharing channel in CDMA

1)

2)

SJBIT/Dept of ECE Page 43


Computer Communication Networks 06EC71

3)

Recommended questions:

1. Define controlled access and list three protocols in this category.


2. Compare and contrast a random access protocol with a channelization protocol.
3. Define channelization and explain the three protocols.
4. List and explain the three categories of multiple access protocols.
5. Explain why collision is an issue in a random access protocol but not in controlled
access or channelizing protocols.
6. Compare and contrast a random access protocol with a controlled access protocol.

SJBIT/Dept of ECE Page 44


Computer Communication Networks 06EC71

Unit 4: Hrs: 07

Syllabus:

IEEE standards, standard Ethernet, changes in the standards, Fast Ethernet, Gigabit
Ethernet, Wireless LAN IEEE 802.11

Recommended readings:

Text Book: Data Communication & Networking, B Forouzan, 4e, TMH

Chapter 13 – page 395 to 417


Chapter 14 – page 421 to 434

SJBIT/Dept of ECE Page 45

You might also like