data link synchronous protocols - sdlc, hdlc

52
Prof Madhumita Tamhane SDLC SYNCHRONOUS DATA LINK COMMUNICATION DATA LINK CONTROL COMMUNICATION

Upload: madhumita-tamhane

Post on 20-Jan-2017

273 views

Category:

Engineering


0 download

TRANSCRIPT

Page 1: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane

SDLC

SYNCHRONOUS DATA LINK COMMUNICATION

DATA LINK CONTROL COMMUNICATION

Page 2: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane

SDLC

✓ Synchronous Bit Oriented Protocol by IBM. ✓ Simplex/half duplex/full duplex. ✓ Sliding window protocol. ✓ Language EBCDIC. ✓ Data frame 256 characters long. ✓ All data link control functions performed by a single

control field. ✓ Master-slave environment only.

Page 3: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane

SDLC

✓ The primary station controls data exchange on the communication channel and issues command.

✓ The secondary station receives commands and returns responses to the primary.

✓ Three transmission states:- ✓ Transient state:-before and after the initial

transmission and after each line turnaround. ✓ Idle state:- after 15 or more consecutive 1s have been

received. ✓ Active state:- whenever either primary or secondary

station is transmitting information or control signals.

Page 4: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane

SDLC

✓ General frame structure:

Flag Address Control Data… FCS Flag

8 bits 8 bits 8 bits Variable multiple of 8

16 bits 8 bits

Page 5: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane

SDLC - Flag

✓ 7EH binary or “=“ in EBCDIC. ✓ For synchronization and indication of limits of frame. ✓ Multiple frames can have following variations:

✓ Beginning and ending flag of a frame. ✓ FCS 01111110 01111110 address …

✓ Ending flag of a frame can be common with beginning flag of next frame.

✓ FCS 01111110 address control…

✓ Ending ‘0’ of ending flag of a frame can be common with beginning ‘0’ of beginning flag of next frame.

✓ FCS 011111101111110 address control…

✓ Can be sent continuously to indicate idle line 1s.

Flag Flag

01111110 01111110

Page 6: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane

SDLC - Address

✓ 256 addresses possible. ✓ 00H null or void address, used for network testing. ✓ FFH is broadcast address. ✓ 254 unique station addresses or group addresses. ✓ No address given to primary as… ✓ Primary to secondary frame has destination secondary

address. ✓ Secondary to primary frame has source secondary

address.

Address

8 bits

Page 7: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane Control Field

!!!!

✓ 8 bit long. ✓ Used for polling, acknowledging previously received

frames and other data link management functions. ✓ Defined in three different frame formats.

✓ Information frame ✓ Control frame ✓ un-numbered frame

Control

8 bits

Page 8: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane Control Field – Information frame

!!!!!

✓ LSB b7 – “0” identifies information frame. ✓ Information frame is used for transmitting sequenced

information. ✓ Packet numbered using 3-bit scheme. !

P/P

Or

F/F

b0 b1 b2 b3 b4 b5

nr0

b6 b7

ns

Page 9: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane Control Field – Information frame

✓ ns =b4, b5, b6 - number of frame being sent. ✓ From 000 to 111 and repeats. ✓ nr =b0, b1, b2 - acknowledgement. ✓ It is number of next frame it expects to receive. ✓ Indicates all frames before nr are received correctly. ✓ Uses piggybacking as it is I frame. ✓ nr and ns together used for flow control and error

control ARQ.

P/P

Or

F/F

b0 b1 b2 b3 b4 b5

nr0

b6 b7

ns

Page 10: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane Control Field – Information frame

✓ Primary keeps track of ns and nr of all secondaries while secondary keeps track of its own ns and nr.

✓ A station can not send more than 7 frames together before receiving an acknowledgement to avoid ambiguity in received frame number.

✓ Say 8 frames, 0 - 7 are sent and ACK0 is received. ✓ There is ambiguity whether

✓ receiver received all correctly and expecting new frame “0” or

✓ frame “0” had error and receiver aborted and expecting retransmission from old frame “0”.

✓ No ambiguity if max, only 7 frames, 0 - 6 are sent.

Page 11: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane Control Field – Information frame

✓ Example: !

Primary ns: Primary nr :

!Secondary ns: Secondary nr:

!!!!!!

0 1 2 0 0 0

3 4 2 2

0 1 3 3

2 3 4 4 4 4

4 5 6 7 0 5 5 5 5 5

5 1

Page 12: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane Control Field – Information frame

✓ Bit b3 is poll/not-a-poll (1/0) and sent from primary to secondary.

✓ Bit b3 is sending final /not-a-final frame(1/0) when sent from secondary to primary.

