The Data Link Layer 2 Chapter 3 CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Data Link Layer Design Issues Error.

Slides:



Advertisements
Similar presentations
Chapter 3 The Data Link Layer.
Advertisements

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.
William Stallings Data and Computer Communications 7th Edition
By: Ashley Owens Chelsey James Dannielle Turmon. Protocols Consist of 1) Forward Channels(for data) 2)Reverse Channels(for acknowledgements)
Data Link Control We want to minimize the amount of error correcting and detecting we need to do.
Chapter 11 Data Link Control
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.
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.
The Data Link Layer Data Link Layer Design Issues Error Detection and Correction Elementary Data Link Protocols Sliding Window Protocols Example Data Link.
EEC-484/584 Computer Networks Lecture 12 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
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.
Computer Networks: Data Link Layer 1 Data Link Layer.
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.
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.
Chi-Cheng Lin, Winona State University CS 313 Introduction to Computer Networking & Telecommunication Data Link Layer Part I – Designing Issues and Elementary.
Transport Layer Moving Segments. Transport Layer Protocols Provide a logical communication link between processes running on different hosts as if directly.
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.
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 Chapter 3 1. H YBRID M ODEL The hybrid reference model to be used in this book. 2.
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.
Copyright © Lopamudra Roychoudhuri
Computer Networks Lecture 3: Data Link - part II Based on slides from D. Choffnes Northeastern U. and P. Gill from StonyBrook University Revised Autumn.
Eighth Edition by William Stallings Chapter 7 – Data Link Control Protocols Data Link Control Protocols need layer of logic above Physical to manage exchange.
Data Link Layer: Data Link Control : Data Communication and Computer Networks Asst. Prof. Chaiporn Jaikaeo, Ph.D.
The Data Link Layer Chapter 3 CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Data Link Layer Design Issues Error.
The Data Link Layer Chapter 3 1/21/2016www.ishuchita.com1.
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.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 The Data Link Layer Chapter 3.
Chi-Cheng Lin, Winona State University CS412 Introduction to Computer Networking & Telecommunication Data Link Layer Part II – Sliding Window Protocols.
Chapter 3 The Data Link Layer Computer Networks. The Data Link Layer Chapter 3 CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D.
Distributed Systems 4. Data Link Layer Simon Razniewski Faculty of Computer Science Free University of Bozen-Bolzano A.Y. 2015/2016.
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.
Computer Networking Lecture 16 – Reliable Transport.
Data Link Layer.
Chapter 3: The Data Link Layer –to achieve reliable, efficient communication between two physically connected machines. –Design issues: services interface.
The Data Link Layer Chapter 3
Computer Communication & Networks
2.10 Flow and Error Control Before that ...
Part III Datalink Layer 10.
Data Link Layer as a Reliable Data Transport Protocol
Chapter 5 Peer-to-Peer Protocols and Data Link Layer
Objectives of Today’s Lecture
The Transport Layer Reliability
Objectives of Today’s Lecture
Chapter 5 Peer-to-Peer Protocols and Data Link Layer
Lecture 4 Peer-to-Peer Protocols and Data Link Layer
Presentation transcript:

The Data Link Layer 2 Chapter 3 CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Data Link Layer Design Issues Error Detection and Correction Elementary Data Link Protocols Sliding Window Protocols Example Data Link Protocols Revised: August 2011

The Data Link Layer CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Responsible for delivering frames of information over a single link Handles transmission errors and regulates the flow of data Physical Link Network Transport Application

TUNALI Computer Networks 1 3 Assumptions Source and destination are directly connected to each other There can be an error during the transmission The channel has finite data rate There is a nonzero propagation delay Purpose Develop algorithms for reliable and efficient communication between the source and the destination

TUNALI Computer Networks 1 4 Protocol Definitions Continued  Some definitions needed in the protocols to follow. These are located in the file protocol.h.

