Chapter 3 The Data Link Layer

Similar documents
The Data Link Layer. Data Link Layer Design Issues

The Data Link Layer Chapter 3

Chapter 3. The Data Link Layer

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

The Data Link Layer Chapter 3

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

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

CS422 Computer Networks

Data Link layer (CN chap 3.1, 3.4, 3.6)

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

Overview. Data Link Technology. Role of the data-link layer. Role of the data-link layer. Function of the physical layer

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

CSE 461: Framing, Error Detection and Correction

Data Link Layer. Overview. Links. Shivkumar Kalyanaraman

CSE 123: Computer Networks

Data Link Layer. Srinidhi Varadarajan

ISO/OSI Reference Model. Data Link Layer. 7. Application. 6. Presentation. 5. Session. 4. Transport. 3. Network. 2. Data Link. 1.

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

Data Link Technology. Suguru Yamaguchi Nara Institute of Science and Technology Department of Information Science

Chapter 3. The Data Link Layer

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

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.

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

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

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

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

06/05/2008. Chapter 3. The Data Link Layer. Data Link Layer Design Issues. Services Provided to the Network Layer. Error Control Flow Control

CSCI-1680 Link Layer I Rodrigo Fonseca

COMPUTER NETWORKS UNIT-3

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

4. Error correction and link control. Contents

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

Networking Link Layer

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

Hamming codes can also correct burst of errors by using iterleaving

DATA LINK LAYER UNIT 7.

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

Lecture 5: Data Link Layer Basics

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

Introduction to Computer Networks. 03 Data Link Layer Introduction

Where we are in the Course

Communication Networks. Part I

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

Operating Systems and. Computer Networks. Introduction to Computer Networks. Operating Systems and

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

Chapter 5 Data-Link Layer: Wired Networks

3. Data Link Layer 3-2

EITF25 Internet- - Techniques and Applica8ons Stefan Höst. L4 Data link (part 1)

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

Data Link Layer Overview

Data Link Layer Overview

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

INF Data Communication Data Link Layer

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

Data Link Layer Overview

C08a: Data Link Protocols

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

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

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

Data Link Layer Overview

2.1 CHANNEL ALLOCATION 2.2 MULTIPLE ACCESS PROTOCOLS Collision Free Protocols 2.3 FDDI 2.4 DATA LINK LAYER DESIGN ISSUES 2.5 FRAMING & STUFFING

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

Telecommunication Protocols Laboratory Course

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

CSCI-1680 Link Layer Reliability Rodrigo Fonseca

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

CSEP 561 Error detection & correction. David Wetherall

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

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

CSE123A discussion session

5th Slide Set Computer Networks

Inst: Chris Davison

CSCI-1680 Link Layer Reliability John Jannotti

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

Chapter 11 Data Link Control 11.1

Introduction to Data Communications & Networking

Link layer, LANs: outline. Chapter 5-1 Link Layer. Link layer: introduction. Link layer services

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

Politecnico di Milano Scuola di Ingegneria Industriale e dell Informazione. Link Layer. Fundamentals of Communication Networks

Peer-to-Peer Protocols and Data Link Layer. Chapter 5 from Communication Networks Leon-Gracia and Widjaja


Chapter 11 Data Link Control 11.1

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

Data Link Layer (1) Networked Systems 3 Lecture 6

Introduction to Computer Networks

This Lecture. BUS Computer Facilities Network Management. Line Discipline. Data Link Layer

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

Comparison of ISO-OSI and TCP/IP Suit. Functions of Data Link Layer:

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

CSE 123A Computer Networks

Data Link Control Protocols

Computer Networking. Lecture 4 - Coding and Error Control

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

CS 4453 Computer Networks Winter

UNIT I FUNDAMENTALS & LINK LAYER

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

Computer and Network Security

Transmission SIGNALs

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

Transcription:

Chapter 3 The Data Link Layer 陳瑞奇 (Rikki) 亞洲大學資訊工程學系 Adapted from Computer Networks, Andrew S. Tanenbaum, Vrije University, Netherlands & Computer Networking: A Top Down Approach, Jim Kurose, Keith Ross Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, Pearson Education-Prentice Hall, 2011 1 The Data Link Layer 7 6 5 application Application presentation Presentation session Session H: header T: trail Each may be empty. SH PH PH AH AH AH 4 transport Transport TH SH PH AH 3 Network network NH TH SH PH AH 2 Data link link DH NH TH SH PH AH DT 1 physical Physical bit streams OSI Reference Model 2 1

Data Link Layer Design Issues Network layer services 3 2 Framing Error Control Flow Control 1 Network Data link Physical DH bit streams DT 3 Packets and Frames Relationship between packets and frames. 3 2 1 Network Data link Physical Packet Packet Header Payload field Trailer Header Payload field Trailer DH DT 4 2

