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

Similar documents
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

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

Point-to-Point Links. Outline Encoding Framing Error Detection Sliding Window Algorithm. Fall 2004 CS 691 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

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

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

CSCI-1680 Link Layer Reliability Rodrigo Fonseca

CSCI-1680 Link Layer Reliability John Jannotti

CSE 461: Framing, Error Detection and Correction

CSCI-1680 Link Layer I Rodrigo Fonseca

Networking Link Layer

Data Link Layer. Srinidhi Varadarajan

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

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

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

The Transport Layer Reliability

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

Direct Link Networks (II)

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

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

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

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

Reliable Transmission

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

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

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

CSE123A discussion session

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

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.

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

CSE 123: Computer Networks

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

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

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

DATA LINK LAYER UNIT 7.

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

Chapter 3. The Data Link Layer

Ch. 7 Error Detection and Correction

Data Link Control. Surasak Sanguanpong Last updated: 11 July 2000

CPE 548 Exam #1 (50 pts) February 17, 2016

Transport Layer Marcos Vieira

Principles of Reliable Data Transfer

CS321: Computer Networks Error Detection and Correction

UNIT I FUNDAMENTALS & LINK LAYER

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

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

CSE 123: Computer Networks

Data Link Layer: Overview, operations

Chapter 10 Error Detection and Correction 10.1

CS422 Computer Networks

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

Links. CS125 - mylinks 1 1/22/14

Flow Control, and Congestion Control

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

Inst: Chris Davison

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

Data Link Control Protocols

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

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

(Refer Slide Time: 2:20)

The Data Link Layer Chapter 3

Announcements Computer Networking. Outline. Transport Protocols. Transport introduction. Error recovery & flow control. Mid-semester grades

Chapter Six. Errors, Error Detection, and Error Control. Data Communications and Computer Networks: A Business User s Approach Seventh Edition

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

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

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

Chapter 2: Getting Connected

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

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

CPE 448/548 Exam #1 (100 pts) February 14, Name Class: 448

4. Error correction and link control. Contents

Copyright 2010, Elsevier Inc. All rights Reserved

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

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

Lecture 5: Data Link Layer Basics

Data Link Layer. Overview. Links. Shivkumar Kalyanaraman

Data Communication & Computer Networks INFO

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

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

CS 3640: Introduction to Networks and Their Applications

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

Data Link Layer (1) Networked Systems 3 Lecture 6

COMPUTER NETWORKS UNIT-3

Introduction to Computer Networks. 03 Data Link Layer Introduction

file:///c:/users/hpguo/dropbox/website/teaching/fall 2017/CS4470/H...

Computer and Network Security

Reliable Byte-Stream (TCP)

The Data Link Layer Chapter 3

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

Computer Networking : Principles, Protocols and Practice

Communications Software. CSE 123b. CSE 123b. Spring Lecture 3: Reliable Communications. Stefan Savage. Some slides couresty David Wetherall

ERROR AND FLOW CONTROL. Lecture: 10 Instructor Mazhar Hussain

The flow of data must not be allowed to overwhelm the receiver

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

CSE 123A Computer Networks

Flow Control, and Congestion Control

Good Ideas So Far Computer Networking. Outline. Sequence Numbers (reminder) TCP flow control. Congestion sources and collapse

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

Transcription:

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

Outline Chapter 2 - Getting Connected 2.1 Perspectives on Connecting 2.2 Encoding 2.3 Framing 2.4 Error Detection 2.5 Reliable Transmission 2.6 Ethernet 2.7 Wireless 2.8 Summary Thursday, September 8 CS 475 Networks - Lecture 5 2

Error Detection Bit errors in a frame will occur. How do we detect (and then recover) from them? We look at error detection first. We detect errors by adding redundant information. We could transmit duplicate frames. If the frames differ on reception, one (or both) frames contains an error. This is inefficient (and not that reliable). We will look at the two-dimensional parity, checksum, and cyclic redundancy check (CRC) error detection methods. Thursday, September 8 CS 475 Networks - Lecture 5 3

Two-Dimensional Parity Two-dimensional parity is often used with 7-bit codes (ASCII). It requires the addition of a parity byte (and 1 parity bit per word). Two-dimensional parity catches all 1, 2, and 3 bit errors (and most 4 bit errors). Fig 2.14: 2D Parity (Even Parity) Thursday, September 8 CS 475 Networks - Lecture 5 4

