EECS 485 Lecture 11
Networking
John Kloosterman
Copyright By PowCoder代写 加微信 powcoder
Learning Objectives
• Describe how Internet Protocol (IP) divides data into packets and routes them to the right place
• Identify the problems that Transmission Control Protocol (TCP) solves
• Explain why flow control is needed and how it works
• Explain why congestion control is needed and how it works
Internet Protocol (IP)
Internet Protocol (IP)
• How does information travel to the right place? • Every computer on the Internet has an address
• My laptop
172.217.5.14 205.251.242.103 141.212.109.1
• Newer version: longer addresses • IPv4: 32 bits is 4 billion computers • IPv6: 64 bits is way more
HTTP 1.1 GET /
Why packets?
• One reason: can share a link between multiple users or programs
Say hi to partner
• What is one advantage and one disadvantage to using:
• Large packets (1 MB)?
• Small packets (128 bytes)?
Transmission Control Protocol (TCP)
• Packets can arrive out of order
• Packets can disappear
• Packets can be repeated
• TCP: abstraction to make it look like these problems don’t exist
• TCP/IP – TCP along with IP
TCP Big Idea
TCP Big Idea
• Sender stores data in buffer until ACK • Resends data that was lost
• Receiver reassembles messages from packets • Queue means order doesn’t matter
• Application (web browser) given data in order
Detecting dropped packets
• Timeout: if don’t get ACK in this time, assume dropped
TCP Flow Control
Flow control
• Problem to solve: how fast can we send data without overwhelming the receiver?
• Flow control is about the receiver
Sliding window
• Receiver tells sender how much space the sender can assume its buffer has
• Sender can put that much data on the network at one time
Sliding Window Example
Sliding window – sender
• Sender buffers unACKed data
• Only removes data from send buffer after it’s been
• Send window determined by receiver’s advertisements
Sliding window – receiver
• Receiver buffers data that is • Out-of-order
• Not yet read off by application
• ACKs data as it arrives
• Removes data from buffer as app reads
• Shrinks/expands advertised window in response to application behavior
Sliding window
• To implement sliding window, both sender and receiver need to store multiple packets
• Use a buffer tied to a host:port pair • Ports are implemented in OS
• Example well-known server ports: • HTTP: 80
• HTTPS: 443 • SSH: 22
Partner Question
• Two applications are running on your laptop and communicating over the network as clients.
• If the applications communicate with the same server, will their sliding window size be the same?
• If they communicate with different servers, will their sliding window size be the same?
TCP Congestion Control
Congestion Control
• Problem: routers get overloaded when output speed not high enough for inputs
TCP congestion window
• Each TCP sender maintains a congestion window to manage network capacity (which changes based on congestion)
• Maximum number of bytes to have in transit
• I.e., number of bytes still awaiting acknowledgments
• Adapting the congestion window
• Decrease upon losing a packet: backing off
• Increase upon success: optimistically exploring
AIMD sawtooth
Window size
• AIMD: Additive Increase Multiplicative Decrease
• After packet timeout cwnd = cwnd/2 • After packet ACK cwnd += 1
Flow control and congestion control
• Flow control (aka sliding window)
• Keep a fast sender from overwhelming a slow receiver
• Congestion control
• Keep a set of senders from overloading the network
• We need both!
• Different concepts, but similar mechanisms • TCP flow control: receiver window
• TCP congestion control: congestion window
• TCP window: min(congestion_window, receiver_window)
Slow start and TCP sawtooth
Exponential “slow start”
Speed up start using exponential, not linear increase
Window size
HTTP 1.0 vs. 1.1
Partner question
• Using this chart, explain why HTTP 1.1 will be many times faster than HTTP 1.0.
Window size
Learning Objectives
• Describe how Internet Protocol (IP) divides data into packets and routes them to the right place
• Identify the problems that Transmission Control Protocol (TCP) solves
• Explain why flow control is needed and how it works
• Explain why congestion control is needed and how it works
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com