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

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

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

Direct Link Networks. Nodes. Links. Outline Building Blocks Encoding

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

Links. CS125 - mylinks 1 1/22/14

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

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

ECE 4450:427/527 - Computer Networks Spring 2017

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

Introduction to Computer Networks. 03 Data Link Layer Introduction

CSE 123A Computer Networks

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

Some portions courtesy Robin Kravets and Steve Lumetta

CSCI-1680 Link Layer I Rodrigo Fonseca

CSCI-1680 Physical Layer Link Layer I Rodrigo Fonseca

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

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

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

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

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

Housekeeping. Fall /5 CptS/EE 555 1

CompSci 356: Computer Network Architectures Lecture 3: Hardware and physical links References: Chap 1.4, 1.5 of [PD] Xiaowei Yang

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

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

Data Communication & Computer Networks INFO

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

Computer and Network Security

Data Link Layer. Srinidhi Varadarajan

Data Link Layer Overview

Data Link Layer Overview

Data Link Layer Overview

Data Link Layer. Overview. Links. Shivkumar Kalyanaraman

Data Link Layer Overview

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

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

Data Link Layer (1) Networked Systems 3 Lecture 6

CS422 Computer Networks

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

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

Chapter 10 Error Detection and Correction 10.1

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

Data Link Layer. Indian Institute of Technology Madras

Ch. 7 Error Detection and Correction

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

CS 640 Lecture 4: 09/11/2014

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

Transmission SIGNALs

CS 4453 Computer Networks Winter

Lecture 3: Modulation & Layering"

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

Copyright 2010, Elsevier Inc. All rights Reserved

Computer Networking. Lecture 4 - Coding and Error Control

ITP 140 Mobile Applications Technologies. Networks

CSIS Frequency Division Multiplexing. Basic Types of Multiplexing. Frequency Division Multiplexing. Frequency Division Multiplexing.

CSCI 466 Midterm Networks Fall 2011

CSE 461: Framing, Error Detection and Correction

Data Link Layer: Overview, operations

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

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

CompSci 356: Computer Network Architectures Lecture 5: Reliable Transmission and Multi-access links Chapter 2.4, 2.5, 2.6

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

CS455: Introduction to Distributed Systems [Spring 2018] Dept. Of Computer Science, Colorado State University

Networking Link Layer

Where we are in the Course

CS/ECE 438: Communication Networks for Computers Spring 2018 Midterm Examination Online

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

5th Slide Set Computer Networks

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

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

2IC10 Computer Networks Assignments week 4

ITP 140 Mobile Applications Technologies. Networks

CHAPTER 2 Data Representation in Computer Systems

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

Integrated t Services Digital it Network (ISDN) Digital Subscriber Line (DSL) Cable modems Hybrid Fiber Coax (HFC)

CSCI-1680 Link Layer Reliability Rodrigo Fonseca

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

Multiplexing (Recap)

Chapter 2: Getting Connected

UNIT I FUNDAMENTALS & LINK LAYER

Link Layer (L2) Review

CHAPTER 2 Data Representation in Computer Systems

Twelfth Edition. Chapter 8: Wired and Wireless Communication. Copyright 2012 Pearson Education, Inc. Publishing as Prentice Hall 1

CS 455/555 Intro to Networks and Communications. Link Layer

CSCI-1680 Link Layer Reliability John Jannotti

The Link Layer and LANs. Chapter 6: Link layer and LANs

end systems, access networks, links circuit switching, packet switching, network structure

Chapter 5 Data-Link Layer: Wired Networks

Medium Access Control

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

Inst: Chris Davison

DATA LINK LAYER UNIT 7.

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

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

CSE 123: Computer Networks

DCN Questions CHAPTER 1:- NETWORKING FUNDAMENTALS

COMP/ELEC 429/556 Introduction to Computer Networks

Packet/Frame, Error Detection How to send data efficiently & reliably?

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

Lecture 5: Data Link Layer Basics

Lecture 6 Datalink Framing, Switching. From Signals to Packets

Transcription:

CompSci 356: Computer Network Architectures Lecture 4: Link layer: Encoding, Framing, and Error Detection Ref. Chap 2.2, 2.3,2.4 Xiaowei Yang xwy@cs.duke.edu

Overview Review: link/network performance metrics Bandwidth Latency / delay Bandwidth * delay product Throughput Today Types of physical links Link layer functions Encoding Framing Error detection

The simplest network is one link plus two nodes Hi Alice?

Recap: Put bits on the wire Each node (e.g. a PC) connects to a network via a network adaptor. The adaptor delivers data between a node s memory and the network. A device driver is the program running inside the node that manages the above task. At one end, a network adaptor encodes and modulates a bit into signals on a physical link. At the other end, a network adaptor reads the signals on a physical link and converts it back to a bit.

