directcommunicationlinkspaloalto.unileon.es/cn/lect/cn-ch2-2020-section1.pdf · 2020. 4. 1. ·...

23
DIRECT COMMUNICATION LINKS Slides, their text and graphics are Based on textbook Conceptual Computer Networks by: © 2013-2020 José María Foces Morán, José María Foces Vivancos. All rights reserved v 4.0 30th/March/2020

Upload: others

Post on 17-Aug-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: DIRECTCOMMUNICATIONLINKSpaloalto.unileon.es/cn/lect/CN-Ch2-2020-Section1.pdf · 2020. 4. 1. · Framing in Byte-oriented protocols ¨A frameis made of a collection of bytes ¨BISYNC

DIRECT COMMUNICATION LINKSSlides, their text and graphics are Based on textbook Conceptual Computer Networks by:

© 2013-2020 José María Foces Morán, José María Foces Vivancos. All rights reservedv 4.0 30th/March/2020

Page 2: DIRECTCOMMUNICATIONLINKSpaloalto.unileon.es/cn/lect/CN-Ch2-2020-Section1.pdf · 2020. 4. 1. · Framing in Byte-oriented protocols ¨A frameis made of a collection of bytes ¨BISYNC

Chapter 2 outline

¨ Section 1¤ How Datalink protocols build frames (Framing)¤ Overview of Link protocols for point to point communication¤ Intro to multiple-access protocols and the original Ethernet

¨ Section 2¤ Ethernet’s CSMA/CD and Exponential Backoff

2

(C) 2014-2020 José María Foces Morán & José María Foces Vivancos. All rights reserved.

Page 3: DIRECTCOMMUNICATIONLINKSpaloalto.unileon.es/cn/lect/CN-Ch2-2020-Section1.pdf · 2020. 4. 1. · Framing in Byte-oriented protocols ¨A frameis made of a collection of bytes ¨BISYNC

The scenario for Chapter 2

¨ Statistical multiplexing¤ Switching according to distribution of demand

across all connected nodes

¨ Directly connected nodes¤ Host – Switch

¤ Host – Host

¤ PDU is Framen 1 Packet into 1 Frame

¨ Packet Switched Networks¤ Information is broken down into individual

Packets

Host S1

S2

S3

R1

R2

R3

Flow S3 - R2 number 1

Flow S3 - R2 number 2

Flow S3 - R3 number 1

Flow S2 - R3 number 1

ACTIVE FLOWS

Switch 1 Switch 2

3

(C) 2014-2020 José María Foces Morán & José María Foces Vivancos. All rights reserved.

Network 1IP Router

Network 3

Network 2

Internet

Network 4Network 5

Page 4: DIRECTCOMMUNICATIONLINKSpaloalto.unileon.es/cn/lect/CN-Ch2-2020-Section1.pdf · 2020. 4. 1. · Framing in Byte-oriented protocols ¨A frameis made of a collection of bytes ¨BISYNC

Building frames4

Page 5: DIRECTCOMMUNICATIONLINKSpaloalto.unileon.es/cn/lect/CN-Ch2-2020-Section1.pdf · 2020. 4. 1. · Framing in Byte-oriented protocols ¨A frameis made of a collection of bytes ¨BISYNC

What is a Frame?

¨ Datalink protocols are used for direct links

¨ The PDU (Protocol Data Unit) of Datalink protocols is known as Frame

¨ Datalink FRAME = Datalink Header

+Upper layer payload

5

Application

Presentation

Session

Transport

Network

Datalink

PhysicalPhysicalHeader

(Preamble)

PAYLOADDatalinkHeader

A

FRAME

FRAME

(C) 2014-2020 José María Foces Morán & José María Foces Vivancos. All rights reserved.

Page 6: DIRECTCOMMUNICATIONLINKSpaloalto.unileon.es/cn/lect/CN-Ch2-2020-Section1.pdf · 2020. 4. 1. · Framing in Byte-oriented protocols ¨A frameis made of a collection of bytes ¨BISYNC

