Professional Documents
Culture Documents
Networking
Dr. –Ing. Vo Que Son
Email: sonvq@hcmut.edu.vn
Bit stuffing is the process of adding one extra 0 whenever five consecutive 1s follow a 0
in the data, so that the receiver does not mistake the pattern 0111110 for a flag.
Telecomm. Dept. DCN
7
Faculty of EEE HCMUT
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.
Now let us see how the data link layer can combine framing,
flow control, and error control to achieve the delivery of data
from one node to another. The protocols are normally
implemented in software by using one of the common
programming languages.
Telecomm. Dept. DCN
8
Faculty of EEE HCMUT
Error Control
Forward Error Control (FEC)
Usually used in real-time application (e.g. voice, video)
Accept errors if can not correct
List some FEC methods?
Error Detection + ARQ (Automatic Retransmission Request)
Require absolutely correct data transmission
Used in non real-time application (e.g. email, file
transmission)
2 basic ARQ protocols:
• Stop and Wait ARQ: Bisync (IBM), XModem
• Continuous ARQ:
– Go-back N: e.g. HDLC, V.42
– Selective-Repeat: TCP, Service Specific Connection Oriented
Protocol
Telecomm. Dept. DCN
9
Faculty of EEE HCMUT
Protocols
Now let us see how the data link layer can combine
framing, flow control, and error control to achieve the
delivery of data from one node to another. The
protocols are normally implemented in software by
using one of the common programming languages. To
make our discussions language-free, we have written in
pseudocode a version of each protocol that
concentrates mostly on the procedure instead of
delving into the details of language rules.
(continued)
Telecomm. Dept. DCN
26
Faculty of EEE HCMUT
Algorithm 11.5 Sender-site algorithm for Stop-and-Wait ARQ
(continued)
Telecomm. Dept. DCN
27
Faculty of EEE HCMUT
Algorithm 11.6 Receiver-site algorithm for Stop-and-Wait ARQ Protocol
(continued)
Telecomm. Dept. DCN
43
Faculty of EEE HCMUT
Algorithm 11.7 Go-Back-N sender algorithm
(continued)
Telecomm. Dept. DCN
44
Faculty of EEE HCMUT
Algorithm 11.8 Go-Back-N receiver algorithm
(continued)
Telecomm. Dept. DCN
57
Faculty of EEE HCMUT
Algorithm 11.9 Sender-site Selective Repeat algorithm
(continued)
Telecomm. Dept. DCN
58
Faculty of EEE HCMUT
Algorithm 11.10 Receiver-site Selective Repeat algorithm
In case BER=0:
Tix Tix 1 1
U= = =
Tt Tix +2Tp 1+2Tp /Tix 1+2a
Tt
Solution?
Solution?
Simple frame
with header SYN SYN SOH Header Data (128bytes) ETX BCC
Multi-block SYN SYN SOH Header STX Data IBT BCC STX Data ETX ETX
BCC
frame
Data block
Select operation
Master sends data to a specific slave
Put the slave address in the Select control
frame
If the Slave is unready: reply by NAK.
Otherwise, return ACK
Protocol performance:
Low link utilization (Idle RQ),
used with multi-drop links,
operating at data rates up to
64 kbps
Average time to poll each
station:
Tmin
Tavr =
1-Mr .Tix
Tmin: the minimum time to poll
all stations, Mr is the average
rate at which messages are
generated
Telecomm. Dept. DCN
84
Faculty of EEE HCMUT
Example
A BSC protocol is to be used to control the flow of messages between a
computer (Master station) and 10 block-mode terminals (secondaries) over
a multipoint data link. The link data rate, R, is 10 kbps and the average
length of a message, Ni, is 1000 bits. If a poll message and its associated ACK
is 30 bits and the total time to process these messages is 1ms, determine
the average time each terminal will be polled if the average rate at which
messages are generated is:
1 message per minute
6 message per second
The bit error rate and signal propagation delay times of the link can be assumed
to be negligible
Solution:
Tix=100ms
Time to transmit a poll and its ACK: 30/104=3 ms
Time to poll a single secondary: 3 + 1 = 4 ms
Minimum time to poll all secondaries: Tmin=10x4 = 40 ms
Mr = 1 msg/minute = 10-3/60 msg/ms: Tavr=40 ms
o Primary to Secondary: If
P=1, address is destination
00
o Secondary to Primary: If 10
F=1, address is source 01
11