1 / 104

INFO 330 Computer Networking Technology I

INFO 330 Computer Networking Technology I. Chapter 2 The Application Layer Glenn Booker. Application Layer. The Application Layer is the reason the rest of the network exists – to serve applications Most of the software familiar to end users are applications

hidi
Download Presentation

INFO 330 Computer Networking Technology I

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. INFO 330Computer Networking Technology I Chapter 2 The Application Layer Glenn Booker INFO 330 Chapter 2

  2. Application Layer The Application Layer is the reason the rest of the network exists – to serve applications Most of the software familiar to end users are applications Email, FTP, newsgroups, chat, the Web, streaming video, video conferencing, IPTV, etc. We focus first on key concepts related to the Application Layer, then discuss some specific applications in detail INFO 330 Chapter 2

  3. Application Layer New applications designed for network implementation need to decide whether the application is based on Client-server architecture Peer to peer (P2P) Or some hybrid combination of the two INFO 330 Chapter 2

  4. Client-server Architecture In client-server architecture, the server Handles requests from many clients, and Is generally always available Often has a fixed IP address Clients generally don’t communicate with each other, and may be on or off independently of each other and the server Client-server applications include email, FTP, the Web, remote login INFO 330 Chapter 2

  5. Client-server Architecture Complex infrastructure intensive apps might require several types of servers – database, web, etc. Multiple servers may be needed to keep up with the volume of client requests, hence the need for a server farm ordata center INFO 330 Chapter 2

  6. P2P Architecture P2P architecture assumes the clients are on or off at will, and all are treated equally as potential servers and/or clients Apps include Gnutella, Morpheus, BitTorrent, Kazaa and more INFO 330 Chapter 2

  7. P2P Architecture P2P architecture is inherently self-scalable Millions of computers may participate, because each computer adds capacity at the same time it adds possible workload Managing contents of a P2P application can be difficult Only one computer may have a particular file, and there’s no control over when that computer is available INFO 330 Chapter 2

  8. P2P Architecture Key challenges in a good P2P app include ISP friendly, since most residential connections are designed for far more bandwidth down than up, and P2P doesn’t follow this Security, danger of over-sharing Incentives for people to participate INFO 330 Chapter 2

  9. Hybrid Architecture Client-server and P2P combinations exist Napster is the best known for file sharing Obtains file location and description information from a P2P network, but maintains that information on a central server farm Instant messaging (IM) is also hybrid Chats are all P2P, but logging into the system is centralized Includes ICQ, AOL IM , MSN Messenger, etc. INFO 330 Chapter 2

  10. Process Communication Any network application (no matter which architecture) needs to communicate between hosts using processes In this sense, a process is a program running on a client, server, or peer host Processes may communicate with other processes on the same host; this is controlled by the host’s operating system (OS) We are interested in processes that communicate between hosts INFO 330 Chapter 2

  11. Process Communication Processes exchange messages The sending or client process creates a message and sends it into the network The receiving or server process gets the message from the network and might reply Notice that client and server process only relate to their relative roles in sending a message, not the client-server or other architectures mentioned earlier INFO 330 Chapter 2

  12. Sockets A socket is the doorway through which the process sends a message to the network The message goes through a socket on the client process, passes through the network, then enters the server process through another socket A socket bridges the application and transport layers within each host INFO 330 Chapter 2

  13. Sockets Could be UDP on both ends INFO 330 Chapter 2

  14. Sockets A socket is the Application Programming Interface (API) between application and the network The API is all the developer sees of the network connection The developer can choose to use TCP or UDP, and maybe tweak a few transport layer parameters Winsock is the Microsoft socket API INFO 330 Chapter 2

  15. Addressing Processes For the server process to get the message, it has to be addressed correctly The host address and receiving process are the key parts of the address The host address is its IP address (the 32- or 128-bit address of the host’s network interface) The receiving process is identified by its port number, since many processes can be running at once INFO 330 Chapter 2

  16. Addressing Processes Sockets send packets Ports listen for them INFO 330 Chapter 2

  17. Port Number Port numbers follow default values, set by the IANA, unless specified otherwise 21 = FTP 23 = Telnet 25 = SMTP 53 = DNS 80 = HTTP, http://mine.com implies http://mine.com:80 110 = POP3 194 = IRC, and hundreds more INFO 330 Chapter 2

  18. More Protocols Application-layer protocols define how a particular application’s processes are structured What types of messages are allowed The syntax of those messages The meaning of the fields in the syntax Rules for processing messages – when and how to send messages, how to reply, etc. INFO 330 Chapter 2

  19. Application vs its protocols A single application often needs to use several application-layer protocols A web browser might use HTTP, but also FTP, telnet, gopher, etc. An email application might use POP3, SMTP, IMAP, etc. Many app protocols are defined in RFCs But some application-layer protocols are proprietary INFO 330 Chapter 2

  20. RFC Summary For an RFC which lists the current RFC standards, look in the RFC Index for “Internet Official Protocol Standards” The current one is RFC 5000, dated May 2008 INFO 330 Chapter 2

  21. Application Services The transport layer connects the application layer to everything else Have a choice of two protocols, TCP and UDP, unless you want to write your own! Key services include Reliable data transfer – how important is it? Or is your app loss-tolerant? INFO 330 Chapter 2

  22. Application Services How much bandwidth or throughput does your app need? Does sending rate have to equal receiving rate? Some apps are elastic – can tolerate wide ranges of available bandwidth How sensitive is your app to timing? Games and telephony tend to be sensitive to slow or erratic transmission delays How important is security? INFO 330 Chapter 2

  23. TCP Services TCP provides a connection-oriented service, where the sockets of the client and server recognize a connection for the duration of the session Connection is duplex – messages can go both ways at once TCP is highly reliable – the bits leaving one side all get to the other side, and get put back in the original order INFO 330 Chapter 2

  24. TCP Services TCP also provides congestion control, for benefit of the Internet This throttles the sending processes when the connection is congested, and can limit bandwidth TCP does not guarantee any level of transmission rate, or provide delay guarantees So you’ll get your data across, but we don’t know when INFO 330 Chapter 2

  25. UDP Services UDP is a lightweight protocol – meaning it doesn’t do much! UDP is connectionless UDP is unreliable – data may never get there UDP packets may arrive out of order and not realize it There are no transmission rate guarantees INFO 330 Chapter 2

  26. Services NOT Provided TCP and UDP do not provide guarantees of throughput or timing TCP does nothing for security per se, but SSL can be added on at the transport layer See Chapter 7 for INFO 331 INFO 330 Chapter 2

  27. Application Protocols We’ll examine protocols for Internet-based applications HTTP FTP SMTP POP3 IMAP DNS INFO 330 Chapter 2

  28. The Web and HTTP Through the 1980’s, the Internet was used mostly for remote login, file transfer, newsgroups, and email The World Wide Web changed all that, and made the Internet visible to the public Comparable in significance to inventing movable type, the telephone, radio, or TV Web provides demand-based information, vs. broadcast info on radio and TV INFO 330 Chapter 2

  29. HTTP The HyperText Transfer Protocol (HTTP) is the heart of the Web Defined by RFCs 1945 (v1.0) and 2616 (v1.1) Has client and server programs which communicate via HTTP messages Web pages contain objects – files of various sorts, such as a base HTML file, which cites JPG and/or GIF images, etc. App to use HTTP is a browser INFO 330 Chapter 2

  30. HTTP A Web server houses the objects Apache and Microsoft Internet Information Services (IIS) are common Web server apps HTTP defines the messages that pass between client and server Uses TCP for transport protocol HTTP has no memory of previous actions (a stateless protocol) – so if you ask for a file 126 times, it will send the file 126 times INFO 330 Chapter 2

  31. HTTP HTTP can use persistent or non-persistent connections – persistent is the default, but non-persistent can be specified A non-persistent connection to get a web page might work like this: Client requests a TCP connection to web server on port 80 Client requests the HTML page Server retrieves the HTML page, and sends it INFO 330 Chapter 2

  32. HTTP Server closes the TCP connection Client closes the TCP connection Client reads the HTML file, and finds 10 JPGs referenced Client repeats steps 1-4 ten times (!) to download each of the JPG images Not very efficient! Browser can determine how many parallel TCP connections are used (typically 5-10) INFO 330 Chapter 2

  33. More Delays! How long does this process take? The round-trip time (RTT) is for a packet to go from client to server and back Includes propagation delays, queuing delays, processing delays TCP handshake involves two messages between client (C) and server (S); C-S, S-C Then request the file (C-S), and get the file from the server (S-C) INFO 330 Chapter 2

  34. RTT Delay So the time for getting one file is two times the RTT, plus the transmission time for uploading the file from the server (Fig. 2.7, p. 104, 5th ed.) In the non-persistent connection example, this is done 11 times for one HTML file and 10 JPGs INFO 330 Chapter 2

  35. Persistent Connection If there’s a persistent connection, the TCP connection stays, so the handshake is done once not only for the web page in the example, but for many HTTP requests Connection is closed after some period of inactivity Persistent connections can be with or without pipelining INFO 330 Chapter 2

  36. Persistent Connection Without pipelining, the client requests a new object only after the previous request has been filled With pipelining, the clients requests new objects as needed, and may be waiting for several responses at once This is the default setting for web browsers Could reduce total RTT to one RTT unit for all parts of a web page, vs. 22 units for a non-persistent connection! INFO 330 Chapter 2

  37. HTTP vs HTML Don’t confuse HTTP with HTML HTTP is the protocol used to define how files are requested and transferred between server and clients HTML is the format of web pages So an HTML file might be the structure of an entity body transferred using HTTP INFO 330 Chapter 2

  38. HTTP Messages HTTP messages are two types, request messages (from client) and response messages (from server) All HTTP messages are plain ASCII text ‘Both types of message consist of a start-line, zero or more header fields (also known as "headers"), an empty line (i.e., a line with nothing preceding the CRLF) indicating the end of the header fields, and possibly a message-body.’ [RFC 2616, para 4.1] CRLF is a “carriage return and line feed” INFO 330 Chapter 2

  39. HTTP Messages There are many headers which could appear in requests or responses Cache-Control, Connection, Date, Pragma, Trailer, Transfer-Encoding, Upgrade, Via, and/or Warning [RFC 2616, para 4.5] Disclaimer: RFC 2616 is 176 pages long – so we’re just providing a summary of where to look for info if you’re curious about the details of these messages INFO 330 Chapter 2

  40. HTTP Requests Request messages have variable number of lines, depending on the method called General request syntax is Method Request-URI HTTP-Version Methods are OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, or CONNECT [RFC 2616, para 5.1.1] Most commonly used is GET Request-URI is the desired Uniform Resource Identifier (URI, commonly called a URL) INFO 330 Chapter 2

  41. HTTP Requests HTTP-Version is what it sounds like, e.g. HTTP/1.1 There are many possible request headers Accept, Accept-Charset, Accept-Encoding, Accept-Language, Authorization, Expect, From, Host, If-Match, If-Modified-Since, If-None-Match, If-Range, If-Unmodified-Since, Max-Forwards, Proxy-Authorization, Range, Referer, TE (extension transfer-codings), and/or User-Agent [RFC 2616, para 5.3] INFO 330 Chapter 2

  42. HTTP Responses HTTP responses go from server to client General syntax starts with HTTP-Version Status-Code Reason-Phrase[RFC 2616, para 6.1] The Status-Code could be dozens of values "200" OK "403" Forbidden "404" Not Found The Reason-Phrase is any text phrase assigned INFO 330 Chapter 2

  43. HTTP Responses Response headers can include Accept-Ranges, Age, ETag, Location, Proxy-Authenticate, Retry-After, Server, Vary, and/or WWW-Authenticate [RFC 2616, para 6.2] Responses usually include entities, unless the HEAD method was used INFO 330 Chapter 2

  44. HTTP Entities An entity is the object sent or returned with an HTTP message Entities can be with requests or responses Entity headers include Allow, Content-Encoding, Content-Language, Content-Length (bytes), Content-Location, Content-MD5, Content-Range, Content-Type, Expires, Last-Modified, and/or extension-header [RFC 2616, para 7.1] Where extension-header is any allowable message-header for that kind of message INFO 330 Chapter 2

  45. HTTP So HTTP describes request and response message formats Both types typically have a first line which tells its purpose (the request or status line) There can be many header lines There might be an entity attached INFO 330 Chapter 2

  46. Cookies! HTTP is stateless But some would like to remember a little information about web site visitors, hence cookies were defined with RFC 2965 Cookies require four parts A cookie header in HTTP responses A cookie header in HTTP requests Cookie files on the user’s computer A database on the web server INFO 330 Chapter 2

  47. Cookies When a user visits a cookied web site the first time, they are assigned a unique ID number, which is stored in the database A Set-cookie method is used in their response to flag that ID number Set-cookie: 1678 All subsequent HTTP interaction with that site, even years later, will flag that cookie number and identify the user INFO 330 Chapter 2

  48. Cookies Cookie: 1678 This provides a way for web sites to automate login for repeat customers, and track browsing and spending patterns One-click shopping is only possible with cookies The price for convenience is the lack of privacy Ads on web sites can be targeted to match the user’s preferences INFO 330 Chapter 2

  49. Other HTTP Content So far we assumed the file content for HTTP was HTML files, JPGs, GIFs, etc. Entities can be many other file formats XML files, which are structured text VoiceXML, WML (web pages for mobile phones), streaming audio and video, and P2P file sharing INFO 330 Chapter 2

  50. Web Caching A Web cache, or proxy server, acts as an intermediate between clients and servers The cache stores recently used files, so they don’t have to be requested again The cache acts as client and server ISPs typically use web caching to cut down on outgoing web traffic (to the servers) and lower request response time INFO 330 Chapter 2

More Related