Tải bản đầy đủ (.pdf) (70 trang)

TRUYỀN SỐ LIỆU VÀ MẠNG Ch03 data link layer protocols

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (3.03 MB, 70 trang )

Data Communication and
Networking
Dr. –Ing. Vo Que Son
Email:

Telecomm. Dept.
Faculty of EEE

DCN
HCMUT

1


Content
Chapter 3: Data Link Layer Protocols
Flow Control
Error Control
Connection Management
Data Link Protocols

Chapter 4: Telecommunication Networks
802.x standard and TCP/IP Model
Ethernet, Token Pass, Token Ring
IP Addressing: Classfull and VLSM
Network devices
Switching and Routing
STP, VLAN
Telecomm. Dept.
Faculty of EEE


DCN
HCMUT

2


Framing
The data link layer needs to pack bits into frames, so
that each frame is distinguishable from another.
Fixed-Size Framing
Variable-Size Framing

Telecomm. Dept.
Faculty of EEE

DCN
HCMUT

3


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.
Faculty of EEE

DCN
HCMUT

4


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:
• Idle RQ: Bisync (IBM), XModem
• Continuous RQ:
– Go-back N: e.g. HDLC, V.42
– Selective-Repeat: TCP, Service Specific Connection Oriented
Protocol
Telecomm. Dept.

Faculty of EEE

DCN
HCMUT

5


Notations
P

I -frame

S

ACK frame or NAK frame

 P: Primary, sending data frames
 S: Secondary, receiving data frames and sending ACK back to
Primary
 I frame: data/Information frame
 I(N): Data frame with sequence N
 ACK (Acknowledge) frame: response/reply sent from S back to
P, confirm receiving a good I-frame
 NAK (Negative Acknowledge) frame: response/reply sent from
S back to P, confirm receiving a corrupted I-frame (error
frame)
Telecomm. Dept.
Faculty of EEE


DCN
HCMUT

6


Idle RQ
 Principle:

 P can have only 1 I-frame
outstanding (awaiting for
an ACK) at a time
 On receipt of an error-free
ACK frame, P transmits
another I-frame
 If S receives an I-frame or
P receives an ACK
containing transmission
error: the frame is
discarded
 If P does not receive an
ACK within a given timeout
interval: retransmits the
waiting I-frame
 If an ACK is corrupted, the
S receives another copy of
the frame and it is rejected
by S.
Telecomm. Dept.
Faculty of EEE


DCN
HCMUT

7


Idle RQ
 Implicit retransmission
 P has to wait a timeout
interval before retransmission
 What is the drawback of this
mechanism? How to improve

 Explicit retransmission
 If S receives a corrupted Iframe: return an NAK to P
 If P receives an ACK, stop the
timer, and transmit the next
frame.
 If P receives a NAK, retransmit
the I-frame
 If P does not receives ACK or
NAK during a timeout interval,
do the retransmission by timer

Telecomm. Dept.
Faculty of EEE

DCN
HCMUT


8


Idle RQ
Advantages :
Send and Wait (Stop and Wait)
Small buffers: both P and S
keeps only 1 frame

Disadvantages:
Low link utilization
Used in transmission of
printable characters
Half-duplex applications

Notation:
N(S): send sequence number
N(R): receive sequence
number
Telecomm. Dept.
Faculty of EEE

DCN
HCMUT

9


Idle-RQ

 Link utilization:

 In case BER=0:

Tix
Tix
1
1
U= 
=
=
Tt Tix +2Tp 1+2Tp /Tix 1+2a
 What is the meaning of parameter a?
Telecomm. Dept.
Faculty of EEE

DCN
HCMUT

10


Idle-RQ
 Remember:

a=

Tp

Tix


(length of the link in bits)

 If a < 1 (i.e. Tix > Tp ): when
1st transmitted bit reaches S,
P will still be transmitting.
Hence U is close 100%
 If a > 1 (i.e. Tix < Tp) frame
transmission is completed
before 1st bit reaches S.
Hence U is low.
 Idle-RQ is efficient for links
where a << 1 (long frames
compared to propagation
time)
Telecomm. Dept.
Faculty of EEE

a>1

a<1

DCN
HCMUT

11


Idle-RQ
 In case BER>0 (channel with errors): in order to transmit 1 Iframe successfully, sender needs to retransmit Nr frames:

Tix
Tix
1
1
U=
=
=
=
Nr .Tt Nr (Tix +2Tp ) Nr (1+2Tp /Tix ) Nr (1+2a)

 If we call Pf is the FER, and 1 frame has Ni bits:

Pf =1-(1-BER)Ni

 Probability that i transmission are needed to deliver frame
successfully ( i-1 transmission in error and the ith transmission is
error free ):


