CS352- Link Layer Dept. of Computer Science Rutgers University.

Slides:



Advertisements
Similar presentations
Noise, Information Theory, and Entropy (cont.) CS414 – Spring 2007 By Karrie Karahalios, Roger Cheng, Brian Bailey.
Advertisements

Introduction to Information Technologies
Lecture 15 Link Layer Protocols. Lecture 15-2 Link Layer Services r Framing and link access: encapsulate datagram into frame adding header and trailer,
Transmission Errors Error Detection and Correction
Chapter 12 Multiple Access Figure 12.1 Data link layer divided into two functionality-oriented sublayers Figure 12.2 Taxonomy of multiple-access protocols.
EEC-484/584 Computer Networks Lecture 7 Wenbing Zhao
PART III DATA LINK LAYER. Position of the Data-Link Layer.
15 – Data link layer Chapter 5: The Data Link Layer Our goals: r understand principles behind data link layer services: m error detection, correction.
CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 12 Introduction to Computer Networks.
11/11/ /13/2003 DLL, Error Detection, MAC, ARP November 11-13, 2003.
1 K. Salah Module 4.0: Data Link Layer The Logical Link Control (LLC) sublayer –Framing –Flow Control –Error Control The Media Access Control (MAC) sublayer.
EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao
EEC-484/584 Computer Networks Lecture 7 Wenbing Zhao
5: DataLink Layer5-1 Link Layer – Error Detection/Correction and MAC.
7/2/2015Errors1 Transmission errors are a way of life. In the digital world an error means that a bit value is flipped. An error can be isolated to a single.
Error Detection and Correction
EEC-484/584 Computer Networks Lecture 7 Wenbing Zhao
Transmission Errors Error Detection and Correction
Chi-Cheng Lin, Winona State University CS412 Introduction to Computer Networking & Telecommunication Medium Access Control Sublayer.
4-1 Last time □ Link layer overview ♦ Services ♦ Adapters □ Error detection and correction ♦ Parity check ♦ Internet checksum ♦ CRC □ PPP ♦ Byte stuffing.
Chapter 12 Multiple Access Figure 12.1 Data link layer divided into two functionality-oriented sublayers Figure 12.2 Taxonomy of multiple-access protocols.
© Janice Regan, CMPT 128, CMPT 371 Data Communications and Networking LANs 2: MAC protocols.
جلسه دهم شبکه های کامپیوتری به نــــــــــــام خدا.
Network Layer4-1 Lower limit on the number of check bits r We want to design a code m with m message bits and r check bits Allowing all single errors to.
5: DataLink Layer5a-1 13: Link Layer, Multiple Access Protocols Last Modified: 10/14/2015 3:28:03 PM.
1 Data Link Layer Lecture 20 Imran Ahmed University of Management & Technology.
PART III DATA LINK LAYER. Position of the Data-Link Layer.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Data Link Layer PART III.
Part 2: Packet Transmission Packets, frames Local area networks (LANs) Wide area networks (LANs) Hardware addresses Bridges and switches Routing and protocols.
ICOM 6115©Manuel Rodriguez-Martinez ICOM 6115 – Computer Networks and the WWW Manuel Rodriguez-Martinez, Ph.D. Lecture 14.
COSC 3213: Computer Networks I Instructor: Dr. Amir Asif Department of Computer Science York University Section M Topics: 1. Error Detection Techniques:
CS3505: DATA LINK LAYER. data link layer  phys. layer subject to errors; not reliable; and only moves information as bits, which alone are not meaningful.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Data Link Layer PART III.
10/27/ Data Link Layer - Lin 1 CPET/ECET Data Link Layer Data Communications and Networking Fall 2004 Professor Paul I-Hai Lin Electrical.
5: DataLink Layer5-1 Error Detection EDC= Error Detection and Correction bits (redundancy) D = Data protected by error checking, may include header fields.
5: DataLink Layer5a-1 Chapter 5: The Data Link Layer Our goals: r understand principles behind data link layer services: m error detection, correction.
4: DataLink Layer1 Multiple Access Links and Protocols Three types of “links”: r point-to-point (single wire, e.g. PPP, SLIP) r broadcast (shared wire.
Data Communications, Kwangwoon University12-1 Chapter 12. Multiple Access 1.Random Access 2.Controlled Access 3.Channelization.
5: DataLink Layer5-1 Link Layer r 5.1 Introduction and services r 5.2 Error detection and correction r 5.3Multiple access protocols r 5.4 Link-Layer Addressing.
1 Week 5 Lecture 3 Data Link Layer. 2 Data Link Layer location application: supporting network applications –FTP, SMTP, STTP transport: host-host data.
11/25/20151 EEC-484 Computer Networks Lecture 12 Wenbing Zhao Cleveland State University
Overview All data can be corrupted, for reliable communications we must be able to detect and correct errors implemented at the data link and transport.
5: DataLink Layer 5a-1 Multiple Access protocol. 5: DataLink Layer 5a-2 Multiple Access Links and Protocols Three types of “links”: r point-to-point (single.
Computer Communication & Networks Lecture 9 Datalink Layer: Error Detection Waleed Ejaz
1 © Unitec New Zealand CRC calculation and Hammings code.
Error Detection.
10.1 Chapter 10 Error Detection and Correction Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
5: DataLink Layer5a-1 Chapter 5: The Data Link Layer Our goals: r understand principles behind data link layer services: m error detection, correction.
10.1 Chapter 10 Error Detection and Correction Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Network Layer4-1 Chapter 5: The Data Link Layer Our goals: r understand principles behind data link layer services: m error detection, correction m sharing.
5: DataLink Layer5-1 Chapter 5 Link Layer and LANs Computer Networking: A Top Down Approach Featuring the Internet, 3 rd edition. Jim Kurose, Keith Ross.
THE MEDIUM ACCESS CONTROL SUBLAYER 4.1 THE CHANNEL ALLOCATION PROBLEM 4.2 MULTIPLE ACCESS PROTOCOLS.
Chapter 5 Link Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 A note on the use of these.
The Data Link Layer.
Packetizing Error Detection
Introduction to Information Technologies
CIS 321 Data Communications & Networking
Computer Communication Networks
Multiple Access Mahesh Jangid Assistant Professor JVW University.
Channel Allocation (MAC)
Part III Datalink Layer 10.
Multiple Access Methods
Introduction to Information Technologies
Chapter 13 Multiple Access
Link Layer and LANs Not everyone is meant to make a difference. But for me, the choice to lead an ordinary life is no longer an option 5: DataLink Layer.
Error Detection Neil Tang 9/26/2008
Chapter 13 Multiple Access
Lecture 5- Data Link Layer
Error Detection and Correction
Presentation transcript:

CS352- Link Layer Dept. of Computer Science Rutgers University

CS352 Fall,20052 Content Error detection and correction MAC sub-layer Ethernet Token Ring

Error Detection and Correction

CS352 Fall,20054 Error Detection and Correction Used on many link types Can be used anytime you don’t trust the media Caches,memories, disks Major Algorithmic Strategies: Parity 1 and 2 dimensional Hamming codes (Interleaved Parity Codes) Checksums Cyclic Redundancy Codes (CRC)

CS352 Fall,20055 Parity Codes Single Bit Parity: Detect single bit errors Two Dimensional Bit Parity: Detect and correct single bit errors 0 0

CS352 Fall,20056 Hamming Codes Want to be able to correct error with less overhead than 2D parity Hamming codes correct all single bit errors with only log(M) extra bits and detect double bit errors Uses an interleaved parity scheme

CS352 Fall,20057 Calculating a Hamming Code Procedure: Place message bits in their non-power-of-two Hamming positions Build a table listing the binary representation each each of the message bit positions Calculate the check bits

CS352 Fall,20058 Hamming Code Example Message to be sent: n : check bits Position

CS352 Fall,20059 Hamming Code Example Calculate check bits: 3 = = = = = = = = Message to be sent: n : check bits Position

CS352 Fall, Starting with the 2 0 position: Look at positions with 1’s in them Count the number of 1’s in the corresponding message bits If even, place a 1 in the 2 0 check bit, i.e., use odd parity Otherwise, place a 0 Calculate check bits: 3 = = = = = = = = Message to be sent: n : check bits Position Hamming Code Example

CS352 Fall, Repeat with the 2 1 position: Look at positions those positions with 1’s in them Count the number of 1’s in the corresponding message bits If even, place a 1 in the 2 1 check bit Otherwise, place a 0 10 Calculate check bits: 3 = = = = = = = = Message to be sent: n : check bits Position Hamming Code Example

CS352 Fall, Repeat with the 2 2 position: Look at positions those positions with 1’s in them Count the number of 1’s in the corresponding message bits If even, place a 1 in the 2 2 check bit Otherwise, place a 0 1 Calculate check bits: 3 = = = = = = = = Message to be sent: n : check bits Position Hamming Code Example

CS352 Fall, Hamming Code Example Original message = 1011 Sent message = Now, how do we check for a single-bit error in the sent message using the Hamming code?

CS352 Fall, Using Hamming Codes to Correct Single-Bit Errors Received message: n : check bits Calculate check bits: 3 = = = = = = = = Position

CS352 Fall, Starting with the 2 0 position: Look at positions with 1’s in them Count the number of 1’s in both the corresponding message bits and the 2 0 check bit and compute the parity. If even parity, there is an error in one of the four bits that were checked. Odd parity: No error in bits 1, 3, 5, 7 Received message: n : check bits Calculate check bits: 3 = = = = = = = = Position Using Hamming Codes to Correct Single-Bit Errors

CS352 Fall, Repeat with the 2 1 position: Look at positions with 1’s in them Count the number of 1’s in both the corresponding message bits and the 2 1 check bit and compute the parity. If even parity, there is an error in one of the four bits that were checked. Even parity: ERROR in bit 2, 3, 6 or 7! Received message: n : check bits Calculate check bits: 3 = = = = = = = = Position Using Hamming Codes to Correct Single-Bit Errors

CS352 Fall, Repeat with the 2 2 position: Look at positions with 1’s in them Count the number of 1’s in both the corresponding message bits and the 2 2 check bit and compute the parity. If even parity, there is an error in one of the four bits that were checked. Even parity: ERROR in bit 4, 5, 6 or 7! Received message: n : check bits Calculate check bits: 3 = = = = = = = = Position Using Hamming Codes to Correct Single-Bit Errors

CS352 Fall, Position Finding the error’s location

CS352 Fall, No error in bits 1, 3, 5, Position Finding the error’s location

CS352 Fall, ERROR in bit 2, 3, 6 or 7 ERROR in bit 4, 5, 6 or 7 Error must be in bit 6 because bits 3, 5, 7 are correct, and all the remaining information agrees on bit 6 erroneous bit, change to Position Finding the error’s location

CS352 Fall, Finding the error’s location An Easier Alternative to the Last Slide 3 = = = = = = = = EENE 110 = 6 E = error in column NE = no error in column

CS352 Fall, Hamming Codes Hamming codes can be used to locate and correct a single-bit error If more than one bit is in error, then a Hamming code cannot correct it Hamming codes, like parity bits, are only useful on short messages

CS352 Fall, CRC Polynomial Codes Can detect errors on large chunks of data Has low overhead More robust than parity bit Requires the use of a “code polynomial” Example: x 2 + 1

CS352 Fall, Cyclic Redundancy Check Procedure: 1. Let r be the degree of the code polynomial. Append r zero bits to the end of the transmitted bit string. Call the entire bit string S(x) 2. Divide S(x) by the code polynomial using modulo 2 division. 3. Subtract the remainder from S(x) using modulo 2 subtraction. The result is the checksummed message

CS352 Fall, Generating a CRC Example Message: x x x x x x + 1 = x 3 + x + 1 Code Polynomial: x (101) Step 1: Compute S(x) r = 2 S(x) =

CS352 Fall, Generating a CRC Example (cont’d) Step 2: Modulo 2 divide Remainder

CS352 Fall, Generating a CRC Example (cont’d) Step 3: Modulo 2 subtract the remainder from S(x) Checksummed Message

CS352 Fall, Decoding a CRC Procedure 1. Let n be the length of the checksummed message in bits 2. Divide the checksummed message by the code polynomial using modulo 2 division. If the remainer is zero, there is no error detected.

CS352 Fall, Decoding a CRC Example Checksummed message ( n = 6) 1011 Original message (if there are no errors) Remainder = 0 (No error detected)

CS352 Fall, Decoding a CRC Another Example When a bit error occurs, there is a large probability that it will produce a polynomial that is not an even multiple of the code polynomial, and thus errors can usually be detected Remainder = 1 (Error detected)

CS352 Fall, Choosing a CRC polynomial The longer the polynomial, the smaller the probability of undetected error Common standard polynomials: (1) CRC-12: x 12 + x 11 + x 3 + x 2 + x (2) CRC-16: x 16 + x 15 + x (3) CRC-CCITT: x 16 + x 12 + x 5 + 1

MAC sub-layer

CS352 Fall, What is “Media” RadioRing Shared Wire

CS352 Fall, Medium Access Sub-layer Network Layer Data Link Layer Physical Layer Medium Access Sub-layer

CS352 Fall, Medium Access Sublayer (cont’d) Medium access (MAC) sub-layer is not important on point-to-point links The MAC sub-layer is only used in broadcast or shared channel networks Examples: Satellite, Ethernet, Cellular

CS352 Fall, Access Protocols Who gets to use the channel next? Fixed/Static assignment Demand assignment Contention Turn-Based

CS352 Fall, Fixed Assignment Protocols Static and predetermined allocation of channel access: independent of user activity Idle users may be assigned to the channel, in which case channel capacity is wasted Examples: TDMA, FDMA

CS352 Fall, Channel Partitioning MAC protocols: TDMA TDMA: time division multiple access access to channel in "rounds" each station gets fixed length slot (length = pkt trans time) in each round unused slots go idle example: 6-station LAN, 1,3,4 have pkt, slots 2,5,6 idle

CS352 Fall, Channel Partitioning MAC protocols: FDMA FDMA: frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go idle example: 6-station LAN, 1,3,4 have pkt, frequency bands 2,5,6 idle frequency bands time

CS352 Fall, Demand Assignment Protocols Allocate channel capacity to hosts on a demand basis (i.e., only to active users) Requires methods for measuring the demand for the channel Polling Reservation schemes

CS352 Fall, Polling A central controller interrogates each host and allocates channel capacity to those who need it Good for systems with: Short propagation delay Small polling messages Non-bursty traffic

CS352 Fall, Reservation Schemes Hosts independently reserve the channel for period of time Reservations are usually piggybacked on data messages passing along the channel Good for systems with : short propagation delay no central controller node non-bursty traffic

CS352 Fall, Reservation Protocols (cont’d) Reservation protocol examples: Bit-Map Protocol Binary Countdown Protocol

CS352 Fall, Bit-Map Protocol Contention and data transmission periods alternate The contention period is divided into slots, with 1 bit-wide slots for each host in the network. If a host wants to transmit a packet, it sets its contention slot equal to 1. Otherwise, it sets it to 0. The slots pass all hosts in sequence, so every host is aware of who will transmit data frame

CS352 Fall, Bit-Map Protocol (cont’d) But what if there are a large number of hosts in the network? The contention period will have to grow to include them all With a large number of hosts, the contention period may be very long, leading to inefficiency

CS352 Fall, Binary Countdown Protocol During contention period, each host broadcasts its binary address one bit at a time, starting with the most significant bit bits transmitted simultaneously are boolean OR’d together Arbitration rule: If a host sent a zero bit but the boolean OR results in a one bit, the host gives up and stops sending address bits Whichever host remains after the entire address has been broadcast gets access to the medium

CS352 Fall, Binary Countdown (cont’d) Bit Time Host Addresses

CS352 Fall, Binary Countdown: Fairness Stations with the highest addresses will always win. This is good if you want to implement priority, but bad if you want to give all hosts fair access to the channel Used in CAN-bus networks (cars) Solution: Change the address of a host after a successful transmission

CS352 Fall, Binary Countdown: Permuting Addresses After host A successful transmission, all hosts with addresses less than host A add one to their address, improving their priority Host A changes its address to zero, giving it the lowest priority