CIS 321 Data Communications & Networking

Transcription

CIS 321 Data Communications & Networking
CIS 321
Data Communications &
Networking
Data Link Layer
Introduction
Protocol – set of rules governing communication
specific to one or more layers of the OSI model
Data link protocols define the rules devices use to
implement data link layer functions
Contain rules for line discipline, flow control, and
error control
University of South Alabama
Computer and Information Sciences
2
Flow Control
Coordinates amount of data sent before receiving
acknowledgement
Purpose: prevent overwhelming receiver
Buffer overflow
University of South Alabama
Computer and Information Sciences
3
Error Control
Error detection and error correction
Error detection (VRC,LRC)
Error Correction
Receiver informs sender of any frames lost or damaged
and coordinates retransmission of those frames by the
sender
Usually handled via automatic repeat request (ARQ)
University of South Alabama
Computer and Information Sciences
4
Figure 9-1
WCB/McGraw-Hill
University of South Alabama
Computer and Information Sciences
The

McGraw-Hill Companies, Inc., 1998
Figure 9-2
Single-bit error
WCB/McGraw-Hill
University of South Alabama
Computer and Information Sciences
The

McGraw-Hill Companies, Inc., 1998
Figure 9-4
Burst error (Multiple-bit error)
WCB/McGraw-Hill
University of South Alabama
Computer and Information Sciences
 The McGraw-Hill Companies, Inc., 1998
Figure 9-7
WCB/McGraw-Hill
Error detection:VRC
University of South Alabama
Computer and Information Sciences
The

McGraw-Hill Companies, Inc., 1998
Figure 9-8
Error detection: LRC
WCB/McGraw-Hill
University of South Alabama
Computer and Information Sciences
The

McGraw-Hill Companies, Inc., 1998
Figure 9-9
Error detection: VRC and LRC
WCB/McGraw-Hill
University of South Alabama
Computer and Information Sciences
The

McGraw-Hill Companies, Inc., 1998
Flow and Error Control Mechanisms
Stop-and-Wait ARQ
Go-back-N ARQ
Selective-Repeat ARQ
University of South Alabama
Computer and Information Sciences
11
11.2 Stop-and-Wait
Sender keeps copy of last frame sent and waits
for ACK for that frame
Next frame cannot be sent until ACK has been
received
Frames are numbered alternately 0 and 1
Damaged or lost frames are resent
Repeats until EOT is sent
University of South Alabama
Computer and Information Sciences
12
Stop-and-Wait Normal Operation
University of South Alabama
Computer and Information Sciences
13
Lost or Damaged Frame
University of South Alabama
Computer and Information Sciences
14
Lost Acknowledgement
Detect duplication
Frame 1 discarded
University of South Alabama
Computer and Information Sciences
15
Stop-and-Wait
Advantage: simplicity; each frame is checked and
ACK’d before next frame is sent
Numbering of frames prevents duplication
Disadvantage:
Waste of the bandwidth
Slow: time spent waiting of an acknowledge can be
significant
University of South Alabama
Computer and Information Sciences
16
Piggybacking
Method of combining data frame and
acknowledgement
Use more efficiency the bandwidth
University of South Alabama
Computer and Information Sciences
17
Piggybacking
University of South Alabama
Computer and Information Sciences
18
Sliding Window
Sender may transmit several frames before
needing an ACK
Use more efficiency the bandwidth (sending many
segments in the same time)
Don’t waste the time in acknowledgement waiting
receiver may use a single ACK to confirm multiple
frames
Sliding window refers to the number of frames
that may be transmitted before ACK is required
Frames must be numbered
to allow receiver to
University of South Alabama
Computeris
and acknowledged
Information Sciences
identify which frame
19
11.3 Go-Back-N
Allows for more efficient transmission – send
multiple frames before requiring an ACK
Specify a window or range of sequence numbers
of frames that may be received
University of South Alabama
Computer and Information Sciences
20
Sliding Window
Receiver includes the number of next frame it
expects to receive in ACK
Sender then knows all previous frames through
that number have been received
University of South Alabama
Computer and Information Sciences
21
Sender Window
Window contains 0 to
2m -1 frames
Frames numbered
using m bits
Frames numerous are
between 0 and 2m -1
Once ACK arrives, the
acknowledged frames
exit the window to put
the new frames
University of South Alabama
Computer and Information Sciences
22
Receiver Window
The acknowledged frames are sent to the
network layer
University of South Alabama
Computer and Information Sciences
23
Go-Back-N Operation
Timers: sender sets a timer for each frame (none
for receiver)
Acknowledgement – receiver sends positive ACK;
NAK on damaged or out of order frames
Resending Frames – sender sends set of frames
from damaged up to last one sent
University of South Alabama
Computer and Information Sciences
24
Go-Back-N Operation
In this example 3-bit
sequence number
field is used.
window size:
23-1 = 7.
University of South Alabama
Computer and Information Sciences
11.4 Selective Repeat
Go-Back-N less efficient since all out of order or
damaged frames must be resent in order
Selective Repeat is a more efficient method, yet
required more processing
University of South Alabama
Computer and Information Sciences
26
Selective Repeat, Lost Frame
University of South Alabama
Computer and Information Sciences
27
Comparisons between Go-back-n
and Selective-Repeat
Sending only specific damaged or lost frames
requires complexity of sorting and more storage
is required in select-reject
Go-back-n is typically used due to simplicity
University of South Alabama
Computer and Information Sciences
28
Data Transparency
Flag to separate between frames
Flag fields delimit frame at both ends with a
unique pattern 01111110.
A single flag may close one frame and open
another
To Identify that the current sequence is not a flag
Anytime 5 consecutive 1s are encountered, a
redundant 0 is inserted
University of South Alabama
Computer and Information Sciences
29
Bit Stuffing and Removal
University of South Alabama
Computer and Information Sciences
30
Credits
All figures obtained from publisher-provided
instructor downloads
Data Communications and Networking, 3rd edition by
Behrouz A. Forouzan. McGraw Hill Publishing, 2004
University of South Alabama
Computer and Information Sciences
31