Metrics to describe a link Bandwidth Why are some links slow/fast? Latency/delay Transmission delay Store and forward Delay * bandwidth product Throughput How long does it take to send a file?

Commonly Used Physical Links Different links have different transmission ranges Signal attenuation Cables Connect computers in the same building Leased lines Lease a dedicated line to connect far-away nodes from telephone companies Wireless links Wifi, WiMax, Bluetooth, ZigBee, 4G, 5G

Cables CAT-5: twisted pair Coaxial: thick and thin Fiber Fiber Cable Ethernet 40GbE 10BASE2 cable, thin-net 200m 10Base4, thick-net 500m CAT-5

Leased lines Tx series speed: multiple of 64Kpbs Copper-based transmission DS-1 (T1): 1,544, 24*64kpbs DS-2 (T2): 6,312, 96*64kps DS-3 (T3): 44,736, 672*64kps OC-N series speed: multiple of OC-1 Optical fiber based transmission OC-1: 51.840 Mbps OC-3: 155.250 Mbps OC-12: 622.080 Mbps

Last mile links Wired links POTS: 28.8-56Kbps (Plain old telephone service) ISDN: 64-128Kbps (Integrated Services Digital Network) xdsl: 128Kbps-100Mbps (over telephone lines) Digital Subscriber Line CATV: 1-40Mpbs (shared, over TV cables) Wireless links Wifi, WiMax, Bluetooth, ZigBee, 4G, 5G Data rates: 4G (20Mbps), 5G (10Gbps)

xdsl wiring 1.5-8.4Mpbs Central Office 16-640Kpbs Subscriber premises Local loop Runs on existing copper 18,000 feet at 1.544Mbps 9,000 at 8.448 Mbps ADSL OC links 13-55Mpbs Central office Nbrhood optical Network unit Subscriber premises Must install VDSL transmission hardware 1000-4500 feet of copper VDSL (Very high)

Wireless links Wireless links transmit electromagnetic signals through space Used also by cellular networks, TV networks, satellite networks etc. Shared media Divided by frequency and space FCC determines who can use a spectrum in a geographic area, ie, licensing Auction is used to determine the allocation Expensive to become a cellular carrier Unlicensed spectrum WiFi, Bluetooth, Infrared

Sample link metrics Link type Typical Bandwidth Typical oneway latency Round-trip delay Dial-up 56 Kbps 10 km 87 us 5 bits RTT x Bandwidth Wireless LAN 54 Mbps 50 m 0.33 us 18 bits Satellite 45 Mbps 35,000 km 230 ms 10 Mb Cross-country fiber 10 Gbps 4,000 km 40 ms 400 Mb

Overview Review: link/network performance metrics Bandwidth / throughput Latency / delay Bandwidth * delay product Today Types of physical links Link layer functions Encoding Framing Error detection

Link-layer functions Most functions are completed by adapters Encoding Framing Error detection Reliable transmission (if have time)

Encoding Implemented in hardware High and low signals, ignore modulation Simplest one: 1 to high, 0 to low

1 to high, 0 to low Non-return to zero Not good for decoding Baseline wander Clock recovery

Solution 1: Nonreturn to zero inverted (NRZI) A transition from current signal encodes 1 No transition encodes 0 Does it solve all problems? Not for consecutive 0s NRZI

Solution 2: Manchester encoding Clock XOR NRZ 1: high à low; 0: low à high Drawback: doubles the rate at which signals are sent Baud rate: signal change rate Bit rate = half of baud rate. 50% efficient

Final solution: 4B/5B Key idea: insert extra bits to break up long sequences of 0s or 1s 4-bit of data are encoded in a 5-bit code word 16 data symbols, 32 code words At most one leading 0, two trailing 0s For every pair of codes, no more than three consecutive 0s 5-bit codes are sent using NRZI

4-bit data symbol 5-bit code 0000 11110 0001 01001 0010 10100 0011 10101 0100 01010 0101 01011 0110 01110 0111 01111 1000 10010 1001 10011 4-bit data symbol Exercise: 00101101 What s the high/low signal sequence? Efficiency? 5-bit code 1010 10110 1011 10111 1100 11010 1101 11011 1110 11100 1111 11101

Overview Link layer functions Encoding Framing Error detection

Framing Block of data Now we ve seen how to encode bitstreams But nodes send blocks of data (frames) A s memory à adaptor à adaptor à B s memory An adaptor must determine the boundary of frames

Variety of Framing Protocols Framing Why is it an important task of an adaptor? Frames may belong to different apps Need to decide when to deliver them to apps Design choices Byte-oriented protocols Sentinel approach Byte-counting approach BISYNC, PPP, DDCMP Bit-oriented protocols Clock-based framing

