Cornell CS502 Web Basics and Protocols CS 502 – Carl Lagoze Acks to McCracken Syracuse Univ.
Cornell CS502 In the beginning….
Cornell CS502 In the beginning…
Cornell CS502 ARPANET DoD funded through leadership of Licklider Inspired by move from batch to timesharing Allowed remote login
Cornell CS502 Packet Switching Invented in early 1960’s by Baran, Davies, Kleinrock digital, redundant, efficient, upgradeable (software) 1969 ARPANET first network implementation
Cornell CS502 Packet Switching Network messages broken up into packets Each pocket has a destination address Pass and forward model – router gets packet, examine, decides where to send next Message reassembled on other end
Cornell CS502 Layered Protocol Model
Cornell CS502 TCP/IP Protocol Suite IP – packet delivery TCP – virtual circuits, packet reassembly ARP/RARP – address resolution
Cornell CS502 Protocol Layers
Cornell CS502 Internet Issues (Internet 2) Demands of multimedia applications Virtual circuit reservations – bandwidth and quality of service guarantees Real time streaming protocols State saving
Cornell CS502 Internet Governance Internet Society (ISOC) – Evolution, social & political issues Internet Architecture Board (IAB) – Oversees standards process Internet Engineering Task Force (IETF) – standards development Internet Assigned Names Authority (IANA) – protocol # assignment Internet Corporation for Assigned Names and Numbers (ICANN) – IP and DNS addresses World Wide Web Consortium (W3C) – web standards and evolution
Cornell CS502 Internet Documents STD’s – Official IETF Internet standards – RFC’s – “Requests for Comments” to IETF community for information, standardization – Internet Drafts – IETF working documents – W3C Reports (recommendations, drafts, notes) –
Cornell CS502 Well-Known Protocols Telnet – external terminal interface, RFC 854 (1983) FTP – file transfer, RFC 959 (1985) SMTP – mail transport, RFC 821 (1982) HTTP – distributed, collaborative hypermedia systems, RFC 1945 ( ), RFC 2616 ( )
Cornell CS502 Daemons and Ports telnetd httpd ftpd Socket (Virtual Circuit)
Cornell CS502 Basic Socket ServerProgramming
Cornell CS502 HTTP HTTP is… –Designed for document transfer –Generic not tied to web browsers exclusively can serve any data type –Stateless no persistent client/server connection
Cornell CS502 HTTP Session An HTTP session consists of a client request followed by a server response Requests and responses: –are sent in plain text –conform to the HTTP syntax –consist of start line, headers, blank line, and message body
Cornell CS502 HTTP Request Start line –Consists of method, URL, version GET index.html HTTP/1.1 –Valid methods include: GET, POST, HEAD, PUT, DELETE Headers –HTTP/1.1 requires a Host: header Body content
Cornell CS502 HTTP Request Methods Methods include –GET: retrieve information identified by the URL –HEAD: same as get but don't get message body (content) –POST: accept the request content and send it to the URL –PUT: store the request content as the given URL
Cornell CS502 HTTP Response Start line –consists of HTTP version, status code, and description HTTP/ OK HTTP/ Not Found Headers Content-type: text/html Content
Cornell CS502 HTTP Response Codes Respose coded by first digit –1xx: informational, request received –2xx: success, request accepted –3xx: redirection –4xx: client error –5xx: server error
Cornell CS502 HTTP Content Body Header fields can affect content interpretation –required header field: Content-type –others: Content-Encoding, Content-Length, Expires, Last- Modified –added by web server - we will configure some of these later
Cornell CS502 Serving a Page User of client machine types in a URL
Cornell CS502 Serving a Page Server name is translated to an IP address via DNS
Cornell CS502 Serving a Page Client connects to server using IP address and port number
Cornell CS502 Serving a Page Client determines path and file to request
Cornell CS502 Serving a Page Client sends HTTP request to server
Cornell CS502 Serving a Page Server determines which file to send
Cornell CS502 Serving a Page Server sends response code and the document
Cornell CS502 Serving a Page Connection is broken