Data Link Layer Protocols Flow Control in 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.
Data Link Layer (cont’d)
The Data Link Layer Chapter 3. Data Link Layer Design Issues Services Provided to the Network Layer Framing Error Control Flow Control.
Network Operations & administration CS 4592 Lecture 15 Instructor: Ibrahim Tariq.
Assume that a file is transferred from a node A to a node B. The file has been fragmented in 5 frames (denoted as f0, f1, f2, f3, f4). Show the flow of.
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.
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.
8-Reliability and Channel Coding Dr. John P. Abraham Professor UTPA.
Data Link Layer Review Advanced Computer Networks.
Chapter 7 – Data Link Control Protocols
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.
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.
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.
1 Reliable Data Transfer. 2 r Problem: Reliability  Want an abstraction of a reliable link even though packets can be corrupted or get lost r Solution:
Data Link Control Protocols
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.
Data Link Layer We have now discussed the prevalent shared channel technologies  Ethernet/IEEE  Wireless LANs (802.11) We have now covered chapters.
CSC 311 Chapter Eight FLOW CONTROL TECHNIQUES. CSC 311 Chapter Eight How do we manage the large amount of data on the network? How do we react to a damaged.
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.
The data link layer. Data Link Layer Design Issues Services Provided to the Network Layer Framing Error Control Flow Control.
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 Chapter 3 10/28/2015www.noteshit.com1.
Data Link Layer Savera Tanwir. Data Link Layer Design Issues Services Provided to the Network Layer Framing Error Control Flow Control.
Copyright © Lopamudra Roychoudhuri
Data Link Layer - 2 Dr. Sanjay P. Ahuja, Ph.D. Fidelity National Financial Distinguished Professor of CIS School of Computing, UNF.
Data Link and Flow Control Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific.
Eighth Edition by William Stallings Chapter 7 – Data Link Control Protocols Data Link Control Protocols need layer of logic above Physical to manage exchange.
Chapter 3: Channel Coding (part 3). Automatic repeat request (ARQ) protocols ▫Used in combination with error detection/correction ▫Block of data with.
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.
CS 453 Computer Networks Lecture 11 Layer 2 – Data Link Layer Protocols.
11.1 Flow and Error Control Flow Control Error Control.
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.
© Janice Regan, CMPT 128, CMPT 371 Data Communications and Networking Principles of reliable data transfer 0.
Data Link Layer. Data link layer The communication between two machines that can directly communicate with each other. Basic property – If bit A is sent.
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.
DATA LINK CONTROL. DATA LINK LAYER RESPONSIBILTIES  FRAMING  ERROR CONTROL  FLOW CONTROL.
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
2.10 Flow and Error Control Before that ...
Data Link Layer Flow Control.
March 21, 2001 Recall we have talked about the Sliding Window Protocol for Flow Control Review this protocol A window of size I can contain at most I.
Part III Datalink Layer 10.
Chapter 11 Data Link Control
Instructor Mazhar Hussain
Data Link Layer What does it do?
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)
The Transport Layer Reliability
Chapter 5 Peer-to-Peer Protocols and Data Link Layer
Lecture 4 Peer-to-Peer Protocols and Data Link Layer
Presentation transcript:

Data Link Layer Protocols Flow Control in Data Link Layer

Flow Control: Initial Assumptions Simplex Channel Infinite buffer capacity with the receiver Error free transmission Network layer at the senders end is always ready with data No need for flow control

Protocol Definitions Continued Some definitions needed in the protocols to follow. These are located in the file protocol.h.

Protocol Definitions (ctd.) Some definitions needed in the protocols to follow. These are located in the file protocol.h.

Unrestricted Simplex Protocol

Some assumptions dropped Infinite capacity in the buffer of the receiver. Need for flow control Stop-n-Wait protocol –Sender sends a frame –And waits for a signal in the form of a dummy frame –No seq no. is required since the line is still error free

Simplex Stop-and- Wait Protocol

Further assumptions dropped The channel is noisy, frames may be damaged or lost Good scene : data frame reaches intact, ack sent back and received, next frame sent Bad scene : –Data frame damaged or lost..hence no ack – sender times out and resends.. No problems –Data frame reaches intact but Ack lost.. Times out..resends.. Receiver receives duplicate frames..Problem

