Protocol Principles. Framing, FCS and ARQ 2005/03/11. (C) Herbert Haas

Similar documents
Agenda. Protocol Principles

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

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

Institute of Computer Technology - Vienna University of Technology. L02 - Protocol Principles

3. Data Link Layer 3-2

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

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

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

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

Inst: Chris Davison

Chapter 3. The Data Link Layer

CSE 123: Computer Networks

CSCI-1680 Link Layer I Rodrigo Fonseca

Telematics. 5th Tutorial - LLC vs. MAC, HDLC, Flow Control, E2E-Arguments

Data Link Layer: Overview, operations

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

CSE 461: Framing, Error Detection and Correction

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

Flow control: Ensuring the source sending frames does not overflow the receiver

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

Telematics. 5rd Tutorial - LLC vs. MAC, HDLC, Flow Control, E2E-Arguments

Data Link Layer (1) Networked Systems 3 Lecture 6

Lecture 5: Flow Control. CSE 123: Computer Networks Alex C. Snoeren

Data Link Control Protocols

DATA LINK LAYER UNIT 7.

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

CS 4453 Computer Networks Winter

Networking Link Layer

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

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.

CSE 123: Computer Networks Alex C. Snoeren. HW 1 due NOW!

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

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

INTERNET ARCHITECTURE & PROTOCOLS

William Stallings Data and Computer Communications. Chapter 7 Data Link Control

The Data Link Layer Chapter 3

Chapter 11 Data Link Control 11.1

Links. CS125 - mylinks 1 1/22/14

CS422 Computer Networks

Line Protocols. Protocol Principles. Two Important Principles for Data Communication. Agenda

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

Lecture 7: Sliding Windows. CSE 123: Computer Networks Geoff Voelker (guest lecture)

I. INTRODUCTION. each station (i.e., computer, telephone, etc.) directly connected to all other stations

8. TCP Congestion Control

Lecture 7: Flow Control"

UNIT IV -- TRANSPORT LAYER

Outline. CS5984 Mobile Computing

Data Link Layer. Overview. Links. Shivkumar Kalyanaraman

Data Link Layer (cont.) ( h h h ) (Sicherungsschicht) HDLC - 1.

(Sicherungsschicht) Chapter 5 (part 2) [Wa0001] HDLC - 1.

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

Lecture 7: Flow & Media Access Control"

Data Link Control Protocols

No book chapter for this topic! Slides are posted online as usual Homework: Will be posted online Due 12/6

Announcements. No book chapter for this topic! Slides are posted online as usual Homework: Will be posted online Due 12/6

CS457 Transport Protocols. CS 457 Fall 2014

5th Slide Set Computer Networks

User Datagram Protocol (UDP):

Comparison of ISO-OSI and TCP/IP Suit. Functions of Data Link Layer:

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

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

NWEN 243. Networked Applications. Layer 4 TCP and UDP

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


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

Chapter 7: Data Link Control. CS420/520 Axel Krings Page 1

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

Chapter 7: Data Link Control. Data Link Control Protocols

Data Link Layer. Learning Objectives. Position of the data-link layer. MCA 207, Data Communication & Networking

HDLC. King of the Link 2005/03/11. (C) Herbert Haas

CSCI-1680 Link Layer Reliability John Jannotti

Transport Protocols Reading: Sections 2.5, 5.1, and 5.2

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

TCP Strategies. Keepalive Timer. implementations do not have it as it is occasionally regarded as controversial. between source and destination

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

Solutions for Chapter similar to 1 and 3

The Data Link Layer Chapter 3

Transport Protocols Reading: Sections 2.5, 5.1, and 5.2. Goals for Todayʼs Lecture. Role of Transport Layer

Introduction to Computer Networks. 03 Data Link Layer Introduction

Fast Retransmit. Problem: coarsegrain. timeouts lead to idle periods Fast retransmit: use duplicate ACKs to trigger retransmission

Chapter 11 Data Link Control 11.1

Physical and Data Link layers

16.682: Communication Systems Engineering. Lecture 17. ARQ Protocols

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

