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

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

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

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

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

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

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

CSCI-1680 Link Layer I Rodrigo Fonseca

CSE 461: Framing, Error Detection and Correction

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

CSCI-1680 Link Layer Reliability Rodrigo Fonseca

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

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

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

CSCI-1680 Link Layer Reliability John Jannotti

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

Networking Link Layer

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

Reliable Transmission

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

Direct Link Communication I: Basic Techniques. Data Transmission. ignore carrier frequency, coding etc.

CSE 123: Computer Networks

Reliable Byte-Stream (TCP)

End-to-End Protocols. End-to-End Protocols

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

The Data Link Layer Chapter 3

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

Direct Link Communication I: Basic Techniques. Data Transmission. ignore carrier frequency, coding etc.

The Transport Layer Reliability

CSE 123A Computer Networks

CSE 123: Computer Networks

Administrivia. FEC vs. ARQ. Reliable Transmission FEC. Last time: Framing Error detection. FEC provides constant throughput and predictable delay

Transport Layer Marcos Vieira

Flow Control, and Congestion Control

Direct Link Networks (II)

DATA LINK LAYER UNIT 7.

Inst: Chris Davison

Some portions courtesy Robin Kravets and Steve Lumetta

Data Link Layer. Srinidhi Varadarajan

Where we are in the Course

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

Data Communication & Computer Networks INFO

The Data Link Layer Chapter 3

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

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

Links. CS125 - mylinks 1 1/22/14

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.

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

TCP. Sliding Windows, Flow Control, and Congestion Control. Networks : TCP Sliding Windows 1

UNIT I FUNDAMENTALS & LINK LAYER

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

Data Link Control Protocols

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

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

Flow Control, and Congestion Control

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

Solutions for Chapter similar to 1 and 3

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

Chapter 2: Getting Connected

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

Principles of Reliable Data Transfer

Data Link Layer (1) Networked Systems 3 Lecture 6

Lecture 5: Data Link Layer Basics

Computer and Network Security

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

CS422 Computer Networks

CSE123A discussion session

Link Layer: Error detection and correction

Chapter 11 Data Link Control 11.1

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

CS 43: Computer Networks. 16: Reliable Data Transfer October 8, 2018

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

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

NWEN 243. Networked Applications. Layer 4 TCP and UDP

CS254 Network Technologies. Lecture 2: Network Models & Error Detection and Correction. Dr Nikos Antonopoulos

Introduction to Computer Networks. 03 Data Link Layer Introduction

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

Chapter 11 Data Link Control 11.1

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

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

Reliable Transport I: Concepts and TCP Protocol

The GBN sender must respond to three types of events:

4. Error correction and link control. Contents

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

Reliable Data Transfer

Computer Networking : Principles, Protocols and Practice

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

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

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

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

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

Data Link Layer. Indian Institute of Technology Madras

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

CS457 Transport Protocols. CS 457 Fall 2014

Problem 7. Problem 8. Problem 9

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

Lecture 7: Flow Control"

3. Data Link Layer 3-2

Data Link Layer Overview

TCP : Fundamentals of Computer Networks Bill Nace

Computer Networking. Reliable Transport. Reliable Transport. Principles of reliable data transfer. Reliable data transfer. Elements of Procedure

Transcription:

Introduction to Computer Networks Lecture16 Role of data link layer Service offered by layer 1: a stream of bits Service to layer 3: sending & receiving frames To achieve this layer 2 does Framing Error detection (rarely error correction) Multiplexing Media access control Addressing (multiple access links) Today s lecture Framing Error detection Reliability through retransmission 1

Framing 1 sentinel approach Used by Point-to-Point-Protocol (PPP) Special characters for start and end of frame Use byte stuffing if they appear in body 8 8 8 16 16 8 Flag Address Control Protocol Payload Checksum Flag Framing 2 byte counting approach Used by DECNET s DDCMP Instead of end of frame character uses frame length field 8 8 8 14 42 16 Count Header Body CRC Framing 3 bit oriented s delimited by special bit patterns HDLC uses 01111110 If 011111 occurs in body, sender inserts 0 8 16 16 8 Beginning Header Body CRC Ending sequence sequence 2

Framing 4 clock based framing Used by protocols from the phone network Fixed size frames No escape codes Overhead Payload 9 rows 90 columns Today s lecture Framing Error detection Reliability through retransmission Error detection Typical errors important to protect against Random bits flipped Bursts of corrupted bits Aim of error detection schemes Catch most common errors No solution can catch all errors Strengths depends on algorithm and size increase Example: parity bit 3