Problem of Duplicate frames Solution : –Keep a sequence number for each frame to distinguish between the new frame and a duplicate frame. How large should be the sequence number? Or What should be minimum number of bits required for the sequence number? –The only ambiguity at the receiver is between two successive frames.. Say m and m+1 and never between m-1 and m +1.. Its only after the ack for m-1 reaches back intact mth frame is sent.. And once mth frame reaches intact at the receivers end.. Story of m-1th frame is over.. However depending upon whether ack of mth frame reaches back intact or not either mth or m+1 th frame is sent.. hence only 1 bit is sufficient

A Simplex Protocol for a Noisy Channel A positive acknowledgement with retransmission protocol. Continued

A Simplex Protocol for a Noisy Channel (ctd.) A positive acknowledgement with retransmission protocol.

Further assumption dropped Channel is simplex.. So, Now communication is two way.. I.e. Duplex channel –Interleave data and ack.. So..a kind field is required to specify whether the frame contains data or ack. –Piggyback ack on data frame

Sliding Window Protocol(Duplex) At any instant of time, the sender maintains a set of sequence numbers corresponding to frames it is permitted to send – this includes – frames not yet sent –Frames sent but not yet acknowledged.. May have to be sent again This corresponds to the senders window. When a packet comes from the NL..it is appended in the window and when an ack arrives for a frame..it is deleted from the buffer(and from the window)

Sliding Window Protocol(Duplex) Similarly, the receiver also maintains a set of sequence numbers corresponding to frames it is permitted to accept. –When a frame arrives, its seq number is checked..if it falls in the window it is accepted else discarded.. Once an ack is sent for a frame it is deleted from the window so that duplicate frames are not accepted. Sliding window gives the DLL the flexibility to accept the frames in any order but they must be handed over to the NL in order.

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.

Sliding Window Protocols A One-Bit Sliding Window Protocol A Protocol Using Go Back N A Protocol Using Selective Repeat

A One-Bit Sliding Window Protocol Continued

A One-Bit Sliding Window Protocol (ctd.)

How does it handle duplicate frames… Say when an Ack is lost …A times out and resends.. Both A and B are wanting to send a packet numbered 0, or one can imagine they have both sent out packets with seq no. 1 and are waiting for its ack.

A sends A0, seq = 0, ack = 1, B sends B0, seq=0, ack = 1, but B0 is lost. B gets the packet A0 but ack is not the one required.. It resends B0 with the ack of A0… I.e. A0, seq = 0 and ack =0, (This is a duplicate of the ack that was lost) also it increments the FE.I.e FE becomes 1. Duplicates of A0,0,1 are rejected since their seq number (0) dont match the FE(1). However B sends the duplicate of the above again. If this is also lost.. A duplicates and then B duplicates and so on.

Eventually one of the duplicates of B reaches A..I.e. the ack required by A (remember both are waiting for ack of packet 0 in the beginning) and A sends another packet.. A1 with seq =1 and ack =0 that for B0 it just received. This was a good scene : problem was only due to noisy channel.. Ack were being lost

Bad scene : duplicates without transmission error When B sends before receiving a frame from A.

A One-Bit Sliding Window Protocol (2) Two scenarios for protocol 4. (a) Normal case. (b) Abnormal case. The notation is (seq, ack, packet number). An asterisk indicates where a network layer accepts a packet.

Further assumption dropped So far, implicitly, we have assumed that the time of transmission is negligible. I.e. the time frame takes to reach the receiver and the ack to travel back is negligible.

Long propagation delays Consider a 50 kbps satellite channel with a round trip delay of 500 msec (10^-3 sec). To send a frame of size 1000 bits..it takes = 1000/50kbps = 20msec. At t=0, the sender sends the first bit and at t = 20 msec (1000/50,000 sec= 1/50 sec= 1000/50 msec = 20msec), it sends the last bit. At t= 270 msec, the frame completely reaches the receiver. Not before t= 520 msec, the ack arrives back at the receiver ( it will be later than this). This means that the sender was blocked for 500 msec out of 520 msec.

Contd.. That means –Long propagation delays –High bandwidth –And, short frame length Is bad in terms of channel efficiency. A large window size is needed at the senders end whenever the bandwidth * round trip delay is large.

Pipelining Imagine in the above example, if the sender could send more frames without waiting for the ack for the first one, the channel could have been utilized more efficiently. This technique is called pipelining.

