Admin Protocol Stack Application Layer Break HTTP DNS P2P CSCD58 W INTER 2018 W EEK 3 - A PPLICATION L AYER Brian Harrington University of Toronto Scarborough January 23, 2018
Admin Protocol Stack Application Layer Break HTTP DNS P2P A DMIN • Midterm • Feb 27 • In class • More info closer to the date
Admin Protocol Stack Application Layer Break HTTP DNS P2P A IR T RAVEL A NALOGY
Admin Protocol Stack Application Layer Break HTTP DNS P2P P OSTAL A NALOGY
Admin Protocol Stack Application Layer Break HTTP DNS P2P W HY L AYERING ? • Each layer can provide a service • Don’t care about layers above • Don’t worry about layers below • Modular Design • Changes to baggage handling procedures doesn’t affect ticketing • Changes to postal routing doesn’t affect addressing
Admin Protocol Stack Application Layer Break HTTP DNS P2P I NTERNET P ROTOCOL S TACK
Admin Protocol Stack Application Layer Break HTTP DNS P2P I NTERNET P ROTOCOL S TACK • Application: • User-end application protocols • FTP , SMTP , HTTP • Transport: • Process to process data transfer • TCP , UDP • Network: • Routing from source to destination • IP • Link: • Transferring data between adjacent points • Ethernet, WiFi, PPP • Physical: • Moving bits “Along the wire”
Admin Protocol Stack Application Layer Break HTTP DNS P2P A PPLICATION L AYER • Example Network Applications • E-mail • Web Pages • Instant Messaging (IM) • P2P File Sharing • Multiplayer Games • Streaming Store Video (Netflix, YouTube, etc) • Voice over IP (Skype) • Video over IP (Skype) • Facebook • Google Search • Google... everything else
Admin Protocol Stack Application Layer Break HTTP DNS P2P A PPLICATION L AYER • Remember: Assume that Transport (& Below) layers are present & working • Run on different end systems • Don’t have to care about network core • Just “post the letter” and assume it will get there • Or not... • Application Layer protocols define messages sent between end systems and actions taken • Deployment controlled by users, not network
Admin Protocol Stack Application Layer Break HTTP DNS P2P A PPLICATION A RCHITECTURES • Client-Server • Always-on server • Constant address • More traffic = More data centres • Peer-to-Peer (P2P) • Arbitrary end systems communicating • Peers come and go/change IPs • Quid-pro-quo • Self-scalable • Hybrid • Skype (central server, calls are P2P) • Most instant messaging (user data on server, chats are P2P) • Napster (oops)
Admin Protocol Stack Application Layer Break HTTP DNS P2P P ROCESS C OMMUNICATION • Process: Program running on a specific host (computer) • same host: inter-process communication defined by OS • different hosts: need to pass messages • Client Process: • Initiates communication • Server Process: • Waits to be contacted • IP address uniquely identifies host • To identify a process, need to add a port number • HTTP: 80 • Mail: 25
Admin Protocol Stack Application Layer Break HTTP DNS P2P S OCKETS • Socket: “door” through which process sends/receives messages • Mailbox analogy
Admin Protocol Stack Application Layer Break HTTP DNS P2P W HAT DO WE NEED FROM THE T RANSPORT LAYER ? • Data Integrity • Can we tolerate some loss? • Timing • Can we tolerate some delay? • Throughput • Do we need a minimum amount of bandwidth? • Security • Do we need encryption/redundancy/authentication?
Admin Protocol Stack Application Layer Break HTTP DNS P2P A PPLICATION L AYER : R EQUIREMENTS Application Data Integrity Throughput Time Sensitive File transfer no loss elastic no E-mail no loss elastic no Static web pages no loss elastic no voice over IP loss-tolerant 5Kb:Audio yes (~100msec) 10Kb:Video stored video loss-tolerant 10Kb yes (~2 sec) stock trading no loss elastic (Time=money)
Admin Protocol Stack Application Layer Break HTTP DNS P2P W HAT SERVICES DOES THE T RANSPORT L AYER OFFER ? • UDP • Connectionless: Doesn’t try to set up connection first • Unreliable: Send it out and hope for the best • No flow or congestion control • TCP • Connection Oriented: Sets up a connection between server and client • Reliable Transport: Sending process can count on receiving process getting message • Flow Control: Sender won’t overwhelm receiver • Congestion Control: throttle sender when network is overloaded • Note: Neither protocol provides: • Timing • Min Bandwidth • Security
Admin Protocol Stack Application Layer Break HTTP DNS P2P SSL • Secure Socket Layer • Application Layer protocol • Sits “on top” of TCP • Pseudo-Transport layer • Encrypts data before sending it via TCP • What about Timing/Bandwidth? • Tough luck!
Admin Protocol Stack Application Layer Break HTTP DNS P2P B REAK
Admin Protocol Stack Application Layer Break HTTP DNS P2P HTTP: H YPER T EXT T RANSFER P ROTOCOL • Basic application layer protocol for the web • Client-Server based • Client: Web browser • Server: Web server • Uses TCP connection (Port 80) • Stateless (server doesn’t remember client requests) • Keeping state is hard • Cookies used instead
Admin Protocol Stack Application Layer Break HTTP DNS P2P HTTP V ERSIONS • Non-persistent • 2RTT + File transfer time per object • A good browser will open parallel TCP connections • A good server may stop it • Persistent • 1RTT (connection) + 1RTT/object • Need timeout for connection
Admin Protocol Stack Application Layer Break HTTP DNS P2P HTTP R EQUEST
Admin Protocol Stack Application Layer Break HTTP DNS P2P HTTP R ESPONSE
Admin Protocol Stack Application Layer Break HTTP DNS P2P HTTP: R ESPONSE C ODES • 200 OK • request succeeded, requested object later in this msg • 301 Moved Permanently • requested object moved, new location specified later in this msg (Location:) • 400 Bad Request • request msg not understood by server • 404 Not Found • requested document not found on this server • 505 HTTP Version Not Supported
Admin Protocol Stack Application Layer Break HTTP DNS P2P HTTP: C OOKIES
Admin Protocol Stack Application Layer Break HTTP DNS P2P W EB C ACHING • Majority of WWW is asymmetric • Accessed much more frequently than updated • Origin server may be (physically) far away (propagation delay) • Solution: Web Caching • Typically installed by ISP • Less traffic on access link • Faster response time for users • Reduce stress on “poor” content providers
Admin Protocol Stack Application Layer Break HTTP DNS P2P W EB C ACHING • Assumptions • Avg object size: 1Mb • Avg request rate: 15/sec • Avg LAN bandwidth: 1 Gbps • Avg RTT from router to origin server: 2 sec • Access Link Rate: 15Mbps • Results: • LAN utilization: 1.5% • Access link utilization: 100% • Delay: RTT + Access + LAN • 2sec + infinite + negligible
Admin Protocol Stack Application Layer Break HTTP DNS P2P W EB C ACHING • Solution #1: Upgrade • Upgrade to 100Mbps access link • Access link traffic intensity = 15% • Delay: RTT + Access + LAN • 2sec + negligible + negligible • VERY expensive • Solution #2: Web Cache • Assume we can satisfy 40% of requests (typical) • Access link traffic intensity = 60% • Still results in negligible access time • Delay: 0.6 * (RTT + Access + LAN) + 0.4 * (LAN) • 0.6 * (2sec + negligible) + 0.4 * (negligible) • ~1.2sec
Admin Protocol Stack Application Layer Break HTTP DNS P2P DNS (D OMAIN N AME S YSTEM ) • Every server has an IP address • Can just type: http://74.125.224.72 • But we’re not very good at memorizing • “I don’t know, why don’t you 74.125.224.72 it?” • Need a way to translate between the two
Admin Protocol Stack Application Layer Break HTTP DNS P2P DNS (D OMAIN N AME S YSTEM ) • Why not just have one centralized system? • Single point of failure • Traffic volume • Distance • Maintenance/updates?
Admin Protocol Stack Application Layer Break HTTP DNS P2P DNS (D OMAIN N AME S YSTEM ) • Want to find IP for web.cs.toronto.edu? • Start at top, work your way down
Admin Protocol Stack Application Layer Break HTTP DNS P2P R OOT N AME S ERVERS • 13 Root Name servers • Authoritative resource for top level domain servers • Now replicated: ~350 mirrored servers
Admin Protocol Stack Application Layer Break HTTP DNS P2P DNS E XAMPLE : R ECURSIVE M ODE • Try local first • Local DNS requests from root • root requests from intermediate • etc... • What’s wrong with this picture? • Too much work for top level servers
Admin Protocol Stack Application Layer Break HTTP DNS P2P DNS: I TERATIVE M ODE • Push burden of work back to querier • Lower traffic for top level domains • “I don’t know, ask that server” vs. “I don’t know, I’ll go ask”
Recommend
More recommend