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.

Slides:



Advertisements
Similar presentations
1 Data Link Protocols By Erik Reeber. 2 Goals Use SPIN to model-check successively more complex protocols Using the protocols in Tannenbaums 3 rd Edition.
Advertisements

Chapter 3 The Data Link Layer.
Data Link Layer Protocols Flow Control in 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.
11-1 FRAMING The data link layer needs to pack bits into frames, so that each frame is distinguishable from another. Our postal system practices a type.
Primitives for Achieving Reliability 3035/GZ01 Networked Systems Kyle Jamieson Department of Computer Science University College London.
CIS 725 Data Link Layer. Physical Layer Figure 3-1 B. Forouzan, TCP/IP Protocol Suite.
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,
IS333, Ch. 26: TCP Victor Norman Calvin College 1.
Data Link Control We want to minimize the amount of error correcting and detecting we need to do.
Chapter 11 Data Link Control
Data link control. Data Link Control –Flow Control how much data may sent –Error Control How can error be detected and corrected.
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.
Protocols. Basics Defining Interactions VERTICAL Application Presentation Session Transport Network Data Link Physical Please do this for me OK It’s.
CSC 3352 Computer Communications Chapter 3&41 The Link Layer Has 2 main Components The Data Link Layer Medium Access Control (MAC) Examples:SLIP, PPP,
CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 13 Introduction to Computer Networks.
CSE 461: Sliding Windows & ARQ. Next Topic  We begin on the Transport layer  Focus  How do we send information reliably?  Topics  The Transport layer.
20101 The Data Link Layer Chapter Design Issues Controls communication between 2 machines directly connected by “wire”-like link Services Provided.
Error Checking continued. Network Layers in Action Each layer in the OSI Model will add header information that pertains to that specific protocol. On.
Principles of Reliable Data Transfer. Reliable Delivery Making sure that the packets sent by the sender are correctly and reliably received by the receiver.
11.1 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 11: Flow Control – can occur at layer 2 (data link) and at layer 4 (transport)  You saw the need in the most recent assignment.  Data packets.
Data Link Layer We have now discussed the prevalent shared channel technologies  Ethernet/IEEE  Wireless LANs (802.11) We have now covered chapters.
3: Transport Layer 3a-1 8: Principles of Reliable Data Transfer Last Modified: 10/15/2015 7:04:07 PM Slides adapted from: J.F Kurose and K.W. Ross,
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.
Cyclic Code. Linear Block Code Hamming Code is a Linear Block Code. Linear Block Code means that the codeword is generated by multiplying the message.
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.
Review:. Chapter 3: The Data Link Layer –achieve reliable, efficient communication between two physically connected machines. –Example problems to be.
Chapter 5 Peer-to-Peer Protocols and Data Link Layer PART I: Peer-to-Peer Protocols ARQ Protocols and Reliable Data Transfer Flow Control.
CS 453 Computer Networks Lecture 9 Layer 2 – Data Link Layer.
ICOM 6115©Manuel Rodriguez-Martinez ICOM 6115 – Computer Networks and the WWW Manuel Rodriguez-Martinez, Ph.D. Lecture 13.
1 Chapter Six - Errors, Error Detection, and Error Control Chapter Six.
CS 453 Computer Networks Lecture 9 Layer 2 – Data Link Layer.
Today’s topic: UDP Reliable communication over UDP.
Midterm Review. Physical Layer Physical layer design goal: send out bits as fast as possible with acceptable low error ratio C=B*log(1+S/N) – C is the.
CS 453 Computer Networks Lecture 11 Layer 2 – Data Link Layer Protocols.
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.
CSE/EE 461 Sliding Windows and ARQ. 2 Last Time We finished up the Network layer –Internetworks (IP) –Routing (DV/RIP, LS/OSPF) It was all about routing:
NET 221D : COMPUTER NETWORKS FUNDAMENTALS LECTURE 4: DATA LINK LAYER Behrouz A. Forouzan” Data communications and Networking 1.
Part III. Data Link Layer Chapter 11. Data Link Control COMP 3270 Computer Networks Computing Science Thompson Rivers University.
Midterm Review. Physical Layer Physical layer design goal: send out bits as fast as possible with acceptable low error ratio C=B*log(1+S/N) – C is the.
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.
Data Link Layer.
Chapter 3: The Data Link Layer –to achieve reliable, efficient communication between two physically connected machines. –Design issues: services interface.
9. Principles of Reliable Data Transport – Part 1
Reliable Transmission
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.
Net 221D : Computer Networks Fundamentals
CMPT 371 Data Communications and Networking
Data Link Layer What does it do?
Data Link Layer.
Chapter 3 – Part 1 The Data Link Layer.
Data Link Layer: Data Link Control
Overview Jaringan Komputer (2)
CS412 Introduction to Computer Networking & Telecommunication
Data Link Layer (cont’d)
Chapter 11 Data Link Control
Getting Connected (Chapter 2 Part 3)
Data Link Layer (cont’d)
Selective Repeat.
Presentation transcript:

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 before bit B, bit A will be received earlier than bit B Fundamental constraints – Errors – Computers have different capabilities – Delay is not zero

