Presentation is loading. Please wait.

Presentation is loading. Please wait.

Internet Engineering Course Application Layer Protocols.

Similar presentations


Presentation on theme: "Internet Engineering Course Application Layer Protocols."— Presentation transcript:

1 Internet Engineering Course Application Layer Protocols

2 2 Applications and application-layer protocols Application: communicating, distributed processes ◦ running in network hosts in “user space” ◦ exchange messages ◦ e.g., email, file transfer, the Web Application-layer protocols ◦ one “piece” of an application - others are e.g. user agents.  Web:browser  E-mail: mail reader  streaming audio/video: media player ◦ define messages exchanged by apps and actions taken ◦ use services provided by lower layer protocols application transport network data link physical application transport network data link physical application transport network data link physical

3 3 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: r initiates contact with server (“speaks first”) r typically requests service from server, r for Web, client is implemented in browser; for e-mail, in mail reader Server: r provides requested service to client r e.g., Web server sends requested Web page, mail server delivers e-mail request reply

4 4 Auxiliary terms ++ socket: Internet application programming interface ◦ 2 processes communicate by sending data into socket, reading data out of socket (like sending out, receiving in via doors) Q: how does a process “identify” the other process with which it wants to communicate? ◦ IP address of host running other process ◦ “port number” - allows receiving host to determine to which local process the message should be delivered

5 5 Properties of transport service of interest to the app Data loss some apps (e.g., audio) can tolerate some loss other apps (e.g., file transfer, telnet) require 100% reliable data transfer Connection-oriented vs connectionless services Bandwidth, Timing r some apps (e.g., multimedia) require at least a minimum amount of bandwidth r some apps (e.g., Internet telephony, interactive games) require low delay and/or low jitter r other apps (elastic apps, e.g. file transfer) make use of whatever bandwidth, timing they get

6 6 Transport service requirements of common apps Application file transfer e-mail Web documents real-time audio/ video stored audio/video interactive games financial apps Data loss no loss No-loss loss-tolerant no loss Bandwidth elastic audio: 5Kb-1Mb video:10Kb-5Mb same as above few Kbps up elastic Time Sensitive no yes, 100’s msec yes, few secs yes, 100’s msec yes and no

7 7 Internet apps: their protocols Application e-mail remote terminal access Web file transfer streaming multimedia remote file server Internet telephony nslookup and many others Application layer protocol » smtp [RFC 821] » telnet [RFC 854] » http [RFC 2068] » ftp [RFC 959] proprietary (e.g. RealNetworks) NSF SIP, RTP, proprietary (e.g., Skype) » DNS [RFC 882, 883,1034,1035] Underlying transport protocol TCP TCP or UDP typically UDP, TCP also possible UDP

8 8 The TELNET Protocol TCP connection data and control over the same connection. Network Virtual Terminal negotiated options

9 9 Network Virtual Terminal intermediate representation of a generic terminal. provides a standard language for communication of terminal control functions.

10 10 Network Virtual Terminal NVT NVT ServerProcess TCP TCP

11 11 Negotiated Options All NVTs support a minimal set of capabilities. Some terminals have more capabilities than the minimal set. The 2 endpoints negotiate a set of mutually acceptable options (character set, echo mode, etc).

12 12 Option examples Line mode vs. character mode echo modes character set (EBCDIC vs. ASCII)

13 13 Control Functions TELNET includes support for a series of control functions commonly supported by servers. This provides a uniform mechanism for communication of (the supported) control functions.

14 14 Control Functions Interrupt Process (IP) ◦ suspend/abort process. Abort Output (AO) ◦ process can complete, but send no more output to user’s terminal. Are You There (AYT) ◦ check to see if system is still running.

15 15 More Control Functions Erase Character (EC) ◦ delete last character sent ◦ typically used to edit keyboard input. Erase Line (EL) ◦ delete all input in current line.

16 16 Command Structure All TELNET commands and data flow through the same TCP connection. Commands start with a special character called the Interpret as Command escape character (IAC). The IAC code is 255. If a 255 is sent as data - it must be followed by another 255.

17 17 Looking for Commands Each receiver must look at each byte that arrives and look for IAC. If IAC is found and the next byte is IAC - a single byte is presented to the application/terminal (a 255). If IAC is followed by any other code - the TELNET layer interprets this as a command.

18 18 Playing with TELNET You can use the telnet program to play with the TELNET protocol. telnet is a generic TCP client. ◦ Sends whatever you type to the TCP socket. ◦ Prints whatever comes back through the TCP socket. ◦ Useful for testing TCP servers (ASCII based protocols).

19 19 Some TCP Servers you can play with Many Unix systems have these servers running (by default): ◦ echo port 7 ◦ discard port 9 ◦ daytime port 13 ◦ chargen port 19

20 20 telnet hostname port > telnet rcs.rpi.edu 7 Trying 128.113.113.33... Connected to cortez.sss.rpi.edu (128.113.113.33). Escape character is '^]'. Hi dave stop it ^] telnet> quit Connection closed.

21 21 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

22 22 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. ◦ 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

23 23 ftp commands, responses Sample commands: sent as ASCII text over control channel USER username PASS password LIST return list of file in current directory RETR filename retrieves (gets) file STOR filename stores (puts) file onto remote host Sample return codes status code and phrase (as in http) 331 Username OK, password required 125 data connection already open; transfer starting 425 Can’t open data connection 452 Error writing file

24 24 application layer transport layer (TCP/UDP) network layer (IP) link layer (e.g. ethernet) physical layer application layer transport layer (TCP/UDP) network layer (IP) link layer (e.g. ethernet) physical layer OS network stack Sockets as means for inter-process communication (IPC) Process Socket OS network stack Socket Internet

25 25 Addressing server Address the machine on the network ◦ By IP address (127.0.0.1 – localhost) Address the process ◦ By the “port”-number The pair of IP-address + port – makes up a “socket- address” OS network stack Process#m Port#m Process#1 Port#1 … Host#1 OS network stack Process#k Port#k Process#1 Port#1 … Host#n … Network IP-address#1IP-address#n

26 26 Socket types Datagram socket – using UDP ◦ Not sequenced ◦ Not reliable ◦ Not unduplicated ◦ Connectionless Stream socket – using TCP ◦ Sequenced ◦ Reliable ◦ Unduplicated ◦ Connection-oriented Raw and others (extracurricular)

27 27 Usage of port-numbers Standard applications use predefined port-numbers ◦ 21 - ftp ◦ 23 - telnet ◦ 80 - http ◦ 110 - pop3 (email) ◦ … Other applications should choose between 1024 and 65535 ◦ 4662 – eMule ◦ …

28 28 Socket primitives SOCKETcreate a new socket BINDattach a local address to a socket LISTENannounce a willingness to accept connections ACCEPTAccept an incoming connection, Create a socket and a child process for the client CONNECTactively attempt to establish a connection SENDsend some data over the connection RECEIVEreceive some data from the connection CLOSErelease the connection (the port)

29 29 Client+server: connectionless CREATEBIND SEND CLOSE RECEIVE

30 30 Client+server: connection-oriented SOCKET BINDLISTENCONNECTACCEPT RECEIVE SEND CLOSE TCP three-way handshake

31 31 Application Layer: Summary application service requirements: ◦ reliability, bandwidth, delay client-server paradigm Internet transport service model ◦ connection-oriented, reliable: TCP ◦ unreliable, datagrams: UDP specific protocols: –http –ftp –smtp, pop3 –Dns –… sockets –client/server implementation –using tcp, udp sockets


Download ppt "Internet Engineering Course Application Layer Protocols."

Similar presentations


Ads by Google