Byte-oriented protocols: the sentinel approach Transmitted from the leftmost bit Binary Synchronous Communication (BISYNC) by IBM in late 60s Frame: a collection of bytes (characters) SYN, ETX What if special characters appear in a data stream? Escape character: DLE Character stuffing

Point-to-Point Protocol (PPP) Internet dialup access RFC 1661, 1994 Flag: 01111110; Address & Control: default Protocol: de-multiplexing IP, Link Control Protocol,, Checksum: two or four bytes Link Control Protocol Set up and terminate the link Negotiate other parameters maximum receive unit

Byte-oriented protocols: the byte counting approach DDCMP by DECNET (Digital Data Communication Message Protocol) A byte count field The corruption of the count field The sentinel approach: Corrupted ETX

Bit-oriented protocols High-level data link control (HDLC) protocol Frame: a collection of bits Beginning/ending sequence: 01111110 Idle sequence: 01111110 or idle flags 11111111 Bit-stuffing for data Frames are of variable length

The bit-stuffing algorithm Bit-stuffing for data Sender: inserts a 0 after every five consecutive 1 s Receiver: after five consecutive 1 s, If the next bit is 0, removes it If the next bit is 1 If the next bit is 0 (i.e. the last 8 bits are 01111110), then frame ends Else error; discard frame, wait for next 01111110 to receive

An exercise Suppose a receiver receives the following bit sequence 011010111110101001111111011001111110 What s the resulting frame after removing stuffed bits? Indicate any error.

Clock-based Framing STS-1/OC-1 frame 51.840Mbps The slowest SONET link Synchronous Optical Network (SONET) Each frame is 125 us long, 810 bytes = 125 us * 51.84Mbps Clock synchronization special pattern repeated enough times

Synchronized timeslots as placeholder Real frame data may float inside

Overview Link layer functions Encoding Framing Error detection

Error detection Error detection code adds redundancy Analogy: sending two copies Parity Checksum CRC Error correcting code

Two-dimensional parity A sample frame of six bytes Even parity bit Make an even number of 1s in each row and column Detect all 1,2,3-bit errors, and most 4-bit errors

Internet checksum algorithm Basic idea (for efficiency) Add all the words transmitted and then send the sum. Receiver does the same computation and compares the sums IP checksum Adding 16-bit short integers using 1 s complement arithmetic Take 1 s complement of the result Used by lab 2 to detect errors

1 s complement arithmetic -x is each bit of x inverted If there is a carry bit, add 1 to the sum [-2^(n-1)-1, 2^(n-1)-1] Example: 4-bit integer -5 + -2 +5: 0101; -5: 1010; +2: 0010; -2: 1101; -5 + -2 = 1010+1101 = 0111 + one carrier bit; à1000 = -7

Calculating the Internet checksum u_short cksum (u_short *buf, int count) { register u_long sum = 0; } while (count--) { sum += *buf++; if (sum & 0xFFFF0000) { /* carry occurred. So wrap around */ sum &= 0xFFFF; sum++; } } // one s complement sum return ~(sum & 0xFFFF); // one s complement of the sum

Verifying the checksum Adds all 16-bit words together, including the checksum 0: correct 1: errors

Remarks Can detect 1 bit error Not all two-bits Efficient for software implementation

Cyclic Redundancy Check Cyclic error-correcting codes High-level idea: Represent an n+1-bit message with an n degree polynomial M(x) Divide the polynomial by a degree-k divisor polynomial C(x) k-bit CRC: remainder Send Message + CRC that is dividable by C(x)

Polynomial arithmetic modulo 2 B(x) can be divided by C(x) if B(x) has higher degree B(x) can be divided once by C(x) if of same degree x^3 + 1 can be divided by x^3 + x^2 + 1 The remainder would be 0*x^3 + 1*x^2 + 0*x^1 + 0*x^0 (obtained by XORing the coefficients of each term) Remainder of B(x)/C(x) = B(x) C(x) Substraction is done by XOR each pair of matching coefficients

CRC algorithm 1. Multiply M(x) by x^k. Add k zeros to Message. Call it T(x) 2. Divide T(x) by C(x) and find the remainder 3. Send P(x) = T(x) remainder Append remainder to T(x) P(x) dividable by C(x)

An example 8-bit msg 10011010 Divisor (3bit CRC) 1101 Msg sent: 11111001101

How to choose a divisor Arithmetic of a finite field Intuition: unlikely to be divided evenly by an error Corrupted msg is P(x) + E(x) If E(x) is single bit, then E(x) = x i If C(x) has the first and last term nonzero, then detects all single bit errors Find C(x) by looking it up in a book

Summary Link layer functions Encoding NRZ, NRZI, Manchester, 4B/5B Framing Byte-oriented, bit-oriented, time-based Bit stuffing Error detection Parity, checkshum, CRC