Data Link Layer Framing

Data link layer framing What the data link layer does is to encapsulate the packets from the network layer into frames and send out these frames. So we will discuss how to deliver these frames.

Framing How does the receiver know where is the start and where is the end of a frame? Counter. Tell the receiver how many bytes there are in this frame. Problems? The counter part could be corrupted and you are done.

Flag Bytes Add special bytes to the beginning and the end of the frame. What if the data contains the flag bytes? Add ESC byte to each flag or ESC in the data. Stuffing. Any time you see an ESC, the next byte is either ESC or FLAG naturally occurred in the data. Or, a FLAG is a real FLAG if not proceeded by ESC.

Using Bits More flexibility gained by sending bits. Using as the flag bits. If the data contains “011111”, add a 0 after the fifth 1. When the receiver sees in the data part “ ,” it removes the last 0. What if the original data contains “ ”? – It will be stuffed as “ ”, and won’t be regarded as the flag. The receiver will destuff it back into “ ” What if the original data contains “ ”? – It will be stuffed as “ ”. The receiver will destuff it back into “ ”

Data Link Layer Protocols

Data link layer protocols Assume that the physical layer, the data link layer, and the network layer are three processes and communicate with each other. Assume that the sender always has enough data to send. Assume that the machines don’t crash. Assume that the data flows only one direction (simplex).

Protocol 1. Your protocol really depends on the world you live in. If (1) the link never screws up your bits, and (2) the receiver’s network layer process reads the bits infinitely fast, what should be your protocol?

Protocol 1 Sender. 1.Grab data from the network layer. 2.Send to physical layer. Goto 1. Receiver 1.Get data from the physical layer 2.Give it to the network layer. Goto 1.

Protocol 2 Now remove assumption (2). The receiver’s network layer process is not infinitely fast. How to design the protocol? – Note that the receiver may not be able to process a frame if it is still working on a frame received earlier.

Protocol 2 The receiver must provide some kind of acknowledgements. If the receiver never tells the sender anything, the sender has no way of knowing whether this speed is too high or too low. The simplest form of ack is the receiver sends back an ack every time he receives a frame. The sender waits for this ack to start sending the next frame. Called “stop and wait.”

Protocol 2 Sender. 1.Grab data from the network layer and send to physical layer. 2.Wait (blocked here) for ack. 3.After getting ACK, goto 1. Receiver 1.Wait (blocked here) for data. 2.After getting the data, give it to the network layer and send ack. Goto 1.

Protocol 3 Now, let’s remove assumption (1). There is now noise in the channel and frames could be corrupted. Both the data frame and the ack frame. How to design your protocol? What are the considerations? When a frame is lost, how can the sender know?

Protocol 3 So we can add a timer. If the sender does not receive the ack before the timer expires, he knows something is wrong and resend this frame. How long should the timer be set? Problems?

Protocol 3 A sent B frame F. B received the frame. Sent ack to A. Ack got lost. A time out. Resend F. B received F. AGAIN!

Sequence Number Every frame has a sequence number. Sender says I am sending the frame with sequence number m. Receiver acks saying that I have successfully received the frame with sequence number m, please send me frame with sequence number m+1. This will solve the duplication problem.

Protocol 3 Sender (maintains “m” as the sequence number up to which has been ACKed) 1.Grab data from the network layer. 2.Send to physical layer with the current sequence number, i.e., m+1 and start timer. 3.Wait for ACK. If got an ACKm+1, m:=m+1, repeat 1. Else, timeout, repeat 2. Receiver (maintains “m” as the sequence number up to which has been received) 1.Wait for data. 2.Get data from the physical layer. If it is with the expected sequence number, i.e., m+1, give it to the network layer, m:=m+1. 3.send ACKm. Goto 1.

Protocol 3 Question 1. After sender sends frame m, will he receive ACK lower than m-1? Will it receive ACK higher than m?

Protocol 3 Answer. No. Because when sender sent frame m, he must have received ACK from the receiver of m-1. Receiver keeps the sequence number and won’t decrease it. And it will not receive ACK higher than m, because m+1 has not been sent yet.

Protocol 3 Question 2. After sending out an ACKm, what are the possible frames the receiver can receive?

Protocol 3 Answer. The only possible frames he could receive is m or m+1. In what case he receives m? (ACKm gets lost) In what case he receives m+1 (when everything goes fine)? Why can’t he receive m-1 (Because when sender sends m, he knows that m-1 is received correctly.)? Why can’t he receive m+2 (because sender won’t send m+2 before the receiver sends ACKm+1)?

Protocol 3 Question 3. How many bits should the sequence number have?

Protocol 3 Answer. 1 bit. At any time, there are only two possible frames both for the sender and the receiver.