hdlc concepts

31
1 Protocol Efficiency and HDLC In this section: Protocol efficiency: – Effective data rates – Utilization – Stop and wait flow control efficiency – ARQ flow control efficiency The High-level data-link control (HDLC) protocol – HDLC data frames – HDLC operation

Upload: bijoy04

Post on 18-Nov-2014

799 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: HDLC Concepts

1

Protocol Efficiency and HDLC

• In this section:

– Protocol efficiency:– Effective data rates– Utilization– Stop and wait flow control efficiency– ARQ flow control efficiency

– The High-level data-link control (HDLC) protocol– HDLC data frames– HDLC operation

Page 2: HDLC Concepts

2

Protocol Efficiency

• Can be measured in various ways

• One measure: effective data rate (EDR)

• Parameters:

– R: bit rate, in bits per second

– S: signal speed in transmission medium, in metres per second

– D: distance to send, in metres

– T: time to create one frame, in seconds

– TF: frame, TA: acknowledgement

– F: frame size, in bits

– N: number of user data bits in a frame, in bits

– A: number of bits in an acknowledgement, in bits

Page 3: HDLC Concepts

3

Effective Data Rate calculation

• For an unrestricted protocol (i.e. no flow control, or acknowledgements), the effective data rate (EDR) is

• For a stop and wait protocol:

RF

T

NEDR

time needed for one frame

RAF

TTSD

NEDR

AF

2

Page 4: HDLC Concepts

4

Example, for Stop-and-Wait

• Suppose:

– N = 160 bits, D = 200 ,A = 40 bits, TF = 1.5x10-6 s, TA = 0.5x10-6 s, S = 2x108 m/s, F = 200 bits, R = 10 Mbps = 1x107 bits/s

• Note that this is about 57% of the bit rate

sb

sb

bbss

sm

mb

RAF

TTSD

N

AF

/107.5

/100.1

40200105.0105.1

/102

2002

160

2

6

766

8

Page 5: HDLC Concepts

5

Maximum Efficiency of Sliding Window

• Adjustments to stop and wait formula

• Instead of sending 1 frame, we could send W frames replace N with N x W

• Acknowledgements could be piggy-backed on to data frames replace F + A with 2F, and replace TF + TA with 2TF

• Actual efficiency depends on error rate: number of frames re-transmitted, etc.

RF

TSD

WNEDR

F2

Page 6: HDLC Concepts

6

Utilization

• Objective: obtain a measure of efficiency that is independent of the transmission speed of the medium.

• Utilization: fraction of time (1.0 best case) that transmitter can send bits, as opposed to waiting for acknowledgements or flow control

• Simplifying assumptions:

– TF, TA are negligible

– A is much smaller than F, so that F+A F

Page 7: HDLC Concepts

7

Maximum Utilization (1)

• Time to send one frame and receive an acknowledgement is

• If the window size is W, the time to send W frames is

• Actual time spent transmitting bits is

• Utilization (U) is the ratio of the actual time transmitting, over the time needed to send and receive an acknowledgement. The maximum utilization is

R

F

S

D2

R

F

S

DW 2

R

FW

12

1

2

FS

DR

R

F

S

DW

R

FW

Page 8: HDLC Concepts

8

Maximum Utilization (2)

• Simplify by using the ratio of propagation time (D/S) to transmission time (F/R)

• Let

– This is a pure ratio (i.e. no units).

– Another way of viewing the value a is that if one normalizes the frame transmission time to 1, the “length” of the link in bits is a frames.

• Therefore, the maximum utilization can be expressed as:

FS

DRa

12

1

a

A BFrame 1Frame 2Frame a

Page 9: HDLC Concepts

9

Actual Utilization

• Example: Error free sliding window protocol.

– Send W frames, receive one acknowledgement.

– Two cases:

– Case 1: W ≥ 2a + 1

– The acknowledgement for frame 1 reaches A before the sending window is exhausted.

– In this case, the sender can transmit continuously with no pause, and ratio of the actual utilization to maximum utilization is 1.0

A BFrame a+2Frame a+3Frame 2a+1

Ack

Page 10: HDLC Concepts

10

Actual Utilization

• Example: Error free sliding window protocol.

– Send W frames, receive one acknowledgement.

– Case 2: W < 2a + 1

– A exhausts the window at time W, and cannot send frames until time 2a+1.

A BW – a + 1W – a + 2Frame W

Ack

A Ba + 2Frame W

Ack

A BW – a + 1W – a + 2Frame W

Ack

Page 11: HDLC Concepts

11

Normalized Utilization

• For error-free sliding window:

12

12

121

aW

a

W

aW

U

Page 12: HDLC Concepts

12

Utilization in the presence of errors

• Suppose that the probability of an error in a frame is P.

• Stop and wait:

• Selective Reject:

• Go-back-N:

12