Pipelining Imagine the scenario, when the sender always has something to send until the ack for the first frame arrives.. Best scenario, right? Clearly this is not Stop-n Wait.

Pipelining contd… Let Channel capacity is b bits/sec Frame size l bits, Round trip propagation time is R The time required to transmit a single frame is l/b. So, in stop n wait, the line is busy for l/b time and idle for R time, thus the line utilization is = l/b divided by l/b + R = l/(l + bR). If l < bR, the efficiency will be less than 50%.

Pipelining over noisy channels What if one or more frames is errored. Two options : –Throw away all the subsequent frames and go back and start resending from the damaged frame. This corresponds to size 1 window in the receiver. - Go back N Protocol –Buffer the subsequent frames and wait for the damaged frame to be resent, once that comes handover the frames in proper order to the NL-Selective Repeat Protocol

Comparison Trade off between the bandwidth utilization and the buffer space in the receiver.

A Protocol Using Go Back N Pipelining and error recovery. Effect on an error when (a) Receivers window size is 1. (b) Receivers window size is large.

Issues For a maxseq = 7, Number of outstanding frames can only be 7 and not 8. To see why, let us consider what happens when 8 frames are allowed to be outstanding.. That is the scene is Sender has sent out 8 frames The piggybacked ack for frame 7 finally comes to the sender. Now suppose the sender has 8 outstanding frames, 0…7 Now sender sends next frame 0, if it is lost, if B has a frame to send, B will send the piggybacked ack for 7.

Next, the sender sends the next frame 1 without waiting for the ack for 0, now suppose this is also lost, again B has a frame to send,then B will again send ack for 7. And so on.. Sender sends all the outstanding frames, 0…7 Suppose all of them are lost, the receiver will still send the ack of the last frame received I.e. 7. Now sender has no way of knowing, whether all the frames were lost or since it has received ack for 7..all the frames reached intact.

Solution The problem is solved by keeping at most 7 instead of 8 outstanding frames, say –0-6 in the first batch, and –7,0-5 in the second If all the frames in the second batch are lost, sender may keep on receiving ack for frame 6 which is not in senders window and hence it will know that frames were lost.

Sliding Window Protocol Using Go Back N Continued

Sliding Window Protocol Using Go Back N Continued

Sliding Window Protocol Using Go Back N Continued

Sliding Window Protocol Using Go Back N

Sliding Window Protocol Using Go Back N (2) Simulation of multiple timers in software.

A Sliding Window Protocol Using Selective Repeat Continued

A Sliding Window Protocol Using Selective Repeat (2)

A Sliding Window Protocol Using Selective Repeat (3) Continued

A Sliding Window Protocol Using Selective Repeat (4)

Issues in Selective Repeat 7 frames 0-6 are sent, Received, ack-ed, and window of the receiver advanced to 7,0-5 All ack lost Sender times out and resends frame 0-6 At receiver, 0-5 accepted, buffered(since next frame it is expecting is 7) as new frames and ack- ed (Ack 6) and 6 discarded and acked as a duplicate Sender advances its window to 7,0-5 Sends packets 7,0-5

7 is accepted and passed onto the NL 0 and others are rejected as duplicate and the previous buffered frames are passed on to the NL - wrong packets!!!! Order in which packets are sent: P0…p6, p0…p6, p7, p0(new)…p5(new) Order in which packets are handed over to NL of the receiver: P0…p6,p7,p0…p5(duplicate) and rest are discarded including the new frames

Solution Keep the window size 4 That is half the range of permitted sequence numbers.

A Sliding Window Protocol Using Selective Repeat (5) (a) Initial situation with a window size seven. (b) After seven frames sent and received, but not acknowledged. (c) Initial situation with a window size of four. (d) After four frames sent and received, but not acknowledged.

Programming Assignments Make Groups of two and, Implement –Sliding window protocol with CRC on a duplex channel –Go Back N protocol with Hamming Code on a duplex channel Implementation of the channel must be clearly defined. There must be two copies of the same program running simultaneously, ( For example, on time sharing basis on the same machine, say in two different windows.) if required some synchronization may be added between the two processes. Alternatively, threads could be used. Will tell you more about the points on which your programs will be evaluated. Few are: –Acks incorporated or not, piggybacked or not, channel is truly duplex or not etc

I Acknowledge Help from the following site In preparing this lecture.