CSMC 417. Computer Networks Prof. Ashok K Agrawala Ashok Agrawala Set 4. September 09 CMSC417 Set 4 1

Similar documents
CSMC 417. Computer Networks Prof. Ashok K Agrawala Ashok Agrawala. Nov 1,

Chapter 3. The Data Link Layer

Point-to-Point Links. Outline Encoding Framing Error Detection Sliding Window Algorithm. Fall 2004 CS 691 1

Islamic University of Gaza Faculty of Engineering Department of Computer Engineering ECOM 4021: Networks Discussion. Chapter 2.

CSCI-1680 Link Layer I Rodrigo Fonseca

2.4 Error Detection Bit errors in a frame will occur. How do we detect (and then. (or both) frames contains an error. This is inefficient (and not

Links. CS125 - mylinks 1 1/22/14

Lecture 5. Homework 2 posted, due September 15. Reminder: Homework 1 due today. Questions? Thursday, September 8 CS 475 Networks - Lecture 5 1

CS 640 Introduction to Computer Networks. Role of data link layer. Today s lecture. Lecture16

Data Link Networks. Hardware Building Blocks. Nodes & Links. CS565 Data Link Networks 1

EE 122: Error detection and reliable transmission. Ion Stoica September 16, 2002

High Level View. EE 122: Error detection and reliable transmission. Overview. Error Detection

Introduction to Computer Networks. 03 Data Link Layer Introduction

Problem Statement. Physical and Data Link Layer Overview. Five Tasks Encoding. Make two computers talk to each other

Computer Network. Direct Link Networks Reliable Transmission. rev /2/2004 1

Department of Computer and IT Engineering University of Kurdistan. Data Communication Netwotks (Graduate level) Data Link Layer

Error Detection Codes. Error Detection. Two Dimensional Parity. Internet Checksum Algorithm. Cyclic Redundancy Check.

CSE 461: Framing, Error Detection and Correction

Chapter 3. The Data Link Layer

CS422 Computer Networks

CompSci 356: Computer Network Architectures. Lecture 4: Link layer: Encoding, Framing, and Error Detection Ref. Chap 2.2, 2.3,2.4

06/05/2008. Chapter 3. The Data Link Layer. Data Link Layer Design Issues. Services Provided to the Network Layer. Error Control Flow Control

The Data Link Layer. Data Link Layer Design Issues

Direct Link Networks. Lecture - Encoding & Framing 1. Areas for Discussion. Problems

ECE 4450:427/527 - Computer Networks Spring 2017

Networking Link Layer

CSE 123A Computer Networks

Direct Link Networks. Framing. Lecture - Encoding & Framing 1. Problems. Areas for Discussion

Inst: Chris Davison

CSCI-1680 Link Layer Reliability Rodrigo Fonseca

Data Link Layer. Overview. Links. Shivkumar Kalyanaraman

Some portions courtesy Robin Kravets and Steve Lumetta

Overview. Performance metrics - Section 1.5 Direct link networks Hardware building blocks - Section 2.1 Encoding - Section 2.2 Framing - Section 2.

Chapter 3. The Data Link Layer. Wesam A. Hatamleh

Data Link Layer Overview

The Data Link Layer Chapter 3

CSCI-1680 Link Layer Reliability John Jannotti

Data Link Layer Overview

Data Link Technology. Suguru Yamaguchi Nara Institute of Science and Technology Department of Information Science

The data link layer has a number of specific functions it can carry out. These functions include. Figure 2-1. Relationship between packets and frames.

Links Reading: Chapter 2. Goals of Todayʼs Lecture. Message, Segment, Packet, and Frame

UNIT I FUNDAMENTALS & LINK LAYER

Data Link Layer Overview

Data Link Layer Overview

Jaringan Komputer. Data Link Layer. The Data Link Layer. Study the design principles

Data Link Layer. Srinidhi Varadarajan

CMSC 417. Computer Networks Prof. Ashok K Agrawala Ashok Agrawala. October 11, 2018

Housekeeping. Fall /5 CptS/EE 555 1

Data Link Layer. Indian Institute of Technology Madras

Data Link Protocols. High Level Data. Control Protocol. HDLC Framing ~~~~~~~~ Functions of a Data Link Protocol. Framing PDUs. Addressing Destination

Overview. Data Link Technology. Role of the data-link layer. Role of the data-link layer. Function of the physical layer

CSCI-1680 Physical Layer Link Layer I Rodrigo Fonseca

Computer and Network Security

COMPUTER NETWORKS UNIT I. 1. What are the three criteria necessary for an effective and efficient networks?

CSE 123: Computer Networks

Lecture 5: Data Link Layer Basics

DATA LINK LAYER UNIT 7.

Copyright 2010, Elsevier Inc. All rights Reserved

From Signals to Packets Computer Networking. Link Layer: Implementation. Datalink Functions. Lecture 5 - Coding and Error Control

UNIT I FUNDAMENTALS & LINK LAYER

CIS 551 / TCOM 401 Computer and Network Security. Spring 2007 Lecture 7

Data Link Layer: Overview, operations

The Data Link Layer Chapter 3

PART III. Data Link Layer MGH T MGH C I 204

Computer Networking. Lecture 4 - Coding and Error Control

Chapter 2: Getting Connected

Direct Link Networks: Building Blocks (2.1), Encoding (2.2), Framing (2.3)

5th Slide Set Computer Networks

From Signals to Packets Computer Networking. Link Layer: Implementation. Network Delay. 06-datalink.ppt, , Fall

Outline. EEC-484/584 Computer Networks. Data Link Layer Design Issues. Framing. Lecture 6. Wenbing Zhao Review.

Message, Segment, Packet, and Frame Link-layer services Encoding, framing, error detection, transmission control Error correction and flow control

Goals of Today s Lecture. Adaptors Communicating

SRI RAMAKRISHNA INSTITUTE OF TECHNOLOGY DEPARTMENT OF INFORMATION TECHNOLOGY COMPUTER NETWORKS UNIT - II DATA LINK LAYER

Where we are in the Course

UNIT-II 1. Discuss the issues in the data link layer. Answer:

EITF25 Internet Techniques and Applications L3: Data Link layer. Stefan Höst

Data link layer functions. 2 Computer Networks Data Communications. Framing (1) Framing (2) Parity Checking (1) Error Detection

L3: Building Direct Link Networks I. Hui Chen, Ph.D. Dept. of Engineering & Computer Science Virginia State University Petersburg, VA 23806

TYPES OF ERRORS. Data can be corrupted during transmission. Some applications require that errors be detected and corrected.

Lecture / The Data Link Layer: Framing and Error Detection

CS 457 Networking and the Internet. Link Layer Protocols. Problems 8/31/16. Fall 2016 Indrajit Ray

Data Communication & Computer Networks INFO

3. Data Link Layer 3-2

Reliable Transmission

C08a: Data Link Protocols

Transmission SIGNALs

CS 4453 Computer Networks Winter

Lecture 4: CRC & Reliable Transmission. Lecture 4 Overview. Checksum review. CRC toward a better EDC. Reliable Transmission

2.1 CHANNEL ALLOCATION 2.2 MULTIPLE ACCESS PROTOCOLS Collision Free Protocols 2.3 FDDI 2.4 DATA LINK LAYER DESIGN ISSUES 2.5 FRAMING & STUFFING

COMPUTER NETWORKS CS CS 55201

Chapter 10 Error Detection and Correction. Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Telecom Systems Chae Y. Lee. Contents. Flow Control Error Detection/Correction Link Control (Error Control) Link Performance (Utility)

Ch. 7 Error Detection and Correction

Advanced Computer Networks. Rab Nawaz Jadoon DCS. Assistant Professor COMSATS University, Lahore Pakistan. Department of Computer Science

Data Link Layer (1) Networked Systems 3 Lecture 6

COMPUTER NETWORKS CS CS 55201

COMP/ELEC 429/556 Introduction to Computer Networks

Lecture 6: Reliable Transmission. CSE 123: Computer Networks Alex Snoeren (guest lecture) Alex Sn

Introduction to Data Communications & Networking

CSE 123: Computer Networks

Transcription:

CSMC 417 Computer Networks Prof. Ashok K Agrawala 2009 Ashok Agrawala Set 4 1

The Data Link Layer 2

Data Link Layer Design Issues Services Provided to the Network Layer Framing Error Control Flow Control 3

Functions of the Data Link Layer Provide service interface to the network layer Dealing with transmission errors Regulating data flow Slow receivers not swamped by fast senders 4

Functions of the Data Link Layer (2) Relationship between packets and frames. 5

Services Provided to Network Layer (a) Virtual communication. (b) Actual communication. 6

Services Provided to Network Layer (2) Placement of the data link protocol. 7

Encoding Signals propagate over physical links Source node encodes the bits into a signal Receiving node decodes the signal back into bits Simplify some electrical engineering details Assume two discrete signals, high and low E.g., could correspond to two different voltages Simple approach High for a 1, low for a 0 October 08 CMSC417 0 Set 0 101 1 0 0 1 1 0 0 0 1 1 1 1 1 08 0

Problem With Simple Approach Long strings of 0s or 1s introduce problems No transitions from low-to-high, or high-to-low Receiver keeps average of signal it has received Uses the average to distinguish between high and low Long flat strings make receiver sensitive to small change Transitions also necessary for clock recovery Receiver uses transitions to drive its own clock Long flat strings do not produce any transitions Can lead to clock drift at the receiver Alternatives Non-return to zero inverted, and Manchester encoding October 08 CMSC417 Set 10 9

Encoding NRZ NRZI Manchester 4B/5B Bit Rate and Baud Rate October 08 CMSC417 Set 10 10

Encoding October 08 CMSC417 Set 10 11

4-bit Symbol 5-bit Code 0000 11110 0001 01001 0010 10100 0011 10101 0100 01010 0101 01011 0110 01110 0111 01111 1000 10010 1001 10011 1010 10110 1011 10111 1100 11010 1101 11011 1110 11100 4B/5B Encoding Each 1 has no more than one leading 0 and no more then two trailing 0s. Sent using NRZI 1111 11101 October 08 CMSC417 Set 10 12

Framing Break sequence of bits into a frame Typically implemented by the network adaptor Sentinel-based Delineate frame with special pattern (e.g., 01111110) 01111110 Frame contents 01111110 Problem: what if special patterns occurs within frame? Solution: escaping the special characters E.g., sender always inserts a 0 after five 1s and receiver always removes a 0 appearing after five 1s Bit Stuffing Similar to escaping special characters in C programs October 08 CMSC417 Set 10 13

Bit Oriented Protocols Frame a collection of bits No Byte boundary SDLC Synchronous Data Link Control IBM HDLC High-Level Data Link Control ISO Standard HDLC Frame Format October 08 CMSC417 Set 10 14

Framing Bit Oriented Bit stuffing (a) The original data. (b) The data as they appear on the line. (c) The data as they are stored in receiver s memory after destuffing. 15

Byte-Oriented Protocols Frame a collection of bytes. Examples BISYNC Binary Synchronous Communication IBM DDCMP Digital Data Communication Message Protocol PPP Point-to-Point Sentinel Based Use special character as marker BISYNC SYN and SOH STX and ETX DLE as escape character. - Character Stuffing October 08 CMSC417 Set 10 16

Framing (a) A frame delimited by flag bytes. (b) Four examples of byte sequences before and after stuffing. 17

Frame Structure PPP Frame Format BISYNC Frame Format October 08 CMSC417 Set 10 18

Framing (Continued) Counter-based Include the payload length in the header instead of putting a sentinel at the end Problem: what if the count field gets corrupted? Causes receiver to think the frame ends at a different place Solution: catch later when doing error detection And wait for the next sentinel for the start of a new frame DDCMP Frame Format October 08 CMSC417 Set 10 19

Framing A character stream. (a) Without errors. (b) With one error. 20

Clock-Based Framing (SONET) Clock-based Make each frame a fixed size No ambiguity about start and end of frame But, may be wasteful Synchronous Optical Network (SONET) Slowest speed link STS-1 51.84 Mbps ( 810*8*8K) Frame 9 rows of 90 bytes First 3 bytes of each row are overhead First two bytes of a frame contain a special bit pattern to mark the start of the frame check for it every 810 bytes October 08 CMSC417 Set 10 21

Sonet Frame October 08 CMSC417 Set 10 22

Three STS-1 frames to one STS-3 frame October 08 CMSC417 Set 10 23

Error Detection Errors are unavoidable Electrical interference, thermal noise, etc. Error detection Transmit extra (redundant) information Use redundant information to detect errors Extreme case: send two copies of the data Trade-off: accuracy vs. overhead Techniques for detecting errors Parity checking Checksum Cyclic Redundancy Check (CRC) October 08 CMSC417 Set 10 24

Error Detection Techniques Parity check Add an extra bit to a 7-bit code Odd parity: ensure an odd number of 1s E.g., 0101011 becomes 01010111 Even parity: ensure an even number of 1s E.g., 0101011 becomes 01010110 Two Dimensional Parity October 08 CMSC417 Set 10 25

Two Dimensional Parity October 08 CMSC417 Set 10 26

Checksum Checksum Treat data as a sequence of 16-bit words Compute a sum of all the 16-bit words, with no carries Transmit the sum along with the packet October 08 CMSC417 Set 10 27

Internet Checksum Algorithm Consider data as a sequence of 16-bit integers Add them together using 16-bit one s complement arithmetic Take 1 s complement of the sum That is the checksum October 08 CMSC417 Set 10 28

Cyclic Redundancy Check Have to maximize the probability of detecting the errors using a small number of additional bits. Based on powerful mathematical formulations theory of finite fields Consider (n+1) bits as n degree polynomial 3 2 Cx ( ) = x+ x + 1 Message M(x) represented as polynomial M( x) = x + x + x + x Divisor C(x) of degree k Send P(x) as (n+1) bits +k bits such that P(x) is exactly divisible by C(x) 7 4 3 1 October 08 CMSC417 Set 10 29

CRC Basis Use modulo 2 arithmetic Any Polynomial B(x) can be divided by a divisor polynomial C(x) if B(x) is of higher degree than C(x) Any polynomial B(x) can be divided once by a divisor polynomial C(x) if they are of the same degree The remainder obtained when B(x) is divided by C(x) is obtained by subtracting C(x) from B(x) To subtract C(x) from B(x) we simply perform the exclusive-or operation on each pair of matching coefficients. October 08 CMSC417 Set 10 30

CRC Basis 1. Multiply M(x) by x k, i.e. add k zeros at the end of the message. Call this T(x) 2. Divide T(x) by C(x) 3. Subtract the remainder from T(x) Message sent 1001101010 101 October 08 CMSC417 Set 10 31

Cyclic Redundancy Check All single bit errors if x k and x 0 terms are nonzero All double-bit errors as long as C(x) has a factor with at least three terms Any odd number of errors as long as C(x) has (x+1) as a factor Any burst error of length k bits October 08 CMSC417 Set 10 32

Common CRC Polynomials CRC C(x) CRC-8 x 8 + x 2 + X 1 + 1 CRC-10 x 10 + x 9 + x 5 + x 4 + x 1 + 1 CRC-12 x 12 + x 11 + x 3 + x 2 + 1 CRC-16 x 16 + x 15 + x 2 + 1 CRC-CCITT x 16 + x 12 + x 5 + 1 CRC-32 x 32 + x 26 + x 23 + x 22 + x 16 + x 12 + x 11 + x 10 + x 8 + x 7 + x 5 + x 4 + x 2 + x 1 + 1 October 08 CMSC417 Set 10 33

Error-Correcting Codes Use of a Hamming code to correct burst errors. 34

Link-Layer Services Encoding Representing the 0s and 1s Framing Encapsulating packet into frame, adding header, trailer Using MAC addresses, rather than IP addresses Error detection Errors caused by signal attenuation, noise. Receiver detecting presence of errors Error correction Receiver correcting errors without retransmission Flow control Pacing between adjacent sending and receiving nodes October 08 CMSC417 Set 10 35

Adaptors Communicating datagram link layer protocol frame frame sending node adapter adapter receiving node Link layer implemented in adaptor (network interface card) Ethernet card, PCMCI card, 802.11 card Sending side: Encapsulates datagram in a frame Adds error checking bits, flow control, etc. Receiving side Looks for errors, flow control, etc. Extracts datagram and passes to receiving node 36

Elementary Data Link Protocols An Unrestricted Simplex Protocol A Simplex Stop-and-Wait Protocol A Simplex Protocol for a Noisy Channel 37

Protocol Definitions Continued Some definitions needed in the protocols to follow. These are located in the file protocol.h. 38

Protocol Definitions (ctd.) Some definitions needed in the protocols to follow. These are located in the file protocol.h. 39

Unrestricted Simplex Protocol 40

Reliable Transmission Transfer frames without errors Error Correction Error Detection Discard frames with error Acknowledgements and Timeouts Retransmission ARQ Automatic Repeat Request October 08 CMSC417 Set 10 41

Stop and Wait Duplicate Frames October 08 CMSC417 Set 10 42

Stop and Wait with 1-bit Seq No October 08 CMSC417 Set 10 43

Stop and Wait Protocols Simple Low Throughput One Frame per RTT Increase throughput by having more frames in flight Sliding Window Protocol October 08 CMSC417 Set 10 44

Simplex Stopand-Wait Protocol 45

A Simplex Protocol for a Noisy Channel A positive acknowledgement with retransmission protocol. Continued 46

A Simplex Protocol for a Noisy Channel (ctd.) A positive acknowledgement with retransmission protocol. 47

Sliding Window Protocol Sender assigns a sequence number SeqNum Sender maintains three variables: Send Window Size SWS Last Ack Received LAR Last Frame Sent LFS Invariant LFS LAR < SWS When ACK arrives sender movers LAR to the right and thereby allowing the sender to transmit another frame Associate a timer with each frame it transmits October 08 CMSC417 Set 10 48

Sliding Window Protocol Receiver maintains three variables: Receiver Window Size RWS Largest acceptable Frame Number LAF Last Frame Received LFR Invariant LAF LFR < RWR When frame with SEQNum arrives If SeqNum < LFR or SeqNum >LAF discard the frame If LFR < SeqNum < LAF then accept the frame SeqNumtoAck largest seq no not yet acked. Send this as ack. October 08 CMSC417 Set 10 49

Sliding Window Sliding Window on Sender Timeline Sliding window on Receiver October 08 CMSC417 Set 10 50

Sliding Window Throughput Keep the pipe full SWS selected to reflect how many frames we want in transit at any time Timeout results in a decrease in the amount of data in transit RWS can be any value If 1 implies the receiver does not buffer any out of order frames October 08 CMSC417 Set 10 51

Finite Sequence Numbers Can only use a finite number of bits for sequence number The number will roll over - MaxSeqNum If RWS = 1 then MaxSeqNum > SWS + 1 is sufficient In general SWS < (MaxSeqNum +1)/2 October 08 CMSC417 Set 10 52

Functions of Sliding Window Protocol 1. Reliably deliver frame across unreliable links 2. Deliver frames to higher levels in sequence 3. Flow Control Separation of Concerns!! October 08 CMSC417 Set 10 53

Sliding Window Protocols A One-Bit Sliding Window Protocol A Protocol Using Go Back N A Protocol Using Selective Repeat 54

Sliding Window Protocols (2) A sliding window of size 1, with a 3-bit sequence number. (a) Initially. (b) After the first frame has been sent. (c) After the first frame has been received. (d) After the first acknowledgement has been received. 55

A One-Bit Sliding Window Protocol 56 Continued

A One-Bit Sliding Window Protocol (ctd.) 57

A One-Bit Sliding Window Protocol (2) Two scenarios for protocol 4. (a) Normal case. (b) Abnormal case. The notation is (seq, ack, packet number). An asterisk indicates where a network layer CMSC417 Set 4 accepts a packet. September 09 58

A Protocol Using Go Back N Pipelining and error recovery. Effect on an error when (a) Receiver s window size is 1. September (b) 09Receiver s window CMSC417 size is Set 4large. 59

Sliding Window Protocol Using Go Back N 60 Continued

Sliding Window Protocol Using Go Back N 61 Continued

Sliding Window Protocol Using Go Back N 62 Continued

Sliding Window Protocol Using Go Back N 63

Sliding Window Protocol Using Go Back N (2) Simulation of multiple timers in software. 64

A Sliding Window Protocol Using Selective Repeat 65 Continued

A Sliding Window Protocol Using Selective Repeat (2) Continued 66

A Sliding Window Protocol Using Selective Repeat (3) 67 Continued

A Sliding Window Protocol Using Selective Repeat (4) 68

A Sliding Window Protocol Using Selective Repeat (5) (a) Initial situation with a window size seven. (b) After seven frames sent and received, but not acknowledged. (c) Initial situation with a window size of four. (d) After four frames sent and received, but not acknowledged. 69

Protocol Verification Finite State Machined Models Petri Net Models 70

Finite State Machined Models (a) State diagram for protocol 3. (b) Transmissions. 71

Petri Net Models A Petri net with two places and two transitions. 72

Petri Net Models (2) A Petri net model for protocol 3. 73

Example Data Link Protocols HDLC High-Level Data Link Control The Data Link Layer in the Internet 74

High-Level Data Link Control Frame format for bit-oriented protocols. 75

High-Level Data Link Control (2) Control field of (a) An information frame. (b) A supervisory frame. (c) An unnumbered frame. 76

The Data Link Layer in the Internet A home personal computer acting as an internet host. 77

PPP Point to Point Protocol The PPP full frame format for unnumbered mode operation. 78

PPP Point to Point Protocol (2) A simplified phase diagram for bring a line up and down. 79

PPP Point to Point Protocol (3) The LCP frame types. 80