12

)1(

121

aW

a

PW

aWP

U

12

112

)1(

1221

1

aW

WPPa

PW

aWaP

P

U

12

1

a

PU

Page 13: HDLC Concepts

13

Utilization for P = 0.001

U

a

Page 14: HDLC Concepts

14

Logical Link Control (LLC)

• In the IEEE 802 series of standards for local area networks (LANs), LLC is above the medium access control layer (MAC)

• For Asynchronous Transfer Mode (ATM), LLC is combined with network layer functions.

• In other standards, LLC comprises all of layer 2:

– High-Level Data Link Control (HDLC), ISO 3009 / 4305

– Link Access Procedure, Balanced (LAPB),ITU-T protocol for X.25 systems

– Link Access Procedure, D-Channel (LAPD), ITU-T protocol for ISDN (Integrated Services Data Network) systems

– Link Access Procedure for Frame-Mode Bearer Services (LAPF), data link protocol for Frame Relay

– Point-to-Point protocol (PPP) used between home computers and internet service providers (RFC 1661)

Page 15: HDLC Concepts

15

High-level Data Link Control (HDLC)

• Original source: IBM’s synchronous data link control (SDLC)

• Related protocols: ITU-T’s link access procedure standards (LAPB, …), PPP

• ISO Standards: 3009, 4305

Page 16: HDLC Concepts

16

HDLC Basics

• Stations:

– Primary: sends data, controls the link with commands

– Secondary: receives data, responds to control messages

– Combined: can issue both commands and responses

• Link configuration:

– Unbalanced: one primary station, one or more secondary stations

– Balanced: two combined stations

Page 17: HDLC Concepts

17

HDLC Basics

• Data transfer modes (not a complete set; these are most common)

– Normal response mode (NRM):

– Used with unbalanced configuration

– Primary initiates data transfer; secondary can only reply

– Asynchronous balanced mode (ABM):

– Used with balanced configurations

– Either side may send data at any time

• Address modes

– Regular: sequence numbers have 3 bits

– Extended: sequence numbers have 7 bits

Page 18: HDLC Concepts

18

HDLC overall frame format

data CRCAddress Control

1 variable 2 or 4variable 1 or 2

octets

01111110 FS

frame separator (FS): bit stuffing used for allfields between separators

ITU-T versionsof the CRC are used

Page 19: HDLC Concepts

19

HDLC address fields

• F bit:

– if 1, this is the final octet of the address

– if 0, another address octet follows

• If the link is strictly point-to-point, the value of the field will be 10000000, as the address is not relevant

• An address of 11111111 represents “all stations”

bits

F

1 7

address

Page 20: HDLC Concepts

20

HDLC control field types

• Information (I-frames)

– Carries upper level data

– Also includes ARQ sequence numbers for sending and receiving

• Supervisory messages (S-frames)

– Used for flow control

– 4 types

– Includes receiving sequence number

• Un-numbered messages (U-frames)

– Used for link setup and disconnection

– 15 types

Page 21: HDLC Concepts

21

I-frame control field

• NS: sending sequence number

• NR: receiving sequence number

• P/F: poll or final bit– Command frame: asks for response (P – poll)– Response frame: indicates response (F – final)

0 NS P/F

1 7 1

bits

7

0 NS P/F

1 3 1 3

NR

NS

bits

extendedmode

regularmode

Page 22: HDLC Concepts

22

S-Frame Control field

• S field – RR: receive ready (bits: 00)

– Positive acknowledgement, ready for I frame– Used when no reverse data; otherwise NR sent in an I-

frame– RNR: receive not ready (bits 10)

– Positive acknowledgement, not ready to receive– REJ: reject (bits 01)

– Negative acknowledgement, go-back-N ARQ method– SREJ: selective reject (bits: 11)

– Negative acknowledgement, selective reject ARQ method

01 S P/F NR

1 31bits 21

regularmode

Page 23: HDLC Concepts

23

S-Frame Control field

• The S field is the same as the regular mode

• The four zeros are needed to ‘pad’ the field to two full octets, 16 bits.

01 S P/F NRextended

mode

1 71bits 21

0000

4

Page 24: HDLC Concepts

24

U-frame control field

• SNRM: set normal response mode (M1 = 00, M2 = 001)

• SABM: set asynchronous balanced mode (M1 = 11, M2 = 100)

• SABME: set asynchronous balanced mode, extended (M1 = 11, M2 = 110)

• DISC: disconnect (M1=00, M2=010)

• UA: un-numbered acknowledgement (M1 = 00, M2 = 110)

• RSET: resets send and receive sequence numbers (M1 = 11, M2=001)

• FRMR: frame reject (M1 = 10, M2=001)

• (see Forouzan, Table 11.1, p. 286)

11 M1 P/F

1 31bits 2

M2

Page 25: HDLC Concepts

25

HDLC operation

• One of the messages SNRM, SABM, SABME, … is used to set up the link initially.

– Sets the mode, and the length of sequence numbers

• UA is used as a positive acknowledgment for U-frames

• After setting up the link, data transfer can occur.

• The DISC message is used to terminate the connection.

• If a damaged U-frame is received, FRMR is sent as a reply.

Page 26: HDLC Concepts

26

Connection

SABM

UA

DISC

A B

UA

Page 27: HDLC Concepts

27

A

Sample Two-Way Data Exchange

I,0,0

I,0,1

I,1,1

S,RR,2

I,1,3

NR Sequencenumbers: next messageexpected

NRNSFrame type

Frame typeMessageNR

B

I,2,1

Page 28: HDLC Concepts

28

Go-Back-N ARQ

I,0,0

I,2,0

S,REJ,1

I,1,0

I,2,0

I,1,0

A B

I,3,0

Page 29: HDLC Concepts

29

Selective Reject ARQ

I,0,0

I,2,0

S,SREJ,1

I,1,0

I,3,0

I,1,0

A B

Page 30: HDLC Concepts

30

Receiver Busy

I,3,0

S,RNR, 4

S,RR,0,P

S,RNR,4,F

I,4,0

S,RR,0,P

S,RR,4,F

A B

Page 31: HDLC Concepts

31

Timeout

I,0,0

I,1,0

I,1,0

A B

S,RR,2

I,0,0