An exchange using the OSI model Packet Packet Packet DH Packet DT 5 Network Layer Services (a) Virtual communication. (b) Actual communication. 6 3

Services Provided to Network Layer 7 Possible Services Offered 1. Unacknowledged connectionless service: Ethernet 2. Acknowledged connectionless service: WLAN, WiFi 3. Acknowledged connection-oriented service: ATM, Frame Relay 8 4

Framing methods Flag DH bit streams DT Too risky to count on timing to mark the start and end of each frame Other methods: 1. Byte Count (rarely used anymore) 2. Flag bytes with byte stuffing (PPP) 3. Flag bits with bit stuffing 4. Physical layer coding violations 9 Framing (1): Byte Count DH A byte stream. (a) Without errors. (b) With one error. DT 10 5

Framing (2):Flag bytes with byte stuffing DH DT a) A frame delimited by flag bytes. b) Four examples of byte sequences before and after byte stuffing. 11 Framing (3): Flag bits with bit stuffing Flag 01111110 Flag 01111110 Bit stuffing. (a) The original. (b) The as they appear on the line. 12 6

Framing (4): Physical layer coding violations The combinations of low-low and highhigh which are not used for may be used for marking frame boundaries. 13 Error Control Process (1) Single-bit error Multiple-bit error WCB/McGraw-Hill The McGraw-Hill Companies, Inc., 1998 14 7

Error Control Process (2) Burst error WCB/McGraw-Hill The McGraw-Hill Companies, Inc., 1998 15 Error Control Process (3) All transmission media have potential for introduction of errors Error control process has two components Error detection DH DT redundancy in so that error can be detected Error correction DH DT once error detected, frames corrected or retransmitted 16 8

Redundancy WCB/McGraw-Hill The McGraw-Hill Companies, Inc., 1998 17 Error Detection Codes Linear, systematic block codes 1. Parity. 2. Checksums. 3. Cyclic Redundancy Checks (CRCs). 4. Hamming codes. 5. Binary convolutional codes. 6. Reed-Solomon codes. 7. Low-Density Parity Check codes. 18 9

Error Detection Codes (1) Parity Check For single-bit error WCB/McGraw-Hill odd parity or even parity make number of 1 s in character odd or even The McGraw-Hill Companies, Inc., 1998 21 Error-Detecting Codes (1) Interleaving of parity bits to detect a burst error. Even Parity 22 10

Error-Detecting Codes (2) Checksum WCB/McGraw-Hill The McGraw-Hill Companies, Inc., 1998 23 Error Detection Codes (3) Cyclic Redundancy Check (CRC) treat frame as one long binary number attach remainder to frame 16-bit (32-bit) CRC DH Packet CRC 24 11

Error-Detecting Codes (3) Error-Detecting Codes -- CRC WCB/McGraw-Hill The McGraw-Hill Companies, Inc., 1998 25 Error-Detecting Codes (3) 0 0 Example calculation of the CRC 26 12

Error-Detecting Codes (3) CRC (Cyclic Redundancy Check) CRC Code = Polynomial Code 110001 = x 5 + x 4 + x 0 Original Message (dividend): M(x) Generator (divisor): G(x) Degree of G(x): r Quotient: Q(x) Remainder (CRC): R(x) Transmitted Message: T(x) Modulo 2 division (add/sub = XOR) G(x) Q(x) x r M(x) T(x) = x r M(x) - R(x) = M(x)&R(x) T(x)/G(x) = 0 DH Packet CRC R(x) If T (x)/g(x) = 0 then Correct, otherwise Error 27 r 0 s Error-Detecting Codes (3): CRC Calculation of the polynomial code checksum. DH Packet DT 28 13

Standard Polynomials (used in HDLC) (used in Ethernet) WCB/McGraw-Hill The McGraw-Hill Companies, Inc., 1998 29 Hardware CRC Source: http://www.erg.abdn.ac.uk/users/gorry/course/dl-pages/crc.html 31 14

Error Correction (1) Two types of errors Lost frame - never arrives Damaged frame - error in bits Automatic Repeat request (ARQ) Error detection Positive acknowledgment (ACK) if received Retransmission after time-out if not ACK Negative ACK (NACK)and retransmission if error Error-Correcting Codes 32 Error Correction (2) WCB/McGraw-Hill The McGraw-Hill Companies, Inc., 1998 33 15

Error Correction (3) Hamming Code WCB/McGraw-Hill The McGraw-Hill Companies, Inc., 1998 34 1 Hamming Code (4) 1 1 Generation of Hamming Code (Even Parity Check) 1 WCB/McGraw-Hill The McGraw-Hill Companies, Inc., 2001 35 16

