the data link layer chapter 3 1. h ybrid m odel the hybrid reference model to be used in this book....
TRANSCRIPT
THE DATA LINK LAYER
Chapter 3
1
HYBRID MODEL
The hybrid reference model to be used in this book.2
FUNCTIONS OF THE DATA LINK LAYER
3
DATA LINK LAYER DESIGN ISSUES
• Services Provided to the Network Layer
• Framing (Packetizing)• Physical addressing• Error Control• Flow Control• Access control.
4
SERVICES PROVIDED TO NETWORK LAYER
• Unacknowledged connectionless service.No acknowledgement, no logical connection, used in very low error rate channel and real-time traffic.
• Acknowledged connectionless service.each frame acknowledged, used in unreliable channel
• Acknowledged connection-oriented servicea connection established, frames are numbed.reliable transmission guaranteed.
5
For the data link layer, break the bit stream up into discrete frames and computer the checksum for each frame (error control).
Four methods are used to break the bit stream.
1.Character count. (rarely used)2.Flag bytes with byte stuffing3.Starting and ending flags, with bit stuffing.
4.Physical layer coding violations. 6
FRAMING (PACKETIZING)
7
FRAMING (2)
(a) A frame delimited by flag bytes.(b) Four examples of byte sequences before and after
stuffing.
8
FRAMING (3)
Bit stuffing(a) The original data.(b) The data as they appear on the line.(c) The data as they are stored in receiver’s
memory after destuffing.9
10
Ensuring the sending entity does not overwhelm the receiving entity
Feedback-based flow control
Flow Control
Rate-based flow control (network layer)
STOP AND WAIT
11
Only one frame at a time can be in transit. 1.Source transmits frame2.Destination receives frame and replies with acknowledgement (if it is correct, otherwise send NAK.)3.Source waits for ACK before sending next frame4.Destination can stop flow by not send ACK5.Source can retransmit if got a NAK.6.Works well for a few large frames7.Inefficient line utilization for small frames
SLIDING WINDOW PROTOCOLS
12
Allow multiple frames to be in transit•Receiver has buffer W long•Transmitter can send up to W frames without ACK•Each frame is numbered•ACK includes number of next frame expected•Sequence number bounded by size of field (k)• Frames are numbered
modulo 2k
EXAMPLE SLIDING WINDOW
13
SLIDING WINDOW PROTOCOLS (2)
Duplex communication: each station needs to maintain two windows
Piggyback: num of frame and num of ack are included in one frame.
Sliding-window flow control is more efficient than stop-and-wait flow control.
14
ERROR CONTROL
Detection and correction of errors• Lost frames: a frame failed to arrived to
the other side. • Damaged frames: some bits are in
error.Automatic repeat request
Error detectionPositive acknowledgmentRetransmission after timeoutNegative acknowledgement
15
ERROR DETECTION AND ERROR CORRECTION
Additional bits added by transmitter for error detection and/or error correction code
Error detection is more often used in protocol with ARQ. High code rate, high reliability.
c)Error correction is used in specific situation. (no reverse channel)
d)Hybrid ARQ: combination of error detection and correction.
16
ERROR CONTROL SCHEME
17
STOP-AND –WAIT ARQ
18
1. Source transmits single frame
2. Wait for ACK3. If received frame
damaged, discard it4. Transmitter has timeout5. If no ACK within timeout,
retransmit6. If ACK damaged,
transmitter will not recognise it, Transmitter will retransmit
7. Receive gets two copies of frame
8. Use ACK0 and ACK19. Simple but Inefficient
GO BACK N Based on sliding window If no error, ACK as usual with next frame
expected Use window to control number of outstanding
frames If error, reply with rejection
Discard that frame and all future frames until error frame received correctly
Transmitter must go back and retransmit that frame and all subsequent frames
19
SELECTIVE REJECT (RETRANSMISSION)
Only rejected frames are retransmittedSubsequent frames are accepted by the
receiver and bufferedMinimizes retransmissionReceiver must maintain large enough
buffer to reordering.More complex login in transmitter
20
EXAMPLE DATA LINK PROTOCOLS
• HDLC – High-Level Data Link Control
• The Data Link Layer in the Internet
21
HIGH-LEVEL DATA LINK CONTROL
Frame format for bit-oriented protocols.
22
HIGH-LEVEL DATA LINK CONTROL (2)
23
24
Flag AddressControl
Information FCS Flag
8 bits
8 or more bits
8 or 16 bits
Variable length, 0 or more bits
16 or 32 bits
8 bits
The contents of an HDLC frame are shown in the following table:
THE DATA LINK LAYER IN THE INTERNET
PPP (Point-to-point protocol) handles error detection, supports multiple protocols, allows IP addresses to be negotiated at connection time.
25
PPP – POINT TO POINT PROTOCOL
The PPP full frame format for unnumbered mode operation.
26
27
Performance of ARQ
Stop-and-Wait Flow Control
The total time to send the data as T = n(2tprop + tframe)
The utilization, or efficiency, of the line is
)2( frameprop
frame
ttn
tnu
It is useful to define the parameter a = tprop/tframe .
Then
au
21
1
28
Error-free sliding-window flow control
2a1W 21
2a1W 1
a
Wu where W is window size