260 likes | 551 Views
Chapter 1 Internet and Web Protocols. Objectives. Understand how the Internet developed Explain the role and function of important Internet protocols Explain the role and function of HTTP and interpret HTTP transaction details Read and write XML documents. Internet History.
E N D
Objectives • Understand how the Internet developed • Explain the role and function of important Internet protocols • Explain the role and function of HTTP and interpret HTTP transaction details • Read and write XML documents
Internet History • Developed in the late 1960’s, as a way to interconnect diverse computer networks • First network: the ARPAnet(Department of Defense, Advanced Research Projects Agency) • Early uses: research and communication, in academic and laboratory environments
Internet Design Principles • Open Architecture • based on public, non-proprietary standards • Distributed Control • no single command center or point of failure • inherently scalable • Simplicity • protocols are dependable, easy to implement, inexpensive
Internet Weaknesses • IP Addresses • initial expectations for a few thousand hosts underestimated the growth rate of the Internet • newer protocol versions expand the address space from about 4x109 to about 3x1038 • Security • widespread misuse of Internet applications (spam, e-crime, etc.) were not anticipated • security features have been added retroactively, but problems persist
World Wide Web History • Developed around 1990 as a tool for sharing hyperlinked text documents over the Internet • Sponsor: European Center for Nuclear Research (CERN) • Original browsers were text-mode only • Graphical browsers and e-commerce developed soon thereafter
Internet and Web Governance • The Internet Society (ISOC) governs Internet protocol developments • Internet Architecture Board (IAB) • Internet Engineering Task Force (IETF) • The Internet Corporation for Assigned Names and Numbers (ICANN) controls registry of domain names by various registrars • The World Wide Web Consortium (W3C) governs Web protocol developments
Internet Protocols • Internet protocols govern transmission of data from one host to another • IP: Internet Protocol • TCP: Transmission Control Protocol • UDP: User Datagram Protocol • Internet protocols depend upon the availability of a network layer, and provide services to various Internet applications
Internet Protocol Stack • Each layer of the stack uses the services of the layer below it, and provides services to the layer above it • For example, e-mail depends on TCP, which depends on IP, etc.
IP (Internet Protocol) • Sends chunks of data (packets) between Internet hosts • IP is connectionless: there is no fixed circuit established between end points; each packet is sent individually • Delivery is best-effort (no guarantee)
IP Addresses • Each host on the Internet is identified by a unique IP Address, a 32-bit string • IP addresses are typically represented as four octets (8-bit values) in decimal • e.g., 134.126.20.73 • Domain names (e.g., www.jmu.edu) are translated to IP addresses by the Internet’s Domain Name System (DNS) • IPv4 vs. IPv6
IPv4 vs. IPv6 • IP version 4 uses 32-bit IP addresses, allowing for about 4 billion addresses • The growth of the Internet has led to an IP address shortage (4 billion is not enough!) • various work-arounds have been developed • IPv6 will eliminate this problem by expanding the IP address to 128 bits
TCP (Transmission Control Protocol) • TCP breaks application data into packets and delivers it using IP • TCP adds value to IP: • reliability: guaranteed delivery of all packets • ordering: packets arrive in the order sent • flow-control: transmission is throttled in order to prevent recipient buffer overflows • multiplexing: the sender and receiver can maintain multiple open application-level channels
UDP (User Datagram Protocol) • UDP also breaks application data into packets and delivers it using IP • UDP adds value to IP: • error-detection: the receiver can detect transmission errors • multiplexing: the sender and receiver can maintain multiple open application-level channels
TCP guarantees correct delivery Better for email, WWW, and applications that depend on correctness UDP is faster than TCP (because it doesn’t correct errors) Better for streaming applications that can tolerate some noise (such as audio and video) TCP vs. UDP
HTTP (HyperText Transfer Protocol) • Allows web clients to request and receive delivery of documents and services • Governs the format of web addresses and the exchange of information on the Web • A client-server protocol • clients make requests, servers respond
HTTP Transaction • One HTTP Transaction consists of two parts: • HTTP Request • HTTP Response Request Server Client Response
Statelessness • There is no memory (preservation of state) between HTTP transactions • Each HTTP transaction is independent of the one before it and the one after it C L I E N T S E R V E R
Uniform Resource Locators • Each web resource is identified by a unique URL • General form for a URL:<scheme><domain name><port>For example,http://www.mywebsite.net:80(the port is usually omitted and a default is used)
HTTP Request Methods • Each HTTP request contains a method attribute that identifies its purpose • Valid methods include • GET retrieve a resource • POST submit data to be processed • CONNECT create a TCP/IP tunnel • DELETE delete a resource • HEAD get response headers only • OPTIONS get a list of supported methods • PUT replace a resource • TRACE echo the request
HTTP Response Codes • Each HTTP response contains a response code that indicates the general outcome • Response code categories / examples: • 1xx: Information 100 continue • 2xx: Success 200 OK • 3xx: Redirect 301 Moved Permanently • 4xx: Client Error 404 Not Found • 5xx: Server Error 500 Internal Server Error
HTTP Headers • Each request and response message begins with header lines that provide meta-information • Request header data examples: • method, resource, protocol version, host • Response header data examples: • protocol version, response code, content type, content length, date Headers ---------------------- Data Headers ---------------------- Data Request Response
HTTP Request Message GET /hello.html HTTP/1.1 Host: grove.cs.jmu.edu HTTP Response Message HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Content-Type: text/html Content-Length: 37 Date: Fri, 07 Sep 2007 16:13:28 GMT <html> <body> Hello! </body> </html> HTTP Headers Example A blank line separates message headers from message body
eXtensible Markup Language • XML is a meta-language that is used to define other languages • XML is used to create document types, which specify the syntax for describing an individual of that type • For example, in a medical records system, document types might include • patient, medical test, hospital admission • XML is also used to define XHTML, the language for writing web pages • each XHTML document defines one web page
Review • Internet & Web History • Internet Design • Internet Protocols (IP, TCP, UDP) • Web Protocol (HTTP) • XML