The Data Link Layer Framing Error Control Flow Control

Slides:



Advertisements
Similar presentations
5-1 Data Link Layer l Objective: to achieve reliable and efficient communication between 2 adjacent machines l Data link layer design issues n services.
Advertisements

Chapter 3 The Data Link Layer.
EE 4272Spring, 2003 Chapter 7 Data Link Control Objectives: Effective & reliable data communication between two directly connected transmitting-receiving.
William Stallings Data and Computer Communications 7th Edition
C) All rights reserved by Professor Wen-Tsuen Chen1 Chapter 3 The Data link Layer ä For reliable, efficient communication between two adjacent machines.
Chapter 3: The Datalink Layer CS 455/555. Topics to be covered Design Issues Error detection and correction Elementary datalink protocols Sliding window.
1 Lecture #12: Data Link Layer. Error Control. C o n t e n t s l Services Provided by DLL l DLL data structures l Error Control Mechanisms –Error correcting.
Chapter 3 The Data Link Layer.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Chapter 11 Data Link Control and Protocols.
8-Reliability and Channel Coding Dr. John P. Abraham Professor UTPA.
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 1 Data Link Control Chapter 7.
Chapter 3 The Data Link Layer.
EEC-484/584 Computer Networks Lecture 6 Wenbing Zhao
EEC-484/584 Computer Networks Lecture 8 Wenbing Zhao (Part of the slides are based on materials supplied by Dr. Louise Moser at UCSB and.
CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 12 Introduction to Computer Networks.
CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 13 Introduction to Computer Networks.
The Data Link Layer Chapter 3. Position of the data-link layer.
The OSI Reference Model
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.
Computer Networks Data Link Layer.
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.
20101 The Data Link Layer Chapter Design Issues Controls communication between 2 machines directly connected by “wire”-like link Services Provided.
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.
Example Data Link Protocols Quick review Reference Models? Layers? Flow Control? Bit stuffing? Connection Oriented? Synchronous transmission?
Data Link Layer RAHUL DEVA.
THE DATA LINK LAYER Out of order with the book Dr. John P. Abraham University of Texas, Panam.
1 The Data Link Layer Chapter 3. 2 Data Link Layer Algorithms for achieving reliable, efficient communication between two adjacent machines. Adjacent.
Data Link Layer - 1 Dr. Sanjay P. Ahuja, Ph.D. Fidelity National Financial Distinguished Professor of CIS School of Computing, UNF.
The Data Link Layer Chapter 3. Data Link Layer Design Issues a) Services Provided to the Network Layer b) Framing c) Error Control d) Flow Control.
Chi-Cheng Lin, Winona State University CS 313 Introduction to Computer Networking & Telecommunication Data Link Layer Part I – Designing Issues and Elementary.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Data Link Control and Protocols.
Chapter 3 THE DATA LINK LAYER
Chapt 3 Data Link Layer1 Data Link Layer Functions –Provides services to network layer Well-defined interface –Framing –Flow control – between adjacent.
11.1 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 5 Peer-to-Peer Protocols and Data Link Layer PART I: Peer-to-Peer Protocols ARQ Protocols and Reliable Data Transfer Flow Control.
1 Kyung Hee University Data Link Protocols. 2 Kyung Hee University 11 장 Data Link Control and Protocols 11.1 Flow and Error Control 11.2 Stop-and-Wait.
THE DATA LINK LAYER Chapter 3 1. H YBRID M ODEL The hybrid reference model to be used in this book. 2.
The Data Link Layer Goal –As reliable as possible, efficient communication Point-to-Point –single connection –bits arrive in order sent Not necessarily.
The Data Link Layer. Functions of the Data Link Layer Provide service interface to the network layer Dealing with transmission errors Error detection.
The Data Link Layer. Functions of the Data Link Layer Provide service interface to the network layer Frame delineation Dealing with transmission errors.
The Data Link Layer Chapter 3 10/28/2015www.noteshit.com1.
UNIT-II Computer Network Data Link Layer. Data Link Layer Prepared by - ROHIT KOSHTA Data Link Layer is second layer of OSI reference model and is placed.
Computer Networks Module 3: Data Link Layer (Framing) Dr. Vikram Shete St. Francis Institute of Technology.
Data Link Layer Savera Tanwir. Data Link Layer Design Issues Services Provided to the Network Layer Framing Error Control Flow Control.
Layer Two Data Link Layer Collects bits from layer 1 and organizes into frames Passes bits that make up frames to layer 1 for transmission Concerned with.
Chapter 11 Data Link Control
Data Link Layer: Data Link Control : Data Communication and Computer Networks Asst. Prof. Chaiporn Jaikaeo, Ph.D.
CIS : Data Link Control. Flow Control Ensuring the sending entity does not overwhelm the receiving entity —Preventing buffer overflow Transmission.
The Data Link Layer Chapter 3 1/21/2016www.ishuchita.com1.
Data Link Protocols ผศ.ดร. อนันต์ ผลเพิ่ม
Telecommunications & Networking Lesson 3. ISO Open System Interconnect (OSI) Application Presentation Session Transport Network Data Link Physical Application.
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.
Data Link Layer. Link Layer The data unit to be transmited at the link layer is called a frame. Why link layer? How can it know where a frame begins and.
Chi-Cheng Lin, Winona State University CS412 Introduction to Computer Networking & Telecommunication Data Link Layer Part II – Sliding Window Protocols.
1 The Data Link Layer A. S. Tanenbaum Computer Networks W. Stallings Data and Computer Communications Chapter 3.
11.1 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 9: Data Link Control Business Data Communications, 4e.
Chapter 3: The Data Link Layer –to achieve reliable, efficient communication between two physically connected machines. –Design issues: services interface.
24/11/1013-Datalink1 The Data Link Layer Role Services Functions –Framing –Encapsulation –Addressing –Connection Control –Ordered Delivery –Flow Control.
2.10 Flow and Error Control Before that ...
Chapter 3 The Data Link Layer.
Data Link Layer Objective: to achieve reliable and efficient communication between 2 adjacent machines Data link layer design issues services provided.
Data Link Layer.
Chap. 4 Data link layer 2.
Data Link Layer What does it do?
Data Link Layer Objective: to achieve reliable and efficient communication between 2 adjacent machines Data link layer design issues services provided.
Data Link Layer Objective: to achieve reliable and efficient communication between 2 adjacent machines Data link layer design issues services provided.
EEC-484/584 Computer Networks
Data Link Layer. Position of the data-link layer.
Presentation transcript:

