Você está na página 1de 27

1/7/11

HTTP (HTML)
IT Workshop 2011 Sudhir Gupta

The Ever-changing Internet

Different colors based on IP address http://research.lumeta.com/ches/map

1/7/11

What is the Internet?


WWW Video conferencing ftp telnet Email Instant messaging

A communication infrastructure Usefulness is in exchanging information

History of the Internet


Tim Berners-Lee at CERN in 1989
Proposal for WWW in 1990 First web page on November 13, 1990

Hypertext - Text that contains links to other text.


Ted Nelsons Xanadu Vannevar Bushs Memex
(http://www.theatlantic.com/unbound/flashbks/computer/bushf.htm)

W3C
Get more info at: http://www.isoc.org/internet/history/

1/7/11

Divide Work into Layers

01010

0 1 0 1 0

01010

make network simple and reliable a connect segments, address (locating points on graph) and route (navigating graph) 01010 01010

physically encode bits on wire

Protocol Stack

Were here.

1/7/11

Servers
Hardware server
Computer on Internet, always running

Software server
Program running on server Listening on port
Receives requests, processes them, makes outgoing calls

Daemon examples: sshd, lpd, inetd, httpd

Applications
Traditional PC applications
Everything done locally Fast but sharing difficult Word, Excel

Client/server applications
Client local and responsive Client provides interface Server centralizes resources Server performs some work

1/7/11

Domain Name Service


TCP/IP uses IP Addresses (171.64.123.12) DNS allows us to use URLs to refer to IP addresses (e.g. www.yahoo.com) Its just a service built on top of TCP/IP!!!

HTTP and HTML


Hypertext Transfer Protocol (HTTP) Tim Berners-Lee, 1991 Hypertext Markup Language
For creating web pages

1/7/11

Client and Server


User uses HTTP client (Web Browser) It has a URL (e.g. http://www.yahoo.com/) Makes a request to the server Server sends back data (the response) User clicks on the client side...
request (URL)

Client

response (HTML, )

Server

HTTP Client (Browser)


NCSA Mosaic (M. Andreesen) Netscape Navigator (M. Andreesen) Microsoft Internet Explorer Browser Wars of the 1990's Mozilla (Netscape Open Sourced) Now Mozilla Firefox Apple Safari (from Konqueror) Others (Opera, Lynx)

1/7/11

Universal Resource Location (URL)


http://www.bvb.edu:80/class/itws/schedule.html

Protocol (Scheme)

Universal Resource Location (URL)


http://www.bvb.edu:80/class/itws/schedule.html

Host Name

1/7/11

Universal Resource Location (URL)


http://www.bvb.edu:80/class/itws/schedule.html

Port

Universal Resource Location (URL)


http://www.bvb.edu:80/class/itws/schedule.html

Path

1/7/11

Request
Just a string of ASCII text GET /food/index.html HTTP/1.0\r\n\r\n

HTTP Server
Listens on port 80 (usually) Handles HTTP requests Sends back responses Document root is a directory in the file system Server maps path to file system file

1/7/11

URL Path = File System Path


URL Path / maps to Document Root Lets say Document Root is C:\htdocs\
/ => C:\htdocs\ /images/ => C:\htdocs\images\ /a/X.html => C:\htdocs\a\X.html

Response Example
HTTP/1.1 200 OK Date: Fri, 16 Apr 2004 18:48:13 GMT Server: Apache/1.3.29 (Darwin) Last-Modified: Fri, 16 Apr 2004 10:15:59 GMT ETag: "58db37-89-407fb25f" Accept-Ranges: bytes Content-Length: 137 Connection: close Content-Type: text/html <html> <body> <p>Welcome</p> <img src=smiley.gif"> </body> </html>

HTTP Header

Blank line

Data

10

1/7/11

Example Request / Response


Client requests
http://courses.lnmiit.edu/food/index.html

Client sends
GET /food/index.html HTTP/1.0\r\n\r\n

Server sees request with path /food/index.html Server maps onto Document Root
G:/webroot + /food/index.html

Server sends back file over HTTP (e.g. HTML file)

HTML Characteristics
Just a Text File!
+ Portable + Human Readable/Writable

Defines the Structure (not Appearance) of the Document


Client (Browser) defines the appearance + Portable + Pours into Browser (PDAs, Bigger/Smaller)

11

1/7/11

Document Structure
<html> <head><title>My First Web Page</title> </head> <body bgcolor="white"> <p>A Paragraph of Text.</p> </body> </html>

Nested Tags
Like a tree, each element is contained inside a parent element Each element may have any number of attributes
<html>...</html>

<head>...</head> <title>...</title> other stuff

<body>...</body> bgcolor="white" <p>...</p> <br> <table>...</table>

This is some text!

12

1/7/11

13

1/7/11

14

1/7/11

15

1/7/11

16

1/7/11

17

1/7/11

18

1/7/11

19

1/7/11

20

1/7/11

21

1/7/11

22

1/7/11

23

1/7/11

24

1/7/11

25

1/7/11

26

1/7/11

27

Você também pode gostar