reliable transport

28
Reliable Transport EE122 TAs Past and Present

Upload: iden

Post on 22-Feb-2016

39 views

Category:

Documents


0 download

DESCRIPTION

Reliable Transport. EE122 TAs Past and Present. Review of Principles. Are people eavesdropping on my postal correspondence during transit?. Would like my mail to be protected by safes, cages, sealed containers, locks and keys Armed guards would be nice too Good or bad idea?. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Reliable Transport

Reliable TransportEE122 TAs Past and Present

Page 2: Reliable Transport

Review of Principles

Page 3: Reliable Transport

As seen on Amazon

Are people eavesdropping on my postal correspondence during transit?

• Would like my mail to be protected by safes, cages, sealed containers, locks and keys

• Armed guards would be nice too• Good or bad idea?

Page 4: Reliable Transport

“The most secure USPS® mail (protected by safes, cages, sealed containers,

locks and keys).”

Acceptable for sending US government“Classified” and “Secret“ information

“650 uniformed Postal Police Officers who are assigned to critical postal facilities throughout the country. The officers provide perimeter security, escort high-value mail shipments, and perform other essential protective functions.”

Page 5: Reliable Transport

Good or bad idea?• It exists, but so do lolcats• Does this ensure confidentiality?• Can the sender and receiver ensure confidentiality by themselves?• Should all mail be treated super-securely?

– As a performance enhancement?– Does it impose a burden on those who do not require that

functionality?• Cost• “it is possible that the Registered Mail process could slow the speed at which a

mailpiece travels”

• End-to-end arguments not limited to reliable transport– or to computer networks: audits of banks, airline reservation systems, …

(see Saltzer, Reed & Clark, 1984)

Page 6: Reliable Transport

Once upon a time …• Alice and Bob send their children,

Gretel and Hansel, deep into the forest

• To return home, they must collect information along the forward path– The Brothers Grimm called this

information “fähigkeit bits”• Should they store this info:

– themselves?or:– along the forest path (using bread

crumbs)?• When can the info be lost?

Page 7: Reliable Transport

Fate-Sharing

• “An end-to-end protocol design should not rely on the maintenance of state (i.e. information about the state of the end-to-end communication) inside the network. Such state should be maintained only in the endpoints, in such a way that the state can only be destroyed when the endpoint itself breaks” -- RFC 1958

• If you violate fate-sharing, you risk being eaten by a witch

Page 8: Reliable Transport

We now return to our regularly scheduled programming

Page 9: Reliable Transport

Please, no more jokes about Panda• Panda is embarrassed at being

mentioned in homework and section problems

• To avoid the attention, he’s gone into hiding far, far away (with no internet)

• Kay, feeling partly culpable, sends him care packages(when she’s not busy operating the hotel telephone)– Many other GSIs are equally culpable but don’t care

• It takes 5 days for the postal service from Berkeley to Panda’s sanctuary

• Worse yet, the postal service is unreliable

Page 10: Reliable Transport

Transmitting Care Packages (TCP) v0.1

• Panda notices he’s missing package #5– He posts Kay a request to resend it(every package is unique)– All is well (eventually)

• Later he’s missing package #20– He posts Kay a request to resend it– Nothing happens– Why? (assume Kay hasn’t abandoned him)

Page 11: Reliable Transport

Transmitting Care Packages v0.2

• Panda decides instead to post Kay a thank-you note for each package

• From the time Kay sends the first package, how long will it be to receive confirmation?– Assuming Kay has a limited daily send rate (i.e., cannot

send x days of packages at once, due to customs etc.), should Kay send more packages in the meantime?

• When Kay receives the confirmation, she sends another package– Why might Kay not want to send as much as possible?

Page 12: Reliable Transport

What sort of thank-you note?

• Panda could send:– “I have received package #1”– “I have received package #2”– “I have received package #3”

• or:– “I have received all packages up to #1”