Two-Dimensional Parity PC serial port hardware can be configured to transmit and receive using 1-D parity. The settings must be identical on both ends of the link. Windows Serial Port Properties Window Thursday, September 8 CS 475 Networks - Lecture 5 5

Internet Checksum Algorithm Checksums are not used at the link layer, but are used at the higher layers in the TCP/IP stack. The checksum algorithm is easy to implement in software. In the Internet (TCP/IP) checksum algorithm, data is treated as 16-bit integers. The integers are added using ones complement arithmetic. The ones complement of the sum is sent as the checksum. Thursday, September 8 CS 475 Networks - Lecture 5 6

Internet Checksum Algorithm In ones complement addition any carry out of the most significant bit is added back in at the least significant position. Example: Compute the 8-bit check sum of 11000011, 10101010, 0111 using the Internet checksum algorithm. 11000011 10101010 0101 1 0110 0110 0111 11100101 A carry wrap around. Final sum. Checksum is 0000 The checksum is the ones complement (inverse) of the sum. Thursday, September 8 CS 475 Networks - Lecture 5 7

Internet Checksum Algorithm At the receiver all words are added (including the checksum) using ones complement arithmetic. If there are no errors the sum will be all 1s (11111111 in the previous example). The Internet checksum algorithm uses only a small number of extra bits (16 for a message of any size), but it is relatively weak. Experience has shown that the algorithm is sufficient as long as stronger error detection (CRC) is used at the link layer. Thursday, September 8 CS 475 Networks - Lecture 5 8

Cyclic Redundancy Check The CRC algorithm is based on polynomial division. The bits in the message are treated as coefficients of a polynomial. For example, the four bit message 1011 represents: M(x) = 1 x 3 + 0 x 2 + 1 x 1 + 1 = x 3 + x + 1 Note that most messages are thousands of bits long and would represent polynomials of high degree. Thursday, September 8 CS 475 Networks - Lecture 5 9

Cyclic Redundancy Check To calculate a CRC, the sender and receiver agree on a divisor polynomial, C(x) Standard divisor polynomials are known to give good results. (Ethernet uses CRC-32). CRC C(x) CRC-8 x 8 + x 2 + x + 1 CRC-10 x 10 + x 9 + x 5 + x 4 + x + 1 CRC-12 x 12 + x 11 + x 3 + x 2 + 1 CRC-16 x 16 + x 12 + 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 Thursday, September 8 CS 475 Networks - Lecture 5 10

Cyclic Redundancy Check To compute the k-bit CRC: 1)Multiply M(x) by x k (add k zeros at the end of the message). Call this message T(x). 2)Divide T(x) by C(x) and find the remainder. 3)Subtract the remainder from T(x). In performing the division, exclusive-or is used instead of subtraction. Polynomials of equal order can always be divided. The result is the original message followed by the remainder in step 2). Thursday, September 8 CS 475 Networks - Lecture 5 11

Cyclic Redundancy Check Consider computing the 3-bit CRC for the message M(x) = 1000 using C(x) =. )1000000 Message Thursday, September 8 CS 475 Networks - Lecture 5 12

Cyclic Redundancy Check 1 )1000000 Message 100 Thursday, September 8 CS 475 Networks - Lecture 5 13

Cyclic Redundancy Check 11 )1000000 Message 1001 100 Thursday, September 8 CS 475 Networks - Lecture 5 14

Cyclic Redundancy Check 111 )1000000 Message 1001 1000 101 Thursday, September 8 CS 475 Networks - Lecture 5 15

Cyclic Redundancy Check 1111 )1000000 Message 1001 1000 1011 110 Thursday, September 8 CS 475 Networks - Lecture 5 16

Cyclic Redundancy Check 11111 )1000000 Message 1001 1000 1011 1100 1 Thursday, September 8 CS 475 Networks - Lecture 5 17

Cyclic Redundancy Check The transmitted signal is 1000101. If this polynomial is divided by at the receiver, the remainder should be 0. If it is not, then an error has occurred. 11111001 )1000000 Message 1001 1000 1011 1100 1000 101 Remainder Thursday, September 8 CS 475 Networks - Lecture 5 18

Cyclic Redundancy Check Although the CRC calculation appears complex, it can be computed in hardware using a shift register and exclusive-or gates. Fig. 2.16: CRC calc. using a shift register Division by x 3 + x 2 + 1. Thursday, September 8 CS 475 Networks - Lecture 5 19

