Data Link Control: Line Discipline Error Control Flow Control
Data Link Control: Line Discipline Error Control Flow Control
Data Link Control: Line Discipline Error Control Flow Control
control
Line discipline
ErroR control
Flow control
introduction
Line Discipline
Flow Control
Error Control
Line discipline
This can be done in two ways:
Enquiry
/acknowledgement
method
Poll /Select method
(ENQ/ACK)
(ENQ/ACK) method
By this way one station ensure that the other
is ready or not.
A is sender and B is receiver. A first sends an
enquiry(ENQ) frame asking if the receiver is
ready to accept data.
If
the
receiver
is
ready, it
sends
acknowledgement (ACK) frame else it sends
(NAK) negative acknowledgement frame.
(ENQ/ACK) method
If neither an ACK nor a NAK is received within
a specified time limit sender assumes that the
ENQ frame was lost, so it sends a replacement.
Sender make 3 such attempts before giving up.
If NAK comes for 3 times , the sender
disconnects and begins everything at another
time.
If the response is ACK, sender will send data.
At the end sender sends (EOT) end of
transmission frames.
(ENQ/ACK) method
Sender
Receiver
ENQ
ACK
D ata
ACK
EOT
Poll/select method
This works with the system where there is a
primary station and many secondary stations.
All are connected by same channel
Each secondary device have a unique
address.
Only one transmission can occur at a time.
Primary
Secondary
A
Secondary
B
Secondary
C
select method
When primary wants to send data to a
particular secondary, it transmits a select (SEL)
frame, one field of which includes the address
of the intended secondary.
As all secondary devices are connected by a
single link so each one checks the address
field.
When a secondary recognizes its own
address, it opens the frame and reads that
information that the data are forthcoming.
select method
If the secondary is awake and running it
returns an ACK frame to the primary.
Then the primary sends one or more data
frames, each addressed to the intended
secondary.
select method
S1
Primary
SEL
ACK
D ata
ACK
S2
S3
Poll method
When the primary is ready to receive the data ,
it polls(ask) each device to send data.
The device responds either NAK if it has
nothing to send or with data.
If the response is NAK the primary polls the
next secondary until it finds one with data to
send.
When the response is positive the primary
reads
the
frame
and
sends
an
acknowledgement (ACK) to the secondary. The
secondary may now send frames one after
another.
poll method
Flow control
Flow control refers to a set of procedures
used to restrict the amount of data the sender
can send before waiting for acknowledgement.
Buffer: each receiving device has a block of
memory called a buffer, reserved for storing
incoming data until they are processed.
If buffer begins to fill up receiver tells the send
to control the flow of data or halt the
transmission until it is again ready to receive
data.
Flow control
Flow Control
Receiver
D ata
Wait
time
ACK
D ata
Wait
time
ACK
senders window
receivers window
An example
Receiver Side
Sender Side
1 2 3 4 5 6 7 0 1 2
1 2 3 4 5 6 7 0 1 2
1 2 3 4 5 6 7 0 1 2
Data 0
1 2 3 4 5 6 7 0 1 2
1 2 3 4 5 6 7 0 1 2
Data 1
1 2 3 4 5 6 7 0 1 2
1 2 3 4 5 6 7 0 1 2
ACK 2
1 2 3 4 5 6 7 0 1 2
Error Control
Selective Reject
Receiver
Data 0
ACK 1
No error
Data 1
ACK 0
Data 0
NAK
No error
Error in
Frame 0
Data 0
ACK 1
No error
Receiver
D ata 0
Time out
Lost
Data 0
ACK 1
Sender
Receiver
Data 0
Time out
Lost
ACK 1
No error
Data 0
ACK 1
Second
copy
Discarded
Receiver
Da t a 0
Data 1
No error
Da t a 2
ACK 3
Data 3
Data 4
Da t a 5
NAK 3
Resent
Resent
Resent
Da t a 3
Data 4
Da t a 5
Error, Discarded
Discarded
Discarded
Receiver
Da t a 0
Data 1
Da t a 2
Data 3
Data 4
NAK 2
Resent
Resent
Resent
Da t a 2
Data 3
Da t a 4
Lost
Out of sequence,
discarded
Receiver
Da t a 0
Data 1
Time out
AC K 2
Resent
Resent
Lost
Da t a 0
Data 1
Discarded
Discarded
assignments
What is selective reject ARQ?
How damaged , lost frame and lost
acknowledgements are managed using this
procedure?