CIS_321_ch11

advertisement
CIS 321
Data Communications &
Networking
Chapter 11 – Data Link Control and
Protocols
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
Data Link Layer Functions
University of South Alabama
Computer and Information Sciences
3
Flow Control
 Coordinates amount of data sent before receiving
acknowledgement
 Purpose: prevent overwhelming receiver

Buffer overflow
University of South Alabama
Computer and Information Sciences
4
Error Control
 Error detection and 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
5
Flow and Error Control Mechanisms
 Stop-and-Wait ARQ
 Go-back-N ARQ
 Selective-Repeat ARQ
University of South Alabama
Computer and Information Sciences
6
11.2 Stop-and-Wait ARQ
 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
7
Stop-and-Wait Normal Operation
University of South Alabama
Computer and Information Sciences
8
Lost or Damaged Frame
University of South Alabama
Computer and Information Sciences
9
Lost Acknowledgement
University of South Alabama
Computer and Information Sciences
10
Delayed Acknowledgement
University of South Alabama
Computer and Information Sciences
11
Stop-and-Wait
 Advantage: simplicity; each frame is checked and
ACK’d before next frame is sent

Numbering of frames prevents duplication
 Disadvantage: inefficiency; slow
 Frame and ACKs use entire bandwidth
 If distance is long between devices, time spent
waiting can be significant
University of South Alabama
Computer and Information Sciences
12
Bidirectional Transmission
 Possible if two parties have separate channels for
full-duplex transmission or share same channel
for half-duplex transmission
University of South Alabama
Computer and Information Sciences
13
Piggybacking
 Method of combining data frame and
acknowledgement
 Saves bandwidth due to less overhead from
separate data frame and ACK frame into one
frame
University of South Alabama
Computer and Information Sciences
14
Piggybacking
University of South Alabama
Computer and Information Sciences
15
Sliding Window
 Sender may transmit several frames before
needing an ACK
 Much more efficient; receiver may use a single
ACK to confirm multiple frames
 Sliding window refers to upper and lower limit on
number of frames that may be transmitted before
ACK is required
 Frames must be numbered to allow receiver to
identify which frame is acknowledged
University of South Alabama
Computer and Information Sciences
16
11.3 Go-Back-N ARQ
 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
17
Sliding Window
 Receiver includes 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
18
Sender Window
 Window contains 0 to
2m -1 frames
 Window shrinks as
frames are sent out
 Once ACK arrives,
window expands
equal to number of
frames acknowledged
by ACK
University of South Alabama
Computer and Information Sciences
19
Receiver Window
 Size of window is always 1
 Receiver expects the next
ordered frame (must always be
in order)
 Any frame arriving out of order
is discarded
University of South Alabama
Computer and Information Sciences
20
Control Variables
 Sender : S – sequence number of recently sent frame; SF
- sequence number of first frame in window; SL –
sequence number of last frame in window
 Window size is W = SL - SF + 1
 Receiver : R – sequence number of next frame expected
University of South Alabama
Computer and Information Sciences
21
Go-Back-N Operation
 Timers: sender sets a timer for each frame (none
for receiver)
 Acknowledgement – receiver sends positive ACK;
silent on damaged or out of order frames
 Resending Frames – sender sends set of frames
from damaged up to last one sent and ACK’d
University of South Alabama
Computer and Information Sciences
22
11.4 Selective Repeat ARQ
 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
23
Sender and Receiver Windows
 Sender window and control variables are same
as Go-Back-N
 Receiver window is same size; looks for range of
sequence numbers

Requires two control variables to define window
boundaries: RF and RL
 Also defines a negative acknowledgement (NAK)
to report sequence number of damaged frame
University of South Alabama
Computer and Information Sciences
24
Selective Repeat ARQ
University of South Alabama
Computer and Information Sciences
25
Selective Repeat ARQ, Lost Frame
University of South Alabama
Computer and Information Sciences
26
Comparisons between Go-back-n
and Selective-Reject
 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
27
11.5 HDLC
 High-level Data Link Control – protocol
supporting half-duplex and full-duplex
communication over point-to-point and multipoint
links
University of South Alabama
Computer and Information Sciences
28
HDLC Modes of Communication
 Relationship between two devices involved in an
exchange
 Defines who controls the link
 Two modes:


Normal response mode (NRM)
Asynchronous balanced mode (ABM)
University of South Alabama
Computer and Information Sciences
29
Normal Response Mode
 Refers to standard primary-secondary
relationships
 Used for all exchanges in unbalanced
configurations
 Primary can issues commands
 Secondary must have permission from primary
before responding or sending data
University of South Alabama
Computer and Information Sciences
30
NRM
University of South Alabama
Computer and Information Sciences
31
Asynchronous Balanced Mode
 All stations are equal
 Stations in point-to-point configurations act as both
primary and secondary
University of South Alabama
Computer and Information Sciences
32
HDLC Frames
 Three types; each functions as an envelope to
transmit a specific type of message
 Information frames (I-frames) – transports user
data and control info relating to user data
 Supervisory frames (S-frames) – used to
transport control info for data link layer flow and
error controls
 Unnumbered frames (U-frames) – used for
system mgmt and link mgmt
University of South Alabama
Computer and Information Sciences
33
HDLC Frame
University of South Alabama
Computer and Information Sciences
34
Flag Field
 Marks the beginning and end of frame and
provides synchronization with 01111110
University of South Alabama
Computer and Information Sciences
35
Address Field
 Contains address of secondary station that is
originator or destination of the frame
 If created by primary, contains a to address
 If created by secondary, contains a from address
 May be one byte or several bytes long
University of South Alabama
Computer and Information Sciences
36
Control Field
 One- or two-byte segment for flow management
 Fields differ depending on frame type
 First or first and second bits identify type of frame
 All three frame types contain a poll/final (P/F) bit;
used to identify whether frame was sent by
primary to a secondary or from secondary to
primary
University of South Alabama
Computer and Information Sciences
37
Information Field
 Contains user’s data in an I-frame; network
management in a U-frame; not included in an Sframe
 Often used in a data frame to acknowledge
receipt of another separate frame – called
piggybacking
University of South Alabama
Computer and Information Sciences
38
FCS Field
 Error detection field
 Stores either two- or four-byte CRC
University of South Alabama
Computer and Information Sciences
39
Different Control Frames
 I-frame – used for user information and transport
and piggyback acknowledgements
 S-frame – used for acknowledgement, flow
control, and error control when piggybacking is
not appropriate
 U-frame – used to exchange session
management and control information between
devices
University of South Alabama
Computer and Information Sciences
40
Data Transparency
 To address the possibility that a bit pattern may
match flag field indicator and be misinterpreted,
bit stuffing may be used
 Anytime 5 consecutive 1s are encountered, a
redundant 0 is inserted
 Identifies that the current sequence is not a flag
University of South Alabama
Computer and Information Sciences
41
Bit Stuffing and Removal
University of South Alabama
Computer and Information Sciences
42
Coming Up… Ch 12
 Point-to-Point Access: PPP (brief)
University of South Alabama
Computer and Information Sciences
43
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
44
Download