Lecture 7: Flow & Media Access Control" CSE 123: Computer Networks Alex C. Snoeren HW 2 due next Wednesday!
Lecture 7 Overview" Flow control Go-back-N Sliding window Methods to share physical media: multiple access Fixed partitioning Random access Channelizing mechanisms 2
Stop-and-Wait Performance" Lousy performance if xmit 1 pkt << prop. delay How bad? Want to utilize all available bandwidth Need to keep more data in flight How much? Remember the bandwidth-delay product? Also limited by quality of timeout (how long?) 3
Pipelined Transmission" Sender Receiver Sender Receiver Data 0 Data 0 Data 1 Data 1 Data 2 Data 3 ACK 0 ACK 2 ACK 3 Data 2 Data 3 ACK 0 Ignored! Keep multiple packets in flight Allows sender to make efficient use of the link Sequence numbers ensure receiver can distinguish frames Duplicate acknowledgements signal loss ACK the highest consecutive frame received Ignore (for now) non-sequential frames 4
Go-Back-N" Sender Receiver Sender Receiver Data 0 Data 0 Data 1 Data 1 Data 2 Data 3 ACK 0 Data 2 Data 3 ACK 0 ACK 2 ACK 3 Data 2 Data 4 Retransmit from point of loss upon duplicate ACK Packets between loss event and retransmission are ignored Also go-back-n if a timeout event occurs ACKs are cumulative Acknowledge current frame and all previous ones 5
Send Window" T imeout Sender Data 0 Data 1 Data 2 Data 3 Data 4 Data 2 Data 3 Data 4 ACK 0 Receiver Bound on number of outstanding packets Window opens upon receipt of new ACK Window resets entirely upon a timeout Limits amount of waste Still lots of duplicates We can do better with selective retransmission Go-Back-N Example with window size 3 6
Sliding Window" Single mechanism that supports: Multiple outstanding packets Reliable delivery In-order delivery Flow control At the core of all modern ARQ protocols Stop-and-Wait is a special case Receive window size of one 7
Sliding Window Sender" Sender: Window Size Window bounds outstanding unacked data Implies need for buffering at sender Last ACK applies to in-order data What to do on a timeout? Last ACK Last Sent Go-Back-N: send all unacknowledged data on timeout Selective Repeat: timer per packet, resend as needed 8
Sliding Window Receiver" Receiver: Receive Window Receiver buffers too: data may arrive out-of-order or faster than can be consumed flow control Receiver ACK choices: Last Received Largest Accepted Cumulative, Selective (exempt missing frames), Negative 9
Deciding When to Retransmit" How do you know when a packet has been lost? Ultimately sender uses timers to decide when to retransmit But how long should the timer be? Too long: inefficient (large delays, poor use of bandwidth) Too short: may retransmit unnecessarily (causing extra traffic) Right timer is based on the round-trip time (RTT) Which can vary greatly for reasons well see later 10
Can we shortcut the timeout?" Timeout is long in practice If packets are usually in order then out-of-order ACKs imply that a packet was lost Negative ACK» Receiver requests missing packet Fast retransmit» When sender receives multiple duplicate acknowledgements resends missing packet 11
Fast retransmit" Sender Data 0 Data 1 Data 2 Data 3 Data 4 ACK 0 Receiver Don t bother waiting Receipt of duplicate acknowledgement (dupack) indicates loss Retransmit immediately Data 2 Used in TCP Need to be careful if frames can be reordered 12
Is ARQ the Only Way?" No. We could use redundancy Send additional data to compensate for lost packets Why not use retransmission? Broadcast media with lots of receivers» If each one ACK/NAK then hard to scale Lots of messages Lots of state» Heterogeneous receivers E.g., variable quality wireless reception Highly lossy or very long delay channels (e.g., satellite) 13
Forward Error Correction" Use erasure codes to redundantly encode k data frames into m>k encoded frames Why do it at the frame level? E.g., Reed Solomon Codes, Tornado codes Multicast/broadcast encoded frames speculatively A receiver can reconstruct message from any k frames in the set of m encoded frames 14
A Digital Fountain " File Transmission 0 hours 1 hour 2 hours 3 hours User 1 User 2 4 hours 5 hours 15
Fixed Partitioning" Need to share media with multiple nodes (n) Multiple simultaneous conversations A simple solution Divide the channel into multiple, separate channels Channels are physically separate Bitrate of the channel is split across channels Nodes can only send/receive on their assigned channel Several different ways to do it Multiple Access madlibs 16
Frequency Division (FDMA)" Divide bandwidth of f Hz into n channels each with bandwidth f/n Hz Easy to implement, but unused subchannels go idle Used by traditional analog cell phone service, radio, TV Amplitude Amplitude Frequency Frequency 17
Time Division (TDMA)" Divide channel into rounds of n time slots each Assign different hosts to different time slots within a round Unused time slots are idle Used in GSM cell phones & digital cordless phones Example with 1-second rounds n=4 timeslots (250ms each) per round Host # 1 2 3 1 2 3 4 2 4 1 sec 1 sec 1 sec 18
Code Division (CDMA)" Do nothing to physically separate the channels All stations transmit at same time in same frequency bands One of so-called spread-spectrum techniques Sender modulates their signal on top of unique code Sort of like the way Manchester modulates on top of clock The bit rate of resulting signal much lower than entire channel Receiver applies code filter to extract desired sender All other senders seem like noise with respect to signal Used in newer digital cellular technologies 19
Partitioning Visualization" FDMA TDMA power power CDMA power Courtesy Takashi Inoue 20
For Next Time" Keep reading 2.6 in P&D Start on Homework 2 Keep going on the project 21