






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Notes; Professor: Xu; Class: COMPUTR NETWRK PROGRAMNG; Subject: Computer Science & Engineering; University: University of South Carolina - Columbia; Term: Fall 2008;
Typology: Study notes
1 / 11
This page cannot be seen from the preview
Don't miss anything!







Wenyuan Xu Department of Computer Science and Engineering University of South Carolina
CSCE515 – Computer Network Programming
What is WWW?
an architecture framework for accessing linked document spread over millions of machines 1989-1990 – Tim Berners-Lee invents the World Wide Web at CERN
CERN: European center for nuclear research.
Means for distributing high-energy physics data
Means for transferring text and graphics simultaneously
Client/Server data transfer protocol Communication via application level protocol System ran on top of standard networking infrastructure
Established a common language for sharing information on computers Text mark up language Simple and easy to use
Requires a client application to render text/graphics
CSCE515 – Computer Network Programming
1994 – Mark Andreesen invents MOSAIC at National Center for Super Computing Applications (NCSA)
First graphical browser
Internet’s first “killer app”
Freely distributed
Became Netscape Inc.
1995 (approx.) – Web traffic becomes dominant
Exponential growth
E-commerce
Web infrastructure companies
World Wide Web Consortium
CSCE515 – Computer Network Programming
URL
Hypertext link/ Hyperlink
Gets the IP address of the server (via DNS)
Makes a TCP connection to port 80 on the server
Sends an HTTP request to the web server
Receives the required files from the web server
Releases the TCP connection.
Renders the page onto the screen as specified by its HTML or other web languages
Clients/browsers – to dominant implementations
Servers – run on sophisticated hardware
Caches – many interesting implementations
Internet – the global infrastructure which facilitates data transfer
Hyper Text Transfer Protocol (HTTP)
Hyper Text Markup Language (HTML) eXtensible Markup Language (XML)
Uniform Resource Identifiers (URIs)
URI: Uniform Resource Identifiers
http://www.cse.sc.edu:80/foo/blah
ftp://ftp.is.co.za/rfc/rfc1808.txt
mailto:[email protected]
/foo/blah No server mentioned
CSCE515 – Computer Network Programming
CSCE515 – Computer Network Programming
urn:isbn:0-395-36341-
CSCE515 – Computer Network Programming
The RFC states that the HTTP protocol
client sends a request
server returns a reply.
CSCE515 – Computer Network Programming
TRACE: used to trace HTTP forwarding through proxies, tunnels, etc.
OPTIONS: used to determine the capabilities of the server, or characteristics of a named resource.
CSCE515 – Computer Network Programming
GET, HEAD and POST are supported everywhere.
HTTP 1.1 servers often support PUT, DELETE, OPTIONS & TRACE.
CSCE515 – Computer Network Programming
“ HTTP/1.0 ” or “ HTTP/1.1 ”
HTTP 0.9 did not include a version number in a request line.
If a server gets a request line with no HTTP
version number, it assumes 0.
CSCE515 – Computer Network Programming
After the Request-Line come a number (possibly zero) of HTTP header lines.
Each header line contains an attribute name followed by a “:” followed by a space and the attribute value.
The Name and Value are just text.
Host: www.sc.edu Request Headers provide information to the server about the client
what kind of client
what kind of content will be accepted
who is making the request There can be 0 headers (HTTP 1.0) HTTP 1.1 requires a Host: header
Request-Line Headers.. .
Content...
blank line blank line
just CRLF
Request-Line Headers.. .
Content...
blank line blank line
CSCE515 – Computer Network Programming
Content-length: 267
CSCE515 – Computer Network Programming
GET /~wyxu/index.html HTTP/1. Accept: / Host: www.cse.se.edu User-Agent: Internet Explorer From: [email protected] Referer: http://foo.com/
There is a blank line here!
CSCE515 – Computer Network Programming
POST /~POST /~wxy/changegrade.cgiwxy/changegrade.cgi HTTP/1.1HTTP/1. Accept: /Accept: / Host:Host:^ www.cse.sc.eduwww.cse.sc.edu UserUser--Agent:Agent:^ SecretAgentSecretAgent^ V2.3V2. ContentContent--Length: 35Length: 35 RefererReferer:: http://monte.cs.rpi.edu/blahhttp://monte.cs.rpi.edu/blah
stuidstuid=6660182722&item=test1&grade=99=6660182722&item=test1&grade=
CSCE515 – Computer Network Programming
GET used to retrieve an HTML document.
HEAD used to find out if a document has changed.
POST used to submit a form.
ASCII Status Line
Headers Section
Content can be anything (not just text)
typically an HTML document or some kind of
blank lineblank line
HTTP-Version Status-Code Message
Status Code is 3 digit number (for computers)
Message is text (for humans)
CSCE515 – Computer Network Programming
Content type - More
application/pdf: PDF files;
application/msword: word files
audio/mpeg: MP3 or other MPEG audio;
audio/x-wav: WAV audio
image/gif: GIF image;
image/jpeg: JPEG JFIF image;
image/tiff: Tag Image File Format;
video/mpeg: MPEG-1 video with multiplexed audio; CSCE515 – Computer Network Programming
text/html: display directly MIME type is not one of the build-in ones:
consults its table of MIME types
table associate a MIME type with a viewer
To interpret a rapidly growing collection of file types:
Plug-in
helper application
CSCE515 – Computer Network Programming
A code module that the browser fetches
from a special directory on the disk and installs as an extension to itself.
Client machine Browser
Base code plug in
Browser runs as a single process
interface CSCE515 – Computer Network Programming
A complete program, running as a separate process.
Client machine Browser
Process
Browser helper
Process
application/pdf: PDF files;
Æ Acrobat is automatically started
application/msword: word files
Æ Microsoft word
The client sends a complete request. The server sends back the entire reply. The server closes it’s socket.
If the client needs another document it must open a new connection.
This was the default for HTTP 1.
CSCE515 – Computer Network Programming
CSCE515 – Computer Network Programming
wget www.google.com Using wireshark capture the file
Homework,
Using browser to open www.google.com,
HTML
Hyper-Text
Markup Language
CSCE515 – Computer Network Programming
If not: check the home page for some links.
,
start/end a table
, start/end a table row
, start/end a table cell
, start/end table header cell
**
| hour | number of hits |
|---|---|
| 12-1AM | 4,320 |
| 1-2AM | 18,986 |
hour number of hits 12-1AM 4, 1-2AM 18, 2-3AM 246
CSCE515 – Computer Network Programming
CSCE515 – Computer Network Programming
CSCE515 – Computer Network Programming
Server
TCP
3-wayhandshake complete
accept
arrivingSYN
Completed connection queue
Incomplete connection queue
Sum of both queuescannot exceed backlog
CSCE515 – Computer Network Programming
calling accept() is a library call, not an atomic
CSCE515 – Computer Network Programming
expected number of simultaneous clients.
Transaction size (time to compute or lookup
Variability in transaction size.
Available system resources (perhaps what
CSCE515 – Computer Network Programming
Reading:
UNP 30
RFC 2396: http://www.ietf.org/rfc/rfc2396.txt
HTTP 1.
Next Lecture:
Advanced socket programming