CS162 Operating Systems and Systems Programming Lecture 25 Review April 27 2011 Ion Stoica http inst eecs berkeley edu cs162 New CS162 Gateway system class to give students a broad view on how today s systems and services Better prepare students to design and develop such services Teach students how to develop large projects in teams Enable department to create a new core OS class which will be offered in Spring 2012 Will use a real OS for projects likely Android Enable other system classes for which cs 162 will be prerequisite to go deeper in their specific material and have more sophisticated projects 4 27 Ion Stoica CS162 UCB Spring 2011 Lec 25 2 New vs Old CS162 Curriculum 70 overlap File systems queueing theory slightly fewer lectures on concurrency caching and distributed systems More networking database transactions p2p and cloud computing Different project emphasize on how a system works end to end rather than focusing on implementing OS concepts in Nachos What if you want to do an OS project CS 163 in Spring 2012 CS 262 graduate System class you ll need instructor approval CS295 Cloud computing Seminar you ll need my approval 4 27 Ion Stoica CS162 UCB Spring 2011 Lec 25 3 Example Accessing Amazon DNS Servers DNS request Datacenter create result page User Account DB Product DB Load balancer Ad Server Complex interaction of multiple components in multiple administrative domains 4 27 Ion Stoica CS162 UCB Spring 2011 Lec 25 4 Universal Resource Locator URL protocol host name port directory path resource This is what you enter in the browser Example http www amazon com http www amazon com 80 index html protocol http host name www amazon com Name of an Amazon s web server port 80 default HTTP port directory path Path relative to web directory at server e g public html resource index html default file Contains HTML home page of Amazon 4 27 Ion Stoica CS162 UCB Spring 2011 Lec 25 5 Domain Name Service DNS Resolution Resolve www amazon com to the IP address of an Amazon HTTP server DNS Servers DNS request Datacenter create result page User Account DB Product DB Load balancer Ad Server 4 27 Ion Stoica CS162 UCB Spring 2011 Lec 25 6 DNS Resolution Resolve www amazon com to the IP address of an Amazon HTTP server How does client know DNS server Client configured with the address of the local DNS server DNS request www amazon com DNS response 72 21 211 176 4 27 Ion Stoica CS162 UCB Spring 2011 DNS server Lec 25 7 How Does Client Communicates with DNS Server A Via transport protocol e g UDP Transport protocol in a nutshell Allow two application end points to communicate Each application identified by a port number on the machine it runs Multiplexes demultiplexes packets from to different processes using port numbers Can provide reliability flow control congestion control Two main transport protocols in the Internet User datagram protocol UDP just provide multiplexing demultiplexing no reliability Transport Control Protocol TCP provide reliability flow control congestion control 4 27 Ion Stoica CS162 UCB Spring 2011 Lec 25 8 Transport Layer cont d DNS server runs at a specific port number i e 53 Most popular DNS server BIND Berkeley Internet Name Domain Assume client browser port number 1234 Firefox port 1234 Transport 4 27 DNS Req DNS Req BIND port 53 Internet DNS Req 1234 53 DNS Req 1234 53 Ion Stoica CS162 UCB Spring 2011 Transport Lec 25 9 How does UDP packets Get to Destination A Via network layer i e Internet Protocol IP Implements datagram packet switching Enable two end hosts to exchange packets Each end host is identified by an IP address Each packets contains destination IP address Independently routes each packet to its destination Best effort service No deliver guarantees No in order delivery guarantees 4 27 Ion Stoica CS162 UCB Spring 2011 Lec 25 10 Network IP Layer cont d Assume DNS server runs on machine 128 15 11 12 Client configured with DNS server IP address Client runs on machine 16 25 31 10 128 15 11 12 16 25 31 10 DNS Req Firefox port 1234 DNS Req DNS Req 1234 53 Transport DNS Req 1234 53 Network DNS Req 1234 53 16 25 31 10 128 15 11 12 4 27 BIND port 53 DNS Req 1234 53 16 25 31 10 128 15 11 12 Ion Stoica CS162 UCB Spring 2011 Transport Network Lec 25 11 IP Packet Routing Each packet is individually routed Host C Host D Host A Router 1 Router 2 Router 3 Router 5 Host B Router 6 Router 7 Host E Router 4 4 27 Ion Stoica CS162 UCB Spring 2011 Lec 25 12 IP Packet Routing Each packet is individually routed Host C Host D Host A Router 1 Router 2 Router 3 Router 5 Host B Router 6 Router 7 Host E Router 4 4 27 Ion Stoica CS162 UCB Spring 2011 Lec 25 13 Packet Forwarding Packets are first stored before being forwarded Why incoming links Router outgoing links Memory 4 27 Ion Stoica CS162 UCB Spring 2011 Lec 25 14 Packet Forwarding Timing The queue has Q bits when packet arrives packet has to wait for the queue to drain before being transmitted P bits Q bits Capacity R bps Propagation delay T sec Queueing delay Q R P R T time 4 27 Ion Stoica CS162 UCB Spring 2011 Lec 25 15 Packet Forwarding Timing Sender Router1 Packet 1 4 27 Router 2 Receiver propagation delay between Host 1 and Node 1 Ion Stoica CS162 UCB Spring 2011 Lec 25 16 Packet Forwarding Timing Sender transmission time of Packet 1 at Host 1 Router1 Packet 1 propagation delay between Host 1 and Node 1 Packet 1 4 27 Receiver Router 2 Ion Stoica CS162 UCB Spring 2011 processing delay of Packet 1 at Node 2 Packet 1 Lec 25 17 Packet Forwarding Timing Sender transmission time of Packet 1 at Host 1 Router 1 Packet 1 Packet 2 Packet 3 Receiver Router 2 propagation delay between Host 1 and Node 1 Packet 1 Packet 2 Packet 3 processing delay of Packet 1 at Node 2 Packet 1 Packet 2 Packet 3 4 27 Ion Stoica CS162 UCB Spring 2011 Lec 25 18 Packet Forwarding Timing Packets of Different Lengths 10 Mbps 5 Mbps 100 Mbps Receiver Sender 4 27 time 10 Mbps Ion Stoica CS162 UCB Spring 2011 Lec 25 19 Datalink Layer Enable nodes e g hosts routers connected by same link to exchange packets frames with each other Every node interface has a datalink layer address e g 6 bytes No need to route packets as each node on same link receives packets from everyone else on that link e g WiFi Ethernet IP address 16 25 31 10 Datalink address 111 DNS Req 1234 53 16 25 31 10 128 15 11 12 Firefox port 1234 DNS Req Transport DNS Req 1234 53 Network Datalink 4 27 Datalink address 222 DNS Req 1234 53 16 25 31 10 128 15 11 12 111 222 Network Datalink DNS Req
View Full Document
Unlocking...