C08a: Data Link Protocols

Similar documents
The Data Link Layer Chapter 3

The Data Link Layer Chapter 3

CSMC 417. Computer Networks Prof. Ashok K Agrawala Ashok Agrawala. Nov 1,

The Data Link Layer. Data Link Layer Design Issues

Hamming codes can also correct burst of errors by using iterleaving

CMSC 417. Computer Networks Prof. Ashok K Agrawala Ashok Agrawala. October 11, 2018

Chapter 3. The Data Link Layer

Chapter 3. The Data Link Layer. Wesam A. Hatamleh

CS422 Computer Networks

Outline. EEC-484/584 Computer Networks. Data Link Layer Design Issues. Framing. Lecture 6. Wenbing Zhao Review.

CSMC 417. Computer Networks Prof. Ashok K Agrawala Ashok Agrawala Set 4. September 09 CMSC417 Set 4 1

ERROR AND FLOW CONTROL. Lecture: 10 Instructor Mazhar Hussain

Computer Networks. Data Link Layer. Design Issues. Basic Services. Notes. Paolo Costa costa. Notes. Note.

DATA LINK LAYER UNIT 7.

Chapter 3. The Data Link Layer

06/05/2008. Chapter 3. The Data Link Layer. Data Link Layer Design Issues. Services Provided to the Network Layer. Error Control Flow Control

Reliable transmission

Department of Computer and IT Engineering University of Kurdistan. Data Communication Netwotks (Graduate level) Data Link Layer

Lecture 5: Flow Control. CSE 123: Computer Networks Alex C. Snoeren

CS 640 Introduction to Computer Networks. Role of data link layer. Today s lecture. Lecture16

Telematics Chapter 4: Data Link Layer

Flow control: Ensuring the source sending frames does not overflow the receiver

Chapter 11 Data Link Control 11.1

Data Link Control. Outline. DLC functions

Chapter 11 Data Link Control 11.1

THE DATA LINK LAYER. From: Computer Networks, 3rd ed. by Andrew S. Tanenbaum, 1996 Prentice Hall

Chapter 11 Data Link Control 11.1

Lecture 7: Flow Control"

The data link layer has a number of specific functions it can carry out. These functions include. Figure 2-1. Relationship between packets and frames.

User watching video clip. Server with video clips Chapter 4: Data Link Layer Application Layer Application Layer. Beispielbild. Presentation Layer

10.1 REVIEW QUESTIONS

Advanced Computer Networks. Rab Nawaz Jadoon DCS. Assistant Professor COMSATS University, Lahore Pakistan. Department of Computer Science

Data Link Control Protocols

2.1 CHANNEL ALLOCATION 2.2 MULTIPLE ACCESS PROTOCOLS Collision Free Protocols 2.3 FDDI 2.4 DATA LINK LAYER DESIGN ISSUES 2.5 FRAMING & STUFFING

Networking Link Layer

Computer Networking. Reliable Transport. Reliable Transport. Principles of reliable data transfer. Reliable data transfer. Elements of Procedure

L5: Building Direct Link Networks III. Hui Chen, Ph.D. Dept. of Engineering & Computer Science Virginia State University Petersburg, VA 23806

The flow of data must not be allowed to overwhelm the receiver

Data Link layer (CN chap 3.1, 3.4, 3.6)

Analyzation of Automatic Repeat Request (ARQ) Protocols

CPE 548 Exam #1 (50 pts) February 17, 2016

file:///c:/users/hpguo/dropbox/website/teaching/fall 2017/CS4470/H...

Lecture 7: Sliding Windows. CSE 123: Computer Networks Geoff Voelker (guest lecture)

CSE 123: Computer Networks Alex C. Snoeren. HW 1 due NOW!

Computer Network. Direct Link Networks Reliable Transmission. rev /2/2004 1

CSE 461: Framing, Error Detection and Correction

CS 5520/ECE 5590NA: Network Architecture I Spring Lecture 13: UDP and TCP

Lecture 6. TCP services. Internet Transport Layer: introduction to the Transport Control Protocol (TCP) A MUCH more complex transport

UNIT IV -- TRANSPORT LAYER

Intro to LAN/WAN. Transport Layer

Inst: Chris Davison

Network Management & Monitoring Network Delay

Direct Link Communication I: Basic Techniques. Data Transmission. ignore carrier frequency, coding etc.

Problem 7. Problem 8. Problem 9

Lecture 5. Homework 2 posted, due September 15. Reminder: Homework 1 due today. Questions? Thursday, September 8 CS 475 Networks - Lecture 5 1