The Data Link Layer Framing Error Control Flow Control Error Correction Error Detection Flow Control Retransmission with Sliding Window Protocols Protocol Specification and Verification Example Data Link Protocols

DATA LINK LAYER Services Unacknowledged connectionless service Voice Acknowledged connectionless service wireless Acknowledged connection-oriented service no out-of-order

Data Link Protocol

Framing To break the bit stream up into discrete frames and compute the checksum for each frame. When a frame arrives at the destination, the checksum is recomputed and validated. One way to achieve this framing is to insert time gaps between frames. However, networks rarely make any guarantees about timing.

Data Framing Character count Starting and ending characters with character stuffing Starting and ending flags with bit stuffing Physical layer coding violations

Character Count 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 character count frame 1 5 characters frame 2 frame 3 8 characters frame 4 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 frame 2 (wrong) frame 1 5 characters one-bit error Now a character count Even if the checksum is incorrect so the destination knows that the frame is bad, it still has no way of telling where the next frame starts.

Starting and Ending Characters with Character Stuffing DLE STX user data DLE ETX beginning of frame end of frame DLE(0x10): Data Link Escape STX(0x02): Start of TeXt ETX(0x03): End of TeXt DLE STX A DLE B DLE ETX user data 0x10 DLE stuffed at the sender DLE destuffed at the receiver DLE STX A DLE DLE B DLE ETX

Starting and Ending Flags with Bit Stuffing 01111110 user data 01111110 beginning of frame end of frame flag 011011111111111111110010 011011111011111011111010010 bits stuffed at the sender bits destuffed at the receiver original data

Physical Layer Coding Violations 1 0 0 0 1 1 0 user data Ending Delimiter V V 0 V V 0 0 0 end of frame Starting beginning of frame V V 1 V V 0 0 0 V: Violation bit

Error Control Three types of frames at a receiver’s end Damaged frame : Negative acknowledgment / retransmission Lost frame : Time-out mechanism Valid frame : Sequence numbering / discarding for valid but duplicate frames

Flow Control A technique for assuring that a transmitting station does not overwhelm a receiving station with data

Error Detection and Correction Error-correcting codes Error-detecting codes