✓ A secondary can not transmit unless it receives a frame addressed to it with P bit set.

✓ With I frame, primary can select a secondary station, send formatted information, confirm previously received I frame, and poll with a single transmission.

P/P

Or

F/F

b0 b1 b2 b3 b4 b5

nr0

b6 b7

ns

Page 13: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane Excercise

✓ Determine bit pattern for the control field of a frame sent from the primary to a secondary for following conditions..

✓ Primary is sending frame 3. ✓ It is a poll. ✓ Primary is confirming the correct reception of frames

2,3,4 from secondary. !!

✓ Solution: 10110110 = B6H

Page 14: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane Control Field – Supervisory frame

✓ Information sending is not allowed. ✓ Frame is used to : ✓ 1. Confirm previously received I-frames. ✓ 2. Convey ready or busy condition. ✓ 3. Reports missing or error frames. ✓ Hence used for flow and error control and Poll/Select

when I frame not available.

Page 15: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane Control Field – Supervisory frame

✓ Frame identified by 01 in b6, b7 position.

✓ nr =b0, b1, b2 -- frame expected ✓ acknowledgement of correct reception. ✓ sequence number of frame in error

✓ b3 is Poll/Not Poll or Final/Not final . ✓ Bits b4 and b5 are indicate receive status of transmitting

stations, request transmission or retransmission of sequenced information frames.They can be…

P/P

Or

F/F

b0 b1 b2 b3 b4 b5

nr1

b6 b7

X X 0

Page 16: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane Control Field – Supervisory frame

b b Receive Status

0 0 Ready to receive RR Positive acknowledgement when I frame not available.

0 1 Ready Not to receive RNR

1 0 REJ(Reject) Go back N ARQ

1 1 Not Used in SDLC

Page 17: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane

Control Field – Supervisory frame Options✓ RR with P set. ✓ Polling. ✓ Ack when primary wants secondary to send more frames. ✓ RR with F set. ✓ EOT after poll ✓ Positive Ack to selection ✓ Negative response to polling ✓ RNR with P set. ✓ Selection ✓ RNR with F set. ✓ Negative Ack to selection ✓ RR with F = 0. ✓ ARQ REJ of nr (only FD)

Page 18: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane Excercise

✓ Determine bit pattern for the control field of a frame sent from the a secondary to primary for following conditions..

✓ Secondary is ready to receive. ✓ It is a final frame. ✓ Secondary is confirming the correct reception of

frames 3,4,5 from secondary. !!

✓ Solution: 11010001 = D1H

Page 19: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane Excercise

✓ Determine bit pattern for the control field of a frame sent from the a secondary to primary for following conditions..

✓ Secondary is ready to receive. ✓ It is not a final frame. ✓ Secondary is conveying correct reception of frames

2,3,4. ✓ Secondary is conveying that frame 5 is in error. !!✓ Solution: 10100001 = D1H

Page 20: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhaneControl Field – Un-numbered Frame

!!!

!✓ Used for network management operations. ✓ Un-numbered Management Information sending is

allowed. ✓ Frame identified by 11 in b6, b7 position. ✓ b3 is Poll/Not Poll or Final/Not final ✓ b0, b1, b2 , b4, b5 – 32 command/responses possible.

P/P

Or

F/F

b0 b1 b2 b3 b4 b5

1

b6 b7

X X 1X X X

Page 21: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane Control Field – Un-numbered Frame

✓ Possible modes of secondary ✓ The Initialization mode:System specific ✓ Normal Response mode:A secondary can not initiate

unsolicited transmission. ✓ Can transmit only in response to a frame received

with P bit set. ✓ Normal Disconnect mode: Secondary is off-line. ✓ Secondary can receive only a TEST, XID, CFGR,

SNRM, or SIM command from primary and can respond only if P bit is set.

Page 22: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane Control Field – Some Un-numbered commands

✓ Un-numbered Information (UI) ✓ 000 P/F 0011 ✓ Higher level status, operational interruptions, time of day,

link initialization parameters etc. ✓ Set Initialization Mode (SIM) ✓ 000 P 0111 ✓ SIM resets nr and ns counter at primary and

secondary. ✓ Secondary Responses by UA.

✓ Used if network management error noted. ✓ To bring a station out of disconnect mode.

Page 23: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane Control Field – Some Un-numbered commands

✓ Request Initialization Mode (RIM) ✓ 000 F 0111 Response

✓ Request sent by secondary for SIM from primary if error noted or needs to come out of DISC.

✓ Set Normal Response Mode (SNRM) ✓ 100 P 0011 Command

