Chapter 4 data link layer
This presentation is the property of its rightful owner.
Sponsored Links
1 / 75

Chapter 4 Data Link Layer PowerPoint PPT Presentation


  • 67 Views
  • Uploaded on
  • Presentation posted in: General

Chapter 4 Data Link Layer. Framing Error control Flow control Multiplexing Link Maintenance Security. Services. Transfers frames across direct connections Directly connected (can be wireless), wire-like Losses & errors, but no out-of-sequence frames More detailed services

Download Presentation

Chapter 4 Data Link Layer

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Chapter 4 data link layer

Chapter 4 Data Link Layer

Framing

Error control

Flow control

Multiplexing

Link Maintenance

Security


Services

Services

  • Transfers frames across direct connections

    • Directly connected (can be wireless), wire-like

    • Losses & errors, but no out-of-sequence frames

  • More detailed services

    • Framing (bits ↔ frames)

    • Error control (protection from impairment)

    • Flow control

    • Multiplexing

    • Link Maintenance

    • Security: Authentication & Encryption


Data link protocols

Examples

PPP

HDLC

Ethernet LAN

IEEE 802.11 (WiFi) LAN

Packets

Packets

Data link

layer

Data link

layer

Frames

A

B

Physical

layer

Physical

layer

Data Link Protocols


Framing chapter 5 4 in leon garcia

Framing(Chapter 5.4 in Leon-Garcia)


Framing

Bit stream - frames

Frame boundaries can be determined using:

Character Counts

Control Characters

Framing Bits

Framing by illegal code

received

frames

transmitted

frames

Framing

0111110101

0110110111

Framing


Control characters

Data to be sent

A

DLE

B

ETX

DLE

STX

E

After stuffing and framing

DLE

STX

A

DLE

DLE

B

ETX

DLE

DLE

STX

E

DLE

ETX

Control Characters

  • What about transmission of data (including non-printable characters)?

    • Introduce DLE (data link escape) = 0x10

    • DLE STX (DLE ETX) used to indicate beginning (end) of frame

    • Insert extra DLE in front of occurrence of DLE STX (DLE ETX) in frame

    • All DLEs occur in pairs except at frame boundaries.

  • Transmission of printable characters using ASCII

    • Octets with HEX value < 0x20 are nonprintable

    • Use control characters: STX (start of text) = 0x02; ETX (end of text) = 0x03.


Bit stuffing

HDLC frame

any number of bits

Flag

FCS

Control

Information

Flag

Address

Bit Stuffing

  • Frame delineated by flag character

  • HDLC uses bit stuffing to prevent occurrence of flag 01111110 inside the frame

  • Transmitter inserts extra 0 after each consecutive five 1s inside the frame

  • Receiver checks for five consecutive 1s

    • if next bit = 0, it is removed

    • if next two bits are 10, then flag is detected

    • If next two bits are 11, then frame has errors


Example bit stuffing

Data to be sent

(a)

0110111111111100

After stuffing and framing

0111111001101111101111100001111110

(b)

Data received

01111110000111011111011111011001111110

After destuffing and deframing

*000111011111-11111-110*

Example: Bit stuffing


Example framing in ethernet

Example: Framing in Ethernet

  • Ethernet complies to standard IEEE 802.3

  • An illegal manchester coding is used for framing.

  • A character count is also included in the header.

  • All frames have an integral number of bytes. If not, the frame is considered to be received in error.


Error control coding chapter 3 9 in leon garcia

Error Control Coding(Chapter 3.9 in Leon-Garcia)


Error control

c1…cn

b1…bk

Decoder

Channel

Encoder

Error Control

  • Two approaches

    • Forward error correction (FEC)

    • Error detection & retransmission (ARQ)

  • Add redundancy (admit only codewords with a certain pattern)

  • Blindspot: when channel transforms a codeword into another codeword

  • (n,k) block code

  • There are capacity-achieving codes

    • Usually with somewhat high complexity;

    • When bandwidth is abundant it suffices to use simpler codes.


