CS162 Operating Systems and Systems Programming Lecture 22 Networking III April 22 2010 Ion Stoica http inst eecs berkeley edu cs162 Review Link datalink layer Broadcast network frames sent by one host reaches every other host in same network Multi access protocol didn t go over construct frames error detection and correction flow control Network layer stitch together multiple link layer networks Deliver a packet to specified network destination didn t go over segmentation reassemble packet scheduling buffer management Transport layer Multiplexing demultiplexing two lectures ago Flow congestion control in order delivery reliability today 4 13 10 CS162 UCB Spring 2010 Lec 22 2 Transport Protocol Flow control keeps one fast sender from overwhelming a slow receiver Congestion control keeps a set of senders from overloading the network Reliability makes sure the receiver got all packets sent by sender In order delivery makes sure the receiver delivers the packet to application in same order sender sent them Two protocols Stop and Wait Window based 4 13 10 CS162 UCB Spring 2010 Lec 22 3 Automatic Repeat reQuest ARQ Automatic Repeat Request Receiver sends acknowledgment ACK when it receives packet Sender waits for ACK and times out if does not arrive within some time period Simplest ARQ protocol Stop and Wait Send a packet stop and wait until ACK arrives 4 13 10 Sender Timeou t Receiver Packe t ACK Time CS162 UCB Spring 2010 Lec 22 4 Stop and Wait Properties Flow control yes Receiver can implicitly slow down sender by acking a packet only if it has room for at lest another packet Assumption timeout doesn t trigger before receiving ack Congestion control yes Sender sends a new packet only after previous one made it If network is congested packet or ack is lost sender doesn t send new data Reliability yes If a packet is lost sender timeouts and resends the packet In order delivery yes Receiver doesn t get next packet before receiving and acking previous one So what s the problem with Stop and Wait Efficiency 4 13 10 CS162 UCB Spring 2010 Lec 22 5 How Fast Can Stop and Wait Go Suppose we re sending from UCB to New York Bandwidth 1 Mbps megabits sec RTT 100 msec Maximum packet size a k a Maximum Transmission Unit MTU 1500 B 12 000 b No other load on the path and no packet loss What approximately is the fastest we can transmit using Stop and Wait Answer 12 000b 0 1s 120 kbps How about if Bandwidth 1 Gbps 4 13 10 CS162 UCB Spring 2010 Lec 22 6 Administrivia Keys to access AWS will be sent today Last two lectures on security Final Exam Friday May 14 7 00PM 10 00PM All material from the course With slightly more focus on second half but you are still responsible for all the material Two sheets of notes both sides 4 13 10 CS162 UCB Spring 2010 Lec 22 7 Sliding Window Idea allow multiple packets in flight In flight un acked packets Window size W number of packets the sender can send without receiving an ack E g after receiving ack for all packet before and including K send packets K 1 K 2 K W 1 Stop and wait particular case of sliding window W 1 Receiver tells sender W W cannot be larger than receiver s buffer 4 13 10 CS162 UCB Spring 2010 Lec 22 8 Throughput Up to W packets or bytes per RTT Throughput W RTT How large should be the window to fully utilize a link with bandwidth B W Bandwidth x RTT i e Bandwidth Delay or Delay Bandwidth product 4 13 10 CS162 UCB Spring 2010 Lec 22 9 Sliding Window Example This is NOT TCP 4 13 10 CS162 UCB Spring 2010 Lec 22 10 Sliding Window Example Sender Sender at 1s 1 Receiver 1s 2s 3s 1 Send 1st pkt 4s 5s 6s 7s 8s 9s 10s 11s 12s 13s 14s 4 13 10 CS162 UCB Spring 2010 Lec 22 11 Sliding Window Example Sender Sender at 1s Send 1st pkt 1 Receiver 1s 2s 3s 1 a ck 1 1 4s 5s 6s Receiver at 3s Get 1st pkt Deliver 1st pkt to appl Send ack 1 to sender 4 13 10 7s 8s 9s 10s 11s 12s 13s 14s CS162 UCB Spring 2010 Lec 22 12 Sliding Window Example Sender Sender at 2s Send 2nd pkt which is lost 1 2 1 Receiver 1s 2s 3s 1 2 a ck 1 4s 5s 6s 7s 8s 9s 10s 11s 12s 13s 14s 4 13 10 CS162 UCB Spring 2010 Lec 22 13 Sliding Window Example Sender Sender at 3s Send 3nd pkt Receiver at 5s Get 3rd pkt doesn t deliver it since out of seq Send nack 2 request 2nd pkt 4 13 10 1 2 1 3 2 1 Receiver 1s 2s 3s 1 2 3 a ck 1 k nac 4s 5s 6s 2 3 7s 8s 9s 10s 11s 12s 13s 14s CS162 UCB Spring 2010 Lec 22 14 Sliding Window Example Sender Sender at 4s Send 4th pkt Receiver window full 1 2 1 3 2 1 4 3 2 1 Receiver 2 3 4 ack 1 k nac Receiver at 6s Get 4th packet 4 13 10 1s 2s 3s 1 4s 5s 6s 2 3 4 3 7s 8s 9s 10s 11s 12s 13s 14s CS162 UCB Spring 2010 Lec 22 15 Sliding Window Example Sender Sender at 5s Get ack 1 3 Remove 1st 4 3 pkt from buffer 5 4 Send 5th pkt now 2 3 4 5 are in flight window full 2 2 2 3 1 1 1 1 2 Receiver 2 3 4 a ck 5 k nac 1 4s 5s 6s 2 3 4 3 5 4 3 7s 8s 9s 10s 11s 12s 13s 14s Receiver at 7s Get 5th pkt 4 13 10 1s 2s 3s 1 CS162 UCB Spring 2010 Lec 22 16 Sliding Window Example Sender Sender at 7s Get nack 2 Resend pkt 2 Receiver at 9s Get 2nd pkt Deliver it to appl Send ack 2 4 13 10 2 3 2 4 3 2 5 4 3 1 1 1 1 2 5 4 3 2 Receiver 1s 2s 3s 1 2 3 4 a ck 5 k nac 1 2 3 2 a ck CS162 UCB Spring 2010 4s 5s 6s 2 4 3 5 4 3 5 4 3 7s 8s 2 9s 10s 11s 12s 13s 14s Lec 22 17 Sliding Window Example Sender Sender at 11s Get ack 2 3 Send pkt 6 4 3 pkts 3 4 5 6 are in flight 5 4 Receiver at 11s Deliver 3d pkt to appl recall delivery rate is 1pkt every 2s Send ack 3 4 13 10 2 2 2 3 1 1 1 1 2 5 4 3 2 Receiver 2 3 4 a ck 5 k nac 1 6 2 a ck CS162 UCB Spring 2010 4s 5s 6s 2 3 2 a ck 6 5 4 3 1s 2s 3s 1 4 3 5 4 3 5 …
View Full Document
Unlocking...