Principles of Reliable Data Transfer

Lecture 4: CRC & Reliable Transmission. Lecture 4 Overview. Checksum review. CRC toward a better EDC. Reliable Transmission

The Transport Layer. Why is there a transport layer? Addressing

EECS 122, Lecture 19. Reliable Delivery. An Example. Improving over Stop & Wait. Picture of Go-back-n/Sliding Window. Send Window Maintenance

ECE697AA Lecture 3. Today s lecture

Reliable Transport : Fundamentals of Computer Networks Bill Nace

Islamic University of Gaza Faculty of Engineering Department of Computer Engineering ECOM 4021: Networks Discussion. Chapter 2.

Data Link Layer. Overview. Links. Shivkumar Kalyanaraman

The Transport Layer Multiplexing, Error Detection, & UDP

DLL: Flow Control DLL. Simplex. Fast sender / slow receiver scenario. Various protocols used. Simplified examples implemented in C.

CSCI-1680 Link Layer I Rodrigo Fonseca

No book chapter for this topic! Slides are posted online as usual Homework: Will be posted online Due 12/6

Peer-to-Peer Protocols and Data Link Layer. Chapter 5 from Communication Networks Leon-Gracia and Widjaja

Transport Layer. Application / Transport Interface. Transport Layer Services. Transport Layer Connections

Comparison of ISO-OSI and TCP/IP Suit. Functions of Data Link Layer:

Announcements. No book chapter for this topic! Slides are posted online as usual Homework: Will be posted online Due 12/6

1.Write about the Data Link layer design issues.

Data link layer functions. 2 Computer Networks Data Communications. Framing (1) Framing (2) Parity Checking (1) Error Detection

Jaringan Komputer. Data Link Layer. The Data Link Layer. Study the design principles

Communications Software. CSE 123b. CSE 123b. Spring Lecture 3: Reliable Communications. Stefan Savage. Some slides couresty David Wetherall

The Transport Layer Reliability