Reliable Transmission A link-level protocol that wants to deliver frames reliably must recover frames that have errors. This is usually done by using some combination of acknowledgments (ACKs) and timeouts. Recovery algorithms that use ACKs and timeouts are known as automatic repeat request (ARQ) algorithms. We will examine three such algorithms. Thursday, September 8 CS 475 Networks - Lecture 5 20

Stop-and-Wait The simplest ARQ scheme is the stop-and-wait algorithm. After transmitting one frame the sender waits for an acknowledgment before transmitting the next frame. If the ACK does not arrive after a certain interval, the sender retransmits the original frame. Thursday, September 8 CS 475 Networks - Lecture 5 21

Stop-and-Wait If there are no errors, the timeline is as shown at right. (If an error is detected in the received frame, the receiver does not return an ACK. It waits for the frame to be retransmitted.) Fig. 2.17: ACK received Thursday, September 8 CS 475 Networks - Lecture 5 22

Stop-and-Wait If a frame is lost, the sender automatically retransmits the frame after the timer has expired. Fig. 2.17: Lost frame Thursday, September 8 CS 475 Networks - Lecture 5 23

Stop-and-Wait If the ACK is lost, the sender automatically retransmits the frame after the timer has expired. The receiver can discard the duplicate frame, but must still send an ACK. Fig. 2.17: Lost ACK Thursday, September 8 CS 475 Networks - Lecture 5 24

Stop-and-Wait If the ACK is delayed, the sender automatically retransmits the frame after the timer has expired. The receiver can discard the duplicate frame, but must still send an ACK. Fig. 2.17: Slow ACK Thursday, September 8 CS 475 Networks - Lecture 5 25

Stop-and-Wait To simplify detection of duplicate frames, the frame header includes a bit that alternates between 0 and 1. If two consecutive 0 (or 1) frames are received, the receiver knows that the second frame is a duplicate. Fig. 2.18: Stop and wait with 1-bit sequence number. Thursday, September 8 CS 475 Networks - Lecture 5 26

Stop-and-Wait The main problem with the stop-and-wait algorithm is that it does not use the link to its full capacity. A 1.5 Mbps link with a 45 ms RTT has a delay x BW product of 67.5 kb (8 kb). Assuming a 1 kb frame, stop-and-wait would only allow a throughput of 1 kb x 8 b/b / 45 ms = 182 kbps This is only 1/8 of the link BW! Thursday, September 8 CS 475 Networks - Lecture 5 27

Sliding Window To fully utilize the available BW we allow the sender to transmit multiple frames in sequence. Fig. 2.19: Sliding Window Timeline On the 1.5 Mbps link from the previous slide we want the sender to transmit 8 frames and be ready to send the 9 th as soon as the ACK for the first frame is received. Thursday, September 8 CS 475 Networks - Lecture 5 28

Sliding Window The sender assigns a sequence number, SeqNum, to each frame. The sender has to maintain three variables related to the sliding window algorithm: SWS, the send window size, LAR, the seq. num. of the last acknowledgment received, LFS, the seq. num. of the last frame sent Thursday, September 8 CS 475 Networks - Lecture 5 29

Sliding Window A new frame is sent (and LFS incremented) only if: LFS LAR SWS Fig. 2.20: Sliding window on the sender. Thursday, September 8 CS 475 Networks - Lecture 5 30

Sliding Window The receiver maintains the following three variables: RWS, the receive window size, LAF, the sequence number of the largest acceptable frame, LFR, the seq. num. of the last frame received Thursday, September 8 CS 475 Networks - Lecture 5 31

Sliding Window The receiver maintains the following invariant: LAF LFR RWS Fig. 2.21: Sliding window on the receiver. Thursday, September 8 CS 475 Networks - Lecture 5 32

Sliding Window If the SeqNum of a received frame satisfies LFR < SeqNum LAF, the frame is accepted. If all frames with seq. numbers less than SeqNum have been ACKed then this frame is ACKed, LFR is set to SeqNum and LAF is set to LFR + RWS. When frames are received out of order the details are a bit more complicated. See the text for details. Thursday, September 8 CS 475 Networks - Lecture 5 33

Concurrent Logical Channels ARPANET used a variation of stop-and-wait while still keeping the pipe full. It worked by using multiple logical channels and running stop-andwait on each channel. The header of each frame contained a 1-bit sequence number and the number of the logical channel. Thursday, September 8 CS 475 Networks - Lecture 5 34

In-class Exericses If time allows, start work on the homework problems. Thursday, September 8 CS 475 Networks - Lecture 5 35