Link layer environment (2) Link layer protocol implementations use library functions See code ( protocol.h ) for more details CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 GroupLibrary FunctionDescription Network layer from_network_layer(&packet) to_network_layer(&packet) enable_network_layer() disable_network_layer() Take a packet from network layer to send Deliver a received packet to network layer Let network cause “ready” events Prevent network “ready” events Physical layer from_physical_layer(&frame) to_physical_layer(&frame) Get an incoming frame from physical layer Pass an outgoing frame to physical layer Events & timers wait_for_event(&event) start_timer(seq_nr) stop_timer(seq_nr) start_ack_timer() stop_ack_timer() Wait for a packet / frame / timer event Start a countdown timer running Stop a countdown timer from running Start the ACK countdown timer Stop the ACK countdown timer

Sliding Window Protocols CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Sliding Window concept » One-bit Sliding Window » Go-Back-N » Selective Repeat »

Sliding Window concept (1) CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Sender maintains window of frames it can send Needs to buffer them for possible retransmission Window advances with next acknowledgements Receiver maintains window of frames it can receive Needs to keep buffer space for arrivals Window advances with in-order arrivals

Sliding Window concept (2) CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 A sliding window advancing at the sender and receiver Ex: window size is 1, with a 3-bit sequence number. At the start First frame is sent First frame is received Sender gets first ack Sender Receiver

Sliding Window concept (3) CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Larger windows enable pipelining for efficient link use Stop-and-wait (w=1) is inefficient for long links Best window (w) depends on bandwidth-delay (BD) Want w ≥ 2BD+1 to ensure high link utilization Pipelining leads to different choices for errors/buffering We will consider Go-Back-N and Selective Repeat

TUNALI Computer Networks 1 10 Sliding Window Protocols Previous protocols involved transmission of data frames in only one direction In practice, two way data communication is necessary One way to achieve this is to have two lines each having forward and backward channels each implementing Protocol 2 This will waste bandwidth Better way is to use the same circuit for data in both directions There will be data and ack frames in each direction

TUNALI Computer Networks 1 11 Piggybacking The performance is further improved by attaching ack to an outgoing data frame instead of sending a separate ack frame. (piggybacking) Unnecessary overhead of sending a separate frame for ack is avoided Question: How long should data link layer wait for a packet onto which to piggyback the ack? Answer: It starts an ack timer. If a data frame is received from the network layer in the mean time, ack is piggybacked,. if not, a separate ack frame is sent

TUNALI Computer Networks 1 12 Sliding Window Parameters Sequence numbers of frames range from 0 to 2 n –1 where n will be specified later for each protocol Sending Window A set of sequence numbers of frames the sender is permitted to send Receiving Window A set of sequence numbers of frames the receiver is permitted to accept

TUNALI Computer Networks 1 13 Sliding Window Assumptions The protocol must deliver packets to the destination network layer in the same order that they were passed to the data link layer on the sending machine Physical communication channel must deliver all frames in the order sent The senders window contains frames sent but not ack’ed yet When a packet from network layer is received, the upper edge of the window is advanced When ack is received, lower edge of the window is advanced

TUNALI Computer Networks 1 14 Receiver Window Any frame falling outside the window is discarded When a frame whose sequence number is equal to the lower edge of the window is received, it is passed to the network layer An ack is generated Window is rotated by one The receiver window always remains at its initial size

TUNALI Computer Networks 1 15 A One Bit Sliding Window Protocol Sender and receiver window size is 1 Frame sequence numbers are 0 and 1 The ack field contains the number of the last frame received without error No combination of lost frames or premature timeouts can cause the protocol to deliver duplicate packets to either network layer, or to skip a packet, or o get into a deadlock.

