Link Layer: Retransmissions

Similar documents
Link Layer. (continued)

Link Layer. (continued)

Hamming Code. Gives a method for construc=ng a code with a distance of 3. Plus an easy way to correct [soon]

Computer Networks. Randomized Multiple Access

Topics (2) 3. Retransmissions. 4. MulFple Access. 5. Switching. Handling loss. Classic Ethernet, Modern Ethernet

CSE 461 Multiple Access. David Wetherall

Where we are in the Course

Opera-ng Systems and Networks. Network Lecture 4: Link Layer (2) Pending Issues

CS 43: Computer Networks. 27: Media Access Contd. December 3, 2018

CS 43: Computer Networks Media Access. Kevin Webb Swarthmore College November 30, 2017

CSE 461: Multiple Access Networks. This Lecture

Chapter 12 Multiple Access 12.1

CMPE 257: Wireless and Mobile Networking

High Level View. EE 122: Ethernet and Random Access protocols. Medium Access Protocols

ECEN 5032 Data Networks Medium Access Control Sublayer

EE 122: Ethernet and

COS 140: Foundations of Computer Science

ECE453 Introduction to Computer Networks. Broadcast vs. PPP. Delay. Lecture 7 Multiple Access Control (I)

Random Access. 1. Aloha. 2. Slotted Aloha 3. CSMA 4. CSMA/CD

Getting Connected (Chapter 2 Part 4) Networking CS 3470, Section 1 Sarah Diesburg

CSE 461: Wireless Networks

CMPE 257: Wireless and Mobile Networking

Multiple Access in Cellular and Systems

Wireless MACs: MACAW/802.11

Medium Access Control Sublayer Chapter 4

COS 140: Foundations of Computer Science

Lecture 6. Data Link Layer (cont d) Data Link Layer 1-1

MSIT 413: Wireless Technologies Week 8

Multiple Access Links and Protocols

CSE/EE 461 Wireless and Contention-Free Protocols

Wireless Communications

ECE 4450:427/527 - Computer Networks Spring 2017

Computer Network Fundamentals Spring Week 3 MAC Layer Andreas Terzis

MULTIPLE ACCESS PROTOCOLS 2. 1

Computer Networks. Today. Principles of datalink layer services Multiple access links Adresavimas, ARP LANs Wireless LANs VU MIF CS 1/48 2/48

Computer Networks Medium Access Control. Mostafa Salehi Fall 2008

ECE 158A: Lecture 13. Fall 2015

Medium Access Control. MAC protocols: design goals, challenges, contention-based and contention-free protocols

Outline. Introduction to Networked Embedded Systems - Embedded systems Networked embedded systems Embedded Internet - Network properties

Jaringan Komputer. Broadcast Network. Outline. MAC (Medium Access Control) Channel Allocation Problem. Dynamic Channel Allocation

Topics. Link Layer Services (more) Link Layer Services LECTURE 5 MULTIPLE ACCESS AND LOCAL AREA NETWORKS. flow control: error detection:

IEEE , Token Rings. 10/11/06 CS/ECE UIUC, Fall

CS/ECE 439: Wireless Networking. MAC Layer Road to Wireless

Lecture 25: CSE 123: Computer Networks Alex C. Snoeren. HW4 due NOW

Chapter 4. The Medium Access Control Sublayer. Points and Questions to Consider. Multiple Access Protocols. The Channel Allocation Problem.

LECTURE PLAN. Script. Introduction about MAC Types o ALOHA o CSMA o CSMA/CD o CSMA/CA

Redes de Computadores. Medium Access Control

Computer Networks. Shyam Gollakota

Wireless LAN. Access Point. Provides network connectivity over wireless media

Wireless Local Area Networks. Networks: Wireless LANs 1

The Link Layer and LANs. Chapter 6: Link layer and LANs

Wireless Challenges : Computer Networking. Overview. Routing to Mobile Nodes. Lecture 25: Wireless Networking

Lecture 16: QoS and "

CS 3640: Introduction to Networks and Their Applications

Links Reading: Chapter 2. Goals of Todayʼs Lecture. Message, Segment, Packet, and Frame