What is a direct connection?

¨ Example: Host1 is directly connected to the Router¨ Frame:

¤ Payload: Encapsulates an upper-layer PDU¤ Header contains

n A mux key + Host 1 address + Router address, etc

6

Subnetwork

4

3

2

1

Network

Transport

Application

Host 1 Router

Direct connection

DatalinkPhysical

Network

Transport

Application

DatalinkPhysical Subnetwork

Datalink Frame

(C) 2014-2020 José María Foces Morán & José María Foces Vivancos. All rights reserved.

Page 7: DIRECTCOMMUNICATIONLINKSpaloalto.unileon.es/cn/lect/CN-Ch2-2020-Section1.pdf · 2020. 4. 1. · Framing in Byte-oriented protocols ¨A frameis made of a collection of bytes ¨BISYNC

Detection of Frame’s fields

¨ Server transmits a frame to the Switch¤ Network Interface Card = NIC

¤ Transmission electronics

¨ NIC at the receiver (Switch) stores the received sequence of bits

¨ The Switch NIC must be able to recognize the frame:¤ Where the frame begins and ends

¤ Which are the frame’s fields

7

(C) 2014-2020 José María Foces Morán & José María Foces Vivancos. All rights reserved.

Page 8: DIRECTCOMMUNICATIONLINKSpaloalto.unileon.es/cn/lect/CN-Ch2-2020-Section1.pdf · 2020. 4. 1. · Framing in Byte-oriented protocols ¨A frameis made of a collection of bytes ¨BISYNC

Three strategies for delineating a frame

¨ Detection of frame start, its fields and its end¨ Three strategies:

n Byte-oriented protocols: BISYNC, PPP, DDCMP

n Bit-oriented protocols: HDLC, Ethernetn Clock-based protocols: SONET/SDH

8

(C) 2014-2020 José María Foces Morán & José María Foces Vivancos. All rights reserved.

Page 9: DIRECTCOMMUNICATIONLINKSpaloalto.unileon.es/cn/lect/CN-Ch2-2020-Section1.pdf · 2020. 4. 1. · Framing in Byte-oriented protocols ¨A frameis made of a collection of bytes ¨BISYNC

An analogy with C lang strings

¨ C strings are byte-oriented J

¨ How is a C constant character string delimited in the source code?

char s[] = “Hello world!”;

¨ “ sentinel marks the beginning¨ Next “ sentinel marks the end

¤ ASCII Characters are stored in between the two delimiters

9

(C) 2014-2020 José María Foces Morán & José María Foces Vivancos. All rights reserved.

Page 10: DIRECTCOMMUNICATIONLINKSpaloalto.unileon.es/cn/lect/CN-Ch2-2020-Section1.pdf · 2020. 4. 1. · Framing in Byte-oriented protocols ¨A frameis made of a collection of bytes ¨BISYNC

Framing in Byte-oriented protocols

¨ A frame is made of a collection of bytes

¨ BISYNC (Binary Synchronous Communication, BSC)¤ Developed by IBM (late 1960)

¨ DDCMP (Digital Data Communication Protocol)¤ Used in DECNet

¨ PPP (Point to Point Protocol)¤ IP packets over various media

10

(C) 2014-2020 José María Foces Morán & José María Foces Vivancos. All rights reserved.

Page 11: DIRECTCOMMUNICATIONLINKSpaloalto.unileon.es/cn/lect/CN-Ch2-2020-Section1.pdf · 2020. 4. 1. · Framing in Byte-oriented protocols ¨A frameis made of a collection of bytes ¨BISYNC

Framing in the BiSync protocol

¨ BISYNC is a byte-oriented protocol¨ Each byte represents an ASCII/EBCDIC code¨ Sentinels:

¤ SYN SYN characters mark thebeginning of a new frame

¤ SOH (Start of Header): Mark the start of the Header¤ STX (Start of Text): Mark the start of the data (Payload)