✓ Primary places secondary in normal response mode. ✓ Resets nr and ns counter at primary and secondary. ✓ Secondary responses by UA.

Page 24: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane Control Field – Some Un-numbered commands

✓ Request disconnect mode (RD) ✓ 010 F 0011 Response

✓ Disconnect (DISC) ✓ 010 P 0011 Command ✓ In this mode secondary can not receive/send I frames. ✓ Can receive only SIM, SNRM. ✓ Secondary responses by UA. ✓ Disconnect mode (DM) ✓ 000 F 1111 Response ✓ Disconnected secondary reminds primary about its status if later

tries to send un-numbered frame. ✓

Page 25: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane Control Field – Some Un-numbered commands

✓ Un-numbered acknowledgement (UA) ✓ 011 F 0011 Response

✓ In response to SIM, SNRM, DISC ✓ TEST 111 P 0011 ✓ Command/Response to solicit/reply TEST response. ✓ Secondary returns back information field. ✓ Exchange for link testing purpose.

Page 26: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane Control Field – Some Un-numbered commands

✓ Exchange Station Identification (XID) ✓ 101 P 1111 Command/Response ✓ XID solicits identification of secondary station. ✓ I field can be included in the frame to convey

identification data of either primary or secondary station.

✓ EX- In dial-up circuits, it is necessary that secondary station identifies itself before primary will exchange information frames with it. !

Page 27: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane Control Field – Some Un-numbered commands

✓ Frame Reject (FRMR) 100 F 0111 Response

✓ Reasons: ✓ Control field has invalid command. ✓ Data exceeds buffer . ✓ Information sent in frame that doesn't allow it. ✓ ns and nr do not match.

✓ Secondary keeps sending FRMR till it receives SNRM, DISC or SIM

Page 28: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane

Control Field – Some Un-numbered commands

I field of FRMR !!

!

✓ W = 1, Invalid command ✓ X = 1, Prohibited information field received. ✓ Y = 1, Buffer overrun. ✓ Z = 1, Received nr disagrees with transmitted ns.

XXXXXXXX 0XXX0XXX WXYZ 0 0 0 0

C field of rejected command

ns nrsecondary’s present ns and nr

Page 29: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane Frame Check Sequence

!!!!

✓ CRC-16 ✓ g(x) = x16 + x12 + x5 + x1

16 bits

FCS

Page 30: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane Transparency

✓ Flag 01111110 should be avoided in data. ✓ Using zero-bit-insertion or zero stuffing. ✓ In Data, after every five 1’s, a zero is inserted. ✓ Hence, if we get six 1’s, it is a valid flag. ✓ Example: ✓ 01111110 01101111 11010011 Flag Address Control

✓ 1110001100110101 00101011 01111110 Data FCS Flag

Page 31: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane Transparency

✓ Transmitted: ✓ 01111110 01101111 101010011 Flag Address Control

✓ 11100001100110101 00101011 01111110 Data FCS Flag

!✓ Received: ✓ 01111110 01101111 11010011 Flag Address Control

✓ 1110001100110101 00101011 01111110 Data FCS Flag

Page 32: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane Message Abort

✓ Used to permanently terminate a frame. ✓ Generally done to accommodate high-priority message

such as emergency link recovery procedure,… ✓ Message abort is occurrence of 7-14 consecutive 1s. ✓ Zeros are nor inserted in message abort. ✓ Terminates an existing frame and immediately begins

a high priority frame. ✓ If more than 14 consecutive 1s occur in succession, it

places into idle line condition. ✓

Page 33: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane

HDLC

HIGH LEVEL DATA LINK CONTROL

DATA LINK CONTROL COMMUNICATION

Page 34: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane

HDLC

✓ In SDLC - ISO defines high order bit as bo. ✓ In HDLC - ISO defines low order bit as bo. ✓ Hence all patterns are reversed in HDLC.

b0 b1 b2 b3 b4 b5 b6 b7

SDLC

b7 b6 b5 b4 b3 b2 b1 b0

HDLC

Page 35: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane

HDLC - Modes

✓ Normal Response mode NRM: ✓ One primary, rest secondary. ✓ Primary polls/selects secondary. ✓ Unsolicited responses are not allowed.

!✓ Asynchronous Response mode ARM :

✓ A secondary may initiate a transmission without permission from primary if channel in idle.

✓ Primary-secondary relationship otherwise not altered. ✓ Secondary to secondary through primary only.

Page 36: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane

HDLC - Modes

✓ Asynchronous Balance mode ABM : ✓ Special arrangement. ✓ If point to point link between two secondaries is present then

