Page 1Lecture 4: Design Philosophy &Aliti15-441: Computer NetworkingApplicationsLecture Overview• Last time:• Protocol stacks and layering• OSI and TCP/IP models• Application requirements• Application examples• httpp• Project information• Internet Architecture9-6-20072Lecture 4: Design Philosophy & ApplicationsApplications and Application-Layer Protocols• Application: communicating, distributed processesapplicationtransportk• Running in network hosts in “user space”• Exchange messages to implement app• e.g., email, file transfer, the Web•Application-layer protocolsnetworkdata linkphysicalLecture 4: Design Philosophy & Applications 3Applicationlayer protocols• One “piece” of an app• Define messages exchanged by apps and actions taken• User services provided by lower layer protocolsapplicationtransportnetworkdata linkphysicalapplicationtransportnetworkdata linkphysical9-6-2007Client-Server ParadigmTypical network app has two pieces: client and serverClient:applicationtransportnetworkdata linkphysical• Initiates contact with server (“speaks first”)• Typically requests service from server, • For Web, client is implemented in browser; for e-mail, in mail readerrequestLecture 4: Design Philosophy & Applications 4applicationtransportnetworkdata linkphysicalServer:• Provides requested service to client• e.g., Web server sends requested Web page, mail server delivers e-mailreply9-6-2007Page 2Server and ClientServer and Client exchange messages over the network through a common Socket APITCP/UDPServerTCP/UDPClientsgS k t APIkluser spaceportsLecture 4: Design Philosophy & Applications 5TCP/UDPIPEthernet AdapterTCP/UDPIPEthernet AdapterSocket APIhardwarekernel space9-6-2007Network Addressing AnalogyApplications/ServersProfessors at CMUNetwork ProgrammingTelephone Call412-268-8000 ext.123Central NumberApplications/ServersWebPort 80MailPort 25412-268-8000 ext.654IP AddressNetwork NoTelephone NoProfessors at CMUPort No.ExtensionLecture 4: Design Philosophy & Applications 6Central NumberExchangeArea CodeNetwork No.Host Number15-441 Students Clients9-6-2007What Service Does an Application Need?Data loss•Some apps (e.g., audio) canTiming•Some apps (e.g., InternetSome apps (e.g., audio) can tolerate some loss• Other apps (e.g., file transfer, telnet) require 100% reliable data transferSome apps (e.g., Internet telephony, interactive games) require low delay to be “effective”BandwidthLecture 4: Design Philosophy & Applications 7• Some apps (e.g., multimedia) require minimum amount of bandwidth to be “effective”• Other apps (“elastic apps”) make use of whatever bandwidth they get9-6-2007Transport Service Requirements of Common AppsApplication Data loss BandwidthTime Sensitiveno lossno lossno lossloss-tolerantloss-tolerantloss-tolerantelasticelasticelasticaudio: 5Kb-1Mbvideo:10Kb-5Mbsame as above few Kbpsnononoyes, 100’s msecyes, few secsyes, 100’s msecfile transfere-mailweb documentsreal-time audio/videostored audio/videointeractive gamesLecture 4: Design Philosophy & Applications 8no losspelasticyyes and nogfinancial apps9-6-2007Page 3Other Requirements• Network reliabilityNt k i t l b ilbl•Network service must always be available• Security: privacy, denial of service, authentication, …• Scalability.•Scale to large numbers of users traffic flows•Scale to large numbers of users, traffic flows, …• Manageability: monitoring, control, …9-6-20079Lecture 4: Design Philosophy & ApplicationsUser Datagram Protocol(UDP): An AnalogyPostal Mail•Single mailbox to receive UDP• Single socket to receive Postal Mail• Single mailbox to receive Single mailbox to receive messages• Unreliable ☺• Not necessarily in-order delivery• Each letter is independent• Must address each replygmessages• No guarantee of delivery• Not necessarily in-order delivery• Datagram – independent packetsgletters• Unreliable ☺• Not necessarily in-order delivery• Letters sent independently • Must address each replyLecture 4: Design Philosophy & Applications 10pyExample UDP applicationsMultimedia, voice over IP• Must address each packet9-6-2007Transmission Control Protocol (TCP): An Analogy TCP•Reliable–guaranteeTelephone Call•Guaranteed delivery•Reliable –guarantee delivery• Byte stream – in-order delivery• Connection-oriented –single socket per connection•Guaranteed delivery• In-order delivery• Connection-oriented • Setup connection followed by conversationLecture 4: Design Philosophy & Applications 11• Setup connection followed by data transferconversationExample TCP applicationsWeb, Email, Telnet9-6-2007HTTP Basics• HTTP layered over bidirectional byte stream• Almost always TCP• Interaction• Client sends request to server, followed by response from server to client• Requests/responses are encoded in text• Stateless• Server maintains no information about past client requests9-6-200712Lecture 4: Design Philosophy & ApplicationsPage 4How to Mark End of Message?• Size of message Content-Length•Must know size of transfer in advanceMust know size of transfer in advance• Delimiter MIME style Content-Type• Server must “escape” delimiter in content• Close connection• Only server can do this9-6-200713Lecture 4: Design Philosophy & ApplicationsHTTP Request9-6-200714Lecture 4: Design Philosophy & ApplicationsHTTP Request• Request line•MethodMethod• GET – return URI• HEAD – return headers only of GET response• POST – send data to the server (forms, etc.)• URI• E.g. http://www.intel-iris.net/index.htmlwith a proxy• E.g. /index.html if no proxy• HTTP version9-6-200715Lecture 4: Design Philosophy & ApplicationsHTTP Request• Request headers•Authorization–authentication infoAuthorization authentication info• Acceptable document types/encodings• From – user email• If-Modified-Since• Referrer – what caused this page to be requested• User-Agent – client software•Blank-lineBlankline• Body9-6-200716Lecture 4: Design Philosophy & ApplicationsPage 5HTTP Request ExampleGET / HTTP/1.1Accept: */*Accept-Language: en-usAccept-Encoding: gzip, deflateUser-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)Host: www.intel-iris.netConnection: Keep-Alive9-6-200717Lecture 4: Design Philosophy & ApplicationsHTTP Response• Status-line• HTTP version• 3 digit response codegp• 1XX – informational• 2XX –
View Full Document