Data Link Layer: Data Link Control 01204325: Data Communication and Computer Networks Asst. Prof. Chaiporn Jaikaeo, Ph.D.

Slides:



Advertisements
Similar presentations
William Stallings Data and Computer Communications 7th Edition
Advertisements

Chapter 11. Data Link Control
11.1 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 11 Data Link Control (DLC) Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 11 Data Link Control
Chapter 11 Data Link Control (DLC) Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Data and Computer Communications Updated: 2/9/2009.
Flow and Error Control. Flow Control Flow control coordinates the amount of data that can be sent before receiving acknowledgement It is one of the most.
11.1 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
11-5 NOISY CHANNELS Although the Stop-and-Wait Protocol gives us an idea of how to add flow control to its predecessor, noiseless channels are nonexistent.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Chapter 11 Data Link Control and Protocols.
The two main functions of the data link layer are data link control and media access control. Data link control deals with the design and procedures for.
11.1 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
11.1 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 1 Data Link Control Chapter 7.
Piggybacking A method to combine a data frame with ACK. Station A and B both have data to send. Instead of sending separately, station A sends a data frame.
11-6 HDLC High-level Data Link Control (HDLC) is a bit-oriented protocol for communication over point-to-point and multipoint links. It implements the.
11-6 HDLC High-level Data Link Control (HDLC) is a bit-oriented protocol for communication over point-to-point and multipoint links. It implements the.
Chapter 9: Data Link Control Business Data Communications, 4e.
11.1 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Example Data Link Protocols Quick review Reference Models? Layers? Flow Control? Bit stuffing? Connection Oriented? Synchronous transmission?
MODULE I NETWORKING CONCEPTS.
CS3502: Data and Computer Networks DATA LINK LAYER - 2 WB version.
Data and Computer Communications Eighth & Ninth Edition by William Stallings Chapter 7 – Data Link Control Protocols.
Data Link Control Protocols
Data Link Control Protocols Dr. Muazzam A. Khan. Flow Control Ensuring the sending entity does not overwhelm the receiving entity —Preventing buffer overflow.
Aegis School of Telecommunication Chapter 7 Data Link Control Protocols Telecom Systems I by Dr. M. G. Sharma, Phd.
11.1 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction.
11.1 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
1 Kyung Hee University Chapter 11 Data Link Control.
11.1 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Data and Computer Communications Tenth Edition by William Stallings Data and Computer Communications, Tenth Edition by William Stallings, (c) Pearson Education.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Data Link Control and Protocols.
Chapter 3 THE DATA LINK LAYER
11.1 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
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.
Computer Networks Module 3: Data Link Layer (Framing) Dr. Vikram Shete St. Francis Institute of Technology.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Chapter 11 Data Link Control and Protocols.
Chapter 11 Data Link Control
11.1 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Data Link Protocols ผศ.ดร. อนันต์ ผลเพิ่ม
FIT – Monash University High-Level Data Link Control
1 Flow&Error Control R. Supakorn. 2 Flow Control Flow control refers to a set of procedure used to restrict the amount of data that the sender can send.
Chapter 11 Data Link Control.
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.
Chapter 11 Data Link Control and Protocols Flow and Error Control Flow Control Error Control.
11.1 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Data and Computer Communications Data Link Control Protocols.
1 The Data Link Layer A. S. Tanenbaum Computer Networks W. Stallings Data and Computer Communications Chapter 3.
DATA LINK CONTROL. DATA LINK LAYER RESPONSIBILTIES  FRAMING  ERROR CONTROL  FLOW CONTROL.
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.
NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS ( NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS (PRACTICAL PART) Tutorial 4 : Chapter 7 Data & computer.
Data Link Layer.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Chapter 11 Data Link Control and Protocols 1.
Data Communications Data Link Layer.
2.10 Flow and Error Control Before that ...
Chapter 11 Data Link Control
Chapter 11 Data Link Control (DLC)
Chapter 11 Data Link Control and Protocols
Chapter 11 Data Link Control
Chapter 11 - Part 2 Data Link Control.
Chapter 3 Data Link Layer.
CIS 321 Data Communications & Networking
Data Link Layer: Data Link Control
Chapter 11 Data Link Control and Protocols.
Kendali Data Link dan Protokol
Data Link Control (DLC) Services
Presentation transcript:

Data Link Layer: Data Link Control : Data Communication and Computer Networks Asst. Prof. Chaiporn Jaikaeo, Ph.D. Computer Engineering Department Kasetsart University, Bangkok, Thailand Adapted from lecture slides by Behrouz A. Forouzan © The McGraw-Hill Companies, Inc. All rights reserved

2 Outline Framing Framing Byte vs. bit oriented protocols Byte vs. bit oriented protocols Data Link Control Data Link Control Flow control Flow control Error control Error control Protocols Protocols

3 Framing Process of wrapping data with certain info before sending out Process of wrapping data with certain info before sending out A frame typically consists of A frame typically consists of Flag: indication for start and end of a frame Flag: indication for start and end of a frame Header: source/destination addresses, as well as other control information Header: source/destination addresses, as well as other control information Data from the upper layer Data from the upper layer Trailer: error detection/correction code Trailer: error detection/correction code

4 Byte vs. Bit Oriented Framing in byte-oriented protocols Framing in byte-oriented protocols Framing in bit-oriented protocols Framing in bit-oriented protocols

5 Byte Stuffing Process of adding extra byte whenever there is an escape or a flag character in the data Process of adding extra byte whenever there is an escape or a flag character in the data

6 Bit Stuffing Process of adding extra bit to ensure flag sequence does not appear in the data Process of adding extra bit to ensure flag sequence does not appear in the data

7 Flow Control and Error Control Flow control Flow control A set of procedures that tells the sender how much data can be sent before waiting for acknowledgment A set of procedures that tells the sender how much data can be sent before waiting for acknowledgment Error control Error control Includes both error detection and correction Includes both error detection and correction Allows receiver to inform sender of lost or duplicate frames Allows receiver to inform sender of lost or duplicate frames Mostly based on Automatic Repeat Request (ARQ) Mostly based on Automatic Repeat Request (ARQ)

8 Data Link Protocols

9 Protocols for Noiseless Channel Assuming channel is error free Assuming channel is error free Not realistic… Not realistic… No need for error control No need for error control

10 "Simplest" Mechanism Assuming Assuming Noiseless channel Noiseless channel Unlimited buffer and speed for the receiver Unlimited buffer and speed for the receiver

11 "Simplest" : Pseudo Code Sender Sender Receiver Receiver

12 "Simplest": Flow Diagram

13 Stop-and-Wait Mechanism Still noiseless channel Still noiseless channel Receiver has limited buffer Receiver has limited buffer Requires flow control Requires flow control Sender sends one frame at a time and wait for an acknowledgment Sender sends one frame at a time and wait for an acknowledgment

14 Stop-and-Wait: Overview

15 Stop-and-Wait: Pseudo Code Sender side Sender side

16 Stop-and-Wait: Pseudo Code Receiver side Receiver side

17 Stop-and-Wait: Flow Diagram

18 Noisy Channel Realistic Realistic Error can and will happen Error can and will happen Require error control Require error control Mechanisms: Mechanisms: Stop-and-Wait ARQ Stop-and-Wait ARQ Go-Back-N ARQ Go-Back-N ARQ Selective Repeat ARQ Selective Repeat ARQ

19 Stop-and-Wait ARQ Sender keeps a copy of sent frame until successful delivery is ensured Sender keeps a copy of sent frame until successful delivery is ensured Receiver responds with an ack when it successfully receives a frame Receiver responds with an ack when it successfully receives a frame Both data and ack frames must be numbered Both data and ack frames must be numbered When sender does not receive an ack within certain time, it assumes frame is lost, then retransmits the same frame. When sender does not receive an ack within certain time, it assumes frame is lost, then retransmits the same frame.

20 Stop-and-Wait ARQ

21 Flow Diagram: Normal Operation Time SenderReceiver Time Frame 0 ACK 1 Frame 1 ACK 0 S = 0 S = 1 R = 0 R = 1 R = 0 Deliver

22 Thinking Corner  Thinking Corner  Why data frames need to be numbered? Why data frames need to be numbered?

23 Flow Diagram: Lost Frame Time SenderReceiver Time Frame 0 ACK 1 Frame 1 ACK 0 S = 0 R = 0 R = 1 R = 0 S = 1 Timeout Frame 1 Deliver

24 Flow Diagram: Lost ACK Time SenderReceiver Time Frame 0 ACK 1 Frame 1 ACK 0 S = 0 R = 0 R = 1 R = 0 Frame 1 S = 1 Timeout ACK 0 S = 1 S = 0 R = 0 Frame 0 expected; discard Deliver

25 Thinking Corner  Thinking Corner  Why ACK frames need to be numbered? Why ACK frames need to be numbered?

26 Flow Diagram: Delayed ACK SenderReceiver Frame 0 ACK 1 ACK 0 S = 0 R = 0 R = 1 R = 0 Frame 0 Timeout S = 1 S = 0 R = 1 Frame 0 expected; discard Deliver ACK 1 Frame 1 Timeout Frame 1 Deliver

27 Bidirectional Transmission Data are transferred both ways Data are transferred both ways ACK are "piggybacked" with data frames ACK are "piggybacked" with data frames

28 Example Assuming a communication system where: Assuming a communication system where: Stop-and-Wait ARQ is used Stop-and-Wait ARQ is used Bandwidth of the link is 1 Mbps Bandwidth of the link is 1 Mbps Propagation delay is 10 ms Propagation delay is 10 ms One-way data flow One-way data flow Questions Questions What should be an appropriate time-out value? What should be an appropriate time-out value? What is the bandwidth-roundtrip-delay product? What is the bandwidth-roundtrip-delay product? If the system data frames are 1000 bits in length, what is the utilization percentage of the link? If the system data frames are 1000 bits in length, what is the utilization percentage of the link?

29 Improving Link Utilization Previous example demonstrates major disadvantage of Stop-and-Wait ARQ Previous example demonstrates major disadvantage of Stop-and-Wait ARQ Prefer to send more frames before waiting for ACK Prefer to send more frames before waiting for ACK Example: Example: Recalculate the link utilization if we allow up to 15 frames to be sent before waiting for an ACK Recalculate the link utilization if we allow up to 15 frames to be sent before waiting for an ACK

30 Go-Back-N ARQ Allows multiple frames to be sent before waiting for ACK Allows multiple frames to be sent before waiting for ACK These frames must be numbered differently These frames must be numbered differently Frame numbers are called Sequence numbers Frame numbers are called Sequence numbers Frames must be received in the correct order Frames must be received in the correct order If a frame is lost, the lost frame and all of the following frames must be retransmitted If a frame is lost, the lost frame and all of the following frames must be retransmitted

31 Sequence Numbers Frame header contains m bits for sequence number Frame header contains m bits for sequence number That allows up to 2 m different frame numbers That allows up to 2 m different frame numbers How big should m be? How big should m be?

32 Sending Window Sending more than one frame at once requires sender to buffer multiple frames Sending more than one frame at once requires sender to buffer multiple frames Known as "sending window" Known as "sending window" Any of these frames in the window can be lost Any of these frames in the window can be lost

33 "Sliding" Window Once the first frames in the window is ACKed Once the first frames in the window is ACKed ACKed frames are removed from the buffer ACKed frames are removed from the buffer More frames are transmitted More frames are transmitted Result: The window slides to the right Result: The window slides to the right

34 Receiving Window Receiver expects one frame at a time Receiver expects one frame at a time

35 Send vs. Receive Windows

36 Go-Back-N: Window Sizes For m-bit sequence numbers For m-bit sequence numbers Send window size: at most 2 m -1 Send window size: at most 2 m -1  Up to 2 m -1 frames can be sent without ACK Receive window size: 1 Receive window size: 1  Frames must be received in order

37 Go-Back-N: Normal Operation

38 Go-Back-N: Lost Frame ACKs are cumulative

39 Lost ACK: Window Size < 2 m

40 Thinking Corner  Thinking Corner  What is a problem if send window is greater than 2 m -1? What is a problem if send window is greater than 2 m -1?

41 Lost ACK: Window Size = 2 m

42 Thinking Corner  Thinking Corner  Stop-and-Wait is a special case of Go- Back-N. Stop-and-Wait is a special case of Go- Back-N. What is the send window size in Stop-and- Wait? What is the send window size in Stop-and- Wait?

43 Selective Repeat ARQ Go-Back-N always discards out-of-order frames Go-Back-N always discards out-of-order frames Losing one frame may result in retransmission of multiple frames Losing one frame may result in retransmission of multiple frames Very inefficient in noisy link Very inefficient in noisy link Selective Repeat ARQ allows frames to be received out of order Selective Repeat ARQ allows frames to be received out of order Therefore, receive window > 1 Therefore, receive window > 1

44 Send and Receive Windows Sender and receiver share window space equally Sender and receiver share window space equally For m-bit sequence numbers For m-bit sequence numbers Send window: up to 2 m-1 Send window: up to 2 m-1 Receive window: up to 2 m-1 Receive window: up to 2 m-1

45 Send Window

46 Receive Window

47 Negative ACK Used by receiver to indicate missing frame Used by receiver to indicate missing frame

48 Selective Repeat: Window Size

Data Link Control Protocols: HDLC and PPP

50 HDLC High-level Data Link Control High-level Data Link Control Bit-oriented protocol Bit-oriented protocol Support both Support both Point-to-point links Point-to-point links Multipoint links Multipoint links

51 Normal Response Mode "NRM" mode "NRM" mode Used in both point-to-point and multi-point link Used in both point-to-point and multi-point link

52 Asynchronous Balance Mode "ABM" "ABM" Supports only point-to-point links Supports only point-to-point links Each station is both primary and secondary Each station is both primary and secondary

53 HDLC Frames Information frame (I-frame) Information frame (I-frame) Supervisory frame (S-frame) Supervisory frame (S-frame) Unnumbered frame (U-frame) Unnumbered frame (U-frame) Frame Check Sequence (error detection code)

54 Control Field Format N(S) – Frame sequence number N(S) – Frame sequence number N(R) – Ack sequence number N(R) – Ack sequence number P/F P/F Poll (primary  secondary) Poll (primary  secondary) Final (secondary  primary) Final (secondary  primary)

55 U-Frame Codes

56 Connection and Disconnection

57 Data Transfer: No Error

58 Data Transfer: With Error

59 PPP Point-to-Point Protocol Point-to-Point Protocol Byte-oriented protocol Byte-oriented protocol Most common protocol for point-to-point access Most common protocol for point-to-point access Dial-up access Dial-up access ADSL ADSL GPRS/EDGE/3G GPRS/EDGE/3G

60 PPP Frame Format Escape byte: Escape byte: Control field uses HDLC's U-frame format Control field uses HDLC's U-frame format No flow or error control No flow or error control

61 PPP Transition States

62 Multiplexing in PPP

63 PPP Stack Link Control Protocol (LCP) Link Control Protocol (LCP) Authentication Protocol (AP) Authentication Protocol (AP) Network Control Protocol (NCP) Network Control Protocol (NCP)

64 LCP: Link Control Protocol Responsible for establishing, maintaining, configuring, and terminating links Responsible for establishing, maintaining, configuring, and terminating links

65 PPP Authentication Two protocols are supported: Two protocols are supported: Password Authentication Protocol (PAP) Password Authentication Protocol (PAP) Challenge Handshake Authentication Protocol (CHAP) Challenge Handshake Authentication Protocol (CHAP)

66 PAP

67 CHAP

68 NCP: Network Control Protocol A set of control protocols to allow data from the network layer to be encapsulated into a PPP frame A set of control protocols to allow data from the network layer to be encapsulated into a PPP frame One common protocol: IPCP One common protocol: IPCP (Internetwork Protocol Control Protocol) Allow negotiation at the network layer Allow negotiation at the network layer

69 Data Encapsulation

70 Example: PPP Session

71 Example: PPP Session (cont'd)