Page 1 Lecture 3: Design Philosophy & Applications 15-441: Computer Networking Copyright © CMU, 2007-2010. Lecture Overview • Last time: • Protocol stacks and layering • OSI and TCP/IP models • Application requirements • Application examples • ftp • http • Internet Architecture & Performance intro S’ 10 2 Lecture 3: Applications Lecture 3: Applications 3 Applications and Application-Layer Protocols • Application: communicating, distributed processes • Running in network hosts in “user space” • Exchange messages to implement app • e.g., email, file transfer, the Web • Application-layer protocols • One “piece” of an app • Define messages exchanged by apps and actions taken • User services provided by lower layer protocols application transport network data link physical application transport network data link physical application transport network data link physical S’ 10 Lecture 3: Applications 4 Client-Server Paradigm Typical network app has two pieces: client and server application transport network data link physical application transport network data link physical Client: • Initiates contact with server (“speaks first”) • Typically requests service from server, • For Web, client is implemented in browser; for e-mail, in mail reader Server: • Provides requested service to client • e.g., Web server sends requested Web page, mail server delivers e-mail request reply S’ 10Page 2 Lecture 3: Applications 5 Server and Client TCP/UDP IP Ethernet Adapter Server TCP/UDP IP Ethernet Adapter Clients Server and Client exchange messages over the network through a common Socket API Socket API hardware kernel space user space ports S’ 10 Lecture 3: Applications 6 Network Addressing Analogy 412-268-8000 ext.123 Central Number Applications/Servers Web Port 80 Mail Port 25 Exchange Area Code 412-268-8000 ext.654 IP Address Network No. Host Number Telephone No 15-441 Students Clients Professors at CMU Network Programming Tel ep ho ne C al l Port No. Extension S’ 10 Lecture 3: Applications 7 What Service Does an Application Need? Data loss • Some apps (e.g., audio) can tolerate some loss • Other apps (e.g., file transfer, telnet) require 100% reliable data transfer Timing • Some apps (e.g., Internet telephony, interactive games) require low delay to be “effective” Bandwidth • Some apps (e.g., multimedia) require minimum amount of bandwidth to be “effective” • Other apps (“elastic apps”) make use of whatever bandwidth they get S’ 10 Lecture 3: Applications 8 Transport Service Requirements of Common Apps no loss no loss no loss loss-tolerant loss-tolerant loss-tolerant no loss elastic elastic elastic audio: 5Kb-1Mb video:10Kb-5Mb same as above few Kbps elastic no no no yes, 100’s msec yes, few secs yes, 100’s msec yes and no file transfer e-mail web documents real-time audio/ video stored audio/video interactive games financial apps Application Data loss Bandwidth Time Sensitive S’ 10Page 3 Other Requirements • Network reliability • Network service must always be available • Security: privacy, denial of service, authentication, … • Scalability. • Scale to large numbers of users, traffic flows, … • Manageability: monitoring, control, … S’ 10 9 Lecture 3: Applications Lecture 3: Applications 10 User Datagram Protocol(UDP): An Analogy Postal Mail • Single mailbox to receive messages • Unreliable • Not necessarily in-order delivery • Each letter is independent • Must address each reply Example UDP applications Multimedia, voice over IP UDP • Single socket to receive messages • No guarantee of delivery • Not necessarily in-order delivery • Datagram – independent packets • Must address each packet Postal Mail • Single mailbox to receive letters • Unreliable • Not necessarily in-order delivery • Letters sent independently • Must address each reply S’ 10 Lecture 3: Applications 11 Transmission Control Protocol (TCP): An Analogy TCP • Reliable – guarantee delivery • Byte stream – in-order delivery • Connection-oriented – single socket per connection • Setup connection followed by data transfer Telephone Call • Guaranteed delivery • In-order delivery • Connection-oriented • Setup connection followed by conversation Example TCP applications Web, Email, Telnet S’ 10 FTP: The File Transfer Protocol • Transfer file to/from remote host • Client/server model • Client: side that initiates transfer (either to/from remote) • Server: remote host • ftp: RFC 959 • ftp server: port 21 file transfer FTP server FTP user interface FTP client local file system remote file system user at host S’ 10 12 Lecture 3: ApplicationsPage 4 Ftp: Separate Control, Data Connections • Ftp client contacts ftp server at port 21, specifying TCP as transport protocol • Two parallel TCP connections opened: • Control: exchange commands, responses between client, server. “out of band control” • Data: file data to/from server • Ftp server maintains “state”: current directory, earlier authentication FTP client FTP server TCP control connection port 21 TCP data connection port 20 S’ 10 13 Lecture 3: Applications Ftp Commands, Responses Sample Commands: • sent as ASCII text over control channel • USER username • PASS password • LIST return list of files in current directory • RETR filename retrieves (gets) file • STOR filename stores (puts) file onto remote host Sample Return Codes • status code and phrase • 331 Username OK, password required • 125 data connection already open; transfer starting • 425 Can’t open data connection • 452 Error writing file S’ 10 14 Lecture 3: Applications HTTP 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 requests S’ 10 15 Lecture 3: Applications How to Mark End of Message? • Size of message Content-Length • Must know size of transfer in advance • Delimiter
View Full Document