2.4 Error Detection Bit errors in a frame will occur. How do we detect (and then. (or both) frames contains an error. This is inefficient (and not

16.682: Communication Systems Engineering. Lecture 17. ARQ Protocols

CPE 448/548 Exam #1 (100 pts) February 14, Name Class: 448

Transport layer. UDP: User Datagram Protocol [RFC 768] Review principles: Instantiation in the Internet UDP TCP

CSE/EE 461. Sliding Windows and ARQ. Last Time. This Time. We finished up the Network layer Internetworks (IP) Routing (DV/RIP, LS/OSPF)

Transport layer. Review principles: Instantiation in the Internet UDP TCP. Reliable data transfer Flow control Congestion control

Chapter 5 Peer-to-Peer Protocols. School of Info. Sci. & Eng. Shandong Univ..

Lesson Schedule: Class No. Portion covered per hour (An estimate)

Chapter 3 The Data Link Layer

Chapter 3: Transport Layer Part A

CS457 Transport Protocols. CS 457 Fall 2014

Lecture 7: Flow & Media Access Control"

Direct Link Communication I: Basic Techniques. Data Transmission. ignore carrier frequency, coding etc.

Outline. Connecting to the access network: DHCP and mobile IP, LTE. Transport layer: UDP and TCP

Data Communication Networks Final

TCP: Flow and Error Control

Lecture 22 Overview. Last Lecture. This Lecture. Next Lecture. Internet Applications. ADSL, ATM Source: chapter 14

Computer Networking Introduction

STEVEN R. BAGLEY PACKETS

Multiple unconnected networks

CS4700/CS5700 Fundamentals of Computer Networks

CSCI Topics: Internet Programming Fall 2008

Data Link Layer. Indian Institute of Technology Madras

Transport Layer (TCP/UDP)

Transcription:

CISC 7332X T6 C08a: Data Link Protocols Hui Chen Department of Computer & Information Science CUNY Brooklyn College 10/16/2018 CUNY Brooklyn College 1

Data Link Layer Responsible for delivering frames of information over a single link Handles transmission errors Regulates the flow of data Application Transport Network Link Physical 10/16/2018 CUNY Brooklyn College 2

Design Issues in Data Link Layer Discussed Concept of frames Error control Possible services Framing methods Flow control 10/16/2018 CUNY Brooklyn College 3

Outline Possible services Framing methods Data link protocol A utopian simplex protocol Stop-and-wait protocols Stop-and-wait for an error-free channel Stop-and-wait for a noisy channel Analysis of stop-and-wait protocols Sliding window protocols 1-bit sliding window Go-Back-N Selective repeat Data link protocols in practice 10/16/2018 CUNY Brooklyn College 4

Possible Services Unacknowledged connectionless service Frame is sent with no connection/error recovery Example: Ethernet Acknowledged connectionless service Frame is sent with retransmissions if needed Example: 802.11 Acknowledged connection-oriented service Connection is set up; rare 10/16/2018 CUNY Brooklyn College 5

Framing Methods Framing Breaking up bit streams into frames Methods Byte count Flag bytes with byte stuffing Flag bits with bit stuffing Physical layer coding violations Use non-data symbol to indicate frame 10/16/2018 CUNY Brooklyn College 6

Byte Count Frame begins with a count of the number of bytes in it Simple, but difficult to resynchronize after an error Rarely used by itself 10/16/2018 CUNY Brooklyn College 7

Byte Count: Example Expected case Error case 10/16/2018 CUNY Brooklyn College 8

Byte Stuffing Special flag bytes (or sentinel) delimit frames Data cannot contain the flat bytes i.e., occurrences of flags in the data must be stuffed (escaped) Longer (due to stuffing), but easy to resynchronize after error 10/16/2018 CUNY Brooklyn College 9

Byte Stuffing: Example Frame format Stuffing examples Need to escape extra ESCAPE bytes too! 10/16/2018 CUNY Brooklyn College 10

Bit Stuffing Stuffing done at the bit level: Example: frame flag has six consecutive 1s On transmit, after five 1s in the data, a 0 is added On receive, a 0 after five 1s is deleted 10/16/2018 CUNY Brooklyn College 11

Bit Stuffing: Example Data bits Transmitted bits with stuffing 10/16/2018 CUNY Brooklyn College 12

Questions? Concept of framing Framing methods Byte count Byte stuffing Bit stuffing 10/16/2018 CUNY Brooklyn College 13

Elementary Data Link Protocols Link layer environment Utopian Simplex Protocol Stop-and-Wait Protocol for Error-free channel Stop-and-Wait Protocol for Noisy channel 10/16/2018 CUNY Brooklyn College 14

Link Layer Environment Commonly implemented as Network Interface Cards (NICs) and Operating Systems (OS) drivers Remark Network layer (IP) is often a part of the OS software 10/16/2018 CUNY Brooklyn College 15

Link Layer Environment: Example Implementation 10/16/2018 CUNY Brooklyn College 16

Link Layer: Services Link layer protocol implementations use library functions See code (protocol.h) in next slide 10/16/2018 CUNY Brooklyn College 17

Example: protocol.h #define MAX_PKT 1024 /* determines packet size in bytes */ typedef enum {false, true} boolean; /* boolean type */ typedef unsigned int seq_nr; /* sequence or ack numbers */ typedef struct {unsigned char data[max_pkt];} packet;/*packet definition*/ typedef enum {data, ack, nak} frame_kind; /* frame_kind definition */ typedef struct { /* frames are transported in this layer */ frame_kind kind; /* what kind of frame is it? */ seq_nr seq; /* sequence number */ seq_nr ack; /* acknowledgement number */ packet info; /* the network layer packet */ } frame; /* Wait for an event to happen; return its type in event. */ void wait_for_event(event_type *event); /* Fetch a packet from the network layer for transmission on the channel. */ void from_network_layer(packet *p); /* Deliver information from an inbound frame to the network layer. */ void to_network_layer(packet *p); /* Go get an inbound frame from the physical layer and copy it to r. */ void from_physical_layer(frame *r); /* Pass the frame to the physical layer for transmission. */ void to_physical_layer(frame *s); /* Start the clock running and enable the timeout event. */ void start_timer(seq_nr k); /* Stop the clock and disable the timeout event. */ void stop_timer(seq_nr k); /* Start an auxiliary timer and enable the ack_timeout event. */ void start_ack_timer(void); /* Stop the auxiliary timer and disable the ack_timeout event. */ void stop_ack_timer(void); /* Allow the network layer to cause a network_layer_ready event. */ void enable_network_layer(void); /* Forbid the network layer from causing a network_layer_ready event. */ void disable_network_layer(void); /* Macro inc is expanded in-line: increment k circularly. */ #define inc(k) if (k < MAX_SEQ) k = k + 1; else k = 0 10/16/2018 CUNY Brooklyn College 18

Example: protocol.h: Services Group Library Function Description Application Transport Network Link Physical Network layer Physical layer Events & timers from_network_layer(&packet) to_network_layer(&packet) enable_network_layer() disable_network_layer() from_physical_layer(&frame) to_physical_layer(&frame) wait_for_event(&event) start_timer(seq_nr) stop_timer(seq_nr) start_ack_timer() stop_ack_timer() Take a packet from network layer to send Deliver a received packet to network layer Let network cause ready events Prevent network ready events Get an incoming frame from physical layer Pass an outgoing frame to physical layer 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 10/16/2018 CUNY Brooklyn College 19

Questions? Link layer environment Link layer services 10/16/2018 CUNY Brooklyn College 20

Data Link Protocols Examine three protocols Utopian Simplex Protocol (p1) Stop-and-Wait Protocol in an Error-Free Channel (p2) Stop-and-Wait Protocol in a Noisy Channel (p3) 10/16/2018 CUNY Brooklyn College 21

Utopian Simplex Protocol An optimistic protocol (p1) to start Assumes no errors, and receiver as fast as sender Considers one-way data transfer That s it, no error or flow control Flow control Prevent (fast) sender overwhelms (slow) receiver 10/16/2018 CUNY Brooklyn College 22

Utopian Simplex Protocol: Peer Interface and Implementation Unrealistic Error can occur Sender may be faster than receiver } Sender loops blasting frames Receiver loops eating frames 10/16/2018 CUNY Brooklyn College 23

Stop-and-Wait in Error-free Channel Error won t happen, no error control; but senders may be too fast Adding flow control to protocol p1 Protocol (p2) ensures sender won t outpace receiver: Receiver returns a dummy frame called ack when ready Stop and wait: Only one frame out from the sender at a time So, added flow control via the stop-and-wait mechanism 10/16/2018 CUNY Brooklyn College 24

Stop-and-Wait: Example Implementation Wait for Ack Sender waits to for ack after passing frame to physical layer Send Ack Receiver sends ack after passing frame to network layer 10/16/2018 CUNY Brooklyn College 25

Stop-and-Wait in Noisy Channel ARQ (Automatic Repeat request) adds error control Receiver acks frames that are correctly delivered Sender sets timer and resends frame if no ack) For correctness, frames and acks must be numbered Else receiver can t tell retransmission (due to lost ack or early timer) from new frame For stop-and-wait, 2 numbers (1 bit) are sufficient 10/16/2018 CUNY Brooklyn College 26