¤ ETX (End of text): Marks the end of the data

11

Application

Presentation

Session

Transport

Network

Datalink

PhysicalPhysicalHeader

(Preamble)

PAYLOADDatalinkHeader

A

FRAME

FRAME

SYN SYN SOH Identifier Station Address STX Payload ETX CRC-16

Single-block BSC Frame format (Data)

Header

Frame StartHeaderStart

PayloadStart

PayloadEnd

ErrorControl

(C) 2014-2020 José María Foces Morán & José María Foces Vivancos. All rights reserved.

Page 12: DIRECTCOMMUNICATIONLINKSpaloalto.unileon.es/cn/lect/CN-Ch2-2020-Section1.pdf · 2020. 4. 1. · Framing in Byte-oriented protocols ¨A frameis made of a collection of bytes ¨BISYNC

Transparency in the BiSync protocol

¨ What if the payload sent by the upper protocol contains a byte coincident with any of the sentinels? This would confuse the receiving protocol

¨ A special control character known as DLE (Data Link Escape) indicates that the next character is not to be understood as a sentinel but as pure literal data (Byte stuffing)

¨ Example:n We want to send the following ASCII character sequence as data: [A][B][C][D][E][STX][F][G]

n The STX char is not to be understood as meaning “Start of TeXt” but its 8 bits mean only payload data

12

(C) 2014-2020 José María Foces Morán & José María Foces Vivancos. All rights reserved.

Page 13: DIRECTCOMMUNICATIONLINKSpaloalto.unileon.es/cn/lect/CN-Ch2-2020-Section1.pdf · 2020. 4. 1. · Framing in Byte-oriented protocols ¨A frameis made of a collection of bytes ¨BISYNC

Transparency in the BiSync protocol

¨ Example of Byte-stuffing¤ We want to send the following ASCII character sequence as data: “[A][B][C][D][E][STX][F][G]”

¤ The STX char must not be understood to mean “Start of TeXt” but its 8 bits are only payload data

¤ A [DLE] character is included prior to [STX] meaning: “The next character is data, it is not the Bisync sentinel known as[STX]”

¤ The transmitted sequence becomes:n “[A][B][C][D][E][DLE][STX][F][G]”

n What if DLE itself appears in the layer-3 payload? Same as in the C language: Include an escaping DLE character that escapes the special meaning of the next character: [DLE][DLE]

13

Application

Presentation

Session

Transport

Network

Datalink

PhysicalPhysicalHeader

(Preamble)

PAYLOADDatalinkHeader

A

FRAME

FRAME

(C) 2014-2020 José María Foces Morán & José María Foces Vivancos. All rights reserved.

Page 14: DIRECTCOMMUNICATIONLINKSpaloalto.unileon.es/cn/lect/CN-Ch2-2020-Section1.pdf · 2020. 4. 1. · Framing in Byte-oriented protocols ¨A frameis made of a collection of bytes ¨BISYNC

Framing in the BiSync protocol

¨ What if [DLE] itself is to be included as payload data?¤ Same as in the C language¤ Include an escaping DLE character that escapes the special

meaning of the next character: [DLE][DLE]

¨ Example. The payload is the next byte sequence:¤ [1][2][3][DLE][4][5][6]¤ BiSync will transmit the following byte sequence:[1][2][3][DLE][DLE][4][5][6]

14

Application

Presentation

Session

Transport

Network

Datalink

PhysicalPhysicalHeader

(Preamble)

PAYLOADDatalinkHeader

A

FRAME

FRAME

(C) 2014-2020 José María Foces Morán & José María Foces Vivancos. All rights reserved.

Page 15: DIRECTCOMMUNICATIONLINKSpaloalto.unileon.es/cn/lect/CN-Ch2-2020-Section1.pdf · 2020. 4. 1. · Framing in Byte-oriented protocols ¨A frameis made of a collection of bytes ¨BISYNC

Framing in PPP (Point To Point Protocol)