Single parity check

Information bits: b1, b2, b3, …, bk

Check Bit: bk+1= b1+ b2+ b3+ …+ bk modulo 2

Codeword: (b1, b2, b3, …, bk,, bk+!)

Single Parity Check

  • n=k+1

  • All codewords have even # of 1s

    • All error patterns that change an odd number of bits are detectable

    • Others undetectable

  • Redundancy: overhead = 1/(k + 1)


Example

Example

  • Information (7 bits): (0, 1, 0, 1, 1, 0, 0)


Probability of error

n

2

n

4

Probability of Error

P[error detection failure]

= P[undetectable error pattern]

= P[all error patterns with even number of 1s]

= p2(1 – p)n-2 + p4(1 – p)n-4 + …

  • Example: Evaluate above for n = 6, p = 0.01

P[undetectable error] = 0.0014


Two dimensional parity check

1 0 0 1 0 0

0 1 0 0 0 1

1 0 0 1 0 0

1 1 0 1 1 0

1 0 0 1 11

row check bits

column check bit

Two-Dimensional Parity Check


Error detecting capability

1 0 0 1 0 0

0 0 0 0 0 1

1 0 0 1 0 0

1 0 0 1 1 0

1 0 0 1 1 1

1 0 0 1 0 0

0 0 0 0 0 1

1 0 0 1 0 0

1 1 0 1 1 0

1 0 0 1 1 1

Two errors

One error

1 0 0 1 0 0

0 0 0 1 0 1

1 0 0 1 0 0

1 0 0 0 1 0

1 0 0 1 1 1

1 0 0 1 0 0

0 0 0 1 0 1

1 0 0 1 0 0

1 0 0 1 1 0

1 0 0 1 1 1

Three errors

Four errors (undetectable)

Arrows indicate failed check bits

Error-detecting capability

1, 2, or 3 errors can always be detected; Not all patterns >4 errors can be detected


Hamming codes

Hamming Codes

  • Class of linear block codes

  • Capable of correcting all single-error patterns

  • For each m> 2, there is a (2m–1, n-m) Hamming code


M 3 hamming code

m = 3 Hamming Code

  • Information bits are b1, b2, b3, b4

  • Parity checks (binary addition/multiplication)

b5 = b1 + b3 + b4

b6 = b1 + b2 + b4

b7 = + b2 + b3 + b4

  • Linearity

  • 24 = 16 codewords


Hamming 7 4 code

Hamming (7,4) code


Parity check equations

Rearrange parity check equations:

All codewords must satisfy these equations

Note: each nonzero 3-tuple appears once as a column in check matrix H

b1

b2

0 = 1 0 1 1 1 0 0 b3

0 = 1 1 0 1 0 1 0 b4 = Hbt = 0

0 = 0 1 1 1 0 0 1 b5

b6

b7

Parity Check Equations

0 = b1 + b3 + b4 + b5

0 = b1 + b2 + b4 + b6

0 = + b2 + b3 + b4 + b7

  • In matrix form:


Hamming code error detection

0

0

1

0

0

0

0

1 0 1 1 1 0 0

1 1 0 1 0 1 0

0 1 1 1 0 0 1

Single error detected

1

0

1

s = H e= =

0

1

0

0

1

0

0

1 0 1 1 1 0 0

1 1 0 1 0 1 0

0 1 1 1 0 0 1

1

1

1

0

1

1

1

0

0

Double error detected

s = H e= = + =

1

1

1

0

0

0

0

1 0 1 1 1 0 0

1 1 0 1 0 1 0

0 1 1 1 0 0 1

0

1

1

1

1

0

1

0

1

Triple error not detected

s = H e= = + + = 0

Hamming Code: Error Detection


Minimum distance

o

o

o

b1

b2

o

o

o

o

o

Minimum distance

  • Undetectable error pattern must have 3 or more bits

  • At least 3 bits must be changed to convert one codeword into another codeword

Set of n-tuples within distance 1 of b2

Set of n-tuples within distance 1 of b1