(or: “I expect to receive package #2”, but that’s presumptuous)– “I have received all packages up to #2”– “I have received all packages up to #3”

• What happens if a care package is lost?• What happens if a thank-you note is lost?

Page 13: Reliable Transport

Worksheet

Page 14: Reliable Transport

Individual ACKs and Cumulative ACKs

• Individual ACK– Acknowledge every packet received– Loss: resend packet when k “subsequent packets” are received– e.g. ACK-7 means the receiver has received packet 7

• Cumulative ACK– Acknowledge that all packets up to (the CACK number – 1) has

been received– Loss: resend missing packet upon k “duplicate ACKs” and wait

for ACK– e.g. CACK-7 means the receiver has received packets 1, 2, 3, 4,

5, 6, and is expecting (i.e. does not have) packet 7

Page 15: Reliable Transport

Question 1 – No Loss, ACK

1 2 3 4 5 6 7 8 9 10

A B1

ACK-1

2

ACK-2

1 2 3 4 5 6 7 8 9 10

3

ACK-3

1 2 3 4 5 6 7 8 9 10

1

1 2

1 2 3

1 2 3 4

4

ACK-4

1 2 3 4 5 6 7 8 9 10

Zzz …

Page 16: Reliable Transport

Sliding Window

• Ensures the “pipe” is always full (efficiency)

• Send W packets• When one gets ACK’ed, send the next one in line• If a packet times out, retransmit

Page 17: Reliable Transport

Question 2a – No Loss, Individual ACK

1 2 3 4 5 6 7 8 9 10

A B1 2 3

ACK-1 , ACK-2, ACK-3

4 5 6

ACK-4 , ACK-5, ACK-6

1 2 3 4 5 6 7 8 9 10

7 8 9

ACK-7 , ACK-8, ACK-9

1 2 3 4 5 6 7 8 9 10

1 2 3

1 2 3 4 5 6

1 2 3 4 5 6 7 8 9

1 2 3 4 5 6 7 8 9 10

10

ACK-10

1 2 3 4 5 6 7 8 9 10

Page 18: Reliable Transport

Question 2b – No Loss, Cumulative ACK

1 2 3 4 5 6 7 8 9 10

A B1 2 3

CACK-2, CACK-3, CACK-4(i.e., CACK-upto1 ,2,3)

4 5 6

CACK-5, CACK-6, CACK-71 2 3 4 5 6 7 8 9 10

7 8 9

CACK-8, CACK-9, CACK-10

1 2 3 4 5 6 7 8 9 10

1 2 3

1 2 3 4 5 6

1 2 3 4 5 6 7 8 9

1 2 3 4 5 6 7 8 9 10

10

CACK-11

1 2 3 4 5 6 7 8 9 10

Page 19: Reliable Transport

Question 3a – Packet Loss, k=1

1 2 3 4 5 6 7 8 9 10

A B1 2 3

ACK-1, ACK-3

2 4

ACK-2 , ACK-41 2 3 4 5 6 7 8 9 10

5 6 7

ACK-5 , ACK-6, ACK-7

1 2 3 4 5 6 7 8 9 10

1 3

1 2 3 4

1 2 3 4 5 6 7

1 2 3 4 5 6 7 8 9 10

8 9 10

ACK-8, ACK-9, ACK-10

1 2 3 4 5 6 7 8 9 10

k=1

Page 20: Reliable Transport

Question 3b – Packet Loss, k=2

1 2 3 4 5 6 7 8 9 10

A B1 2 3

ACK-1, ACK-3

4

ACK-41 2 3 4 5 6 7 8 9 10

2

ACK-2 1 2 3 4 5 6 7 8 9 10

1 3

1 3 4

1 2 3 4

1 2 3 4 5 6 7

5 6 7

ACK-5, ACK-6, ACK-7

1 2 3 4 5 6 7 8 9 10

k=2

Page 21: Reliable Transport

Question 3c (k=2) – Why bother?

1 2 3 4 5 6 7 8 9 10

A B1 2 3

ACK-1, ACK-3

4

ACK-2, ACK-4

1 2 3 4 5 6 7 8 9 10

5 6 7

ACK-5, ACK-6, ACK-7

1 2 3 4 5 6 7 8 9 10

1 2 3

1 2 3 4

1 2 3 4 5 6 7

1 2 3 4 5 6 7 8 9 10

8 9 10

ACK-8, ACK-9, ACK-10

1 2 3 4 5 6 7 8 9 10

ACK-2 is delayed

Efficiency vs. timeliness

Page 22: Reliable Transport

Question 4a – Packet Loss, k=1

1 2 3 4 5 6 7 8 9 10

A B1 2 3

CACK-2, CACK-2

2 4

CACK-4, CACK-51 2 3 4 5 6 7 8 9 10

5 6 7

CACK-6, CACK-7, CACK-8

1 2 3 4 5 6 7 8 9 10

1 3

1 2 3 4

1 2 3 4 5 6 7

1 2 3 4 5 6 7 8 9 10

8 9 10

CACK-9, CACK-10, CACK-11

1 2 3 4 5 6 7 8 9 10

k=1

The choices for loss with cumulative ACKs are “Send missing packet and optimistically assume that subsequent packets have arrived” and “Send missing packet, and wait for ACK” (Lecture 5). This slide assumes the former.

Page 23: Reliable Transport

Question 4a – Packet Loss, k=1

1 2 3 4 5 6 7 8 9 10

A B1 2 3

CACK-2, CACK-2

2

CACK-41 2 3 4 5 6 7 8 9 10

7 8 9

CACK-5, CACK-6, CACK-7

1 2 3 4 5 6 7 8 9 10

1 3

1 2 3

1 2 3 4 5 6

1 2 3 4 5 6 7 8 9CACK-8, CACK-9, CACK-10

1 2 3 4 5 6 7 8 9 10

k=1

The choices for loss with cumulative ACKs are “Send missing packet and optimistically assume that subsequent packets have arrived” and “Send missing packet, and wait for ACK” (Lecture 5). This slide assumes the latter.

4 5 6

Page 24: Reliable Transport

Question 4b – Packet Loss, k=2

1 2 3 4 5 6 7 8 9 10

A B1 2 3

CACK-2, CACK-2

4

CACK-2

1 2 3 4 5 6 7 8 9 10

5 6 7

CACK-6, CACK-7, CACK-8

1 2 3 4 5 6 7 8 9 10

1 3

1 3 4

1 2 3 4 5 6 7

k=22

CACK-51 2 3 4 5 6 7 8 9 10

1 2 3 4

Page 25: Reliable Transport

Question 5a – Lost ACK, k=1

1 2 3 4 5 6 7 8 9 10

A B1 2 3

ACK-1, ACK-3

2 4

ACK-2 , ACK-41 2 3 4 5 6 7 8 9 10

5 6 7

ACK-5 , ACK-6, ACK-71 2 3 4 5 6 7 8 9 10

1 2 3

1 2 3 4

1 2 3 4 5 6 7

1 2 3 4 5 6 7 8 9 10

8 9 10

ACK-8, ACK-9, ACK-10

1 2 3 4 5 6 7 8 9 10

ACK-2 is lostk=1

Page 26: Reliable Transport

Question 5b – Lost CACK, k=1

1 2 3 4 5 6 7 8 9 10

A B1 2 3

CACK-2, CACK-4

4 5 6

CACK-4, CACK-5, CACK-61 2 3 4 5 6 7 8 9 10

7 8 9

CACK-7, CACK-8, CACK-9

1 2 3 4 5 6 7 8 9 10

1 2 3

1 2 3 4 5 6

1 2 3 4 5 6 7 8 9

1 2 3 4 5 6 7 8 9 10

10

CACK-10

1 2 3 4 5 6 7 8 9 10

CACK-3 is lost

11 packets with Lost ACK vs. 10 packets with Lost CACK

Page 27: Reliable Transport

Question 6 – Timeouts

1 2 3 4 5 6 7 8 9 10

A B1 2 3

4 5 6

ACK-4 , ACK-5, ACK-6

1 2 3 4 5 6 7 8 9 10

1 2 3

1 2 3 4 5 6

1 2 3 4 5 6 7 8 9 101 2 3

…ACK-1 , ACK-2, ACK-3

Page 28: Reliable Transport

Question 7 – NAK, k=2

1 2 3 4 5 6 7 8 9 10

A B1 2 3

CACK1, CACK3

4 5 6

CACK4, NAK-2, CACK5, CACK6

1 2 3 4 5 6 7 8 9 10

7 2 8 9

CACK7, CACK7, CACK8

1 2 3 4 5 6 7 8 9 10

1 3

1 3 4 5 6

1 2 3 4 5 6 7 8

1 2 3 4 5 6 7 8 10

10

CACK10

1 2 3 4 5 6 7 8 9 10

Oh dear, how do we get packet 9 again?

N.B. This is an ambiguous protocol. Ignore the specifics other than why it doesn’t work …