CS162!Operating Systems and!Systems Programming!Lecture 25!Review"April 27, 2011!Ion Stoica!http://inst.eecs.berkeley.edu/~cs162!Lec 25.2!4/27! Ion Stoica CS162 ©UCB Spring 2011!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 !Lec 25.3!4/27! Ion Stoica CS162 ©UCB Spring 2011!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)!Lec 25.4!4/27! Ion Stoica CS162 ©UCB Spring 2011!Example: Accessing Amazon"• Complex interaction of multiple components in multiple administrative domains!Datacenter!Load!balancer!Ad Server!DNS !Servers!User !Account!DB!DNS!request!create!result!page!Product!DB!Lec 25.5!4/27! Ion Stoica CS162 ©UCB Spring 2011!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 !Lec 25.6!4/27! Ion Stoica CS162 ©UCB Spring 2011!Domain Name Service (DNS) Resolution"• Resolve www.amazon.com to the IP address of an Amazon HTTP server!Datacenter!Load!balancer!Ad Server!DNS !Servers!User !Account!DB!DNS!request!create!result!page!Product!DB!Lec 25.7!4/27! Ion Stoica CS162 ©UCB Spring 2011!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!server!DNS response:72.21.211.176Lec 25.8!4/27! Ion Stoica CS162 ©UCB Spring 2011!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 controlLec 25.9!4/27! Ion Stoica CS162 ©UCB Spring 2011!Internet 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 Transport"Firefox (port 1234) BIND (port 53) Transport DNS Req DNS Req 1234 53 DNS Req DNS Req 1234 53Lec 25.10!4/27! Ion Stoica CS162 ©UCB Spring 2011!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 guaranteesLec 25.11!4/27! Ion Stoica CS162 ©UCB Spring 2011!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 Transport"BIND (port 53) Transport DNS Req DNS Req 1234 53 16.25.31.10 128.15.11.12 Network Network DNS Req 1234 53 16.25.31.10 128.15.11.12 DNS Req 1234 53 16.25.31.10 128.15.11.12 DNS Req DNS Req 1234 53 Firefox (port 1234)Lec 25.12!4/27! Ion Stoica CS162 ©UCB Spring 2011!IP Packet Routing"Host A Host B Host E Host D Host C Router 1 Router 2 Router 3 Router 4 Router 5 Router 6 Router 7 • Each packet is individually routed!Lec 25.13!4/27! Ion Stoica CS162 ©UCB Spring 2011!IP Packet Routing"Host A Host B Host E Host D Host C Router 1 Router 2 Router 3 Router 4 Router 5 Router 6 Router 7 • Each packet is individually routed!Lec 25.14!4/27! Ion Stoica CS162 ©UCB Spring 2011!Packet Forwarding"• Packets are first stored before being forwarded!– Why?!incoming links outgoing links Router MemoryLec 25.15!4/27! Ion Stoica CS162 ©UCB Spring 2011!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!time!P/R!T!Q bits!Queueing delay = Q/R!Capacity = R bps!Propagation delay = T sec!Lec 25.16!4/27! Ion Stoica CS162 ©UCB Spring 2011!Packet Forwarding Timing"Packet 1 Sender Receiver Router1 Router 2 propagation delay between Host 1 and Node 1Lec 25.17!4/27! Ion Stoica CS162 ©UCB Spring 2011!Packet Forwarding Timing"Packet 1 Packet 1 Packet 1 processing delay of Packet 1 at Node 2 Sender Receiver Router1 Router 2 propagation delay between Host 1 and Node 1 transmission time of Packet 1 at Host 1Lec 25.18!4/27! Ion Stoica CS162 ©UCB Spring 2011!Packet Forwarding Timing"Packet 1 Packet 2 Packet 3 Packet 1 Packet 2 Packet 3 Packet 1 Packet 2 Packet 3 processing delay of Packet 1 at Node 2 Sender Receiver Router 1 Router 2 propagation delay between Host 1 and Node 1 transmission time of Packet 1 at Host 1Lec 25.19!4/27! Ion Stoica CS162 ©UCB Spring 2011!Packet Forwarding Timing: Packets of Different
View Full Document