Download presentation
Presentation is loading. Please wait.
1
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 Paxson and other colleagues at Princeton and UC Berkeley
2
Announcements Sections this week! Shaddi Hasan 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…… 2
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 3
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 p A –Event B happens with probability p B What is probability both event A and B happen? –Write it down! Answer: Probability = p A p B 5
6
Consider Dice Probability that rolling a single die yields a 1? 1/6 th Probability rolling two dice yields 1 1? 1/36 th Probability rolling two dice yields a 1 and a 2? –Write it down! 6
7
Be Careful Counting Events First die is 1 and second die is 2: 1/36 th One die is 1 and one die is 2: 1/18 th That’s because you could have 1 2 or 2 1 7
8
Mutually Exclusive Events First roll of die is 1:1/6 th First roll of die is 2:1/6 th First roll of die is 3:1/6 th First roll of die is 4:1/6 th First roll of die is 5:1/6 th First roll of die is 6:1/6 th This set of events is complete (or exhaustive) in that one of them must be true Total of probabilities = 1 8
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 9
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 ) –Write it down! Average = 5p A + 2p B + 10p C 10
11
THIS IS ALL YOU NEED TO KNOW! The problems are easier than you think… …but think clearly before computing the answer… 11
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 proabilistic behavior: –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? 13
14
Consider Two Flows (n=2) Flow A sends 1 packet –Probability 1/3 rd Flow B sends no packets –Probability 1/3 rd 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 14
15
n=2 Cases: Each with Prob 1/9 th Flow AFlow B 00 01 02 10 11 12 20 21 22 15 In which cases are packets dropped?
16
N=2 Cases: Have two slots to share Flow AFlow B 00 01 02 10 11 12 20 21 22 16 Average number of drops: 1/9 th x (1+1+2) Average number of packets generated: 2 Fraction of drops: 2/9 th s ✔ ✔ ✔✔
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. 17
18
#4: PS/CS Retransmission After Failure Fact: if transmission fails with probability p, number of retransmissions until success is given by: 18
19
Derivation Success on first transmission: (1-p) Success on second transmission: p(1-p) Success on third transmission: p 2 (1-p) –…. Average number of retransmissions: 0(1-p) + 1*p(1-p) + 2*p 2 (1-p) + ….. = 19
20
Failure Model Assume that probability that the link goes down sometime during a time period t is given by: 20
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…. 21
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 22
23
23 Timing in Circuit Switching Host 1Host 2 Switch 1Switch 2 time
24
24 Timing in Circuit Switching Circuit Establishment Host 1Host 2 Switch 1Switch 2 propagation delay between Host 1 and Switch1 time
25
25 Timing in Circuit Switching Circuit Establishment Host 1Host 2 Switch 1Switch 2 propagation delay between Host 1 and Switch1 Transmission delay time
26
26 Timing in Circuit Switching Circuit Establishment Host 1Host 2 Switch 1Switch 2 propagation delay between Host 1 and Switch1 Transmission delay time
27
27 Timing in Circuit Switching Circuit Establishment Host 1Host 2 Switch 1Switch 2 propagation delay between Host 1 and Switch1 propagation delay between Host 1 and Host 2 Transmission delay time
28
28 Timing in Circuit Switching Information Circuit Establishment Transfer Host 1Host 2 Switch 1Switch 2 propagation delay between Host 1 and Switch1 propagation delay between Host 1 and Host 2 Transmission delay time
29
29 Timing in Circuit Switching Information Circuit Establishment Transfer Circuit Teardown Host 1Host 2 Switch 1Switch 2 propagation delay between Host 1 and Switch1 propagation delay between Host 1 and Host 2 Transmission delay time
30
30 Timing of Datagram Packet Switching Packet 1 Host 1Host 2 Node 1Node 2 propagation delay between Host 1 and Node 1
31
31 Timing of Datagram Packet Switching Packet 1 Host 1Host 2 Node 1Node 2 propagation delay between Host 1 and Node 1 transmission time of Packet 1 at Host 1
32
32 Packet 1 Timing of Datagram Packet Switching Packet 1 Host 1Host 2 Node 1Node 2 We ignore processing delay in the homework! transmission time of Packet 1 at Host 1
33
33 Packet 1 Packet 2 Packet 3 Packet 1 Packet 2 Packet 3 Timing of Datagram Packet Switching Packet 1 Packet 2 Packet 3 We ignore processing delay in the homework! Host 1Host 2 Node 1Node 2 propagation delay between Host 1 and Node 1 transmission time of Packet 1 at Host 1
34
Layering
35
Modularity in Computer Science “Modularity based on abstraction is the way things get done” --Barbara Liskov 35
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 36
37
Methodology Break job down into smaller tasks –And understand how they interact Define abstractions for these tasks Then implement them….. 37
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…. 38
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 39
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… 40
41
You now have 3 minutes to answer… Who invented layering? 41
42
Wrong Answers ISO ARPANET Walt Disney 42
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! 43
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 44
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 45 Dear Steve, We give up. Let’s merge. --Bill
46
CEO Aide FedEx CEO Aide FedEx LocationFedex Envelope (FE) The Path of the Letter 46 Letter Envelope Semantic Content Identity “Peers” on each side understand the same things No one else does Lowest level has most packaging
47
The Path Through FedEx 47 Truck Sorting Office Airport FE Sorting Office Airport Truck Sorting Office Airport Crate FE New Crate FE Higher “Stack” at Ends Partial “Stack” During Transit Deepest Packaging at the Lowest Level of Transport Highest Level of “Transit Stack” is Routing
48
How Does This Apply to Networking? Let’s return to task decomposition…. 48
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 49
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) 50
51
51 Who Does What? Five layers –Lower three layers implemented everywhere –Top two layers implemented only at hosts –What is top layer of router doing? Transport Network Datalink Physical Transport Network Datalink Physical Network Datalink Physical Application Host AHost BRouter
52
52 Logical Communication Layers interacts with peer’s corresponding layer Transport Network Datalink Physical Transport Network Datalink Physical Network Datalink Physical Application Host AHost BRouter
53
53 Physical Communication Communication goes down to physical network Then from network peer to peer Then up to relevant layer Transport Network Datalink Physical Transport Network Datalink Physical Network Datalink Physical Application Host AHost BRouter
54
The Path Through FedEx 54 Company Sorting Office Airport Sorting Office Airport Company Sorting Office Airport In both cases, the highest layer inthe transit nodes is doing routing!
55
55 IP Suite: End Hosts vs. Routers HTTP TCP IP Ethernet interface HTTP TCP IP Ethernet interface IP Ethernet interface Ethernet interface SONET interface SONET interface host router HTTP message TCP segment IP packet
56
56 Layer Encapsulation Trans: Connection ID Net: Source/DestLink: Src/Dest Appl: Get index.html User AUser B Common case: 20 bytes TCP header + 20 bytes IP header + 14 bytes Ethernet header = 54 bytes overhead
57
Five Minute Break….
58
Quote for the day….. The Internet is the first thing that humanity has built that humanity doesn't understand, the largest experiment in anarchy that we have ever had. ~Eric Schmidt 58
59
Characterizing the Layers (OSI) Service: what a layer does Service interface: how to access the service –Interface for layer above Protocol: how peers communicate –Protocol interface: set of rules and formats that govern the communication between network elements –Determines how the peers achieve the service –Does not govern implementation on a single machine, but how the layer is implemented between machines Examples: layer can have many implementations –This allows innovation! 59
60
60 Physical Layer (1) Service: move bits between two systems connected by a single physical link Interface: specifies how to send and receive bits –E.g., require quantities and timing Protocols: coding scheme used to represent bits, voltage levels, duration of a bit Examples: Optical, wireless, etc.
61
(Data) Link Layer (2) Service: Enable hosts to exchange messages –Using abstract (but local) addresses –Not just direct physical connections Interface: send messages (frames) to other end hosts; receive messages addressed to end host Protocols: –Routing –Media Access Control (MAC) Examples: –Ethernet, 802.11, Frame Relay, ATM 61
62
(Inter) Network Layer (3) Service: Deliver packets to specified destination –Using abstract global addresses –Inter-network = across multiple layer-2 networks –E.g., from Ethernet to 802.11 to Frame Relay to ATM Interface: send packets to specified internetwork destinations; receive packets destined for end host Protocols: construct routing tables Examples: IP –Why no other examples? 62
63
Transport Layer (4) Service: Communication between processes –Demultiplexing of communication between hosts –Perhaps: reliable transport, rate adaptation Interface: –send message to specific process at given destination –local process receives messages sent to it Protocol: reliability, flow control, packetization of large messages, framing Examples: TCP and UDP –SCTP, T/TCP, DCCP, 63
64
Application Layer (7 - not 5!) Service: any service provided to the end user Interface: depends on the application Protocol: depends on the application Examples: Skype, SMTP (email), HTTP (Web), Halo, BitTorrent … 64
65
65 The Internet Hourglass Data Link Physical Applications The Hourglass Model Waist There is just one network-layer protocol, IP. The “narrow waist” facilitates interoperability. SMTPHTTPNTPDNS TCPUDP IP EthernetSONET 802.11 Transport FiberCopperRadio
66
66 Avoids NxM Implementation Problem Skype SSHNFS Radio Coaxial cable Fiber optic Application Transmission Media HTTP
67
Implications of Hourglass Allows arbitrary L2 networks to interoperate –Any networks that support IP can exchange packets Allows applications to function on all networks –Applications that can run on IP can use any network Supports innovations above and below IP –Innovations can be independent, done in parallel But changing IP itself, i.e., IPv6, very hard Many claim that a narrow waist is a necessary aspect of any Internet architecture –I am not among them…. 67
68
Internet Design Principles
69
Back to Modularity Modularity in programming: –Set of abstractions Modularity in networking: –Distributed nature of system requires deciding where abstractions are implemented 69
70
Three Basic Architectural Decisions How to break system into modules Where modules are implemented Where state is stored 70
71
Breaking into Modules That is described by layering 71
72
72 Placing Network Functionality Hugely influential paper: “End-to-End Arguments in System Design” by Saltzer, Reed, and Clark (‘84) –End-to-end principle Basic observation: some types of network functionality can only be correctly implemented end-to-end Because of this, end hosts: –Can satisfy the requirement without network’s help –Must do so, since can’t rely on network’s help Thus, don’t need to implement them in network
73
73 Example: Reliable File Transfer Solution 1: make each step reliable, and string them together to make reliable end-to-end process Solution 2: allow steps to be unreliable, but do end- to-end check and try again if necessary OS Appl. OS Appl. Host AHost B OK
74
Discussion Solution 1 cannot be made perfectly reliable –What happens if a network element misbehaves? –Receiver has to do the check anyway! Solution 2 can also fail, but only if the end system itself fails (i.e., doesn’t follow its own protocol) Solution 2 only relies on what it can control –The endpoint behavior Solution 1 requires endpoints trust other elements –That’s not what reliable means! 74
75
Robust (From Clark’s Paper) As long as the network is not partitioned, two endpoints should be able to communicate Failures (excepting network partition) should not interfere with endpoint semantics 75
76
Question? Should you ever implement reliability in network? Perhaps, if needed for reasonable efficiency –Don’t aim for perfect reliability, but ok to reduce error rate If individual links fail 10% of the time, and are traversing 10 links, then E2E error rate is 65% Implementing one retransmission on links –Link error rate reduced to 1%, E2E error rate is 9.5% 76
77
77 Back to the End-to-End Principle Implementing such functionality in the network: Doesn’t reduce host implementation complexity Does increase network complexity Probably imposes delay and overhead on all applications, even if they don’t need functionality However, implementing in network can enhance performance in some cases –E.g., very lossy link
78
78 Conservative Interpretation of E2E Don’t implement a function at the lower levels of the system unless it can be completely implemented at this level Unless you can relieve the burden from hosts, don’t bother
79
79 Radical Interpretation of E2E Don’t implement anything in the network that can be implemented correctly by the hosts –E.g., multicast Make network layer absolutely minimal –E2E principle trumps performance issues –Increases flexibility, since lower layers stay simple
80
Important life lessons (partial) Flexibility often more important than performance Architect for flexibility, engineer for performance 80
81
81 Moderate Interpretation Think twice before implementing functionality in the network If hosts can implement functionality correctly, implement it in a lower layer only as a performance enhancement But do so only if it does not impose burden on applications that do not require that functionality
82
What Does E2E Principle Ignore? There are other stakeholders besides users –ISP might care about the good operation of their network –Various commercial entities –Money-chain might require insertion into the network The need for middlebox functionality –Some functions that, for management reasons, are more easily done in the network. 82
83
Three Basic Architectural Decisions How to break system into modules Where modules are implemented Where state is stored 83
84
Fate-Sharing Note that E2E principles relied on “fate-sharing” –Invariants break only when endpoints themselves break –Minimize dependence on other network elements This should dictate placement of storage 84
85
85 General Principle: Fate-Sharing When storing state in a distributed system, co- locate it with entities that rely on that state Only way failure can cause loss of the critical state is if the entity that cares about it also fails... –… in which case it doesn’t matter Often argues for keeping network state at end hosts rather than inside routers –In keeping with End-to-End principle –E.g., packet-switching rather than circuit-switching –E.g., NFS file handles, HTTP “cookies”
86
Another Quote “A distributed system is one in which the failure of a computer you didn't even know existed can render your own computer unusable” ---Leslie Lamport 86
87
Decisions and Their Principles How to break system into modules –Dictated by Layering Where modules are implemented –Dictated by End-to-End Principle Where state is stored –Dictated by Fate-Sharing 87
88
Question If reliability is implemented by the ends, how is it done? That’s the subject of the next lecture! 88
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.