CS4470 Computer Networking Protocols

Slides:



Advertisements
Similar presentations
Lecture 12 Layer 2 – Data Link Layer Protocols
Advertisements

Spring 2002CS 4611 Outline Encoding Framing Error Detection Sliding Window Algorithm Point-to-Point Links.
EEC-484/584 Computer Networks Lecture 6 Wenbing Zhao
CSCI 4550/8556 Computer Networks Comer, Chapter 7: Packets, Frames, And Error Detection.
PART III DATA LINK LAYER. Position of the Data-Link Layer.
The Data Link Layer Chapter 3. Position of the data-link layer.
1 Outline Encoding Framing Error Detection Sliding Window Algorithm Point-to-Point Links.
The OSI Reference Model
EEC-484/584 Computer Networks Lecture 7 Wenbing Zhao (Part of the slides are based on materials supplied by Dr. Louise Moser at UCSB and.
Adapted from Tanenbaum's Slides for Computer Networking, 4e The Data Link Layer Chapter 3.
EEC-484/584 Computer Networks Lecture 7 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
Error Detection and Reliable Transmission EECS 122: Lecture 24 Department of Electrical Engineering and Computer Sciences University of California Berkeley.
Shashank Srivastava Motilal Nehru National Institute Of Technology, Allahabad Error Detection and Correction : Data Link Layer.
Data link layer: services
Data Link Layer - 1 Dr. Sanjay P. Ahuja, Ph.D. Fidelity National Financial Distinguished Professor of CIS School of Computing, UNF.
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.
CHAPTER 2 HARDWARE BUILDING BLOCK ENCODING FRAMING ERROR DETECTION.
1 Part III Packet Transmission Chapter 7 Packets, Frames, and Error Detection.
Data Link Layer: Error Detection and Correction
Lecture 6: Framing and Error Detection-Data Link Layer Functions
4: DataLink Layer1 Chapter 4: The Data Link Layer Our goals: r understand principles behind data link layer services: m error detection, correction m sharing.
1 Packets, Frames, and Error Detection. 2 The Problem Cannot afford individual network connection per pair of computers Reasons –Installing wires consumes.
Data Link Layer : Services, Framing, Error Detection and Correction2.
COSC 3213: Computer Networks I Instructor: Dr. Amir Asif Department of Computer Science York University Section M Topics: 1. Error Detection Techniques:
Chapter 7 - Packets, Frames and Error Detection 1. Concepts of Packets 2. Motivation for Packet Switching 3. Framing 4. Frame Formats 5. Transmission Errors.
5: DataLink Layer5-1 Error Detection EDC= Error Detection and Correction bits (redundancy) D = Data protected by error checking, may include header fields.
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.
1 Chapter 7 Switching, Packets, Frames, Parity, Checksums, and CRCs.
Computer Communication & Networks Lecture 9 Datalink Layer: Error Detection Waleed Ejaz
SEPT, 2005CSI Part I.2 Packets, Frames, Parity, Checksums, and CRCs Dr. R.L. Probert, SITE, University of Ottawa.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Data Link Layer PART III.
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.
Lecture 4 Error Detecting and Correcting Techniques Dr. Ghalib A. Shah
Simple Parity Check The simplest form of error detection is the parity check used with ASCII codes, originally on asynchronous modem links Each 7 bit ASCII.
Introduction to Information Technologies
Data Link Layer Objective: to achieve reliable and efficient communication between 2 adjacent machines Data link layer design issues services provided.
ERROR DETECTION AND CORRECTION
Data Link Layer.
Advanced Computer Networks
CIS 321 Data Communications & Networking
Data Link Layer What does it do?
Part III Datalink Layer 10.
Error Detection Bit Error Rate(BER): It is the ratio of number Ne of errors appearing over a certain time interval t to the number Nt of 1 and 0 pulses.
Packetizing Error Detection
Net 221D : Computer Networks Fundamentals
Packetizing Error Detection
Link Layer and LANs Its not about how hard you hit... It's about how hard you can get hit and keep moving forward 5: DataLink Layer.
Basic concepts Networks must be able to transfer data from one device to another with complete accuracy. Data can be corrupted during transmission. For.
Chapter 7 Error Detection and Correction
EEC-484/584 Computer Networks
Introduction to Information Technologies
Data Link Layer Objective: to achieve reliable and efficient communication between 2 adjacent machines Data link layer design issues services provided.
Error Detection Neil Tang 9/26/2008
Packetizing Error Detection
Data Link Layer Objective: to achieve reliable and efficient communication between 2 adjacent machines Data link layer design issues services provided.
Protocols and the TCP/IP Suite
Packets, Frames, Parity, Checksums, and CRCs
EEC-484/584 Computer Networks
COMPUTER NETWORKS CS610 Lecture-5 Hammad Khalid Khan.
Packets, Frames, Parity, Checksums, and CRCs
Error Detection and Correction
Switching, Packets, Frames, Parity, Checksums, and CRCs
Data Link Layer: Overview; Error Detection
Error detection: Outline
EECS 122: EE122: Error Detection and Reliable Transmission
Data Link Layer. Position of the data-link layer.
Presentation transcript:

CS4470 Computer Networking Protocols 2/10/2018 CS4470 Computer Networking Protocols 3. Data Link Layer Huiping Guo Department of Computer Science California State University, Los Angeles

Outline Overview of data link layer Framing Error detection 2/10/2018 Outline Overview of data link layer Framing Error detection 3. Link CS470

Data link layer overview 2/10/2018 Data link layer overview Network layer Network layer Data Data Data H T frame Link layer Link layer Data H T 11001010… 11001010… Physical layer Physical layer 3. Link CS470

Data link layer overview (cont.) Achieve reliable, efficient communication between two physically connected machines Make use of services provided by the physical layer Get a series of bits Provide services to the network layer The kind of services depends on the link layer protocol How to make a link appear reliable A link may corrupt frame from time to time 3. Link CS470

Design issues Services interface to the network layer How to group bits into frames (framing) How to deal with errors (error control) Errors in the physical layer How to mediate access to a link if the link is shared by multiple hosts 3. Link CS470

Framing Break the bit stream into frames Why framing? Raw bit stream cannot provide any error detection capability. Bits may change (lightning strikes). Bits may get lost (clock drift). Challenge How to delimitate frames? 3. Link CS470

How to do framing Character count Flag bytes with byte stuffing Starting and ending flags with bit stuffing 3. Link CS470

Character count Uses a field in the header to specify the number of characters in the frame 5 1 2 3 4 5 6 7 8 9 8 0 1 2 3 4 5 6 8 7 8 9 0 1 2 3 frame1 frame2 frame3 frame4 Problem: What if the count is corrupted error 5 1 2 3 4 7 6 7 8 9 8 0 1 2 3 4 5 6 8 7 8 9 0 1 2 3 frame1 frame2: wrong ! 3. Link CS470

Flag bytes with byte stuffing Each frame start and end with special bytes Soh block of data in frame eot Flag bytes Start of header: soh End of text: eot 3. Link CS470

What if the data contains the flag? Byte stuffing Uses another special flag. Translates the data to alternative form 3. Link CS470

Illustration of Frame with byte stuffing After byte stuffing, the characters soh and eot do not occur in the data Stuffed frame longer than original 3. Link CS470

Disadvantages of byte stuffing It is closely tied to the use of 8-bit characters Not all character codes use 8-bit characters UNICODE uses 16-bit characters How to support flags with arbitrary sized characters? 3. Link CS470

Bit stuffing Allows data frames to contain an arbitrary number of bits Allows character codes with an arbitrary number of bits per character Each frame begins and ends with a special bit pattern (01111110) It’s like flag byte 3. Link CS470

Bit stuffing (cont.) Receiver hunts for flag sequence to synchronize To avoid confusion with data containing 01111110 0 inserted after every sequence of five 1s If receiver detects five 1s it checks next bit If 0, it is deleted If 1 and seventh bit is 0, accept as flag If sixth and seventh bits 1, sender is indicating abort 3. Link CS470

Bit Stuffing 3. Link CS470

Exercise 2. Suppose the following sequence of bits arrive over a link Assuming a framing protocol that uses bit stuffing, show the bit sequence transmitted over the link when the frame contains the following bit sequence 1 1 0 0 1 1 1 1 1 0 1 0 1 1 1 1 1 1 0 1 0 1 1 1 1 1 1 1 0 2. Suppose the following sequence of bits arrive over a link 0 1 1 1 1 1 1 0 1 1 1 1 1 0 1 0 1 0 0 1 1 1 1 1 1 0 1 1 0 0 1 1 1 1 1 1 0 Show the resulting frame after any stuffed bits have been removed. 3. Link CS470

Error Detection Parity bits Checksum Cyclic Redundancy Code (CRC) 3. Link CS470

Parity Checking Single Bit Parity: Detect single bit errors 1 Count the number of 1s in the received d+1 bits. An odd number indicates at least one bit errors with an even parity scheme. 3. Link CS470

Parity Checking Two Dimensional Bit Parity: d bits are organized into ixj bit array Parity checking for each column and row Resulting i+j+1 parity bits Detect and correct single bit errors Forward error correction (FEC) Can also detect any combinations of two bit errors 3. Link CS470

Checksum Sender: Receiver: treat data as sequence of 16-bit integers checksum: addition (1’s complement sum) of segment contents Attach the checksum to the end of data segments Receiver: Sum up data and checksum The results are all 1s? Yes, no errors No, errors. 3. Link CS470

2/10/2018 Checksum Example Note When adding numbers, a carryout from the most significant bit needs to be added to the result Example: add two 16-bit integers 1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 0 1 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 1 wraparound Kurose and Ross forgot to say anything about wrapping the carry and adding it to low order bit sum checksum 3. Link CS470

Exercise Calculate the checksum for the following binary numbers. Give the result in binary. Use the 16-bit format. 11000111  11100001 10000111  10001001 11100101  10100011 11111111  11100111 3. Link CS470

Cyclic Redundancy Check A major goal in designing error detection algorithm is to maximize the probability of detecting errors using only a small number of redundant bits CRC uses some fairly powerful mathematics to achieve this goal The theoretical foundation of the CRC is finite field 3. Link CS470

Cyclic Redundancy Check An (n+1) bit message is represented by an n degree polynomial, a polynomial whose highest-order term is xn. The message is represented by a polynomial The value of each bit in the message is as the coefficient for each term in the polynomial The most significant bit represents the hightest-order term Eg. An 8-bit message 10011010 corresponds to the polynomial M(x) = 1 * x7 + 0 * x6 + 0 * x5 + 1 * x4 + 1 * x3 + 0 * x2 + 1 * x1 + 0 * x0 = x7 + x4 + x3 + x We can think of a sender and a receiver as exchanging polynomials with each other 3. Link CS470

Cyclic Redundancy Check view data bits, D, as a binary number choose r+1 bit pattern (generator), G goal: choose r CRC bits, R, such that <D,R> exactly divisible by G (modulo 2) receiver knows G, divides <D,R> by G. If non-zero remainder: error detected! can detect all burst errors less than r+1 bits widely used in practice (ATM, HDCL) 3. Link CS470

CRC Example D.2r R = remainder[ ] G Want: D.2r + R = nG equivalently: if we divide D.2r by G, want remainder R R = remainder[ ] D.2r G 3. Link CS470

Exercise D=11100110, G=11001, r=4 R=? The transmitted bits=? If no error occurs, how the receiver knows the received bits are correct? 3. Link CS470