Stop-and-Wait/ARQ: Example: Sender { Sender loop (p3): Send frame (or retransmission) Set timer for retransmission Wait for ack or timeout If a good ack then set up for the next frame to send (else the old frame will be retransmitted) 10/16/2018 CUNY Brooklyn College 27

Stop-and-Wait/ARQ: Example: Receiver Wait for a frame If it s new then take it and advance expected frame Ack current frame 10/16/2018 CUNY Brooklyn College 28

Questions ARQ Error control via stop-and-wait Flow control via stop-and-wait 10/16/2018 CUNY Brooklyn College 29

Analysis of Stop-and-Wait How well does the stop-and-wait protocols perform? Metrics Throughput (effective bandwidth) and link utilization 10/16/2018 CUNY Brooklyn College 30

Throughput Q: what is the maximum throughput (effective bandwidth)? Best case tx1 frame No error, no retransmission Send and receiver are equally fast 1 RTT + ack p1 p2 tp Note: tp = p1 + p2 = 1 RTT Transfer time = tx1 + tx2 + tp tx2 Throughput = Transfer size/transfer time 9/2/2015 CSCI 445 Fall 2015 31

Link Utilization How much capacity of a channel is being used? Link utilization Throughput / Max Data Rate of the Channel 10/16/2018 CUNY Brooklyn College 32

Timeout? How long should the receiver wait? Timeout: 2 x RTT or more 9/2/2015 CSCI 445 Fall 2015 33

Exercise C08a-1 Data frame size (data) = 1500 bytes Acknowledgement frame size (ack) = 64 bytes Stop-and-Wait protocol: receiver is forced to wait 2 RTT before transmitting acknowledgement frame after having received data frame. No additional processing and queueing delay Draw timeline diagram first, and then compute throughputs and link utilization for one of the following, Dial-up RTT = 87 s; Link bandwidth: 56 Kbps Satellite RTT = 230 ms; Link bandwidth: 45 Mbps 10/16/2018 CUNY Brooklyn College 34

Questions? Estimating link utilization at best-case scenario What if the simple stop-and-wait protocol yields poor link utilization ratio? 10/16/2018 CUNY Brooklyn College 35

Sliding Window Protocols Sliding Window concept One-bit Sliding Window Go-Back-N Selective Repeat 10/16/2018 CUNY Brooklyn College 36

Concept of Sliding Window 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 10/16/2018 CUNY Brooklyn College 37

Concept of Sliding Window: Example A sliding window advancing at the sender and receiver Ex: window size is 1, with a 3-bit sequence number. 10/16/2018 CUNY Brooklyn College 38

Concept of Sliding Window: Example Sender Receiver At the start First frame is sent First frame is received Sender gets first ack 10/16/2018 CUNY Brooklyn College 39

Sliding Window: Advantage 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 10/16/2018 CUNY Brooklyn College 40

Questions? Concept of sliding window 10/16/2018 CUNY Brooklyn College 41

One-Bit Sliding Window Transfers data in both directions with stopand-wait Piggybacks acks on reverse data frames for efficiency Handles transmission errors, flow control, early timers 10/16/2018 CUNY Brooklyn College 42

One-bit Sliding Window: Example: Sender { Prepare first frame Launch it, and set timer... 10/16/2018 CUNY Brooklyn College 43

One-bit Sliding Window: Example: Receiver Wait for frame or timeout... If a frame with new data then deliver it If an ack for last send then prepare for next data frame (Otherwise it was a timeout) Send next data frame or retransmit old one; ack the last data we received 10/16/2018 CUNY Brooklyn College 44

One-Bit Sliding Window: Interactions Two scenarios show subtle interactions exist in p4: Simultaneous start [right] causes correct but slow operation compared to normal [left] due to duplicate transmissions. 10/16/2018 CUNY Brooklyn College 45

Simultaneous Start Normal case Simultaneous Start (Correct, but poor performance) Time Notation is (seq, ack, frame number). Asterisk indicates frame accepted by network layer. 10/16/2018 CUNY Brooklyn College 46

Go-Back-N 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 10/16/2018 CUNY Brooklyn College 47

Go-Back-N: Example 10/16/2018 CUNY Brooklyn College 48

Go-Back-N: Discussion 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 10/16/2018 CUNY Brooklyn College 49

Selective Repeat 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 10/16/2018 CUNY Brooklyn College 50

Selective Repeat: Example 10/16/2018 CUNY Brooklyn College 51

Selective Repeat: Discussion 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) 10/16/2018 CUNY Brooklyn College 52

Selective Repeat: Sequence Number For correctness, we require: Sequence numbers (s) at least twice the window (w) 10/16/2018 CUNY Brooklyn College 53

Selective Repeat: Sequence Number Error case (s=8, w=7) too few sequence numbers Correct (s=8, w=4) enough sequence numbers Originals Retransmits Originals Retransmits New receive window overlaps old retransmits ambiguous New and old receive window don t overlap no ambiguity 10/16/2018 CUNY Brooklyn College 54

Data Link Protocols: Examples in Practice Packet over SONET PPP (Point-to-Point Protocol) ADSL (Asymmetric Digital Subscriber Loop) 10/16/2018 CUNY Brooklyn College 55

Packet over SONET Packet over SONET is the method used to carry IP packets over SONET optical fiber links Uses PPP (Point-to-Point Protocol) for framing 10/16/2018 CUNY Brooklyn College 56

Packet over SONET Protocol stacks PPP frames may be split over SONET payloads 10/16/2018 CUNY Brooklyn College 57

PPP 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 unacknowledged service) is used to carry IP packets Errors are detected with a checksum 10/16/2018 CUNY Brooklyn College 58

PPP Frame 0x21 for IPv4 IP packet 10/16/2018 CUNY Brooklyn College 59

Link Control Protocol A link control protocol brings the PPP link up/down 10/16/2018 CUNY Brooklyn College 60

Link Control State machine for link control 10/16/2018 CUNY Brooklyn College 61

ADSL 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) 10/16/2018 CUNY Brooklyn College 62

ADSL: Protocol Stack 10/16/2018 CUNY Brooklyn College 63

ADSL and PPP 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) 10/16/2018 CUNY Brooklyn College 64

ADSL Frame AAL5 frame is divided into 48 byte pieces, each of which goes into one ATM cell with 5 header bytes 10/16/2018 CUNY Brooklyn College 65

Questions Data link protocols in practice 10/16/2018 CUNY Brooklyn College 66