CHAPTER 7 MAC LAYER PROTOCOLS. Dr. Bhargavi Goswami Associate Professor & Head Department of Computer Science Garden City College

Review. Error Detection: CRC Multiple access protocols. LAN addresses and ARP Ethernet. Slotted ALOHA CSMA/CD

Lecture 4: Wireless MAC Overview. Hung-Yu Wei National Taiwan University

LAN PROTOCOLS. Beulah A AP/CSE

Medium Access Control Sublayer Chapter 4

Contention Protocols and Networks

Multiple Access Protocols

Long Distance Wireless Communication. Principally satellite communication:

Wireless Local Area Networks (WLANs)) and Wireless Sensor Networks (WSNs) Computer Networks: Wireless Networks 1

ICE 1332/0715 Mobile Computing (Summer, 2008)

College of Computer and Information Sciences Department of Computer Engineering CEN444 Computer Networks Midterm 2 Exam Second Semester 1434/1435

COMP/ELEC 429/556 Introduction to Computer Networks

6.9 Summary. 11/20/2013 Wireless and Mobile Networks (SSL) 6-1. Characteristics of selected wireless link standards a, g point-to-point

CSMA/CD (Collision Detection)

Data Link Layer -2- Network Access

Protocols for Multiaccess Networks

Multiple Access Channels

WiFi Networks: IEEE b Wireless LANs. Carey Williamson Department of Computer Science University of Calgary Winter 2018

Lecture 9: Bridging. CSE 123: Computer Networks Alex C. Snoeren

Medium Access Control. IEEE , Token Rings. CSMA/CD in WLANs? Ethernet MAC Algorithm. MACA Solution for Hidden Terminal Problem

Data and Computer Communications. Chapter 13 Wireless LANs

Lecture 24: CSE 123: Computer Networks Stefan Savage. HW4 due NOW

15-441: Computer Networking. Wireless Networking

Strengthening Unlicensed Band Wireless Backhaul

1-1. Switching Networks (Fall 2010) EE 586 Communication and. November 8, Lecture 30

Data Link Layer: Overview, operations

MAC Sublayer(1) Principal service of the Medium Access Control Sublayer: Allocating a single broadcast channel (mostly a LAN) among competing users

original standard a transmission at 5 GHz bit rate 54 Mbit/s b support for 5.5 and 11 Mbit/s e QoS

Data Link Layer -2- Network Access

standard. Acknowledgement: Slides borrowed from Richard Y. Yale

Aloha and slotted aloha

Wireless LANs. ITS 413 Internet Technologies and Applications

Outline: Connecting Many Computers

Final Review Fall 2017 Profs Peter Steenkiste & Justine Sherry

Shared Access Networks Wireless. 1/27/14 CS mywireless 1

