1 / 88

Probability, Preview, and Principles

This document provides a primer on probability, a preview of the course materials, and discusses the principles of design for the Internet. It also includes examples and calculations related to independent events, mutually exclusive events, and statistical multiplexing.

jesther
Download Presentation

Probability, Preview, and Principles

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Probability, Preview, and Principles EE122 Fall 2011 Scott Shenker http://inst.eecs.berkeley.edu/~ee122/ Materials with thanks to Jennifer Rexford, Ion Stoica, Vern Paxsonand other colleagues at Princeton and UC Berkeley

  2. Announcements • Sections this week! • ShaddiHasan • We have new account forms • Get them after class, one per person, no exceptions • Project will be released on Wednesday • So we can get to Reliable Transport beforehand • Problem 3.iii Consider case where F and Q increase, but H and P stay constant. • Waiting list: No way to move more students in • Could try doing a 194……

  3. Outline • Primer on probability (6 slides) • Simple, but all you need…. • Discussion of Homework #1 • Layering • Design Principles for the Internet • Layering • E2E Principle • Fate Sharing

  4. Probability Primer Get out a sheet of paper or otherwise be able to jot down your answers This is not a test, this is so you can tell if you understand the material

  5. Independent Events • Independent: occurrence of one event does not affect the likelihood of the other event • Example of two independent events: • Flow 1 sends 5 packets in a particular frame • Flow 2 sends 2 packets in a particular frame • Assume that: • Event A happens with probability pA • Event B happens with probability pB • What is probability both event A and B happen? • Write it down! • Answer: Probability = pApB

  6. Consider Dice • Probability that rolling a single die yields a 1? 1/6th • Probability rolling two dice yields 1 1? 1/36th • Probability rolling two dice yields a 1 and a 2? • Write it down!

  7. Be Careful Counting Events First die is 1 and second die is 2: 1/36th One die is 1 and one die is 2: 1/18th • That’s because you could have 1 2 or 2 1

  8. Mutually Exclusive Events • First roll of die is 1:1/6th • First roll of die is 2:1/6th • First roll of die is 3:1/6th • First roll of die is 4:1/6th • First roll of die is 5:1/6th • First roll of die is 6:1/6th • This set of events is complete (or exhaustive) in that one of them must be true Total of probabilities = 1

  9. Exclusive vs Independent Events • First roll of die is 1, second roll of die is 3 • Independent • First roll of die is 1, first roll of die is 2 • Exclusive

  10. Computing Averages • Assume that x is some property of an event and that events A, B, C are mutually exclusive and complete (i.e., one of them happens) • E.g., x = number of packets sent in a particular frame • Assume that: • Event A has x=5 • Event B has x=2 • Event C has x=10 • What is the average value of x? (denoted by <x>) • Write it down! • Average <x> = 5pA+2pB + 10pC

  11. THIS IS ALL YOU NEED TO KNOW! • The problems are easier than you think… • …but think clearly before computing the answer…

  12. Discussion of HW#1

  13. #2: Statistical Multiplexing • Time is divided into “frames”, frames into “slots” • Each flow is assigned one slot per frame • The flows have identical proabilisticbehavior: • With equal probability, send zero, one, or two packets • Exclusive events! • Compute the fraction of packets that are dropped when n flows share their slots, for n=1, 2, 3, 4 • Does fraction dropped decrease as n grows?

  14. Consider Two Flows (n=2) • Flow A sends 1 packet • Probability 1/3rd • Flow B sends no packets • Probability 1/3rd • Are these independent or exclusive events? • Independent! So probability that both happen is: Probability = 1/3 x 1/3 = 1/9 • Average number packets/frame generated by A? (1/3 x 0) + (1/3 x 1) + (1/3 x 2) = 1

  15. n=2 Cases: Each with Prob 1/9th In which cases are packets dropped?

  16. N=2 Cases: Have two slots to share ✔ ✔ ✔ ✔ Average number of drops: 1/9th x (1+1+2) Average number of packets generated: 2 Fraction of drops: 2/9ths

  17. Cases n=3 and n=4 • n=3 you can easily enumerate • n=4 have patience, but if you understand how to group equivalent events (and count permutations properly) then it is easy. • And even easier to focus only on cases where shared and individual differ… • Reason to do 3 and 4 is to convince you that there is a trend as n increases….. • If this problem bores you, compute the asymptotic behavior as a function of n. • Email it to me, don’t hand it in with homework.

  18. #4: PS/CS Retransmission After Failure • Fact: if transmission fails with probability p, number of retransmissionsuntil success is given by:

  19. Derivation • Success on first transmission: (1-p) • Success on second transmission: p(1-p) • Success on third transmission: p2(1-p) • …. • Average number of retransmissions: 0(1-p) + 1*p(1-p) + 2*p2(1-p) + …..=

  20. Failure Model • Assume that probability that the link goes down sometime during a time period t is given by:

  21. Using these facts… • Only delay is transmission time • Ignore latency, queueing • Use this time to determine failure rate • Using the formula f(t) for the right value of t • Use that to determine retransmissions • Using f(t)/(1-f(t)) • Packet-switched has to send Q packets • So do the above calculation for packets, not file….

  22. #3: Delays under PS and CS Compare the time it takes to transfer a file of size F under circuit-switching and packet-switching. Network: n links in a row, bandwidth B, latency L. Circuit-switching: Reservation packet (stored-and-forwarded), confirmation packet, file transmission. Packet-switching: File broken into packets (with headers). Packets stored-and-forwarded at nodes. Express delays in terms of: n,B, L, F, etc. Understand limiting behaviors

  23. Timing in Circuit Switching Host 1 Host 2 Switch 1 Switch 2 time

  24. Timing in Circuit Switching Host 1 Host 2 Switch 1 Switch 2 propagation delay between Host 1 and Switch1 CircuitEstablishment time

  25. Timing in Circuit Switching Host 1 Host 2 Switch 1 Switch 2 Transmission delay propagation delay between Host 1 and Switch1 CircuitEstablishment time

  26. Timing in Circuit Switching Host 1 Host 2 Switch 1 Switch 2 Transmission delay propagation delay between Host 1 and Switch1 CircuitEstablishment time

  27. Timing in Circuit Switching Host 1 Host 2 Switch 1 Switch 2 Transmission delay propagation delay between Host 1 and Switch1 CircuitEstablishment propagation delay between Host 1 and Host 2 time

  28. Timing in Circuit Switching Host 1 Host 2 Switch 1 Switch 2 Information Transmission delay propagation delay between Host 1 and Switch1 CircuitEstablishment propagation delay between Host 1 and Host 2 Transfer time

  29. Timing in Circuit Switching Host 1 Host 2 Switch 1 Switch 2 Information Transmission delay propagation delay between Host 1 and Switch1 CircuitEstablishment propagation delay between Host 1 and Host 2 Transfer time Circuit Teardown

  30. Timing of Datagram Packet Switching Host 1 Host 2 Node 1 Node 2 Packet 1 propagation delay between Host 1 and Node 1

  31. Timing of Datagram Packet Switching Host 1 Host 2 Node 1 Node 2 Packet 1 propagation delay between Host 1 and Node 1 transmission time of Packet 1 at Host 1

  32. Timing of Datagram Packet Switching Host 1 Host 2 Node 1 Node 2 Packet 1 transmission time of Packet 1 at Host 1 Packet 1 We ignoreprocessing delay in the homework! Packet 1

  33. Packet 1 Packet 1 Packet 1 Packet 2 Packet 2 Packet 2 Packet 3 Packet 3 Packet 3 Timing of Datagram Packet Switching Host 1 Host 2 Node 1 Node 2 propagation delay between Host 1 and Node 1 transmission time of Packet 1 at Host 1 We ignore processing delay in the homework!

  34. Layering

  35. Modularity in Computer Science “Modularity based on abstractionis the way things get done” --Barbara Liskov

  36. Benefits of Modularity • Implementations hidden behind clean interfaces • Interfaces are incarnations of abstractions • Changes are limited in scope • Allows for continuing evolution and innovation • Easier to reason about

  37. Methodology • Break job down into smaller tasks • And understand how they interact • Define abstractions for these tasks • Then implement them…..

  38. Tasks in Networking • What does it take to send packets across country? • Simplistic decomposition: • Task 1: send along a single wire • Task 2: string these together to go across country • What makes Task 2 nontrivial? • Routing! • More detailed decomposition in next slide….

  39. Tasks in Networking (bottom up) • Electrons on wire • Bits on wire • Packets on wire • Deliver packets across local network • Local addresses • Deliver packets across country • Global addresses • Ensure that packets get there • Do something with the data

  40. How do we organize these tasks? • Put them into “layers” • Layering is a particularly strict form of modularity • Interactions limited to interfaces above and below • To motivate layers, we go back to the beginning…

  41. You now have 3 minutes to answer… Who invented layering?

  42. Wrong Answers • ISO • ARPANET • Walt Disney

  43. Answer: Henry Ford • Before: • Each person worked on the whole car • After: • Each person only handled one particular task • Handed off car to next person in line • Only needed to understand the state of the car as it arrived, and only needed to produce the appropriate output • Could remain ignorant of everything else!

  44. Advantages of Assembly Line • Specialization allows people to get faster • i.e., local improvements in implementation • If you want to change something in the car, only one person needed to know. • i.e., changes of limited scope

  45. More Layering in the Real World • CEO A writes letter to CEO B • Folds letter and hands it to administrative aide • Aide: • Puts letter in envelope with CEO B’s name • Takes to FedEx • FedEx Office • Puts letter in larger envelope • Puts name and street address on FedEx envelope • Puts package on FedEx delivery truck • FedEx delivers to other company Dear Steve, We give up. Let’s merge. --Bill

  46. The Path of the Letter “Peers” on each side understand the same things No one else does Lowest level has most packaging CEO CEO Semantic Content Letter Identity Envelope Aide Aide Location Fedex Envelope (FE) FedEx FedEx

  47. The Path Through FedEx Higher “Stack” at Ends Highest Level of “Transit Stack” is Routing Partial “Stack” During Transit Truck Truck FE FE FE Sorting Office Sorting Office Sorting Office New Crate Crate Crate Crate Airport Airport Airport Deepest Packaging at the Lowest Level of Transport

  48. How Does This Apply to Networking? • Let’s return to task decomposition….

  49. Tasks in Networking • Electrons on wire • Bits on wire • Packets on wire • Deliver packets across local network • Local addresses • Deliver packets across country • Global addresses • Ensure that packets get there • Do something with the data

  50. Resulting Layers • Electrons on wire (contained in next layer) • Bits on wire (Physical) • Packets on wire (contained in next layer) • Deliver packets across local network (Link) • Local addresses • Deliver packets across country (Internetwork) • Global addresses • Ensure that packets get there (Transport) • Do something with the data (Application)

More Related