web basics and protocols cs 502 – 20020129 carl lagoze
DESCRIPTION
Web Basics and Protocols CS 502 – 20020129 Carl Lagoze. Acks to McCracken Syracuse Univ . In the beginning…. In the beginning…. ARPANET. DoD funded through leadership of Licklider Inspired by move from batch to timesharing Allowed remote login. Packet Switching. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Web Basics and Protocols CS 502 – 20020129 Carl Lagoze](https://reader036.vdocuments.net/reader036/viewer/2022081604/56816846550346895dde26b3/html5/thumbnails/1.jpg)
Cornell CS502
Web Basics and Protocols
CS 502 – 20020129Carl Lagoze
Acks to McCrackenSyracuse Univ.
![Page 2: Web Basics and Protocols CS 502 – 20020129 Carl Lagoze](https://reader036.vdocuments.net/reader036/viewer/2022081604/56816846550346895dde26b3/html5/thumbnails/2.jpg)
Cornell CS502
In the beginning….
![Page 3: Web Basics and Protocols CS 502 – 20020129 Carl Lagoze](https://reader036.vdocuments.net/reader036/viewer/2022081604/56816846550346895dde26b3/html5/thumbnails/3.jpg)
Cornell CS502
In the beginning…
![Page 4: Web Basics and Protocols CS 502 – 20020129 Carl Lagoze](https://reader036.vdocuments.net/reader036/viewer/2022081604/56816846550346895dde26b3/html5/thumbnails/4.jpg)
Cornell CS502
ARPANET
• DoD funded through leadership of Licklider
• Inspired by move from batch to timesharing
• Allowed remote login
![Page 5: Web Basics and Protocols CS 502 – 20020129 Carl Lagoze](https://reader036.vdocuments.net/reader036/viewer/2022081604/56816846550346895dde26b3/html5/thumbnails/5.jpg)
Cornell CS502
Packet Switching
• Invented in early 1960’s by Baran, Davies, Kleinrock
• digital, redundant, efficient, upgradeable (software)
• 1969 ARPANET first network implementation
![Page 6: Web Basics and Protocols CS 502 – 20020129 Carl Lagoze](https://reader036.vdocuments.net/reader036/viewer/2022081604/56816846550346895dde26b3/html5/thumbnails/6.jpg)
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
![Page 7: Web Basics and Protocols CS 502 – 20020129 Carl Lagoze](https://reader036.vdocuments.net/reader036/viewer/2022081604/56816846550346895dde26b3/html5/thumbnails/7.jpg)
Cornell CS502
Layered Protocol Model
![Page 8: Web Basics and Protocols CS 502 – 20020129 Carl Lagoze](https://reader036.vdocuments.net/reader036/viewer/2022081604/56816846550346895dde26b3/html5/thumbnails/8.jpg)
Cornell CS502
TCP/IP Protocol Suite
• IP – packet delivery• TCP – virtual circuits, packet
reassembly• ARP/RARP – address
resolution
![Page 9: Web Basics and Protocols CS 502 – 20020129 Carl Lagoze](https://reader036.vdocuments.net/reader036/viewer/2022081604/56816846550346895dde26b3/html5/thumbnails/9.jpg)
Cornell CS502
Protocol Layers
![Page 10: Web Basics and Protocols CS 502 – 20020129 Carl Lagoze](https://reader036.vdocuments.net/reader036/viewer/2022081604/56816846550346895dde26b3/html5/thumbnails/10.jpg)
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
![Page 11: Web Basics and Protocols CS 502 – 20020129 Carl Lagoze](https://reader036.vdocuments.net/reader036/viewer/2022081604/56816846550346895dde26b3/html5/thumbnails/11.jpg)
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
![Page 12: Web Basics and Protocols CS 502 – 20020129 Carl Lagoze](https://reader036.vdocuments.net/reader036/viewer/2022081604/56816846550346895dde26b3/html5/thumbnails/12.jpg)
Cornell CS502
Internet Documents
• STD’s – Official IETF Internet standards– http://www.rfc-editor.org/rfcxx00.html
• RFC’s – “Requests for Comments” to IETF community for information, standardization– http://www.ietf.org/rfc.html
• Internet Drafts – IETF working documents– http://www.ietf.org/ID.html
• W3C Reports (recommendations, drafts, notes)– http://www.w3.org/TR/
![Page 13: Web Basics and Protocols CS 502 – 20020129 Carl Lagoze](https://reader036.vdocuments.net/reader036/viewer/2022081604/56816846550346895dde26b3/html5/thumbnails/13.jpg)
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 (1.0 1996), RFC 2616 (1.1 1999)
![Page 14: Web Basics and Protocols CS 502 – 20020129 Carl Lagoze](https://reader036.vdocuments.net/reader036/viewer/2022081604/56816846550346895dde26b3/html5/thumbnails/14.jpg)
Cornell CS502
Daemons and Ports
23
80
21
telnetd
httpd
ftpd
Socket(Virtual Circuit)
![Page 15: Web Basics and Protocols CS 502 – 20020129 Carl Lagoze](https://reader036.vdocuments.net/reader036/viewer/2022081604/56816846550346895dde26b3/html5/thumbnails/15.jpg)
Cornell CS502
Basic Socket ServerProgramming
![Page 16: Web Basics and Protocols CS 502 – 20020129 Carl Lagoze](https://reader036.vdocuments.net/reader036/viewer/2022081604/56816846550346895dde26b3/html5/thumbnails/16.jpg)
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
![Page 17: Web Basics and Protocols CS 502 – 20020129 Carl Lagoze](https://reader036.vdocuments.net/reader036/viewer/2022081604/56816846550346895dde26b3/html5/thumbnails/17.jpg)
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
![Page 18: Web Basics and Protocols CS 502 – 20020129 Carl Lagoze](https://reader036.vdocuments.net/reader036/viewer/2022081604/56816846550346895dde26b3/html5/thumbnails/18.jpg)
Cornell CS502
HTTP Request
• Start line– Consists of method, URL, versionGET index.html HTTP/1.1– Valid methods include:
• GET, POST, HEAD, PUT, DELETE• Headers
– HTTP/1.1 requires a Host: header• Body content
![Page 19: Web Basics and Protocols CS 502 – 20020129 Carl Lagoze](https://reader036.vdocuments.net/reader036/viewer/2022081604/56816846550346895dde26b3/html5/thumbnails/19.jpg)
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
![Page 20: Web Basics and Protocols CS 502 – 20020129 Carl Lagoze](https://reader036.vdocuments.net/reader036/viewer/2022081604/56816846550346895dde26b3/html5/thumbnails/20.jpg)
Cornell CS502
HTTP Response
• Start line– consists of HTTP version, status code, and
descriptionHTTP/1.1 200 OKHTTP/1.1 404 Not Found
• HeadersContent-type: text/html
• Content
![Page 21: Web Basics and Protocols CS 502 – 20020129 Carl Lagoze](https://reader036.vdocuments.net/reader036/viewer/2022081604/56816846550346895dde26b3/html5/thumbnails/21.jpg)
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
![Page 22: Web Basics and Protocols CS 502 – 20020129 Carl Lagoze](https://reader036.vdocuments.net/reader036/viewer/2022081604/56816846550346895dde26b3/html5/thumbnails/22.jpg)
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
![Page 23: Web Basics and Protocols CS 502 – 20020129 Carl Lagoze](https://reader036.vdocuments.net/reader036/viewer/2022081604/56816846550346895dde26b3/html5/thumbnails/23.jpg)
Cornell CS502
Serving a Page
• User of client machine types in a URL
client( N etscape)
server( Apache)
http: / / www.sm allco.com / index.h tm l
![Page 24: Web Basics and Protocols CS 502 – 20020129 Carl Lagoze](https://reader036.vdocuments.net/reader036/viewer/2022081604/56816846550346895dde26b3/html5/thumbnails/24.jpg)
Cornell CS502
Serving a Page
• Server name is translated to an IP address via DNS
client( N etscape)
server( Apache)
http: / / www.sm allco.com / index.htm l
192.22.107.5
![Page 25: Web Basics and Protocols CS 502 – 20020129 Carl Lagoze](https://reader036.vdocuments.net/reader036/viewer/2022081604/56816846550346895dde26b3/html5/thumbnails/25.jpg)
Cornell CS502
Serving a Page
• Client connects to server using IP address and port number
client( N etscape)
server( Apache)
http: / / www.sm allco.com / index.htm l
192.22.107.5
192.22.107.5port 80
![Page 26: Web Basics and Protocols CS 502 – 20020129 Carl Lagoze](https://reader036.vdocuments.net/reader036/viewer/2022081604/56816846550346895dde26b3/html5/thumbnails/26.jpg)
Cornell CS502
Serving a Page
• Client determines path and file to request
client( N etscape)
server( Apache)
http: / / www.sm allco.com / index.h tm l
![Page 27: Web Basics and Protocols CS 502 – 20020129 Carl Lagoze](https://reader036.vdocuments.net/reader036/viewer/2022081604/56816846550346895dde26b3/html5/thumbnails/27.jpg)
Cornell CS502
Serving a Page
• Client sends HTTP request to server
client( N etscape)
server( Apache)
http: / / www.sm allco.com / index.h tm l
GET index .html HTT P/ 1.1
![Page 28: Web Basics and Protocols CS 502 – 20020129 Carl Lagoze](https://reader036.vdocuments.net/reader036/viewer/2022081604/56816846550346895dde26b3/html5/thumbnails/28.jpg)
Cornell CS502
Serving a Page
• Server determines which file to send
client( N etscape)
server( Apache)
http : / / ww w.sm allco.com / index.htm l"index.htm l" is really/ etc/ httpd / htdocs/ index.htm l
![Page 29: Web Basics and Protocols CS 502 – 20020129 Carl Lagoze](https://reader036.vdocuments.net/reader036/viewer/2022081604/56816846550346895dde26b3/html5/thumbnails/29.jpg)
Cornell CS502
Serving a Page
• Server sends response code and the document
client( N etscape)
server( Apache)
http : / / w ww.sm allco.com / index.htm l
HTTP/ 1.1 200 OKContent- type: text/ htm l
[ contents of index.h tm l]
![Page 30: Web Basics and Protocols CS 502 – 20020129 Carl Lagoze](https://reader036.vdocuments.net/reader036/viewer/2022081604/56816846550346895dde26b3/html5/thumbnails/30.jpg)
Cornell CS502
Serving a Page
• Connection is broken
client( N etscape)
server( Apache)