Computer Networks: Data Link Layer 1 Data Link Layer.

Slides:



Advertisements
Similar presentations
CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 14 Introduction to Computer Networks.
Advertisements

Chapter 3 The Data Link Layer.
The Data Link Layer Chapter 3. Data Link Layer Design Issues Services Provided to the Network Layer Framing Error Control Flow Control.
Assume that a file is transferred from a node A to a node B. The file has been fragmented in 5 frames. Frame 0 is corrupted, the ACK of frame 1 is corrupted,
Chapter 3: The Datalink Layer CS 455/555. Topics to be covered Design Issues Error detection and correction Elementary datalink protocols Sliding window.
Data Link Layer Computer Networks.
Go-Back-N Improve Stop-and-Wait by not waiting!
Chapter 11 Data Link Control
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.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Chapter 11 Data Link Control and Protocols.
EEC-484/584 Computer Networks Lecture 12 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
ELEN 602 Lecture 5 Review of last lecture –Error Detection -- parity/CRC etc. Automatic Retransmission Request (ARQ) Reading: Chap
Data Link Layer as a Reliable Data Transport Protocol Computer Networks Computer Networks Term B10.
Data Link Layer Review Advanced Computer Networks.
EEC-484/584 Computer Networks Lecture 14 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
EEC-484/584 Computer Networks Lecture 12 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
Networks: Data Link Layer1 Data Link Layer. Networks: Data Link Layer2 Data Link Layer Provides a well-defined service interface to the network layer.
Networks: Data Link Layer1 Data Link Layer. Networks: Data Link Layer2 Data Link Layer Provides a well-defined service interface to the network layer.
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.
EEC-484/584 Computer Networks Lecture 14 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
Networks: Data Link Layer1 Data Link Layer. Networks: Data Link Layer2 Data Link Layer Provides a well-defined service interface to the network layer.
EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
Networks: Data Link Layer1 Data Link Layer. Networks: Data Link Layer2 Data Link Layer Provides a well-defined service interface to the network layer.
CSC 450/550 Part 2: The Data Link Layer. CSC 450/550 Summary Part A Functions (1)Functions of the data link layer (2)Framing (3)Error control (3.1) Error.
Adapted from Tanenbaum's Slides for Computer Networking, 4e The Data Link Layer Chapter 3.
# 5 1 Victor S. Frost Dan F. Servey Distinguished Professor Electrical Engineering and Computer Science University of Kansas 2335 Irving Hill Dr. Lawrence,
ARQ Mechanisms Rudra Dutta ECE/CSC Fall 2010, Section 001, 601.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction.
Chi-Cheng Lin, Winona State University CS 313 Introduction to Computer Networking & Telecommunication Data Link Layer Part I – Designing Issues and Elementary.
Leon-Garcia & Widjaja: Communication Networks Copyright ©2000 The McGraw Hill Companies Chapter 5 Leon-Garcia Peer-to-Peer Protocols We will cover most.
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 Transport Layer Lecture 10 Imran Ahmed University of Management & Technology.
The data link layer. Data Link Layer Design Issues Services Provided to the Network Layer Framing Error Control Flow Control.
1 ECE453 – Introduction to Computer Networks Lecture 5 – Data Link Protocols (II)
The Data Link Layer Chapter 3 10/28/2015www.noteshit.com1.
CS 453 Computer Networks Lecture 9 Layer 2 – Data Link Layer.
The Data Link Layer Chapter 3 1/21/2016www.ishuchita.com1.
Lecture Focus: Data Communications and Networking  Data Link Layer  Data Link Control Lecture 22 CSCS 311.
Data Link Layer Flow and Error Control. Flow Control Flow Control Flow Control Specifies the amount of data can be transmitted by sender before receiving.
COSC 3213: Computer Networks I Instructor: Dr. Amir Asif Department of Computer Science York University Section M Topics: 1.Flow Control and ARQ Protocols.
Chi-Cheng Lin, Winona State University CS412 Introduction to Computer Networking & Telecommunication Data Link Layer Part II – Sliding Window Protocols.
1 The utopia protocol  Unrealistic assumptions: –processing time ignored –infinite buffer space available –simplex: data transmitted in one direction.
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.
Data Link Layer as a Reliable Data Transport Protocol Advanced Computer Networks Advanced Computer Networks Term D11.
Computer Networking Lecture 16 – Reliable Transport.
NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS ( NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS (PRACTICAL PART) Tutorial 4 : Chapter 7 Data & computer.
Chapter 3: The Data Link Layer –to achieve reliable, efficient communication between two physically connected machines. –Design issues: services interface.
Computer Communication & Networks
Data Link Layer Flow Control.
Data Link Layer - 3 Dr. Sanjay P. Ahuja, Ph.D.
Part III Datalink Layer 10.
UNIT 4 Data Link Control Line Discipline Flow Control Error Control
Advanced Computer Networks D12
Instructor Mazhar Hussain
CIS 321 Data Communications & Networking
Flow Control.
Chapter 3 – Part 1 The Data Link Layer.
Flow and Error Control.
Overview Jaringan Komputer (2)
Data Link Layer as a Reliable Data Transport Protocol
Chapter 5 Peer-to-Peer Protocols and Data Link Layer
Data Link Layer (cont’d)
Chapter 11 Data Link Control
Data Link Layer (cont’d)
Chapter 5 Peer-to-Peer Protocols and Data Link Layer
Lecture 4 Peer-to-Peer Protocols and Data Link Layer
Presentation transcript:

Computer Networks: Data Link Layer 1 Data Link Layer

Computer Networks: Data Link Layer 2 Data Link Layer Provides a well-defined service interface to the network layer. Determines how the bits of the physical layer are grouped into frames (framing). Deals with transmission errors (CRC and ARQ). Regulates the flow of frames. Performs general link layer management.

Computer Networks: Data Link Layer Medium 1 2 Physical layer entity Data link layer entity 3 Network layer entity Physical Layer Data link Layer Physical Layer Data link Layer A B A B Packets Frames (a) (b) Figure 5.2 Leon-Garcia & Widjaja: Communication Networks Copyright ©2000 The McGraw Hill Companies

Computer Networks: Data Link Layer Data ACK/NAK Data ACK/ NAK Figure 5.7 End to End Hop by Hop Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies

Computer Networks: Data Link Layer 5 Tanenbaum’s Data Link Layer Treatment Concerned with communication between two adjacent nodes in the subnet (node to node). Assumptions: –The bits are delivered in the order sent. –Rigid interface between the HOST and the node  the communications policy and the Host protocol (with OS effects) can evolve separately. – He uses a simplified model.

Computer Networks: Data Link Layer 6 Host A Host B Layer 4 Node 2 Node 1 Layer 4 Layer 2 frame Data Link Layer Model Assume the sending Host has infinite supply of messages. A node constructs a frame from a single packet message. The CRC is automatically appended in the hardware. The protocols are developed in increasing complexity to help students understand the data link layer issues.

Computer Networks: Data Link Layer 7 Packet sequence Error-free packet sequence Information frames Control frames TransmitterReceiver CRC Information packet Header Station A Station B Information Frame Control frame CRC Header Figure 5.8Leon-Garcia & Widjaja: Communication Networks Copyright ©2000 The McGraw Hill Companies Basic Elements of ARQ

Computer Networks: Data Link Layer 8 Continued  Figure 3-9. Some definitions needed in the protocols to follow. These are located in the file protocol.h. Tanenbaum’s Protocol Definitions

Computer Networks: Data Link Layer 9 Protocol Definitions (continued) Figure 3-9. Some definitions needed in the protocols to follow. These are located in the file protocol.h.

Computer Networks: Data Link Layer 10 ackseqkindinfo buffer physical layer network layer data link layer frame packet

Computer Networks: Data Link Layer 11 Figure 3-10 Unrestricted Simplex Protocol

Computer Networks: Data Link Layer 12 Figure 3-11 Simplex Stop-and- Wait Protocol

Computer Networks: Data Link Layer 13 (a) Frame 1 lost A B frame 0 frame 1 ACK frame 1 ACK time Time-out frame 2 (b) ACK lost A B frame 0 frame 1 ACK frame 1 ACK time Time-out frame 2 ACK In parts (a) and (b) transmitting station A acts the same way, but part (b) receiving station B accepts frame 1 twice. Figure 5.9Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies Ambiguities with Stop-and-Wait [unnumbered frames]

Computer Networks: Data Link Layer 14 Transmitter Receiver S last R next 0 1 (0,0) (0,1) (1,0) (1,1) Timer Global State: (S last, R next ) Error-free frame 0 arrives at receiver ACK for frame 0 arrives at transmitter ACK for frame 1 arrives at transmitter Error-free frame 1 arrives at receiver Station A Station B R next S last Figure 5.11 Leon-Garcia & Widjaja: Communication Networks Copyright ©2000 The McGraw Hill Companies State Machine for Stop-and-Wait

Computer Networks: Data Link Layer 15 #define MAX_SEQ 1 typedef enum {frame_arrival, cksum_err, timeout} event_type; include “protocol.h” void sender_par (void) { seq_nr next_frame_to_send; frame s; packet buffer; event_type event; next_frame_to_send = 0; from_network_layer (&buffer); while (true) { s.info = buffer; s.seq = next_frame_to_send; to_physical_layer (&s); start_timer (s.seq); wait_for_event(&event); if (event == frame_arrival) { from_network_layer (&buffer); inc (next_frame_to_send); } Protocol 3 (PAR) Positive ACK with Retransmission [Old Tanenbaum Version]

Computer Networks: Data Link Layer 16 void receiver_par (void) { seq_nr next_frame_to_send; frame r, s; event_type event; frame_expected = 0; while (true) { wait_for_event (&event); if (event == frame_arrival) { from_physical_layer (&r); if (r.seq == frame_expected) { to_network_layer(&r.info); inc (frame_expected); } to_physical_layer (&s); /* Note – no sequence number on ACK */ } Protocol 3 (PAR) Positive ACK with Retransmission [Old Tanenbaum Version]

Computer Networks: Data Link Layer 17 A B frame 0 frame 0 ACK frame 1 ACK time time-out frame 2 Transmitting station A misinterprets duplicate ACKs Figure 5.10Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies [Old] PAR Problem Ambiguities when ACKs are unnumbered

Computer Networks: Data Link Layer 18 PAR Simplex Protocol for a Noisy Channel Figure 3-12.A Positive Acknowledgement with Retransmission protocol. Continued 

Computer Networks: Data Link Layer 19 A Simplex Protocol for a Noisy Channel Figure 3-12.A positive acknowledgement with retransmission protocol.

Computer Networks: Data Link Layer 20 Sliding Window Protocols [Tanenbaum] Must be able to transmit data in both directions. Choices for utilization of the reverse channel: – mix DATA frames with ACK frames. –Piggyback the ACK Receiver waits for DATA traffic in the opposite direction. Use the ACK field in the frame header to send sequence number of frame being ACKed. –  better use of the channel capacity.

Computer Networks: Data Link Layer 21 Sliding Window Protocols ACKs introduce a new issue – how long does receiver wait before sending ONLY an ACK frame.  We need an ACKTimer!!  The sender timeout period needs to be set longer. The protocol must deal with the premature timeout problem and be “robust” under pathological conditions.

Computer Networks: Data Link Layer 22 Sliding Window Protocols Each outbound frame must contain a sequence number. With n bits for the sequence number field, maxseq = 2 n - 1 and the numbers range from 0 to maxseq. Sliding window :: the sender has a window of frames and maintains a list of consecutive sequence numbers for frames that it is permitted to send without waiting for ACKs. The receiver has a window that is a list of frame sequence numbers it is permitted to accept. Note – sending and receiving windows do NOT have to be the same size. The windows can be fixed size or dynamically growing and shrinking.

Computer Networks: Data Link Layer 23 Sliding Window Protocols The Host is oblivious to sliding windows and the message order at the transport layer is maintained. sender’s window :: frames sent but not yet ACKed. –new packets from the Host cause the upper edge inside the sender’s window to be incremented. –acknowledged frames from the receiver cause the lower edge inside the sender’s window to be incremented.

Computer Networks: Data Link Layer 24 Sliding Window Protocols All frames in the sender’s window must be saved for possible retransmission and we need one timer per frame in the window. If the maximum sender window size is B, the sender needs at least B buffers. If the sender’s window gets full (i.e., it reaches the maximum window size, the protocol must shut off the Host (the network layer) until buffers become available.

Computer Networks: Data Link Layer 25 Sliding Window Protocols receiver’s window –Frames received with sequence numbers outside the receiver’s window are not accepted. –The receiver’s window size is normally static. The set of acceptable sequence numbers is rotated as “acceptable” frames arrive. a receiver’s window size = 1  the protocol only accepts frames in order. This scheme is referred to as Go Back N.

Computer Networks: Data Link Layer 26 1.The ACK sequence number indicates the last frame successfully received. - OR - 2. ACK sequence number indicates the next frame the receiver expects to receive. Both of these can be strictly individual ACKs or represent cumulative ACKing. Cumulative ACKing is the most common technique. Two Standard Ways to ACK

Computer Networks: Data Link Layer 27 One-Bit Sliding Window Protocol

Computer Networks: Data Link Layer 28 A B fr 0 time fr 1 fr 2 fr 3 fr 4 fr 5 fr 6 fr 3 ACK1ACK1 error Out-of-sequence frames Go-Back-4: 4 frames are outstanding; so go back 4 fr 5 fr 6 fr 4 fr 7 fr 8 fr 9 ACK2ACK2 ACK3ACK3 ACK4ACK4 ACK5ACK5 ACK6ACK6 ACK7ACK7 ACK8ACK8 ACK9ACK9 Figure 5.13Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies ACKing next frame expected Go Back N

Computer Networks: Data Link Layer 29 A B fr 0 time fr 1 fr 2 fr 3 fr 4 fr 5 fr 1 fr 2 ACK1ACK1 error Out-of-sequence frames Go-Back-7: fr 4 fr 5 fr 3 fr 6 fr 7 fr 0 NAK1NAK1 ACK3ACK3 ACK4ACK4 ACK5ACK5 ACK6ACK6 ACK7ACK7 ACK2ACK2 Transmitter goes back to frame 1 Figure 5.17 Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies Go Back N with NAK error recovery

Computer Networks: Data Link Layer 30

Computer Networks: Data Link Layer 31

Computer Networks: Data Link Layer 32 A B fr 0 time fr 1 fr 2 fr 3 fr 4 fr 5 fr 6 fr 2 ACK1ACK1 error fr 8 fr 9 fr 7 fr 10 fr 11 fr 12 ACK2ACK2 NAK2NAK2 ACK7ACK7 ACK8ACK8 ACK9ACK9 ACK10ACK10 ACK11ACK11 ACK12ACK12 ACK2ACK2 ACK2ACK2 ACK2ACK2 Figure 5.21Leon-Garcia & Widjaja: Communication NetworksCopyright ©2000 The McGraw Hill Companies Selective Repeat with NAK error recovery

Computer Networks: Data Link Layer 33

Computer Networks: Data Link Layer 34