Two dimensional parity Stronger than parity bit Catches 1,2,3 bit errors Catches most 4 bit errors 0101001 1 001 0 Easy to compute 1011110 1 Data 0001110 1 000 1 1011111 0 Parity bits Parity byte 111 0 Internet checksum Sum of 16 bit words in message When result exceeds 2 16 drop 17 th bit, add 1 Uses 1 s complement arithmetic Easy to compute in software (even in the 70s) Weaker error detection than CRC Cyclic redundancy check Generator Message is a polynomial Coefficients modulo 2 Values can be 0 or 1 +,- same as XOR Checksum is remainder of division msg. / generator 11111001 1000000 Message 1001 1000 1011 1100 1000 101 Remainder 4

CRC contd. Size of remainder depends on size of generator Error detection properties depend on generator Standards specify generator Easy to implement in hardware and software Message x 0 x 1 XOR gate x 2 Today s lecture Framing Error detection Reliability through retransmission Reliable transmission s/packets can be lost, corrupted Retransmit to ensure reliability (error correction) Most common at transport layer (layer 4) Done in some data link layers too (layer 2) How does sender know when to retransmit? Use acknowledgements and timeouts 5

Acknowledgements & s An acknowledgement () is a packet sent by one host in response to a packet it has received Making a packet an is simply a matter of changing a field in the transport header Data can be piggybacked in s A timeout is a signal that an to a packet that was sent has not yet been received within a specified time A timeout triggers a retransmission of the original packet from the sender How are timers set? Acknowledgements & s Time (a) (c) (b) (d) Finding the right length for timeout Propagation delay: delay between transmission and receipt of packets between hosts Propagation delay can be used to estimate timeout period How can propagation delay be measured? What else must be considered in the measurement? Harder for transport layer than for data link layer 6

Stop-and-Wait Process won t send next packet until sure receiver has last one The packet/ack sequence enables reliability and flow control Sequence numbers help avoid problem of duplicate packets Problem: keeping the pipe full Example 1.5Mbps link x 45ms RTT = 67.5Kb (8KB) 1KB frames implies 1/8th link utilization Solution: Pipeline via Sliding Window Allow multiple outstanding (un-ed) frames Upper bound on un-ed frames, called window (flow control) Time Buffering on and buffers data so that if data lost, it can resend buffers data so that if data is received out of order, it can be held until all packets are received How can we prevent the sender overflowing receiver s buffer (flow control)? tells sender its buffer size during connection setup How can we ensure reliability? Go-Back-N Send all N un-ed packets when a loss is signaled (inefficient) Selective retransmit Only send un-ed packets (a bit trickier to implement) 7

Assign sequence number to each frame (SeqNum) Maintain three state variables: send window size (SWS) last acknowledgment received (LAR) last frame sent (LFS) Maintain invariant: LFS- LAR <= SWS Sliding Window: LAR SWS LFS Advance LAR when arrives Buffer up to SWS frames Sliding Window: Maintain three state variables receive window size (RWS) largest frame acceptable (LFA) last frame received (LFR) Maintain invariant: LFA - LFR <= RWS LFR RWS SeqNum arrives: if LFR < SeqNum < = LFA then accept if SeqNum < = LFR or SeqNum > LFA then discard Send cumulative s send for largest frame such that all frames less than this have been received LFA Sequence Number Space SeqNum field is finite; sequence numbers wrap around Sequence number space must be larger than number of outstanding frames SWS <= MaxSeqNum-1 is not sufficient suppose 3-bit SeqNum field (0..7) SWS=RWS=7 sender transmit frames 0..6 which arrive, but s lost sender retransmits 0..6 receiver expecting 7, 0..5, but receives the original 0..5 SWS < (MaxSeqNum+1)/2 is correct rule Intuitively, SeqNum slides between two halves of sequence number space 8

0 Stop & wait sequence numbers 0 0 0 0 1 0 1 (c) (d) (e) Simple sequence numbers enable the receiver to discard duplicate copies of the same frame Stop & wait allows one outstanding frame, requires two distinct sequence numbers Another Pipelining Possibility: Concurrent Logical Channels Multiplex 8 logical channels over a single link Run stop- and- wait on each logical channel Maintain three state bits per channel channel busy current sequence number out next sequence number in Header: 3- bit channel num, 1- bit sequence num 4-bits total, same as sliding window protocol Separates reliability from order Sliding Window Summary Sliding window is best known algorithm in networking First role is to enable reliable delivery of packets s and acknowledgements Second role is to enable in order delivery of packets doesn t pass data up to next layer until it has packets in order Third role is to enable flow control Prevents server from overflowing receiver s buffer 9

Sliding Window Example 0 1 2 A3 3 4 5 6 A4 10