¨ Byte-oriented (A variant of HDLC-ABM protocol)¤ Address and Control fields use constant values since PPP is used only for point-to-point communication

¨ Uses the sentinel approach

¨ Over Internet links (ISDN/ADSL/ATM)¨ Frame start character sentinel is denoted as Flag

0 1 1 1 1 1 1 0

¨ Protocol: A multiplexing key (Example: IP / IPX)

¨ Payload: The data transported, max size negotiated (MRU = 1500 bytes)¨ CRC16 or CRC-32 for error detection

15

Flag Dest. Address Control Payload CRC-16/32

Generic PPP frame

Header

FrameStart

FrameEnd

ErrorControl

Protocol Flag

1111 1111BroadcastAlways

0000 0011in PPP always

16-bit MultiplexingKey

Variable-length

(C) 2014-2020 José María Foces Morán & José María Foces Vivancos. All rights reserved.

Page 16: DIRECTCOMMUNICATIONLINKSpaloalto.unileon.es/cn/lect/CN-Ch2-2020-Section1.pdf · 2020. 4. 1. · Framing in Byte-oriented protocols ¨A frameis made of a collection of bytes ¨BISYNC

Point To Point Protocol

¨ Works in tandem with another two protocols¤ Negotiate parameters with:¤ LCP (Link Control Protocol): For testing and managing the link

¤ NCP (Network Control Protocol): IP address, default router, etc

16

Flag Dest. Address Control Payload CRC-16/32

Generic PPP frame

Header

FrameStart

FrameEnd

ErrorControl

Protocol Flag

1111 1111BroadcastAlways

0000 0011in PPP always

16-bit MultiplexingKey

Variable-length

(C) 2014-2020 José María Foces Morán & José María Foces Vivancos. All rights reserved.

Page 17: DIRECTCOMMUNICATIONLINKSpaloalto.unileon.es/cn/lect/CN-Ch2-2020-Section1.pdf · 2020. 4. 1. · Framing in Byte-oriented protocols ¨A frameis made of a collection of bytes ¨BISYNC

Framing

Byte-counting approach¨ DDCMP

¤ count : how many bytes are contained in the frame body¤ -the rest of fields are fixed-size

¨ If count is corrupted¤ Framing error

DDCMP Frame Format © Morgan Kaufmann 2012 Larry Peterson & Bruce Davie.

17

Page 18: DIRECTCOMMUNICATIONLINKSpaloalto.unileon.es/cn/lect/CN-Ch2-2020-Section1.pdf · 2020. 4. 1. · Framing in Byte-oriented protocols ¨A frameis made of a collection of bytes ¨BISYNC

Framing in HDLC

¨ HDLC : High Level Data Link Control

¨ HDLC is a bit-oriented protocol¤ Transmits data in blocks of 1 bit

¨ Beginning and Ending Sequence (Sentinel is the FLAG character)FLAG = 0 1 1 1 1 1 1 0

¨ Any amount of bits, not necessarily a multiple of 8 bits(1 byte)

18

(C) 2014-2020 José María Foces Morán & José María Foces Vivancos. All rights reserved.

Flag Address Control Information field CRC-16/32

Generic HDLC frame

Header

FrameStart

FrameEnd

ErrorControl

Flag

8/16 bits 0 to N bits8/16 bits:· Information· Supervisory· Unnumbered

Page 19: DIRECTCOMMUNICATIONLINKSpaloalto.unileon.es/cn/lect/CN-Ch2-2020-Section1.pdf · 2020. 4. 1. · Framing in Byte-oriented protocols ¨A frameis made of a collection of bytes ¨BISYNC

Data transparency in HDLC

¨ Problem with the Flag sentinel¤ What if the FLAG 0 1 1 1 1 1 1 0 is contained anywhere after the initial Flag?

¤ The receiver would confuse this bit sequence with a Flag (A terminating flag, in this case)

