Title: EE3900 Computer Networks Data Link Control Slide 1
1Data Link Control Chapter 7
2Placement of the Data Link Protocol
3(No Transcript)
4Functions of Data Link Control
- Frame synchronization
- Flow control
- Error control
- Addressing
- Control and data on same link
- Link management
- By performing all of the above functions, the
datalink layer aims at providing a reliable
point-to-point communication link for used by the
upper layers
5Frame Synchronization
- Why framing?
- Easier to detect errors by breaking the bit
stream up into discrete frames and compute the
checksum for each frame - Data in upper layer (e.g. IP layer in TCP/IP) is
organized in units of packets
6Frame Synchronization
- Common methods
- Character count
- Starting and ending characters, with character
stuffing - Starting and ending flags, with bit stuffing
(will be discussed in HDLC) - Others
7Character Count
8Starting/ending Characters
9Flow Control
- to assure that transmitting entity does not
overwhelm receiving entity with data - size of receiver's buffer is limited
10Common Flow Control Methods
- Stop and Wait Protocol
- Sliding Window Protocols
11We first consider flow control for for error-free
transmission. For transmission with errors,
techniques such as Automatic Repeat reQuest (ARQ,
will be discussed later) are used.
12Stop and Wait
- Source transmit a frame, stop and wait for
acknowledgement - Destination send back an acknowledgement after
reception - Source send the next frame when ACK is received
- Destination can stop flow by not send ACK
- Works well for a few large frames
13Fragmentation
- Large block of data may be split into small
frames - Limited buffer size
- Errors detected sooner (when whole frame
received) - On error, retransmission of smaller frames is
needed - Prevents one station occupying medium for long
periods - Stop and wait becomes inadequate
14(No Transcript)
15Stop and Wait - Utilization
- a (Propagation Delay)/(Frame transmission
time) - agt1 under-utilized
- alt1 inefficiently utilized (since time is still
wasted in waiting the ACK) - therefore, not suitable for very high data rates
or very long distance transmission (why?)
16Sliding-Window
- Efficiency improved if multiple frames can be
transmitted at the same time - Consider transmission from A to
- B
- - B can buffers n frames
- - A can send up to n frames without ACK
- - or window size n
- - frame sequence number 0 to m-1
- - nltm, and m is a power of 2
17(No Transcript)
18(No Transcript)
19Sliding Window Enhacements
- Receiver can acknowledge frames without
permitting further transmission (Receive Not
Ready) - Must send a normal acknowledge to resume
- If duplex, use piggybacking
- If no data to send, use acknowledgement frame
- If data but no acknowledgement to send, send last
acknowledgement number again
20Why Error Detection?
- Consider a transmission system with BER1E-6
- Frame size 1000 bits
- Prob that a frame received with no error
0.999, or 1 error frame per 1000 transmitted
frames, too large! - Frame error rate increases when frame size
increases
21(No Transcript)
22Cyclic Redundancy Check (CRC)
- K-bit message
- n-bit frame check sequence (FCS)
- use Modulo 2 Arithmetic, just the same as
exclusive-or operation - 1111 11001
- 1010 11
- --------- -----------
- 0101 11001
- 11001
- -----------
- 101011
23Generation of FCS
- Define
- T(kn)-bit transmitted frame, with nltk
- Mk-bit message
- Fn-bit FCS
- Pa predetermined (n1)-bit divisor
- T2nM F, where FRemainder of (2nM)/P
24Example of FCS Generation
- M1010001101 (10 bits)
- P110101 (6 bits)
- F to be calculated, should be 5 bits
- 1101010110
- P? 110101? 101000110100000 ? 2nM
- 110101
- 111011
- 110101
- 111010
- 110101
- 111110
- 110101
- 101100
- 110101
- 110010
- 110101
- 01110 ? F
25Example of Error Checking
- M1010001101 (10 bits)
- P110101 (6 bits)
- F01110
- 1101010110
- P? 110101? 101000110101110 ? T
- 110101
- 111011
- 110101
- 111010
- 110101
- 111110
- 110101
- 101111
- 110101
- 110101
- 110101
- 00000 ? No Error!
26Widely Used Polynomials
- CRC-16 X16 X15 X2 1
- CRC-CCITT X16 X12 X5 1
- CRC-32 X32 X26 X23 X16 X12 X11
- X10 X8 X7 X5 X4 X2 X 1
27Automatic Repeat Request (ARQ)
- Why ARQ? Error-free transmission is not possible
in real life - ARQ involves
- Error detection
- Positive acknowledgement
- Retransmission after timeout
- Negative acknowledgement
- and retransmission
28Stop-and-Wait ARQ
- based on Stop-and-Wait flow control, plus timeout
mechanism - simple
- inefficient
29Stop and Wait ARQ
- Source transmits single frame
- Wait for ACK
- If received frame damaged, discard it
- Transmitter has timeout
- If no ACK within timeout, retransmit
- If ACK damaged,transmitter will not recognize it
- Transmitter will retransmit
- Receive gets two copies of frame
- Use ACK0 and ACK1
30(No Transcript)
31Go-back-N ARQ
- allow multiple frames to be
- transmitted at the same time
- to improve performance
- ve ack (RRReceive Ready)
- for sliding-window flow
- control
- -ve ack (REJReject) for
- frame retransmission request
32RR2 Receive Ready 2, or the receiver is now
ready to receive frame 2, or the receiver is now
looking for frame 2 P bit indicates that P-bit
timer expires
33Selective-reject ARQ
- Only frames with -ve ack (SREJ) are
retransmitted - more efficient
- larger buffer than Go-back-N
34High-level Data Link Control (HDLC)
- The most important data
- link control protocol
- 3 station types
- 2 link configurations
- 3 data transfer models
35Station Types
- Primary station
- Controls operation of link
- Frames issued are called commands
- Maintains separate logical link to each secondary
station - Secondary station
- Under control of primary station
- Frames issued called responses
- Combined station
- May issue commands and responses
36HDLC Link Configurations
- Unbalanced
- One primary and one or more secondary stations
- Supports full duplex and half duplex
- Balanced
- Two combined stations
- Supports full duplex and half duplex
37Data Transfer Modes
- Normal response mode
- (NRM)
- used with unbalanced configuration
- used on multidrop lines
- Asynchronous response
- mode (ARM)
- rarely used
- Asynchronous balanced
- mode (ABM)
38Asynchronous Balanced mode (ABM)
- most widely used of the 3 modes
- used with a balanced configuration
- each combined station may initiate
- transmission without receiving
- permission from the other
- used as the data link layer protocol
- of the widely used packet-switched
- X.25 networks
39Frame Structure
- Synchronous transmission
- All transmissions in frames
- Single frame format for all data and control
exchanges
40- Flag Field
- delimit the frame at both ends with 01111110
- a single flag may be used as the closing flag of
- one frame and the opening flag of the next
- receiver continuously hunting for the flag, if
- found, it continues to hunt for ending flag
- if the pattern 01111110 appears inside the
frame, - then ...
41Bit stuffing
Figure 6. 11 Bit Stuffing
42- Address Field
- for identifying the secondary station
- not needed for point-to-point link (e.g. PPP)
- 11111111 means all stations, for broadcast use
- Control Field
- HDLC defines 3 types of frames, each with a
different - control field format
- Information frames (I-frames) carry the data
- Supervisory frames (S-frames) provide the ARQ
- mechanism when piggybacking is not used (e.g.
- when there is acknowledgement to be sent, but
no - data to be sent back)
- Unnumbered frames (U-frames) provide
supplemental - link control functions
43- Notes
- 3-bit sequence numbers are used
- N(S) is the sequence number of the frame
- N(R) which number I-frame expected to be
received - S indicate the flow control and error control
functions - Receive Ready (RR)
- Receive Not Ready (RNR)
- Reject (REJ) initiate the go-back-N ARQ
- Selective Reject (SREJ) request retransmission
of - just a single frame
44- Poll/Final Bit
- Use depends on context
- Command frame
- P bit
- 1 to solicit (poll) response from peer
- Response frame
- F bit
- 1 indicates response to soliciting command
- Information Field
- present only in I-frames and some U-frames
- in I-frames it contains upper layer data (e.g.
IP packets) - Frame Check Sequence Field
- normal code is the 16-bit CRC-CCITT
45HDLC Operations
- Consists of the exchange of I-frames, S-frames,
and U-frames - Involves 3 phases
- - Initialization
- - Data Transfer
- - Disconnect
46- Initialization
- signals the other side that initialization is
requested - specifies the mode (NRM, ABM, or ARM)
- specifies whether 3- or 7-bit sequence numbers
are used - example
47Examples of Operation (1)
48Examples of Operation (2)
49Other Data Link Protocols
- LAPB
- used in X.25
- subset of HDLC which provides only the
- Asynchronous Balanced Mode (ABM)
- LAPD
- used in ISDN
- also similar to HDLC
- LAPDm used in GSM
- Point-to-Point Protocol (PPP)
- use subset of HDLC
- widely used in dialup access to Internet
- also widely used in connecting WAN routers
- LLC
- IEEE 802, used in LAN