1 / 31

Internet Engineering Course

Internet Engineering Course. 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

norris
Download Presentation

Internet Engineering Course

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Internet Engineering Course Application Layer Protocols

  2. 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 Applications and application-layer protocols

  3. Typical network app has two pieces: client and server request reply application transport network data link physical application transport network data link physical Client-server paradigm 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

  4. 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 Auxiliary terms ++

  5. 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 Properties of transport service of interest to the app Bandwidth, Timing • some apps (e.g., multimedia) require at least a minimum amount of bandwidth • some apps (e.g., Internet telephony, interactive games) require low delay and/or low jitter • other apps (elastic apps, e.g. file transfer) make use of whatever bandwidth, timing they get

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

  7. Internet apps: their protocols 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 TCP TCP TCP or UDP TCP or UDP typically UDP, TCP also possible UDP Application e-mail remote terminal access Web file transfer streaming multimedia remote file server Internet telephony nslookup and many others

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

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

  10. Network Virtual Terminal Server Process NVT NVT TCP TCP

  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. Option examples • Line mode vs. character mode • echo modes • character set (EBCDIC vs. ASCII)

  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. 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. 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. 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. 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. 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. 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. 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 Hi dave stop it stop it ^] telnet> quit Connection closed.

  21. 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 FTP user interface FTP client FTP server local file system ftp: the file transfer protocol file transfer user at host remote file system

  22. 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 TCP control connection port 21 TCP data connection port 20 FTP client FTP server ftp: separate control, data connections

  23. Sample commands: sent as ASCII text over control channel USER username PASS password LISTreturn list of file in current directory RETR filenameretrieves (gets) file STOR filenamestores (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 ftp commands, responses

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

  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” Host#1 Host#n … Process#1 Process#m … Process#1 Process#k Port#1 Port#m Port#1 Port#k OS network stack OS network stack … IP-address#1 IP-address#n Network

  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. 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. Socket primitives • SOCKET create a new socket • BIND attach a local address to a socket • LISTEN announce a willingness to accept connections • ACCEPT Accept an incoming connection, Create a socket and a child process for the client • CONNECT actively attempt to establish a connection • SEND send some data over the connection • RECEIVE receive some data from the connection • CLOSE release the connection (the port)

  29. CREATE BIND SEND RECEIVE SEND CLOSE Client+server: connectionless

  30. BIND LISTEN RECEIVE SEND SOCKET CONNECT ACCEPT TCP three-way handshake RECEIVE SEND CLOSE Client+server: connection-oriented

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

More Related