¨ Solution: Bit Stuffing or Zero-Bit Insertion¤ A transparency mechanism for allowing the sender to send any bit sequence,

including the sequence of bits that comprise the Flag

19

(C) 2014-2020 José María Foces Morán & José María Foces Vivancos. All rights reserved.

Page 20: DIRECTCOMMUNICATIONLINKSpaloalto.unileon.es/cn/lect/CN-Ch2-2020-Section1.pdf · 2020. 4. 1. · Framing in Byte-oriented protocols ¨A frameis made of a collection of bytes ¨BISYNC

Bit stuffing in HDLC

¨ At the sender: Whenever the sender observes 5 bits 1 after the frame start, thesender inserts a bit 0 before transmitting the next bit:¤ x x x x 1 1 1 1 1 0 x x x x x x x x

¨ At the receiver: The receiver removes the inserted bit 0 whenever it observes the 5 bits 1 and the next bit is a 0:¤ x x x x 1 1 1 1 1 x x x x x x x x

20

(C) 2014-2020 José María Foces Morán & José María Foces Vivancos. All rights reserved.

Page 21: DIRECTCOMMUNICATIONLINKSpaloalto.unileon.es/cn/lect/CN-Ch2-2020-Section1.pdf · 2020. 4. 1. · Framing in Byte-oriented protocols ¨A frameis made of a collection of bytes ¨BISYNC

Bit stuffing in HDLC on the sending side

Bit stuffing on the sending side

¨ Any time five consecutive 1’s appear in the frame (Between thestart and end of frame)¤ x x x x 1 1 1 1 1 x x x x x x x x

¨ The sender inserts (stuffs) 0 before transmitting the next bit¤ x x x x 1 1 1 1 1 0 x x x x x x x x

21

(C) 2014-2020 José María Foces Morán & José María Foces Vivancos. All rights reserved.

Bits to beincluded

in sent frame00110010101001011111000000001111 0-bit

insertioncircuit

xxxxx11111xxxxxx xxxxx111110xxxxxx

enabledisable

TransmissionMedium

disable is set when thetransmitter is sendingthe Flag 01111110

Page 22: DIRECTCOMMUNICATIONLINKSpaloalto.unileon.es/cn/lect/CN-Ch2-2020-Section1.pdf · 2020. 4. 1. · Framing in Byte-oriented protocols ¨A frameis made of a collection of bytes ¨BISYNC

Bit stuffing in HDLC on the receiving side

Bit stuffing on the receiving side¨ After receiving the initial flag, whenever the receiver receives 5

bits 1 and a one bit 0:¤ x x x x 1 1 1 1 1 0 x x x x x x x x

¨ The receiver removes the bit 0 (The inserted bit):¤ x x x x 1 1 1 1 1 x x x x x x x x

22

(C) 2014-2020 José María Foces Morán & José María Foces Vivancos. All rights reserved.

0-bit removalcircuit

xxxxx11111xxxxxxxxxxx111110xxxxxx

enabledisable

TransmissionMedium

Bits includedin recived frame00110010101001011111000000001111

Page 23: DIRECTCOMMUNICATIONLINKSpaloalto.unileon.es/cn/lect/CN-Ch2-2020-Section1.pdf · 2020. 4. 1. · Framing in Byte-oriented protocols ¨A frameis made of a collection of bytes ¨BISYNC

Bit stuffing on the receiving side

¨ When 5 consecutive 1’s are received 11111?

¨ If next bit 0 : (01111100001010…)¤ It’s a stuffed 0, so remove it

and keep receiving the ensuing bits (0001010…) asdata

¨ If next bit 1 : (01111110001010…)¤ Further look at next bit b (0111111b)

n If 0: End of frame marker (01111110)n If 1: Error has been introduced in the

bitstream (01111111)

23

(C) 2014-2020 José María Foces Morán & José María Foces Vivancos. All rights reserved.

0-bit removalcircuit

xxxxx11111xxxxxxxxxxx11111?xxxxxx

enabledisable