E[# of transmission in error]= (i-1).Pr [ # of trans. in error = i-1]
i=1





Pf
  (i-1).P .(1-Pf ) = (1-Pf ).Pf  (i-1).P =
1-Pf
i=1

i=1
i-1
f

Telecomm. Dept.
Faculty of EEE

i-2
f

DCN
HCMUT

12


Idle-RQ
 Number of transmissions:
Nr =1+

 Utilization:

Pf
1
=
1-Pf 1-Pf

U=

1-Pf

(1+2a)

 Total average delay per frame if using Implicit scheme?s
 Utilization Performance when working with high speed and long
propagation delay?
Tt

Telecomm. Dept.
Faculty of EEE

DCN
HCMUT

13


Idle-RQ: Example
A series of 1000-bit frames is to be transmitted using
an idle RQ protocol. Determine the link utilization for
the following types of data link assuming a data
transmission rate of (i) 1 kbps and (ii) 1 Mbps. The
velocity of propagation of the link is 2.108 m/s and
the BER is negligible
A twisted pair cable 1 km in length
A leased line 200 km in length
A satellite link of 50,000 km
Solution?
Telecomm. Dept.
Faculty of EEE


DCN
HCMUT

14


Idle-RQ: Communication
Usually, Idle-RQ is used in
unidirectional communication.
If using bidirectional
communication?
Both sender and receiver have to
send and acknowledge data

Piggy back methods:
outstanding ACKs are placed in the
header of information frames
save bandwidth since the overhead
from a data frame and an ACK
frame (addresses, CRC, etc) can be
combined into just one frame
Telecomm. Dept.
Faculty of EEE

DCN
HCMUT

15



Continuous RQ
 Continuous RQ improves the link utilization at the expense of
increased buffer storage requirements.
 Principle:
 P sends I-frames continuously without waiting for an ACK to be returned
 Since more than 1 I-frames is waiting ACK, P retains a copy of each I-frame
transmitted in a retransmission list (using FIFO)
 S returns an ACK for each correctly received I-frame
 Each I-frame contains a unique identifier which is returned is the
corresponding ACK-frame
 On receipt of an ACK, the corresponding I-frame is removed from the
retransmission list by P
 Frames received free of errors are placed in the link receive list to wait
processing
 On receipt of the next in-sequence I-frame expected, S delivers the
information content within the frame to the upper layer
 In the event of frames being received out of sequence, S retains these in
the link receive list until the next in-sequence frame is received.

Telecomm. Dept.
Faculty of EEE

DCN
HCMUT

16


Continuous RQ


Telecomm. Dept.
Faculty of EEE

DCN
HCMUT

17


Continuous RQ
In the absent of errors, the link utilization of
continuous RQ is approximately 100%
In all continuous RQ schemes, corrupt frames are
discarded and retransmission requested only after
the next error-free frame.
When errors occur:
S detects and requests the retransmission of just those
frames in the sequence that are corrupted: Selective
Repeat
S detects the receipt of an out-of-sequence I-frame and
requests P to retransmit all outstanding unacknowledged Iframes from the last correctly received: Go-back-N
Telecomm. Dept.
Faculty of EEE

DCN
HCMUT

18



Continuous RQ
Selective Repeat: can be implemented in 2 ways:
S acknowledges correctly received frames and P
determines from the sequence of ACK-frames received
that a frame has been lost: implicit retransmission
Or S returns NAK for a frame that is missing from the
sequence: explicit request

Telecomm. Dept.
Faculty of EEE

DCN
HCMUT

19


Continuous RQ
 Selective Repeat: implicit retransmission, I-frame is corrupted
 Assume I-frame N+1 is corrupted
 S returns a ACK for each correctly received I-frame as before
 S returns ACK-frame for I-frames N,N+2,N+3,…
 On receipt of ACK for I-frame N+2, P detects that frame N+1 has not
been acknowledged
 To allow for the possibility of more than one I-frame being corrupted,
on detecting an unacknowledged frame P enter the retransmission
state.
 When in this state, the transmission of the new frames is suspended
until all unacknowledged frames have been retransmitted
 P removes I-frame N+2 from the retransmission list and retransmits Iframe N+1 before transmitting frame N+5

 On receipt of I-frame N+1, the contents of the queued frames in the link
receive list are delivered by S
Telecomm. Dept.
Faculty of EEE

DCN
HCMUT

20


Continuous RQ
 Selective Repeat:
implicit retransmission
 Corrupted I-frame

Telecomm. Dept.
Faculty of EEE

DCN
HCMUT

21


Continuous RQ
Selective Repeat: implicit retransmission, ACK(N) is
corrupted
On receipt of ACK-frame N+1, P detects that I-frame N is
still awaiting acknowledged and hence retransmits it

On receipt of the retransmitted I-frame N, S determines
from its receive sequence variable that this has already
been received correctly and is therefore a duplicate
S discards the frame but returns an ACK for it to ensure P
removes the frame from the retransmission list.

Telecomm. Dept.
Faculty of EEE

DCN
HCMUT

22


Continuous RQ
 Selective Repeat:
implicit retransmission
 Corrupted ACK-frame

Telecomm. Dept.
Faculty of EEE

DCN
HCMUT

23


Continuous RQ

Selective Repeat: explicit retransmission
 Use an explicit NAK to request for a specific frame to be retransmitted.
The NAK-frame is also known as selective reject.

Principle:
 An ACK acknowledges all frames in the retransmission list up to and
including the I-frame with the sequence number the ACK contains
 Assume I-frame N+1 is corrupted
 S returns an ACK for I-frame N
 When S receives I-frame N+2 it detects I-frame N+1 is missing and hence
returns a NAK containing the identifier of the missing I-frame N+1
 On receipt of NAK N+1, P interprets this as S is still awaiting I-frame N+1
and hence retransmits it
 When S returns a NAK, it enters the retransmission state
 When in the retransmission state, the return of ACK-frames is suspended.

Telecomm. Dept.
Faculty of EEE

DCN
HCMUT

24


Continuous RQ
 Principle:
 On receipt of I-frame N+1,
S leaves the retransmission
state and resumes

returning ACK-frames.
 ACK N+4 acknowledges all
frames up to including
frame N+4
 A timer is used with each
NAK to ensure that if it is
corrupted (and hence
frame N+1 is not received),
it is retransmitted

 Selective Repeat: explicit
request:
 Correct Operation
Telecomm. Dept.
Faculty of EEE

DCN
HCMUT

25


×