Application Layer Protocols
Total Page:16
File Type:pdf, Size:1020Kb
ApplicationApplication LayerLayer ProtocolsProtocols • Network Applications Requirements • Application Layer Protocol Functions. • Sample Internet Applications & Protocols: – File Transfer Protocol (FTP). – Sending E-Mail: SMTP. – HyperText Transfer Protocol (HTTP). • Domain Name System (DNS) EECC694 - Shaaban #1 lec #15 Spring2000 5-2-2000 NetworkNetwork ApplicationsApplications && ApplicationApplication LayerLayer ProtocolsProtocols • The development of numerous network applications and the associated application-layer protocols has been a major driving force for computer network advancements over the past 30 years. • The range of such diverse applications include: – Text-based applications such as telnet, electronic mail, file transfer, newsgroups, most popular in the 70’s-80’s. – More recent graphics- and multimedia-based applications such as the World Wide Web (the Internet’s killer-app), Internet telephony, video conferencing, and streaming audio/video on demand, and interactive games. EECC694 - Shaaban #2 lec #15 Spring2000 5-2-2000 Common Network Applications Requirements Application Type Data Loss Bandwidth Requirements Latency sensitivity File transfer No loss Variable none Web documents No loss Variable none Real-time audio/video Loss-tolerant Audio: few Kbps to 1Mbpsyes 100's of msec Video: 10's Kbps to 5 Mbps Stored audio/video Loss-tolerant Same as interactive audio/video few seconds Interactive games Loss-tolerant Few Kbps to 10's Kbps 100's msecs Financial applications No loss Variable Application-dependent EECC694 - Shaaban #3 lec #15 Spring2000 5-2-2000 ApplicationApplication LayerLayer ProtocolsProtocols • An application layer protocol defines how an application processes (clients and servers) , running on different end systems, pass messages to each other. • In particular, an application layer protocol defines: – The types of messages, e.g., request messages and response messages. – The syntax of the various message types, i.e., the fields in the message and how the fields are delineated. – The semantics of the fields, i.e., the meaning of the information that the field is supposed to contain; – Rules for determining when and how a process sends messages and responds to messages. • Many Internet application-layer protocols are fully specified in Request For Comments documents (RFCs) and are therefore in the public domain. – For example, the HTTP 1.1 specification is included in RFC 2068, which was finalized and made public January 1997. – If a browser (HTTP client) developer follows the rules of the HTTP 1.1 RFC, the browser will be able to retrieve Web pages from any Web server that has also has followed the rules of the HTTP 1.1 RFC. EECC694 - Shaaban #4 lec #15 Spring2000 5-2-2000 StructureStructure ofof InternetInternet ApplicationsApplications UsingUsing TCPTCP && TheThe SocketsSockets APIAPI Client Server One or more TCP connections Request or Command Server Reply or Response EECC694 - Shaaban #5 lec #15 Spring2000 5-2-2000 SampleSample InternetInternet ApplicationsApplications Application Type Application-layer protocol Transport Protocol Used/Port Send: Simple Mail Transfer Protocol TCP 25 Electronic mail SMTP [RFC 821] Receive: Post Office Protocol v3 TCP 110 POP3 [RCF 1939] Remote terminal access Telnet [RFC 854] TCP 23 World Wide Web (WWW) HyperText Transfer Protocol 1.1 TCP 80 HTTP 1.1 [RFC 2068] File Transfer Protocol TCP 21 File Transfer FTP [RFC 959] Trivial File Transfer Protocol UDP 69 TFTP [RFC 1350] Remote file server NFS [McKusik 1996] UDP or TCP Streaming multimedia Proprietary (e.g., Real Networks) UDP or TCP Internet telephony Proprietary (e.g., Vocaltec) Usually UDP EECC694 - Shaaban #6 lec #15 Spring2000 5-2-2000 Common Network/System Services & Ports Port Number Process Name Description 1 TCPMUX TCP Port Service Multiplexer 5 RJE Remote Job Entry 7 ECHO Echo 9 DISCARD Discard 11 USERS Active Users 13 DAYTIME Daytime 17 Quote Quotation of the Day 19 CHARGEN Character generator 20 FTP-DATA File Transfer Protocol - Data 21 FTP File Transfer Protocol - Control 23 TELNET Telnet 25 SMTP Simple Mail Transfer Protocol 27 NSW-FE NSW User System Front End 29 MSG-ICP MSG-ICP 31 MSG-AUTH MSG Authentication 33 DSP Display Support Protocol 35 Private Print Servers 37 TIME Time 39 RLP Resource Location Protocol 41 GRAPHICS Graphics 42 NAMESERV Host Name Server 43 NICNAME Who Is 49 LOGIN Login Host Protocol 53 DOMAIN Domain Name Server 67 BOOTPS Bootstrap Protocol Server 68 BOOTPC Bootstrap Protocol Client EECC694 - Shaaban #7 lec #15 Spring2000 5-2-2000 Common Network/System Services & Ports Port Number Process Name Description 69 TFTP Trivial File Transfer Protocol 79 FINGER Finger 80 HTTP HyperText Transfer Protocol 101 HOSTNAME NIC Host Name Server 102 ISO-TSAP ISO TSAP 103 X400 X.400 104 X400SND X.400 SND 105 CSNET-NS CSNET Mailbox Name Server 109 POP2 Post Office Protocol v2 110 POP3 Post Office Protocol v3 111 RPC Sun RPC Portmap 119 NNTP Network News Transfer Protocol 137 NETBIOS-NS NETBIOS Name Server 138 NETBIOS-DG NETBIOS Datagram Service 139 NETBIOS-SS NETBIOS Session Service 146 ISO-TP0 ISO TP0 147 ISO-IP ISO IP 150 SQL-NET SQL NET 153 SGMP SGMP 156 SQLSRV SQL Service 160 SGMP-TRAPS SGMP TRAPS 161 SNMP Simple Network Management Protocol 162 SNMPTRAP SNMPTRAP 163 CMIP-MANAGE CMIP/TCP Manager 164 CMIP-AGENT CMIP/TCP Agent 165 XNS-Courier Xerox 179 BGP Border Gateway Protocol EECC694 - Shaaban #8 lec #15 Spring2000 5-2-2000 FileFile TransferTransfer ProtocolProtocol (FTP),(FTP), RFCRFC 595595 • A protocol dating back to 1971 used for transferring files between hosts. • In a typical FTP session: – The user first provides the hostname of the remote host. – The FTP client process in the local host establishes a control TCP connection with the FTP server process in the remote host on port 21. – The user then provides the user identification and password, which get sent over this TCP connection as part of the FTP commands. – Once the server has authorized the user, for each file to be transferred, FTP opens a data TCP connection on server port 20 which is used to transfer the file and is closed once the transfer is completed. EECC694 - Shaaban #9 lec #15 Spring2000 5-2-2000 CommonCommon FTPFTP CommandsCommands andand RepliesReplies • FTP commands, from client to server, and replies, from server to client, are sent across the control TCP connection encoded in 7-bit ASCII. • In order to delineate successive commands, a carriage return and a line feed end each command (and reply). • Commands consist of four uppercase ASCII characters, some with optional arguments. • Some of the more common commands are given below (with options in italics): – USER username : Used to send the user identification to server. – PASS password : Used to send the user password to the server. – LIST : Used to ask the server to send back a list of all the files in the current remote directory. The list of files is sent over a (new and non-persistent) data TCP connection and not over the control TCP connection. – RETR filename : Used to get a file from the current directory of the remote host. – STOR filename : Used to store a file into the current directory of the remote host. • There is typically a one-to-one correspondence between the commands the user issues and the FTP command sent across the TCP control connection. • Each command is followed by a reply, sent from server to client. Replies are three-digit numbers, with an optional message following the number. message; • Typical replies along with possible messages are as follows: – 331 Username OK, password required – 125 Data connection already open; transfer starting – 425 Can't open data connection – 452 Error writing file EECC694 - Shaaban #10 lec #15 Spring2000 5-2-2000 Sending Electronic Mail: Simple Mail Transfer Protocol (SMTP), RFC 821 • SMTP transfers messages from senders' mail servers to the recipients' mail servers using TCP connections. • SMPT existed long before it was fully specified by RFC 821 in 1982. • Following the client/server model: – SMTP has two sides: a client side which executes on a sender's mail server, and server side which executes on recipient's mail server. – Both the client and server sides of SMTP run on every mail server. – When a mail server sends mail (to other mail servers), it acts as an SMTP client. When a mail server receives mail (from other mail servers) it acts as an SMTP server. • The process of sending a message: – A user agent (mail reader) is used to create a message to be sent. – The user agent directs the message to the outgoing message queue in the user's local mail server (acting as an SMTP client). – The local mail server (SMTP client) opens a TCP connection directly to the remote destination SMTP mail server. – After initial SMTP handshaking, the SMTP client sends the 7-bit ASCII encoded message into the TCP connection. – The remote SMTP server receives the message over the TCP connection, closes the connection and places the message in the receipt's mailbox. EECC694 - Shaaban #11 lec #15 Spring2000 5-2-2000 TheThe InternetInternet MailMail SystemSystem All messages must be 7-bit ASCII Encoded EECC694 - Shaaban #12 lec #15 Spring2000 5-2-2000 ExampleExample TransactionTransaction BetweenBetween AnAn SMTPSMTP ClientClient && ServerServer Once the SMTP Server: 220 receive.edu client (sender) Client: HELO send.edu established a TCP Server: 250 Hello send.edu, pleased to meet you connection to Client: MAIL FROM: <[email protected]> the remote receiving the remote receiving Server: 250 [email protected]..