x Even parity Hamming Code (5) x x O WCB/McGraw-Hill The McGraw-Hill Companies, Inc., 2001 36 Error-Correcting Codes Use of a Hamming code to correct 1-bit errors. Bit 1,2,4,8 與上頁左右顛倒 ( 也是可以 ) 37 17

Flow Control Necessary when is being sent faster than it can be processed by receiver Buffer Usually a buffer is filled, and transfer is stopped until buffer is emptied 38 Flow Control with Error Control WCB/McGraw-Hill The McGraw-Hill Companies, Inc., 1998 39 18

Stop and Wait 42 Stop-And-Wait Seq# 43 19

Stop and Wait ARQ WCB/McGraw-Hill The McGraw-Hill Companies, Inc., 1998 44 Stop-And-Wait ARQ Transmitting Data 1 2 3 3 Retransmission Time Received Data 1 2 3 Error Time Output Data 1 2 3 Time ACK: Acknowledge NAK: Negative ACK 45 20

Stop-and-Wait Flow Control Simplest form of Frame-Oriented Control Source may not send new frame until receiver acknowledges previous one Very inefficient, especially when a single message is broken into many small frames buffer size of receiver is limited if error, detected sooner and less need be retransmitted 46 Sliding-Window Flow Control Allows multiple frames to be in transit Receiver sends acknowledgement with sequence number of next frame Sender maintains list of sequence numbers it can send, receiver maintains list of sequence numbers it can receive Packet 3 ACK n Packet 2 Packet 1 47 21

Sliding Window Protocols (2) A sliding window of size 1, with a 3-bit sequence number. (a) Initially. (b) After the first frame has been sent. (c) After the first frame has been received. (d) After the first acknowledgement has been received. 48 Sliding Window 50 22

Sliding-Window Flow Control (1) Go-Back-N ARQ (GBN ARQ) Go-back 3 Go-back 5 Transmitting Data 1 2 3 4 5 3 4 5 6 7 5 Time Received Data 1 2 3 4 5 Error Error Time Output Data 1 2 3 4 5 Time 51 Damaged Frame WCB/McGraw-Hill The McGraw-Hill Companies, Inc., 1998 52 23

Lost Frame WCB/McGraw-Hill The McGraw-Hill Companies, Inc., 1998 53 Lost ACK WCB/McGraw-Hill The McGraw-Hill Companies, Inc., 1998 54 24

A Protocol Using Go Back N Pipelining and error recovery. 55 Sliding-Window Flow Control (2) Selective-Repeat ARQ (SR ARQ) Retransmission Retransmission Transmitting Data 1 2 3 4 5 3 6 7 8 9 7 Time Received Data 1 2 4 5 3 6 8 9 7 Error Error Time Buffer 1 2 4 5 3 6 8 9 7 Time Output Data 1 2 3 4 5 6 7 8 9 Time 57 25

A Protocol Using Selective Repeat 58 High-Level Data Link Control (HDLC) Frame format for bit-oriented protocols. 66 26

The Data Link Layer in the Internet: PPP A home personal computer acting as an internet host. PPPoE PPP 72 PPP 73 27

PPP Point to Point Protocol The PPP full frame format for unnumbered mode operation. 74 PPP Point to Point Protocol (2) 75 28

PPP over Ethernet (PPPoE) Internet Service Provider (ISP) still like PPP because of authentication (PPP supports CHAP), accounting (checking customer s bill), link management (ISP can use PPP to assign a public IP address for customer). PPPoE PPP DSLAM: Digital Subscriber Line Access Multiplexer Source: http://www.digitaltut.com/ppp-over-ethernet-pppoe-tutorial 76 Protocol 轉換範例 Packet Application IP TCP/UDP IP PPP Ether Ether Ether Ether WiFi WiFi Fiber UTP UTP UTP UTP OFDMA OFDMA Adapted from 清大資工系黃能富教授 77 29

Packet PPPoE 範例 Application DHCP UDP IP PPP Fiber PPP Fiber PPP DSL PPP DSL PPP Ether UTP5 TCP/UDP IP PPP Ethernet UTP5 PPP PPPoE 78 各個電腦自行利用 PPPoE 撥接 ADSL 上網 (DHCP) or Fixed IP PPP over WLAN PPP over WiFi (PPPoE) (PPPoE) Source: http://www.im.isu.edu.tw/faculty/jbsuen/www/net/wireless.ppt TCP/UDP IP PPP WiFi OFDMA 79 30

The Data Link Layer 7 6 5 application Application presentation Presentation session Session H: header T: trail Each may be empty. SH PH PH AH AH AH 4 transport Transport TH SH PH AH 3 Network network NH TH SH PH AH 2 Data link link DH NH TH SH PH AH DT 1 physical Physical bit streams OSI Reference Model 84 End of Chapter 3 Questions? Thank you! Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, Pearson Education-Prentice Hall, 2011 85 31