Codeword n-bit codewords with n =m+r and m data bits r redundant or check bits Not all the 2n codewords are legal. In general, only 2m codewords are legal. ASCII codes of 7 bits with 1 even parity bit ASCII code for “A”: 1000001 codeword for “A”: 10000010 or 01000001 Codeword 10000011 or 11000001 is illegal.

Hamming Distance The number of bit positions in which two codewords differ is called the Hamming distance between these two codewords. The Hamming distance of the complete code is the minimum Hamming distance between all pairs of legal codewords.

Codeword Space To detect d-bit errors, a distance d +1 code is needed. To correct d-bit errors, a distance 2d +1 code is needed. 1-bit error detection 1-bit error correction

Codeword Space : 3-bits

Error Correction with Codewords: An Example

Determine the Number of Check bits To correct single bit errors with m bits message and r check bits (n=m+r) Code space : 2m n-bit legal messages(codewords) For an n-bit legal codeword, all its n neighbors at a distance 1 from it are illegal n+1 bit patterns are dedicated to each legal message (n+1)2m <= 2n and consequently (m+r+1)2m <= 2m+r. we have : (m+r+1) <= 2r

Hamming Code The bits that are powers of 2 (1, 2, 4, 8, 16, etc.) are check or parity bits of some data bits. For example, m=7 (ASCII) and r=4 (7+4+1 <= 24) B1 : B3 B5 B7 B9 B11 B2 : B3 B6 B7 B10 B11 B4 : B5 B6 B7 B8 : B9 B10 B11 1 001 000 “H” xx1x001x000 0 1 0 1 0 0 01 01 00 1001 0000 00110010000 codeword

Hamming Code : Example

To Correct Burst Errors A sequence of k consecutive codewords are arranged as a matrix, one codeword per row. To correct burst errors, the data should be transmitted one column at a time, i.e., column by column. If a burst error of length k bits occurs, at most 1 bit in each of the k consecutive codewords will have been affected, but the Hamming code can correct one error per codeword, so the entire block can be restored.

To Correct Burst Errors

When a Burst Error Occurs

To Correct Burst Errors: An Example B1 : B3 B5 B7 B9 B11 B2 : B3 B6 B7 B10 B11 B4 : B5 B6 B7 B8 : B9 B10 B11 ASCII Codeword 1001000 00110010000 1100001 10111001001 1101101 11101010101 1 2 3 4 5 6 7 8 9 10 11 column 011 001 111 110 011 000 101 010 001 000 011 burst error 011 001 111 111 101 000 101 010 001 000 011 Codeword 00111010000 10110001001 11111010101 Codeword 00110010000 10111001001 11101010101 B1(011100)+B4(1101) => B5 B1(110001)+B4(1000) => B5 B4(1101) => B4

Error Detection Parity bit low error rate Longitudinal redundancy check (LRC) and Vertical redundancy check (VRC) Cyclic redundancy code (CRC code) / Polynomial code Easy hardware implementation Can detect burst errors

Parity Bit block size: 1000 bits a message: 106 bits Hamming code: 1000+10 bits (m+r+1 <= 2n) parity bit: 1000+1 bits a message: 106 bits without no error Hamming code: 106+10000 bits parity bit: 106+1000 bits with a low error rate 10-6 parity bit: 106+1000+(1000+1) bits ( one error occurs) retransmitted block

Longitudinal Redundancy Check and Vertical Redundancy Check 1 0 1 1 0 1 1 1 1 1 0 1 0 1 1 1 0 0 1 1 1 0 1 0 1 1 1 1 0 0 0 0 1 0 0 0 1 0 1 1 0 1 0 1 1 1 1 1 0 1 1 1 1 1 1 0 VRC LRC

Cyclic Redundancy Code (CRC) / Polynomial Code A m-bit frame is regarded as the coefficient list for a polynomial, M(x), with m terms, ranging from xm-1 to x0. For example, 110001 represents a polynomial x5+x4+x0. Addition and subtraction are identical to EXCLUSIVE OR. For example, 10011011 11110000 + 11001010 -10100110 = 01010001 =01010110

Computing Cyclic Redundancy Code Both the sender and the receiver must agree upon a generator polynomial, G(x), with the degree r in advance. Append r zero bits into M(x) => xrM(x) Divide xrM(x) by G(x) Subtract the remainder from xrM(x) and let the result be T(x)

CRC Example