!! Due next week (week 3), start of class. !! Electronic turnin. !! No class trawler (do that for Fishnet #2) !! On web site

Chapter 4. The Medium Access Control Sublayer

Lecture 23 Overview. Last Lecture. This Lecture. Next Lecture ADSL, ATM. Wireless Technologies (1) Source: chapters 6.2, 15

Local Area Networks NETW 901

Chapter 4: The Medium Access Layer

Unit 7 Media Access Control (MAC)

Lecture 12 December 04, Wireless Access. Graduate course in Communications Engineering. University of Rome La Sapienza. Rome, Italy

CS 123: Lecture 12, LANs, and Ethernet. George Varghese. October 24, 2006

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 16

Medium Access Control. CSCI370 Lecture 5 Michael Hutt New York Institute of Technology

Transcription:

Link Layer: Retransmissions

Context on Reliability Where in the stack should we place reliability functions? Application Transport Network Link Physical CSE 461 University of Washington 2

Context on Reliability (2) Everywhere! It is a key issue Different layers contribute differently Application Transport Network Recover actions (correctness) Link Physical Mask errors (performance optimization) CSE 461 University of Washington 3

ARQ (Automatic Repeat request) ARQ often used when errors are common or must be corrected E.g., WiFi, and TCP (later) Rules at sender and receiver: Receiver automatically acknowledges correct frames with an ACK Sender automatically resends after a timeout, until an ACK is received CSE 461 University of Washington 4

ARQ (2) Normal operation (no loss) Timeout Sender Frame ACK Receiver Time CSE 461 University of Washington 5

ARQ (3) Loss and retransmission Timeout Sender Frame Receiver X Time Frame ACK CSE 461 University of Washington 6

So What s Tricky About ARQ? CSE 461 University of Washington 7

Duplicates What happens if an ACK is lost? Sender Frame Receiver Timeout X ACK CSE 461 University of Washington 8

Duplicates (2) What happens if an ACK is lost? Sender Frame Receiver Timeout New Frame?? X ACK Frame ACK CSE 461 University of Washington 9

Duplicates (3) Or the timeout is early? Sender Frame Receiver Timeout ACK CSE 461 University of Washington 10

Duplicates (4) Or the timeout is early? Sender Frame Receiver Timeout ACK New Frame?? Frame ACK CSE 461 University of Washington 11

So What s Tricky About ARQ? Two non-trivial issues: How long to set the timeout? How to avoid accepting duplicate frames as new frames Want performance in the common case and correctness always CSE 461 University of Washington 12

Timeouts Timeout should be: Not too big (link goes idle) Not too small (spurious resend) Fairly easy on a LAN Clear worst case, little variation Fairly difficult over the Internet Much variation, no obvious bound We ll revisit this with TCP (later) CSE 461 University of Washington 13

Sequence Numbers Frames and ACKs must both carry sequence numbers for correctness To distinguish the current frame from the next one, a single bit (two numbers) is sufficient Called Stop-and-Wait CSE 461 University of Washington 14

Stop-and-Wait In the normal case: Sender Receiver Time CSE 461 University of Washington 15

Stop-and-Wait (2) In the normal case: Timeout Sender Receiver Frame 0 ACK 0 Time Frame 1 ACK 1 CSE 461 University of Washington 16

Stop-and-Wait (3) With ACK loss: Sender Receiver Frame 0 Timeout X ACK 0 CSE 461 University of Washington 17

Stop-and-Wait (4) With ACK loss: Timeout It s a Resend! Sender Receiver Frame 0 X ACK 0 Frame 0 ACK 0 CSE 461 University of Washington 18

Stop-and-Wait (5) With early timeout: Sender Frame 0 Receiver Timeout ACK 0 CSE 461 University of Washington 19

Stop-and-Wait (6) With early timeout: Sender Frame 0 Receiver Timeout ACK 0 OK Frame 0 ACK 0 It s a Resend CSE 461 University of Washington 20

Limitation of Stop-and-Wait It allows only a single frame to be outstanding from the sender: Good for LAN, not efficient for high BD Ex: R=1 Mbps, D = 50 ms How many frames/sec? If R=10 Mbps? CSE 461 University of Washington 21

Sliding Window Generalization of stop-and-wait Allows W frames to be outstanding Can send W frames per RTT (=2D) Various options for numbering frames/acks and handling loss Will look at along with TCP (later) CSE 461 University of Washington 22

Multiple Access

Topic Multiplexing is the network word for the sharing of a resource Classic scenario is sharing a link among different users Time Division Multiplexing (TDM) Frequency Division Multiplexing (FDM) CSE 461 University of Washington 24

Time Division Multiplexing (TDM) Users take turns on a fixed schedule 2 2 2 2 CSE 461 University of Washington 25

Frequency Division Multiplexing (FDM) Put different users on different frequency bands Overall FDM channel CSE 461 University of Washington 26

TDM versus FDM In TDM a user sends at a high rate a fraction of the time; in FDM, a user sends at a low rate all the time Rate TDM FDM Time CSE 461 University of Washington 27

TDM versus FDM (2) In TDM a user sends at a high rate a fraction of the time; in FDM, a user sends at a low rate all the time Rate TDM FDM Time CSE 461 University of Washington 28

TDM/FDM Usage Statically divide a resource Suited for continuous traffic, fixed number of users Widely used in telecommunications TV and radio stations (FDM) GSM (2G cellular) allocates calls using TDM within FDM CSE 461 University of Washington 29

Multiplexing Network Traffic Network traffic is bursty ON/OFF sources Load varies greatly over time Rate R Rate R Time Time CSE 461 University of Washington 30

Multiplexing Network Traffic (2) Network traffic is bursty Inefficient to always allocate user their ON needs with TDM/FDM Rate R Rate R Time Time CSE 461 University of Washington 31

Multiplexing Network Traffic (3) Multiple access schemes multiplex users according to demands for gains of statistical multiplexing Rate Rate Two users, each need R R Rate R <2R Time R Time Time Together they need R < 2R CSE 461 University of Washington 32

Random Access How do nodes share a single link? Who sends when, e.g., in WiFI? Explore with a simple model Assume no-one is in charge Distributed system CSE 461 University of Washington 33

Random Access (2) We will explore random multiple access control (MAC) protocols This is the basis for classic Ethernet Remember: data traffic is bursty Busy! Zzzz.. Ho hum CSE 461 University of Washington 34

ALOHA Network Seminal computer network connecting the Hawaiian islands in the late 1960s When should nodes send? A new protocol was devised by Norm Abramson Hawaii CSE 461 University of Washington 35

ALOHA Protocol Simple idea: Node just sends when it has traffic. If there was a collision (no ACK received) then wait a random time and resend That s it! CSE 461 University of Washington 36

ALOHA Protocol (2) Some frames will be lost, but many may get through Good idea? CSE 461 University of Washington 37

ALOHA Protocol (3) Simple, decentralized protocol that works well under low load! Not efficient under high load Analysis shows at most 18% efficiency Improvement: divide time into slots and efficiency goes up to 36% We ll look at other improvements CSE 461 University of Washington 38

Classic Ethernet ALOHA inspired Bob Metcalfe to invent Ethernet for LANs in 1973 Nodes share 10 Mbps coaxial cable Hugely popular in 1980s, 1990s : 2009 IEEE CSE 461 University of Washington 39

CSMA (Carrier Sense Multiple Access) Improve ALOHA by listening for activity before we send (Doh!) Can do easily with wires, not wireless So does this eliminate collisions? Why or why not? CSE 461 University of Washington 40

CSMA (2) Still possible to listen and hear nothing when another node is sending because of delay CSE 461 University of Washington 41

CSMA (3) CSMA is a good defense against collisions only when BD is small X CSE 461 University of Washington 42

CSMA/CD (with Collision Detection) Can reduce the cost of collisions by detecting them and aborting (Jam) the rest of the frame time Again, we can do this with wires Jam! X X X X X X X X Jam! CSE 461 University of Washington 43

CSMA/CD Complications Everyone who collides needs to know it happened Time window in which a node may hear of a collision (transmission + jam) is 2D seconds X CSE 461 University of Washington 44

CSMA/CD Complications (2) Impose a minimum frame length of 2D seconds So node can t finish before collision Ethernet minimum frame is 64 bytes X CSE 461 University of Washington 45

CSMA Persistence What should a node do if another node is sending? What now? Idea: Wait until it is done, and send CSE 461 University of Washington 46

CSMA Persistence (2) Problem is that multiple waiting nodes will queue up then collide More load, more of a problem Now! Uh oh Now! CSE 461 University of Washington 47

CSMA Persistence (3) Intuition for a better solution If there are N queued senders, we want each to send next with probability 1/N Send p=½ Whew Send p=½ CSE 461 University of Washington 48

Binary Exponential Backoff (BEB) Cleverly estimates the probability 1st collision, wait 0 or 1 frame times 2nd collision, wait from 0 to 3 times 3rd collision, wait from 0 to 7 times BEB doubles interval for each successive collision Quickly gets large enough to work Very efficient in practice CSE 461 University of Washington 49

Classic Ethernet, or IEEE 802.3 Most popular LAN of the 1980s, 1990s 10 Mbps over shared coaxial cable, with baseband signals Multiple access with 1-persistent CSMA/CD with BEB CSE 461 University of Washington 50

Ethernet Frame Format Has addresses to identify the sender and receiver CRC-32 for error detection; no ACKs or retransmission Start of frame identified with physical layer preamble Packet from Network layer (IP)

Modern Ethernet Based on switches, not multiple access, but still called Ethernet We ll get to it in a later segment Switch Switch ports Twisted pair CSE 461 University of Washington 52

Topic How do wireless nodes share a single link? (Yes, this is WiFi!) Build on our simple, wired model Send? Send? CSE 461 University of Washington 53

Wireless Complications Wireless is more complicated than the wired case (Surprise!) 1. Nodes may have different areas of coverage doesn t fit Carrier Sense 2. Nodes can t hear while sending can t Collision Detect CSMA/CD CSE 461 University of Washington 54

Different Coverage Areas Wireless signal is broadcast and received nearby, where there is sufficient SNR CSE 461 University of Washington 55

Hidden Terminals Nodes A and C are hidden terminals when sending to B Can t hear each other (to coordinate) yet collide at B We want to avoid the inefficiency of collisions CSE 461 University of Washington 56

Exposed Terminals B and C are exposed terminals when sending to A and D Can hear each other yet don t collide at receivers A and D We want to send concurrently to increase performance CSE 461 University of Washington 57

Nodes Can t Hear While Sending With wires, detecting collisions (and aborting) lowers their cost More wasted time with wireless Wired Collision X Resend Wireless Collision XXXXXXXXX Resend X Time XXXXXXXXX CSE 461 University of Washington 58

MACA (Multiple Access with Collision Avoidance) MACA uses a short handshake instead of CSMA (Karn, 1990) 802.11 uses a refinement of MACA (later) Protocol rules: 1.A sender node transmits a RTS (Request-To-Send, with frame length) 2.The receiver replies with a CTS (Clear-To-Send, with frame length) 3.Sender transmits the frame while nodes hearing the CTS stay silent Collisions on the RTS/CTS are still possible, but less likely CSE 461 University of Washington 59

MACA Hidden Terminals A B with hidden terminal C 1. A sends RTS, to B A RTS B C D CSE 461 University of Washington 60

MACA Hidden Terminals (2) A B with hidden terminal C 2. B sends CTS, to A, and C too RTS A CTS B CTS Alert! C D CSE 461 University of Washington 61

MACA Hidden Terminals (3) A B with hidden terminal C 3. A sends frame while C defers Frame Quiet... CSE 461 University of Washington 62

MACA Exposed Terminals B A, C D as exposed terminals B and C send RTS to A and D A RTS B C RTS D CSE 461 University of Washington 63

MACA Exposed Terminals (2) B A, C D as exposed terminals A and D send CTS to B and C All OK All OK A RTS CTS B C RTS CTS D CSE 461 University of Washington 64

MACA Exposed Terminals (3) B A, C D as exposed terminals A and D send CTS to B and C A Frame B C Frame D CSE 461 University of Washington 65

MACA Assumptions? Where does this break?

802.11, or WiFi Very popular wireless LAN started in the 1990s Clients get connectivity from a (wired) AP (Access Point) It s a multi-access problem Various flavors have been developed over time Faster, more features Access Point Client To Network CSE 461 University of Washington 67

802.11 Physical Layer Uses 20/40 MHz channels on ISM (unlicensed) bands 802.11b/g/n on 2.4 GHz 802.11 a/n on 5 GHz OFDM modulation (except legacy 802.11b) Different amplitudes/phases for varying SNRs Rates from 6 to 54 Mbps plus error correction 802.11n uses multiple antennas Lots of fun tricks here CSE 461 University of Washington 68

802.11 Link Layer Multiple access uses CSMA/CA (next); RTS/CTS optional Frames are ACKed and retransmitted with ARQ Funky addressing (three addresses!) due to AP Errors are detected with a 32-bit CRC Many, many features (e.g., encryption, power save) Packet from Network layer (IP) CSE 461 University of Washington 69

802.11 CSMA/CA for Multiple Access Still using BEB! Send? Send? Time CSE 461 University of Washington 70

Cellular MAC Spectrum suddenly very very scarce We can t waste all of it sending JAMs We have QoS requirements Can t be as loose with expectations Can t have traffic fail We also have client/server Centralized control Not peer-to-peer/decentralized

GSM MAC FDMA/TDMA Use one channel for coordination - BEB Use other channels for traffic Dedicated channel for QoS

MAC Tradeoffs?