Peer to peer is allowed. ✓ Mode to be invoked when desired. ✓ Primary brings a secondary in ABM mode.

Page 37: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane

HDLC - Frame

!!!!

✓ General frame structure as defined by ✓ ISO 3309 – 1976 E (Frame structure, Flag and transparency

mechanism.) ✓ ISO 4335 – 1979 E (Control, I, S and U fields)

!✓ Flag same as SDLC.

Flag Address Control Data… FCS Flag

8 bits extended extended Variable multiple of 8

16 bits 8 bits

Page 38: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane

HDLC - Address

!!!!!!

✓ 8 bit or extended. ✓ If bo = 0, next byte is also a part of address. ✓ If bo = 1, end of address.

Address

extended

b7 b6 b5 b4 b3 b2 b1 b0

Page 39: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane

HDLC - Address

✓ Example: !

✓ 01111110 XXXXXXX0 XXXXXXX1 Flag Byte1 Byte2 -end of address

!✓ Can extend up to n number of bytes.

Page 40: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane

HDLC - Control – Information Frame Normal Mode

!!!!!!

Control

normal

P/P

Or

F/F

b7 b6 b5 b4 b3 b2

ns

b1 b0

0 nr

Page 41: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane

HDLC - Control – Information Frame Extended Mode

!!!!!!

Control

extended

ns0 P/

F nr

Page 42: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane

HDLC - Control – Supervisory Frame Normal Mode

!!!!!!

Control

normal

P/F

b7 b6 b5 b4 b3 b2 b1 b0

1 nr0 X X

Page 43: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane

HDLC - Control – Supervisory Frame Extended Mode

!!!!!!

Control

extended

1

P/F nr

0 X X 0 0 0 0

Page 44: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane

HDLC - Control – Supervisory Frame Normal Mode

!!!!!!

b b Receive Status

0 0 Ready to receive RR Positive acknowledgement when I frame not available.

0 1 REJ(Reject) Go back N ARQ

1 0 RNR

1 1 SREJ (selective reject)

Page 45: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane

HDLC - Control – Supervisory Frame

✓ OPTIONS with RR: ✓ RR with ACK ✓ RR with P = 1 ✓ RR with F = 1 ✓ RR with F = 1 !

✓ OPTIONS with RNR: ✓ RNR with ACK ✓ RNR with P = 1 ✓ RNR with F = 1

Page 46: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane

HDLC - Control – Un-numbered Frame

!!!!!!

✓ No extended field available. ✓ Control 5 bits are reversed vis-a-vis SDLC ✓ SIM – 10000 ✓ SNRM - 00001

Control

normal

P/F

b7 b6 b5 b4 b3 b2 b1 b0

1 X1 X X X X

Page 47: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhaneDraw poll response sequence frames for HDLC

Main A

Flag Flag

F

C

S AS - Frame

0 P = 1 RR

Flag FlagAF

C

S

I - Frame

0 F = 0 0Data

Flag FlagAF

C

S

I - Frame

1 F = 1 0Data

Flag Flag

F

C

S AS - Frame

2 P = 0 RNR

Page 48: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane

Draw select response sequence frames for HDLC

Main A

Flag Flag

F

C

S AS - Frame

0 P = 1 RNR

Flag FlagA FCS

S - Frame

RR F = 1 0

Flag FlagAF

C

S

I - Frame

0P = 00Data

Flag FlagA FCS

S - Frame

RR F = 1 1

Page 49: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane

Peer to peer communication using HDLC

A B

Flag FlagBF

C

S

I - Frame

00Data

Flag FlagBF

C

S

U - Frame

11P = 1100Data

Flag FlagAF

C

S

U - Frame

00 F = 1 110Data

Flag FlagBF

C

S

I - Frame

10Data

Page 50: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane

Contd.

A B

Flag FlagAF

C

S

I - Frame

0 2Data

Flag FlagAF

C

S

I - Frame

1 2Data

Flag FlagAF

C

S

I - Frame

2 2Data

Flag Flag

F

C

S BS - Frame

3 RR

Page 51: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane

Peer to peer communication with error

A B

Flag FlagAF

C

S

I - Frame

0 2Data

Flag FlagAF

C

S

I - Frame

1 2Data

Flag FlagAF

C

S

I - Frame

2 2Data

Error

Flag Flag

F

C

S BS - Frame

1 REJ

Page 52: Data Link Synchronous Protocols - SDLC, HDLC

Prof Madhumita Ta

mhane

Contd.

A B

Flag FlagAF

C

S

I - Frame

1 2Data

Flag FlagAF

C

S

I - Frame

2 2Data

Flag Flag

F

C

S BS - Frame

3 RR