Your favorite blog : (popularly known as VIJAY JOTANI S BLOG..now in facebook.join ON FB VIJAY

STEVEN R. BAGLEY PACKETS

EECS 122, Lecture 19. Reliable Delivery. An Example. Improving over Stop & Wait. Picture of Go-back-n/Sliding Window. Send Window Maintenance

CSCI-1680 Link Layer Reliability Rodrigo Fonseca

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

1/29/2008. From Signals to Packets. Lecture 6 Datalink Framing, Switching. Datalink Functions. Datalink Lectures. Character and Bit Stuffing.

CRC. Implementation. Error control. Software schemes. Packet errors. Types of packet errors

Data Link Layer. Goals of This Lecture. Engineering Questions. Outline of the Class

Reliable Transmission

INF Data Communication Data Link Layer

ECE697AA Lecture 3. Today s lecture

Lecture 3: The Transport Layer: UDP and TCP

Chapter 11 Data Link Control 11.1

Data and Computer Communications

Code No: RR Set No. 1

TCP and Congestion Control (Day 1) Yoshifumi Nishida Sony Computer Science Labs, Inc. Today's Lecture

Transcription:

Protocol Principles Framing, FCS and ARQ (C) Herbert Haas 2005/03/11

Link Layer Tasks Framing Frame Protection Optional Addressing Optional Error Recovery Connection-oriented or connectionless mode Optional Flow Control 2

Building a Frame Consists of Data Metadata (Header or "Overhead") Requires synchronous physical transmission (PLL) Arbitrary frame lengths Preamble SD Control DATA FCS ED 3

Preamble Enables PLL synchronization Typically a 0101010...-pattern Example: 8 Byte preamble in Ethernet frames Note: Only necessary when sender- and receiver-clock are not synchronized between frames Asynchronous physical layer Preamble SD Control DATA FCS ED 4

Frame Synchronization Beginning and ending of a frame is indicated by SD and ED symbols bit-patterns or code-violations lenght-field can replace ED (802.3) Idle-line can replace ED (Ethernet) Also called "Framing" Preamble SD Control DATA FCS ED Starting Delimiter Ending Delimiter 5

Protocol Transparence What, if delimiter symbols occur within frame? Solution: Byte-Stuffing Bit-Stuffing!! Preamble SD Control ED DATA SD FCS ED 6

Byte Stuffing Some character-oriented protocols divide data stream into frames Old technique, not so important today Data Link Escape (DLE) character indicates special meaning of next character Data to send: A B C DLE E F G ETX H I STX H DLE STX A B C DLE DLE E F G ETX H I STX H DLE ETX 7

Bit Stuffing Used in bit-oriented protocols Used by most protocols Bits represent smallest transmission unit HDLC-like framing: 01111110-pattern Rule: Trasceiver-HW inserts a zero after five ones Receiver rejects each zero after five ones Data to send: 010011111000111111100101100110 01111110 01001111100001111101100101100110 01111110 8

Code Violations Manchester Differential Manchester AMI 9

Frame Protection A frame check sequence (FCS) protects the integrity of our frame From Sunspots, Mobile-Phones, Noise, Heisenberg and others FCS is calculated upon data bits Different methods based on mathematical efforts: Parity, Checksum, CRC Receiver compares its own calculation with FCS Preamble SD Control DATA FCS ED Protected 10

FCS Methods Parity Even (100111011) or odd (100111010) parity bits Examples: Asynchronous charactertransmission and memory protection Checksum Sum without carries (XOR operation) Many variations and improvements Examples: TCP and IP Checksums 11

Checksum Example: ISBN 100% Protection against Single incorrect digits Permutation of two digits Method: 10 digits, 9 data + 1 checksum Each digit weighted with factors 1-9 Checksum = Sum modulo 11 If checksum=10 then use "X" ISBN 0-13-086388-2 0*1+1*2+3*3+0*4+8*5+6*6+3*7+8*8+8*9 = 244 244 modulo 11 = 2 12

Cyclic Redundancy Check CRC is one of the strongest methods Bases on polynomial-codes Several standardized generatorpolynomials CRC-16: x 16 +x 15 +x 2 +1 CRC-CCITT: x 16 +x 12 +x 5 +1 13

Forward Error Correction Required for "extreme" conditions High BER, EMR Long delays, space-links Introduces much redundancy Example: Reed-Solomon codes, Hamming-codes 0 1 0 1 0 0 1 0 1 0 1 1 1 0 1 1 1 0 0 1 0 1 0 0 1 0 1 0 0 1 0 0 1 1 0 0 0 1 1 0 1 1 0 0 0 1 1 0 0 0 14

Control Field Contains protocol information Addressing Sequence numbers Acknowledgement Flag Frame Type SAP or Payload Type Signalling information 15

Connection-Oriented Protocols Different definitions Some say "protocols without addressing information" and think of circuit-switched technologies Some say "protocols that do error recovery" Correct: "protocols that require a connection establishment before sending data and a disconnection procedure when finished" 16

CO-Protocol Procedures (1) Station A Connection Request Station B Connection Established DATA Disconnection Request Disconnected time time 17

CO-Protocol Procedures (2).... (Connection already established) Keepalive Keepalive ACK Other synonyms: "Hello" or "Receiver Ready".... time time 18

CO-Issues Establishment delay Traffic desriptor during establishment (QoS) Additional frame types necessary Connection establishment Disconnect Keepalive ARQ possible (Error Recovery) 19

Automatic Repeat Request ARQ protocols guarantee correct delivery of data Receiver sends acknowledgements Acknowledgements refer to sequence numbers Missing data is repeated When do we need this? For most data traffic (FTP, HTTP,...) Not for real-time traffic (VoIP) 20

ARQ Variants Idle-RQ Continuous-RQ Selective ACK Positive ACK GoBackN SREJ 21

Idle-RQ Sender Receiver Data Ack Data Ack Data Ack Data Ack 22

Without Sequence Numbers: Sender Receiver Data "ABCD" Ack ABCD No Ack? Retransmission! Data "ABCD" Ack Data "EFGH" Ack ABCD ABCD ABCD ABCD EFGH 23

With Sequence Numbers: Sender Receiver Data "ABCD" S=0 Ack=0 ABCD No Ack? Retransmission! Data "ABCD" S=0 Ack=0 Data "EFGH" S=1 Ack=1 ABCD ABCD EFGH 24

Slow! Vienna Tokyo Data "Stop and Wait": Data is traveling round the earth while sender waits for the acknowledgement. Ack In the meantime no data can be sent!! Data 25

Empty Pipe! Vienna t = 0 s 1 KB Data Tokyo 1.5 Mbit/s This pipe allows 1.5 Mbit/s 350 ms = 525,000 bit 64 KB of data. t = 350 ms Ack But stop-and-wait only allows one frame to be outstanding!!! Assume MTU=1 KByte, then the max rate is (1024 8) bit / 0.35 s 23 Kbit/s 26

Idle-RQ Facts Old and slow method But small code and only little resources necessary At least two sequence numbers necessary To distinguish new from old data Half duplex protocol Example: TFTP 27

Continuous RQ Data Idle-RQ Data Continuous-RQ Ack Data Acks Data and Acks are sent continuously!! Ack Data Ack Data Ack 28

Full Pipe! Vienna t = 0 s 1 KB Data Tokyo 1.5 Mbit/s Ack t = 350 ms This situation corresponds with a sliding window 29

Need For Retransmission Buffer Vienna 0 Tokyo 0 1 Data S=0 0 1 2 Data S=1 0 1 2 3 Timeouts!!! 0 1 2 3 0 1 2 3 Data S=2 Data S=3 Data S=0 Four packets are sent, but due to a network failure none of them arrive (or equivalently they do arrive but the Acks are lost) 0 1 2 3 0 1 2 3 Data S=1.... Ack Ack Retransmissions 0 1 0 30

Continuous-RQ Resources Continuous-RQ requires dramatically more resources than Idle-RQ or connectionless protocols!!! Retransmission Timers Retransmission Buffers Receive Buffers (to maintain sequence) Might result in high CPU loads!!! Reason for DoS Attacks 31

Selective Acknowledgements Vienna Tokyo 0 Data S=0 0 1 Data S=1 Ack=0 0 1 2 Data S=2 1 2 3 Data S=3 Ack=2 2 0 1 3 Ack=3 3 2 0 1 1 Data S=1 Timeout for S=1 1 st retransmission Ack=1 1 3 2 0 Reordering necessary 32

SACK: Duplicates Vienna Tokyo 0 Data S=0 0 1 Data S=1 Ack=0 0 1 2 Data S=2 Ack=1 1 1 2 3 Data S=3 Ack=2 2 1 0 1 3 Ack=3 3 2 1 0 1 1 Data S=1 Timeout for S=1 1 st retransmission Ack=1 3 2 1 0 Duplicate!!! 33

SACK Application: New option for TCP to accomodate to long fat pipes with high BER Optionally, retransmissions might be sent immediately when unexpected (the next but one) ACK occurs Opposite idea: Cumulative ACK 34

GoBack N Vienna Tokyo 0 Data S=0 0 1 Data S=1 Ack=1 0 1 2 Data S=2 0 1 2 3 1 2 3 1 2 3 2 3 Data S=3 Data S=1 Data S=2 Data S=3 NACK = 1 Ack=2 Ack=4 0 0 1 0 2 1 0 3 2 1 0 Sequence maintained! 35

GoBack N Facts Maintains order at receiver-buffer Reordering was too much timeconsuming in earlier days Still used by HDLC and clones ("REJECT") TCP Variant known as "fast retransmit" Uses duplicate acks as NACK 36

Selective Reject ARQ Modern modification of GoBack N Only those frames are retransmitted that receive a NACK Or those that time out Receiver must be able to reorder frames Application: Optional for modern HDLC clones 37

Positive Ack Vienna Tokyo 0 Data S=0 0 1 Data S=1 Ack=1 0 1 2 Data S=2 0 1 2 3 Data S=3 2 0 3 2 0 Timeout S=1 1 2 3 Data S=1 Ack=4 1 3 2 0 Cummulative Ack 38

Positive Ack Facts Always together with cumulative acks Any frame received is buffered Receiver must be able to reorder Problem: Only timeouts trigger retransmission Application: Early TCP 39

Windowing As shown, sender must buffer unacknowledged frames in case for retransmissions Necessary sender-buffer size is called "window" Window size depends on Bandwidth of channel Round-Trip-Time (RTT) 40

Remember: Full Pipe! Vienna t = 0 s 1 KB Data Tokyo 1.5 Mbit/s Ack t = 350 ms This situation corresponds with a sliding window 41

Sliding Window Basics (1) Frames to be sent Frames on flight Window 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 Ack = 3 Frames to be sent Window 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 Frames to be sent Window Already sent and acknowledged Ack = 7 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 42

Sliding Window Basics (2) Window Size in Bytes = BW RTT If smaller: jumping window Extreme case: Idle-RQ for W=1 How many Identifiers? At least W+1 If all W frames must be retransmitted, receiver must distinguish from new data W < (MaxSeqNum+1) /2 To avoid troubles on wrap around 43

Jumping Window Vienna Tokyo 44

Jumping Window Vienna Tokyo 45

Flow Control Too large window sizes Might require too much retransmissions (especially with GoBackN) Result in network congestion (imagine thousands of users) Receiver buffer overflow Flow control #1: Adaptive Windowing Flow control #2: Stop and Go 46

Flow Control Adaptive Windowing The reciever adjusts the sender's window size (sent together with ack) TCP's approach Stop and Go Dedicated flow control frames HDLC's approach (RR and RNR) Ethernet's approach (Pause-Frame) 47

Medium Access In case of shared media Collisions possible Who may send? Basic Techniques Aloha (Ethernet Principle "CSMA/CD") Token (Token Ring, FDDI, Token Bus) Polling (IEEE 802.12) Time Slices (GSM) Will be discussed later together with these related technologies 48

Summary Most link layer protocols utilize CRC for frame protection ARQ Techniques: Idle-RQ, GoBackN, Selective-Ack, Positive-Ack Additionally Cumulative-Ack possible Only Continuous-RQ fills pipe Flow control Either by controlling window size Or deciated stop and go messages 49

If a packet hits a pocket on a socket on a port, And the bus is interrupted as a very last resort, And the address of the memory makes your floppy disk abort, Then the socket packet pocket has an error to report! If your cursor finds a menu item followed by a dash, And the double-clicking icon puts your window in the trash, And your data is corrupted 'cause the index doesn't hash, then your situation's hopeless, and your system's gonna crash! If the label on the cable on the table at your house, Says the network is connected to the button on your mouse, But your packets want to tunnel on another protocol, That's repeatedly rejected by the printer down the hall, And your screen is all distorted by the side effects of gauss, So your icons in the window are as wavy as a souse, When the copy of your floppy's getting sloppy on the disk, And the microcode instructions cause unnecessary risc, Then you have to flash your memory and you'll want to ram your rom. Quickly turn off the computer and be sure to tell your mom!

Quiz What's the problem when putting IPpackets directly onto ISDN? What are Hamming-Codes? What maximum bit-rate can TCPhosts utilize when connected via satellite? Explain why windowing protocols are more prone to DoS-attacks 51