CRC at Receiver End T(x) is received with no error. T(x) is divisible by G(x) When errors represented by error bit pattern E, ( ie. E(x)), occur, (T(x) +E(x)) /G(x) has zero reminder only if E(x) is divisible by G(x) Carefully selects G(x) such that E(x) is not divisible by G(x)

CRC with Single and Double Errors Single-bit error E(x)= xj If G(x) contains tow or more terms, it will never divided E(x) Two isolate single-bits errors E(x)= xi +xj = xj ( xi-j+ 1) ….. i>j Assume G(x) is not divisible by x Select G(x) that does not divide xk+1, where 1< k  i-j

CRC with Odd-Number-bit Errors

CRC with Burst Errors

Well-Known Generator Polynomials CRC-12: x12+x11+x3+x2+x+1 CRC-16: x16+x15+x2+1 CRC-CCITT: x16+x12+x5+1 CRC-32: x32+x26+x23+x22+x16+x12+x11+x10+ x8+ x7+x5+x4+x2+x+1 CRC-16 and CRC-CCITT Catch all single and double errors, all errors with an odd number of bits, all burst errors of length 16 or less, 99.997% of 17-bit error burst, 99.998% of 18-bit error and longer bursts

Flow Control Techniques Stop-and-wait The receiver provide feedback to the sender The sender sends one frame and then waits for an acknowledgement before proceeding

Dealing with the Damaged Frames Adding a timer ( on sender ) The receiver would only send an ack if the data were correctly received After time out, the sender send the frame again

Dealing with the Lost Frames A lost data frame can be resent by using a timer When an acknowledgement is lost The sender’s timer eventually time-out The sender resends the same data frame After the data frame is received, the receiver sends acknowledgement again

Duplicate Frames : Two Cases

Dealing with Duplicate Frames

When Sender’s Time-out is Too Short

Solution: Put Sequence Number in the Acknowledgement

Piggybacking

Acknowledgement Techniques Types Control Frame Data Frame: Piggybacking The technique of temporarily delaying outgoing acknowledgements so that they can be hooked onto the next outgoing data frame is known as piggybacking. Types Positive Acknowledgement: The received frame has no error. Negative Acknowledgement: The received frame has errors.

Flow Control Flow control is a technique for assuring that a transmitting station does not overwhelm a receiving station with data. Sliding Window Protocols: At any instant of time, the sender maintains a set of sequence numbers corresponding to frames it is permitted to send. These frames are said to fall within the sending window. Similarly, the receiver also maintain a receiving window corresponding to the set of frames it is permitted to accept.

Sliding Windows Each outbound frame contain a sequence number ranging from 0 to 2n-1 Sending window Maintained by the sender A set of sequence numbers corresponding to frames the sender is permitted to send Receiving window Maintained by the receiver Corresponds the set of frames the receiver is permitted to accept

Maintain Sliding Windows Sending window When a frame is sent, the upper edge of the window is advanced by one When an acknowledgement is received, the lower edge of the window is advanced by one Receiving window Any received frame the sequence number outside the window is discarded When a frame whose sequence number is equal to lower edge of the window is received, the window is rotated by one

A Sliding Window Size of One

Sliding Window Protocols One bit sliding window protocol ( Stop-and-Wait) Go-back-N Protocol Selective Repeat Protocol

One Bit Sliding Window Protocol Stop –and-Wait A protocol in which the sender sends one frame and then waits for an acknowledgement before proceeding. a sliding window protocol with maximum window size = 1 Sequence number {0, 1} is sufficient Frame header fields Seq : the sequence number of this frame Ack : the number of the last frame is received

Efficiency of Stop-and-Wait 50 kbps data rate 500 msec round-trip delay 1000 bits per frame time (msec) t=0 start sending t=20 completely sent t=250 frame arrival t=270 completely received t=270 acknowledge without delay t=520 acknowledgement arrival 26000 bits could be transmitted in 520 msec. Efficiency: 1000/26000=20/520 < 4% used

Efficiency of Stop-and-Wait

Pipelining 50 kbps data rate 500 msec round-trip delay 1000 bits per frame time (msec) t=0 start sending the first frame t=20 the first completely sent t=250 frame arrival t=270 the first completely received t=270 acknowledge without delay t=520 acknowledgement arrival To pipeline frames without waiting for acknowledgements.

Pipelining

Line of Utilization for Stop-and-Wait Capacity : b bits/sec, frame size : l bits, round-trip delay : R seconds Transmission time : l/b Total duration : R + l/b Utilization : (l/b) / (R + l/b) = l / (l+bR)

