data link control chapter 7

49
EE3900 Computer Networks Data Link Control Slide 1 Department of Electronic Engineering City University of Hong Kong Data Link Control Chapter 7

Upload: ally

Post on 07-Jan-2016

67 views

Category:

Documents


0 download

DESCRIPTION

Data Link Control Chapter 7. Placement of the Data Link Protocol. Functions of Data Link Control. Frame synchronization Flow control Error control Addressing Control and data on same link Link management - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 1

Department of Electronic Engineering City University of Hong Kong

Data Link Control

Chapter 7

Page 2: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 2

Department of Electronic Engineering City University of Hong Kong

Placement of the Data Link Protocol

Page 3: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 3

Department of Electronic Engineering City University of Hong Kong

Page 4: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 4

Department of Electronic Engineering City University of Hong Kong

Functions 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

Page 5: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 5

Department of Electronic Engineering City University of Hong Kong

Frame 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

Page 6: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 6

Department of Electronic Engineering City University of Hong Kong

Frame 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

Page 7: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 7

Department of Electronic Engineering City University of Hong Kong

Character Count

Page 8: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 8

Department of Electronic Engineering City University of Hong Kong

Starting/ending Characters

Page 9: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 9

Department of Electronic Engineering City University of Hong Kong

Flow Control

• to assure that transmitting entity does not overwhelm receiving entity with data• size of receiver's buffer is limited

Page 10: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 10

Department of Electronic Engineering City University of Hong Kong

Common Flow Control Methods

• Stop and Wait Protocol

•Sliding Window Protocols

Page 11: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 11

Department of Electronic Engineering City University of Hong Kong

We first consider flow control for for error-free transmission. For transm

ission with errors, techniques such as Automatic Repeat reQuest (ARQ,

will be discussed later) are used.

Page 12: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 12

Department of Electronic Engineering City University of Hong Kong

Stop 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

Page 13: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 13

Department of Electronic Engineering City University of Hong Kong

Fragmentation• 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

Page 14: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 14

Department of Electronic Engineering City University of Hong Kong

Page 15: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 15

Department of Electronic Engineering City University of Hong Kong

Stop and Wait - Utilization

• a = (Propagation Delay)/(Frame transmission time)

• a>1: under-utilized• a<1: 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?)

Page 16: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 16

Department of Electronic Engineering City University of Hong Kong

Sliding-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- n<m, and m is a power of 2

Page 17: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 17

Department of Electronic Engineering City University of Hong Kong

Page 18: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 18

Department of Electronic Engineering City University of Hong Kong

Page 19: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 19

Department of Electronic Engineering City University of Hong Kong

Sliding 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

Page 20: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 20

Department of Electronic Engineering City University of Hong Kong

Why Error Detection?• Consider a transmission system with BER=1E-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

Page 21: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 21

Department of Electronic Engineering City University of Hong Kong

Page 22: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 22

Department of Electronic Engineering City University of Hong Kong

Cyclic 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

Page 23: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 23

Department of Electronic Engineering City University of Hong Kong

Generation of FCS

Define:T=(k+n)-bit transmitted frame, with n<k

M=k-bit message

F=n-bit FCS

P=a predetermined (n+1)-bit divisor

T=2nM + F, where F=Remainder of (2nM)/P

Page 24: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 24

Department of Electronic Engineering City University of Hong Kong

Example of FCS Generation

• M=1010001101 (10 bits)

• P=110101 (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

Page 25: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 25

Department of Electronic Engineering City University of Hong Kong

Example of Error Checking

• M=1010001101 (10 bits)

• P=110101 (6 bits)

• F=01110 1101010110

P 110101 101000110101110 T 110101 111011 110101 111010 110101 111110 110101 101111 110101 110101 110101 00000 No Error!

Page 26: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 26

Department of Electronic Engineering City University of Hong Kong

Widely 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

Page 27: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 27

Department of Electronic Engineering City University of Hong Kong

Automatic 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

Page 28: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 28

Department of Electronic Engineering City University of Hong Kong

Stop-and-Wait ARQ

• based on Stop-and-Wait flow control, plus timeout mechanism– simple– inefficient

Page 29: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 29

Department of Electronic Engineering City University of Hong Kong

Stop 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

Page 30: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 30

Department of Electronic Engineering City University of Hong Kong

Page 31: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 31

Department of Electronic Engineering City University of Hong Kong

Go-back-N ARQ

• allow multiple frames to be transmitted at the same time• to improve performance• +ve ack (RR=Receive Ready) for sliding-window flow control• -ve ack (REJ=Reject) for frame retransmission request

Page 32: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 32

Department of Electronic Engineering City University of Hong Kong

RR2 = Receive Ready 2, or the receiver is now ready to receive frame #2, or the receiver is now looking for frame #2P bit = indicates that P-bit timer expires

Page 33: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 33

Department of Electronic Engineering City University of Hong Kong

Selective-reject ARQ

• Only frames with -ve ack (SREJ) are retransmitted• more efficient• larger buffer than Go-back-N

Page 34: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 34

Department of Electronic Engineering City University of Hong Kong

High-level Data Link Control (HDLC)

• The most important data link control protocol• 3 station types• 2 link configurations • 3 data transfer models

Page 35: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 35

Department of Electronic Engineering City University of Hong Kong

Station 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

Page 36: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 36

Department of Electronic Engineering City University of Hong Kong

HDLC 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

Page 37: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 37

Department of Electronic Engineering City University of Hong Kong

Data Transfer Modes

• Normal response mode (NRM)

• used with unbalanced configuration• used on multidrop lines

• Asynchronous response mode (ARM)

• rarely used• Asynchronous balanced mode (ABM)

Page 38: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 38

Department of Electronic Engineering City University of Hong Kong

Asynchronous 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

Page 39: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 39

Department of Electronic Engineering City University of Hong Kong

Frame Structure

• Synchronous transmission

• All transmissions in frames

• Single frame format for all data and control exchanges

Page 40: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 40

Department of Electronic Engineering City University of Hong Kong

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 ...

Page 41: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 41

Department of Electronic Engineering City University of Hong Kong

Figure 6. 11 Bit Stuffing

Bit stuffing

Page 42: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 42

Department of Electronic Engineering City University of Hong Kong

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

Page 43: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 43

Department of Electronic Engineering City University of Hong Kong

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

Page 44: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 44

Department of Electronic Engineering City University of Hong Kong

Poll/Final Bit• Use depends on context• Command frame

P bit1 to solicit (poll) response from peer

• Response frameF bit1 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

Page 45: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 45

Department of Electronic Engineering City University of Hong Kong

HDLC Operations

• Consists of the exchange of I-frames, S-frames, and U-frames• Involves 3 phases:

- Initialization- Data Transfer- Disconnect

Page 46: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 46

Department of Electronic Engineering City University of Hong Kong

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:

Page 47: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 47

Department of Electronic Engineering City University of Hong Kong

Examples of Operation (1)

Page 48: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 48

Department of Electronic Engineering City University of Hong Kong

Examples of Operation (2)

Page 49: Data Link Control Chapter 7

EE3900 Computer Networks Data Link Control Slide 49

Department of Electronic Engineering City University of Hong Kong

Other Data Link ProtocolsLAPB

• 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