About HTTP Protocol
About HTTP Protocol
Protocol (HTTP)
By
Mohan Kumar Noothalapati
Agenda
• About HTTP
• HTTP 1.1 vs. HTTP 1.0
• HTTP URLs
• HTTP methods
• WebDAV
• Request/Response formats
• Request/Response headers
• HTTP Status Codes
• HTTP Cookie
• HTTP Caching
• DNS
Hypertext Transfer Protocol
HTTP persistent connection (also known as HTTP keep-alive or HTTP connection reuse) is the idea
of using a single TCP connection to send and receive multiple HTTP requests/responses, as opposed to
opening a new connection for every single request/response pair.
URI,URN,URL
• Web Distributed Authoring and Versioning (WebDAV) is an extension of the Hypertext Transfer Protocol
(HTTP) that facilitates collaboration between users in editing and managing documents and files stored on
World Wide Web servers.
• PROPFIND — used to retrieve properties, stored as XML, from a web resource.
• PROPPATCH — used to change and delete multiple properties on a resource in a single atomic act
• MKCOL — used to create collections
• COPY — used to copy a resource from one URI to another
• MOVE — used to move a resource from one URI to another
• LOCK — used to put a lock on a resource. WebDAV supports both shared and exclusive locks.
• UNLOCK — used to remove a lock from a resource
• Status Codes such as 102 Processing, 207 Multi-Status, 424 Method Failure etc.,
Request & Response Formats
• Request Format
Request-Line = Method SP Request-URI SP HTTP-Version CRLF
*(( general-header
| request-header) CRLF)
CRLF
[ message-body ]
• Response Format
Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF
*(( general-header | response-header ) CRLF)
CRLF
[ message-body ]
HTTP Headers
• HTTP header fields are components of the message header of requests and responses in the
HTTP.
• The header fields are transmitted after the request or response line, the first line of a message.
Header fields are colon-separated name-value pairs in clear-text string format, terminated by a
carriage return (CR) and line feed (LF) character sequence. The end of the header fields is
indicated by an empty field, resulting in the transmission of two consecutive CR-LF pairs. Long
lines can be folded into multiple lines; continuation lines are indicated by the presence of a
space (SP) or horizontal tab (HT) as the first character on the next line.
GET /dumprequest HTTP/1.1
Host: djce.org.uk
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:21.0) Gecko/20100101 Firefox/21.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Referer: http://search.conduit.com/Results.aspx
Connection: keep-alive
HTTP Request Packets
• and a URL
HTTP Request Headers
• For Server’s benefit, client lists URL od document (or document type) from
which the URL in request was obtained.
• Allows server to generate back-links, logging, tracing of bad links…
• Ex.
• Referer: http:/www.w3.com/xxx.html
Pragma:
• A cookie contains no more than 255 characters and cannot take up more than 4K of Disk
Space, which consists of six parameters
• Name of the cookie
• Value of the cookie
• The expiry of the cookie (using Greenwich Mean Time)
• The path the cookie is good for
• The domain the cookie is good for
• The need for a secure connection to use the cookie
• Only the first two parameters are required for the successful operation of the cookie.
Setting a Cookie & Its attributes
• Browser to Server GET /index.html HTTP/1.1
Host: www.example.org
HTTP/1.1 200 OK
second-level node second-level node second-level node second-level node second-level node
dakota tornado
The Resolution Process
annie.west.sprockets.com
ping www.nominum.com.
The Resolution Process
• The workstation annie asks its configured name
server, dakota, for www.nominum.com’s address
dakota.west.sprockets.com
annie.west.sprockets.com
ping www.nominum.com.
The Resolution Process
• The name server dakota asks a root name server, m, for
www.nominum.com’s address
m.root-servers.net
dakota.west.sprockets.com
annie.west.sprockets.com
ping www.nominum.com.
The Resolution Process
• The root server m refers dakota to the com name servers
• This type of response is called a “referral”
m.root-servers.net
dakota.west.sprockets.com Here’s a list of the
com name servers.
Ask one of them.
annie.west.sprockets.com
ping www.nominum.com.
The Resolution Process
• The name server dakota asks a com name server,
f, for www.nominum.com’s address
m.root-servers.net
dakota.west.sprockets.com
f.gtld-servers.net
annie.west.sprockets.com
ping www.nominum.com.
The Resolution Process
• The com name server f refers dakota to the
nominum.com name servers
f.gtld-servers.net
annie.west.sprockets.com
ping www.nominum.com.
The Resolution Process
• The name server dakota asks an nominum.com name
server, ns1.sanjose, for www.nominum.com’s address
m.root-servers.net
dakota.west.sprockets.com
ns1.sanjose.nominum.net
f.gtld-servers.net
annie.west.sprockets.com
ping www.nominum.com.
The Resolution Process
• The nominum.com name server ns1.sanjose
responds with www.nominum.com’s address
m.root-servers.net
dakota.west.sprockets.com
annie.west.sprockets.com
ping www.nominum.com.
The Resolution Process
• The name server dakota responds to annie with
www.nominum.com’s address
Here’s the IP
address for
www.nominum.com
m.root-servers.net
dakota.west.sprockets.com
ns1.sanjose.nominum.net
f.gtld-servers.net
annie.west.sprockets.com
ping www.nominum.com.
The Current TLDs
"."
ORG DZ EDU
Other Organizations Algeria Educational Institutions
...
YU
Yugoslavia
ZM
Zambia
ZW
Zimbabwe
Registries, Registrars, and Registrants
Registry updates Master
zone updated
Registry Zone DB
Slaves
Registrar submits
updated
add/modify/delete
to registry
Registrants