Go-back-N Sender’s window size is n (n >1) At most n outstanding frames can be sent After receiving a damaged frame Receiver discards all subsequent frames Sender retransmits the damaged frame and all its successors after the times out

Go-back-N : An Example

Selective Repeat Receiver’s window size is n ( n >1 ) At most n frames can be buffered Receiver stores all the correct frames following the bad one The sender retransmits only the bad frame not all its successors

Selective Repeat : An Example

Retransmission with Sliding Window Protocols ARQ (Automatic Repeat reQuest): When an error is detected, the receiver requests that the frame be retransmitted. Stop-and-wait ARQ Go-back-N continuous ARQ Selective-repeat continuous ARQ All of them belong to the sliding window protocols. Both Go-back-N and Selective-repeat ARQs uses the pipelining technique.

ARQ Instead of using positive or negative acknowledgement, the receiver sends back only the frame number of the next frame is expects On the receipt of each frame (including damaged) It may speed up the transmission of lost or damaged frames, if the time-out value is “loose”

Stop-and-Wait with ARQ

Window Size The optimal sender’s windows size is 1+(round-trip delay / transmission time) Maximum window size of Go-back-N ARQ is MaxSeq, where the sequence number are 0, 1, ... , MaxSeq. Maximum window size of Selective-repeat ARQ is (MaxSeq+1)/2.

Protocol Specification and Verification Finite State Machine Model Petri Net Model

Finite State Machine Model States Instants that the protocol machine is waiting for the next event to happen Transitions Occur when some event occurs Change form some state to another

Finite State Machine Model for Bit Destuffing input/output 0/11110 0/110 1/ 1/ 1/ 1/ 1/ 1/ 0/ end of frame S 1 2 3 4 5 6 E 0/0 0/10 1/ 0/1110 bit destuffed T beginning of the next frame error 0/11111

State Digram for Stop-and-Wait

Example Data Link Protocols HDLC bit oriented bit stuffing SLIP PPP character oriented character stuffing multiprotocol framing

High-level Data Link Control derived from SDLC (Synchronous Data Link Control) of IBM’s SNA ADCCP (Advanced Data Communication Control Procedure): ANSI HDLC: ISO LAP (Link Access Procedure): X.25 of CCITT LAPB: CCITT http://members.tripod.com/~vkalra/hdlc.html

HDLC Frame Format bits 8 >=0 16 01111110 Address Control Data Checksum 01111110 A frame is delimited with the flag sequence 01111110. On idle point-to-point lines, flag sequences are transmitted continuously. Address to identify one of multiple terminals for point-to-multipoint lines to distinguish commands from responses for point-to-point lines

HDLC Frame Addressing PDN DTE DCE address=0xC0, response address=0xC0, command Address A address=0x80, response address=0x80, command Address B

HDLC Frame Type Control Field * not defined in LAPB

HDLC P/F Bit In Command frames: P (POLL) bit In Response frames: F (FINAL) bit Each Command frame with the POLL bit set to 1 must receive a Response frame with the FINAL bit set to 1.

HDLC Supervisory Frame RR (Receive Ready): acknowledgement frame N(R): the next frame expected to be received REJ (Reject): negative acknowledgement frame N(R): the first frame in sequence not received correctly (Go-back-N protocol) RNR (Receive not Ready): same as Type 0 and telling the sender to stop sending SR (Selective Reject): acknowledgement frame N(R): the frame expected to be retransmitted (Selective Repeat protocol)

HDLC Unnumbered Frame Link Initiation SABM DM UA DISC Link Termination accept reject UA Unnumbered/Acknowledgement SABM Set Asynchronous Balanced Mode DISC Disconnect DM Disconnected Mode

Serial Line IP SLIP (Serial Line IP): to connect SUN workstations to the Internet over a dial-up line using a modem in 1984 RFC 1055 Sending IP packets over the line, with a special flag byte at the end for framing. Using character stuffing. Many problems: no error detection, supporting only IP, no authentication, etc.

Point-to-Point Protocol PPP: RFC 1661, RFC 1662, RFC 1663 A multiprotocol framing mechanism suitable for use over modems, HDLC lines, SONET , and other physical layers. Supports error detection, option negotiation, header compression, and optionally, reliable transmission using HDLC framing. Character-oriented

Homework #2, #3, #6, #9,#11