One-Bit Sliding Window (1) Transfers data in both directions with stop-and-wait Piggybacks acks on reverse data frames for efficiency Handles transmission errors, flow control, early timers CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, { Each node is sender and receiver (p4): Prepare first frame Launch it, and set timer

One-Bit Sliding Window (2) CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, If a frame with new data then deliver it Wait for frame or timeout (Otherwise it was a timeout) If an ack for last send then prepare for next data frame Send next data frame or retransmit old one; ack the last data we received

Two scenarios show subtle interactions exist in p4: −Simultaneous start [right] causes correct but slow operation compared to normal [left] due to duplicate transmissions. Time Normal caseCorrect, but poor performance One-Bit Sliding Window (3) CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Notation is (seq, ack, frame number). Asterisk indicates frame accepted by network layer.

Go-Back-N (1) CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Receiver only accepts/acks frames that arrive in order: Discards frames that follow a missing/errored frame Sender times out and resends all outstanding frames

Go-Back-N (2) CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Tradeoff made for Go-Back-N: Simple strategy for receiver; needs only 1 frame Wastes link bandwidth for errors with large windows; entire window is retransmitted Implemented as p5 (see code in book)

Selective Repeat (1) CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Receiver accepts frames anywhere in receive window Cumulative ack indicates highest in-order frame NAK (negative ack) causes sender retransmission of a missing frame before a timeout resends window

Selective Repeat (2) CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Tradeoff made for Selective Repeat: More complex than Go-Back-N due to buffering at receiver and multiple timers at sender More efficient use of link bandwidth as only lost frames are resent (with low error rates) Implemented as p6 (see code in book)

Selective Repeat (3) CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 For correctness, we require: Sequence numbers (s) at least twice the window (w) Originals Retransmits Error case (s=8, w=7) – too few sequence numbers Correct (s=8, w=4) – enough sequence numbers New receive window overlaps old – retransmits ambiguous New and old receive window don’t overlap – no ambiguity

TUNALI Computer Networks 1 24 Receiver Window Any frame falling outside the window is discarded When a frame whose sequence number is equal to the lower edge of the window is received, it is passed to the network layer An ack is generated Window is rotated by one The receiver window always remains at its initial size

TUNALI Computer Networks 1 25 A One Bit Sliding Window Protocol Sender and receiver window size is 1 Frame sequence numbers are 0 and 1 The ack field contains the number of the last frame received without error No combination of lost frames or premature timeouts can cause the protocol to deliver duplicate packets to either network layer, or to skip a packet, or o get into a deadlock.

TUNALI Computer Networks 1 26 A One-Bit Sliding Window Protocol Continued 

TUNALI Computer Networks 1 27 A One-Bit Sliding Window Protocol (ctd.)

TUNALI Computer Networks 1 28 Peculiar Scenarios for Protocol 4 If both sides simultaneously send an initial packet, half of the frames contain duplicates but there is no transmission error Same situation may happen with premature timeouts

TUNALI Computer Networks 1 29 A Protocol Using Go Back n In protocol 4, sender is required to wait for an ack before the next frame is transmitted If the propagation delay is high, this causes waist of bandwidth. The solution is to allow the sender to transmit more than one frame before receiving any ack. To maximize throughput, the sender is expected to send w frames to keep the line busy, called pipelining.

TUNALI Computer Networks 1 30 Example If Channel capacity: 50 kbps Round trip propagation delay: 500 msec Frame length: 1000 bit Then Frame transmission time is 20 msec t=0 frame sent, t=520 msec ack received Protocol 4 uses 20/520 of the bandwidth To fully utilize bandwidth, w=520/20=26

TUNALI Computer Networks 1 31 Pipelining Receiver Policies Question What happens to the frames received after receiving an in correct frame? Answer Either discard all the frames proceeding the garbled one, (called go back n, receiver window size 1) Or accept those frames, but not forward the to the network layer until the garbled one is retransmitted correctly (called selective repeat, receiver window size greater than 1)

TUNALI Computer Networks 1 32 Receiver Policies

TUNALI Computer Networks 1 33 Sliding Window Protocol Using Go Back N Continued 

TUNALI Computer Networks 1 34 Sliding Window Protocol Using Go Back N Continued 

TUNALI Computer Networks 1 35 Sliding Window Protocol Using Go Back N Continued 

TUNALI Computer Networks 1 36 Sliding Window Protocol Using Go Back N

TUNALI Computer Networks 1 37 Protocol 5 Assumptions 1 Network layer may not always have a packet to send When it has a packet to send it causes network_layer_ready event Data link layer may not send frames as fast as the network layer wants enable_network_layer −Allow network layer to pass packets to data link layer disable_network_layer −Disallow network layer from passing packets to data link layer

TUNALI Computer Networks 1 38 Protocol 5 Assumptions 2 Sequence numbers range from 0 to MAX_SEQ When an acknowledgement comes in for frame n, frames n-1, n-2, and so on are also automatically acknowledged The window size is MAX_SEQ

TUNALI Computer Networks 1 39 Protocol 5 Assumptions 3 There are at most MAX_SEQ many frames outstanding at any instant If it were MAX_SEQ+1, then the protocol fails with the following scenario −The sender sends frames 0 to MAX_SEQ −It receives ack for MAX_SEQ −The sender sends another batch of frames from 0 to MAX_SEQ −All of the last batch is lost −The receiver sends ack for the last correctly received frame which is MAX_SEQ −The sender will think that all the frames of the last batch are correctly received and the protocol will fail

TUNALI Computer Networks 1 40 Multiple timer management

TUNALI Computer Networks 1 41 A Protocol Using Selective Repeat Protocol 5 has poor performance if the error rate of the channel is high An alternative receiver strategy is to accept frames proceeding a garbled one Frame sequence numbers start from 0 and grow to some predefined maximum MAX_SEQ The receiver window is always fixed and has a buffer reserved for each frame number in its window

TUNALI Computer Networks 1 42 A Sliding Window Protocol Using Selective Repeat Continued 

TUNALI Computer Networks 1 43 Continued  A Sliding Window Protocol Using Selective Repeat (2)

TUNALI Computer Networks 1 44 A Sliding Window Protocol Using Selective Repeat (3) Continued 

TUNALI Computer Networks 1 45 A Sliding Window Protocol Using Selective Repeat (4)

TUNALI Computer Networks 1 46 Protocol 6 Mechanisms 1 Function between Checks if the arriving frame sequence number falls within the window The window size is (MAX_SEQ+1)/2

TUNALI Computer Networks 1 47 Protocol 6 Mechanisms 2 The following scenario shows that the protocol fails when window size is MAX_SEQ The sender transmits frames 0 to MAX_SEQ-1 At the receiver, all frames are received correctly The receiver sends MAX_SEQ acks to sender and slides the window to MAX_SEQ-MAX_SEQ-2 All the acks are lost Sender times out and retransmits all the MAX_SEQ frames The receiver accepts frames 0 to MAX_SEQ-2 as new frames and the protocol fails

TUNALI Computer Networks 1 48 Failure Scenario

TUNALI Computer Networks 1 49 Protocol 6 Mechanisms 3 The number buffers needed is the size of the window There is a timer associated with each buffer Protocol 5 assumes that there is always reverse traffic to piggyback acks and it blocks if there is no reverse traffic Protocol 6 implements start_ack_timer When a data frame arrives, a timer is started If no data frame to send back, timer runs off and a special ack frame is sent

TUNALI Computer Networks 1 50 Protocol 6 Mechanisms 4 If the receiver suspects that a frame is garbled or lost, it sends a NAK frame to the sender requesting retransmission To prevent duplicate NAKs, variable no_nak is used. If the standard deviation of ack interval is small, NAK is not that useful Else, NAKs speedup the communication considerably

Example Data Link Protocols CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Packet over SONET » PPP (Point-to-Point Protocol) » ADSL (Asymmetric Digital Subscriber Loop) »

Packet over SONET CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Packet over SONET is the method used to carry IP packets over SONET optical fiber links Uses PPP (Point-to-Point Protocol) for framing Protocol stacks PPP frames may be split over SONET payloads

PPP (1) CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 PPP (Point-to-Point Protocol) is a general method for delivering packets across links Framing uses a flag (0x7E) and byte stuffing “Unnumbered mode” (connectionless unacknow- ledged service) is used to carry IP packets Errors are detected with a checksum IP packet0x21 for IPv4

PPP (2) CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 A link control protocol brings the PPP link up/down State machine for link control

ADSL (1) CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Widely used for broadband Internet over local loops ADSL runs from modem (customer) to DSLAM (ISP) IP packets are sent over PPP and AAL5/ATM (over)

ADSL (2) CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 PPP data is sent in AAL5 frames over ATM cells: ATM is a link layer that uses short, fixed-size cells (53 bytes); each cell has a virtual circuit identifier AAL5 is a format to send packets over ATM PPP frame is converted to a AAL5 frame (PPPoA) AAL5 frame is divided into 48 byte pieces, each of which goes into one ATM cell with 5 header bytes

TUNALI Computer Networks 1 57 Required Reading Tanenbaum Sections

TUNALI Computer Networks 1 58 Homework 2 Chapter 3 21 (23) 27 (30) 29 (32) 30 (34)

End Chapter 3 CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011