Distance 3

  • Spheres of distance 1 around each codeword do not overlap

  • If a single error occurs, the resulting n-tuple will be in a unique sphere around the original codeword


General hamming codes

General Hamming Codes

  • For m> 2, the Hamming code is obtained through the check matrix H:

    • Each nonzero m-tuple appears once as a column

    • The resulting code corrects all single errors

  • P[undetectable error]

    = P[ error is a codeword]

    ≈ (# of codewords with dmin) x pdmin

  • Animated example http://www.systems.caltech.edu/EE/Faculty/rjm/SAMPLE_20040708.html


Hamming codes error correction

R

b

(Receiver)

(Transmitter)

+

e

Error pattern

Hamming Codes: Error-correction

  • Compute syndrome:

    s = HR = H (b + e) = Hb + He = He

  • If s = 0, then the receiver accepts R as the transmitted codeword, find the corresponding k-bit message

  • If s is nonzero, then an error is detected

    • Hamming decoder assumes a single error has occurred

    • Each single-bit error pattern has a unique syndrome

    • The receiver matches the syndrome to a single-bit error pattern and corrects the appropriate bit


Hamming codes performance

s = HR = He

7p

s = 0

s = 0

1–3p

3p

No errors in

transmission

Undetectable

errors

Correctable

errors

Uncorrectable

errors

(1–p)7

7p(1–3p)

7p3

21p2

Hamming Codes: Performance

  • Assume bit errors occur independent of each other and with probability p


Other error control codes

Other Error Control Codes

  • Good practical codes for error detection:

    • Internet Check Sums

    • CRC Polynomial Codes

      They can detect the vast majority of errors.

  • Good codes for error “correction”:

    • Turbo codes

    • Low-density parity-check (LDPC) codes


Internet checksum

Internet Checksum

  • Several Internet protocols (e.g. IP, TCP, UDP) use check bits to detect errors in the header

  • A checksum is calculated for header contents and included in a special field.

  • Treating each 16-bit word in data as an integer, find

    x = b0 + b1 + b2+ ...+ bL-1 modulo 216-1

  • The checksum is then given by:

    bL = - x modulo 216-1

    Thus, the headers satisfy the following pattern:

    0 = b0 + b1 + b2+ ...+ bL-1 + bL modulo 216-1


Polynomial codes

Encoder for g(x) = x3 + x + 1

g0 = 1

g1 = 1

g3 = 1

0,0,0,i0,i1,i2,i3

Reg 2

Reg 1

Reg 0

+

+

Polynomial Codes

  • Convenient mathematical formulation of coding

  • Polynomials as codewords

  • Implemented using shift-register circuits

  • Called cyclic redundancy check (CRC) codes

  • Excellent for detecting burst errors


Automatic repeat request arq chapter 5 in leon garcia

Automatic Repeat Request (ARQ)(Chapter 5 in Leon-Garcia)


Peer to peer protocols

Each layer provides a service to the layer above.

It does so by executing a peer-to-peer protocol.

The protocol uses the the services of the layer below.

Peer-to-Peer Protocols

n + 1

n + 1

n

n

n – 1

n – 1


Service models

Service Models

  • The service model specifies the manner in which information is transferred.

    • Connection-oriented

    • Connectionless


Connection oriented

n + 1 peer process

send

n + 1 peer process

receive

Layer n connection-oriented service

SDU

SDU

Connection-Oriented

  • Connection setup

  • Message transfer

  • Connection release

  • Example: TCP, PPP


Connectionless transfer service

Connectionless Transfer Service

  • No setup

  • Each message sent independently

  • Must provide all address information per message

  • Simple & quick

  • Example: UDP, IP

n + 1 peer process

send

n + 1 peer process

receive

Layer n connectionless service

SDU


Automatic repeat request arq

Automatic Repeat Request (ARQ)

  • Purpose: To pass to the receiver every frame correctly, only once, in order.

  • Bad things can happen: Error, arbitrary delay, out-of-order arrival, or loss. Aim at very high reliability.

  • Assume if frames arrive, they arrive in-order for now. We save the out-of-order problem for later.

  • Basic elements:

    • Error-detecting code

    • ACKs (positive acknowledgments)

    • NAKs (negative acknowledgments)

    • Timeout mechanism


Stop and wait arq

Stop-and-Wait ARQ

Transmit a frame, wait for ACK

Error-free

packet

Packet

Information frame

Transmitter

Receiver

Timer set after each frame transmission

Control frame


Need for sequence numbers

(a) Frame 1 lost

Time-out

Time

A

Frame

0

Frame

1

Frame

1

Frame

2

ACK

ACK

B

(b) ACK lost

Time-out

Time

A

Frame

0

Frame

1

Frame

1

Frame

2

ACK

ACK

ACK

B

Need for Sequence Numbers

  • In cases (a) & (b) the transmitting station A acts the same way

  • But in case (b) the receiving station B accepts frame 1 twice

  • Question: How is the receiver to know the second frame is also frame 1?

  • Need a sequence number: Slast=SN of most recent transmitted frame.


Sequence numbers

The transmitting station misinterprets duplicate ACKs

Question: How is the receiver to know second ACK is for frame 0?

Time-out

Time

A

Frame

0

Frame

0

Frame

2

Frame

1

ACK

ACK

B

Sequence Numbers

(c) Premature Time-out

  • Need SN in ACK: Rnext=SN of next frame expected by the receiver.

  • Implicitly acknowledges receipt of all prior frames.

  • What if ACK only ifSlast=Rnext?


How many bits for sn

0 1

0 1

0 1

0 1

0 1

0 1

0 1

0 1

Rnext

Slast

Timer

Slast

Receiver B

Transmitter A

Rnext

How many bits for SN?

1-Bit SN Suffices


Finite state machine

Slast

Receiver B

Transmitter A

Frame 0

lost/error

ACK 0

lost/error

Rnext

Error-free frame 0

arrives

(0,0)

(0,1)

ACK 0

arrives

ACK 1

arrives

Global State:

(Slast, Rnext)

(1,0)

(1,1)

Error-free frame 1

arrives

Frame 1

lost/error

ACK 1

lost/error

Finite State Machine


S w efficiency

Last frame bit enters channel

ACK arrives

First frame bit enters channel

Transmitter waits for ACK

t

A

B

t

Receiver processes frame and

prepares ACK

First frame bit arrives at receiver

Last frame bit arrives at receiver

S/W Efficiency


S w transmission time

t0 = total time to transmit 1 frame if no error

A

tproc

B

tprop

tprop

tproc

tack

S/W Transmission Time

frame

tftime

bits/info frame

bits/ACK frame

channel transmission rate


Efficiency on error free channel

Efficiency on Error-free channel

Overhead bits (header, CRC)

Effective transmission rate:

Transmission efficiency:

Effect of

frame overhead

Effect of

Delay-Bandwidth Product

Effect of

ACK frame


Delay bandwidth product

Delay-Bandwidth Product

nf=10,000 bits, na=no=200 bits

S/W inefficient for very high speeds or long delays


Average transmission number

Average Transmission Number

Proposition: Let Pf be the frame error probability. Then the average number of transmissions per successful frame is 1/ (1–Pf ).

Proof: The number of transmissions to first correct arrival has geometric distribution.

E.g., if 1-in-10 gets through, then in average 10 tries to success.


Efficiency in channel with errors

Efficiency in Channel with Errors

  • Assuming time-out is equal to t0 (it should be larger)

Effect of frame loss

  • If bit-error-rate is p, then


Go back n

Go-Back-N

  • A sliding-window protocol.

  • Keep channel busy by continuing to send frames

  • Allow a window of up to Ws outstanding frames

  • If ACK for oldest frame arrives before window is exhausted, we can continue transmitting

  • If window is exhausted, pull back and retransmit all outstanding frames


Go back n arq

4 frames are outstanding; so go back 4

Go-Back-4:

Time

fr

0

fr

1

fr

2

fr

3

fr

4

fr

5

fr

3

fr

4

fr

5

fr

6

fr

6

fr

7

fr

8

fr

9

A

B

out of sequence frames

ACK1

ACK2

ACK4

ACK5

ACK3

ACK7

ACK6

ACK9

ACK8

Rnext 0 1 2 3 3 4 5 6 7 8 9

Go-Back-N ARQ

  • Frame transmission are pipelined to keep the channel busy

  • Frame with errors and subsequent out-of-sequence frames are ignored


Choose window size rtt

Time-out

Stop-and-Wait ARQ

Time

fr

1

fr

0

fr

0

A

B

ACK1

Receiver is looking for Rnext=0

If window exhausted, go back N

Go-Back-N ARQ

fr

0

fr

1

fr

2

fr

3

fr

0

fr

1

fr

2

fr

3

fr

4

fr

5

fr

6

Time

A

B

ACK1

ACK5

ACK2

ACK6

ACK4

ACK3

Receiver is looking for Rnext=0

Out-of-sequence frames

Choose Window Size > RTT


Go back n with timeout

Go-Back-N with Timeout

  • Problem with Go-Back-N as presented:

    • If frame is lost and source does not have frame to send, then window will not be exhausted and recovery will not commence

  • Use a timeout with each frame

    • When timeout expires, resend all outstanding frames


Go back n transmitter receiver

Receiver

Transmitter

Send Window (size Ws)

Receive Window (size 1)

...

Frames

transmitted

and ACKed

Slast

Srecent

Slast+Ws-1

Frames

received

Buffers

Rnext

oldest un-ACKed frame

Slast

Timer

Slast+1

Timer

...

most recent transmission

Srecent

Timer

...

max SN allowed

Slast+Ws-1

Go-Back-N Transmitter & Receiver

Receiver will only accept

error-free frame with SN Rnext.

When the frame arrives Rnext is incremented by 1, so the receive window slides forward by 1.


Maximum window size w s 2 m 1

Transmitter goes back 4

Transmitter goes back 4

fr

0

fr

2

fr

3

fr

1

fr

1

fr

2

fr

3

Time

fr

0

A

B

ACK1

ACK

0

ACK2

ACK3

Receiver has Rnext= 0, but it does not know whether this is the old frame 0 or a new frame 0

Rnext 0 1 2 3 0

fr

0

fr

1

fr

0

fr

2

fr

2

fr

1

Time

A

ACK2

ACK3

ACK1

B

Receiver has Rnext= 3 , so it rejects the old frame 0

Rnext 0 1 2 3

MaximumWindow SizeWs = 2m-1

Example: M = 22 = 4, Go-Back – 4 is not good.

Example: Go-Back-3 is good.


Ack piggybacking in bidirectional gbn

SArecent RAnext

Receiver

Transmitter

Transmitter

Receiver

SBrecent RBnext

ACK Piggybacking in Bidirectional GBN

  • In bi-directional communication, ACKs are often piggybacked on data frames to reduce overhead.


Choice of timeout window size

Tout

Tproc

Tprop

Tf

Tprop

Tf

Choice of Timeout & Window Size

  • Timeout value should allow for:

    • 2 Tprop + Tproc

    • A frame begins transmission right before the first frame arrives Tf

    • Next frame carries the ACK, Tf (piggy-back)

    • Thus, timeout > 2 Tprop + 2 Tf + Tproc

  • Ws should be large enough to keep channel busy for Tout


Efficiency of go back n

Efficiency of Go-Back-N

  • if channel is error-free and Ws is large enough to keep channel busy

  • Assume Pfframe loss probability, time to deliver a frame is:

    • tf if first attempt succeeds

    • Tf + Wstf /(1-Pf) otherwise go back Ws and try again

Delay-bandwidth product determines Ws


Improvement over go back n

Improvement over Go-Back-N?

  • Go-Back-N repeats multiple frames when a few errors or losses occur

  • How about retransmitting only an individual frame?

  • Selective Repeat ARQ

    • Timeout pinpoints individual frame

    • Receiver maintains a window of acceptable SN

    • Error-free, but out-of-sequence frames with SN within the receive window are buffered

    • Arrival of Rnext causes window to slide forward by 1 or more

    • NAK causes retransmission of oldest un-acked frame


Selective repeat arq

fr

1

fr

2

fr

0

fr

3

fr

4

fr

5

fr

2

fr

7

fr

8

fr

11

fr

6

fr

9

fr

10

fr

12

Time

A

B

ACK2

NAK2

ACK2

ACK2

ACK7

ACK8

ACK9

ACK10

ACK11

ACK12

ACK1

ACK2

Selective Repeat ARQ


Selective repeat arq1

Receiver

Transmitter

Receive Window

Send Window

...

Frames

transmitted

and ACKed

Frames

received

Rnext

Rnext + Wr-1

Slast

Srecent

Slast+ Ws-1

Buffers

Buffers

Slast

Rnext+ 1

Timer

Slast+ 1

Rnext+ 2

Timer

...

...

Srecent

Timer

max Seq # accepted

Rnext+ Wr- 1

...

Slast+ Ws - 1

Selective Repeat ARQ


Send receive windows

0

0

2m-1

1

2m-1

1

2

2

Rnext

Slast

j

receive

window

send

window

i

i

i + 1

i + Ws– 1

j + Wr– 1

Moves k forward when ACK

arrives with Rnext = Slast + k

k = 1, …, Ws-1

Moves forward by 1 or more when frame arrives with Seq. # = Rnext

Send & Receive Windows

Transmitter

Receiver


What size w s and w r allowed

Frame 0 resent

Send Window

{2}

{0,1,2}

{1,2}

{.}

fr2

fr0

fr0

fr1

A

Time

B

ACK1

ACK2

ACK3

Receive Window

{0,1,2}

{1,2,3}

{2,3,0}

{3,0,1}

Old frame 0 accepted as a

new frame because it falls

in the receive window

What size Ws and Wr allowed?

  • Example: M=22=4, Ws=3, Wr=3


W s w r 2 m is maximum allowed

Frame 0 resent

Send Window

{0,1}

{.}

{1}

fr0

fr0

fr1

A

Time

B

ACK1

ACK2

Receive Window

{0,1}

{1,2}

{2,3}

Old frame 0 rejected because it falls outside the receive window

Ws + Wr = 2m is maximum allowed

  • Example: M=22=4, Ws=2, Wr=2


Why w s w r 2 m works

The number of bits, m, is enough to label all outstanding frames.

Usually, Ws = Wr = 2m-1

Why Ws + Wr = 2m works

0

0

2m-1

1

2m-1

1

Ws +Wr-1

2

Slast

2

receive

window

Rnext

Ws

send

window

Ws-1


Efficiency of selective repeat

Efficiency of Selective Repeat

  • # of transmissions required to deliver a frame is:

    tf / (1-Pf)


Example impact bit error rate on selective repeat

Example: Impact Bit Error Rate on Selective Repeat

nf=10,000 bits, na=no=200 bits

p = 0, 10-6, 10-5, 10-4 and R = 1 Mbps & 100 ms

1 Mbps x 100 ms = 100000 bits = 10 frames → Use Ws = 11

  • GBN >> S&W for large delay-bandwidth product

  • GBN becomes inefficient as error rate increases

  • SR is the best. Efficiency drops as error rate increases


Comparison of arq efficiencies

Comparison of ARQ Efficiencies

Assume na, no<< nf, and L = 2(tprop+tproc)R/nf=(Ws-1).

Selective-Repeat:

For Pf≈0, SR & GBN same

Go-Back-N:

For Pf→1, GBN & SW same

Stop-and-Wait:


Arq efficiencies

10-9 10-8 10-7 10-6 10-5 10-4 10-3 10-2 10-1

p

Delay-Bandwidth product = 10, 100

ARQ Efficiencies


Standard data link layer protocols ppp hdlc chapter 5 5 6 in leon garcia

Standard Data Link Layer Protocols:PPP & HDLC(Chapter 5.5-6 in Leon-Garcia)


Chapter 4 data link layer

DLL

“Packet”

Network

layer

Network

layer

“Frame”

Data link

layer

Data link

layer

Physical

layer

Physical

layer


Ppp point to point protocol

PPP: Point-to-Point Protocol

  • A data link layer protocol.

  • Encapsulating IP packets over point-to-point links.

    • Router-router;

    • Dial-up to router (PC to Internet service provider (ISP))

  • Functions:

    • Provides Framing and Error Detection

    • Link Control Protocols

      • Set up, configure, testing, maintain, terminate;

      • Authentication: Password Authentication Protocol, etc.

    • Network Control Protocols

      • Configure network layer protocols

      • E.g., IP, IPX (Novell), Appletalk


Ppp frame format

2 or 4

1 or 2

variable

Address

Flag

Flag

Control

Protocol

Information

FCS

01111110

01111110

1111111

00000011

CRC 16 or CRC 32

All stations are to

accept the frame

HDLC Unnumbered frame

PPP Frame Format

  • Can support multiple network protocols simultaneously

  • Specifies what kind of packet is contained in the payload


High level data link control hdlc

High-Level Data Link Control (HDLC)

  • Bit-oriented data link control

  • Derived from IBM Synchronous Data Link Control (SDLC)


Hdlc data transfer modes

Commands

Primary

Responses

Secondary

Secondary

Secondary

Commands

Secondary

Primary

Responses

Primary

Secondary

Commands

Responses

HDLC Data Transfer Modes

  • Normal Response Mode

    • Used in polling multidrop lines

  • Asynchronous Balanced Mode

    • Used in full-duplex point-to-point links

  • Mode is selected during connection establishment


Hdlc frame format

Flag

FCS

Control

Information

Flag

Address

HDLC Frame Format

  • Control field gives HDLC its functionality

  • Codes in fields have specific meanings and uses

    • Flag: delineate frame boundaries

    • Address: identify secondary station (1 or more octets)

    • Control: purpose & functions of frame (1 or 2 octets)

    • Information: user data; length not standardized

    • Frame Check Sequence: 16- or 32-bit CRC


Control field format

Information Frame

1

2-4

5

6-8

N(R)

0

N(S)

P/F

Supervisory Frame

1

N(R)

0

S

S

P/F

Unnumbered Frame

1

1

M

M

M

M

P/F

M

Control Field Format

  • S: Supervisory Function Bits

  • N(R): Receive Sequence Number

  • N(S): Send Sequence Number

  • M: Unnumbered Function Bits

  • P/F: Poll/final bit used in interaction between primary and secondary

Note: The information frames and supervisory frames allow HDLC to implement Stop-and-Wait, Go-Back-N, and Selective Repeat ARQ.

Note: The unnumbered frames implement control functions.


Example hdlc using polling

Secondaries B, C

Primary A

B, RR, 0, P

B, I, 0, 0

B, I, 1, 0

X

B, I, 2, 0,F

B, SREJ, 1

C, RR, 0, P

C, RR, 0, F

B, SREJ, 1,P

B, I, 1, 0

B, I, 3, 0

B, I, 4, 0, F

B, I, 0, 5

Time

Example: HDLC Using Polling

Address of secondary

N(S)

N(R)

A polls B

RR=receive ready

B sends 3 info

frames

N(R)

A rejects fr1

A polls C

C nothing to send

A polls B, requests

selective retrans. fr1

B resends fr1

Then fr 3 & 4

A send info fr0

to B, ACKs up to 4


Hdlc flow control

I3

I6

I4

RR6

I5

RNR5

HDLC Flow Control

  • Flow control prevents transmitter from overrunning receiver buffers.

  • Receiver can control flow by delaying acknowledgement messages.

  • Receiver can also use supervisory frames to explicitly control transmitter

    • Receive Not Ready (RNR) & Receive Ready (RR)


  • Login