Unit 1
Unit 1
Unit 1
Unit I – Fundamentals
Robert W Sebesta
Edition: Seventh
Outline
2
1.1 A Brief Introduction to the Internet
1.1.1 Origins
–Advanced Research Projects Agency Network (ARPANET) - late 1960s
and early 1970s
• Text based communication through mail,
• For ARPA-funded research organizations
• BITnet(because its time network, university in new York), Csnet( computer
science network - late 1970s & early 1980s
• email and file transfer for other institutions
–National Science Foundation internet (NSFnet) - 1986
• Originally for non-DOD (Department of Defense) funded places
• Initially connected five supercomputer centers
• By 1990, it had replaced ARPAnet for non-military uses
• Soon became the network for all (by the early 1990s)
• At the lowest level, since 1982, all connections use TCP(transmission control
protocol)/IP(internet protocol).
• Normally the individual computers in an organization are connected to each other in
local network. One node on this local network is physically connected to the internet.
4
1.1 A Brief Introduction to the Internet
1.1.3 Internet Protocol (IP) Addresses
- Internet nodes are identified by names, for computers they are identified by
numeric address.
• In late 1998, a new IP standard IPv6, was approved, although it is still is not
widely used. The most significant change was to expand the address size from 32
bits to 128 bits.
5
1.1 A Brief Introduction to the Internet
6
• In United states, edu education, orgorganization, gov
governmemt, comcompany.
• In Sweden the largest domain is the abbreviation of country, i.e se.
• Fully qualified domain name - the host name and all of the domain
names
• DNS (Domain Name System) servers - convert fully qualified domain
names to IP’s
• Movies.marxbros.comedy.com movies host name, marxbros
movies local domain, which is part of comedy domain ,which in turn
part of com
7
1.1 A Brief Introduction to the Internet
• 1.1.4 Domain Names (cont’d)
8
• The conversion of fully qualified domain name to IP address using a
software systems called name servers before sending the message to
destination thru internet.
• All documents requests from browsers are routed to the nearest name
server.
9
1.1 A Brief Introduction to the Internet
BROWSER
SERVER
3. The
browser
displays the
file
hello.html 172.17.28.45
Client and Server - Static HTML pages
10
• Along with TCP/IP other protocols used for various uses of internet.
• By the mid-1980s, several different protocols had been invented and
were being used on the Internet, all with different user interfaces
(Telnet, FTP, Usenet, mailto).
• telnet is used to log on to another computer von the internet.
• FTP file transfer
• Usenet serve as electronic bulletin board.
• mailto send messages from one computer on the internet to other
computers
11
1.2 The World-Wide Web
1.2.1 Origins
– Tim Berners-Lee at CERN (The European Organization for
Nuclear Research) proposed the Web in 1989
• Purpose: to allow scientists to have access to many databases of
scientific work through their own computers
• http://www.w3.org/History/1989/proposal.html
– Document form: hypertext
– Pages? Documents? Resources?
• We’ll call them documents
– Hypermedia – more than just text – images, sound, etc.
12
1.2 The World-Wide Web
13
1.3 Web Browsers
14
Mosaic Beta version 0.4, Sep 9 1994
15
1.4 Web Servers
16
1.4 Web Servers (cont’d)
17
1.4 Web Servers (cont’d)
1.4.2 General Server Characteristics
• Web servers have two main directories:
1.Document root (servable documents)
2.Server root (server system software)
• Document root is accessed indirectly by clients
– Its actual location is set by the server configuration file
– Requests are mapped to the actual location
• Virtual document trees
• Virtual hosts C:\xampp\apache\
• Proxy servers conf\httpd.conf
• Web servers now support other Internet protocols ftp, gopher,
news,mailto
18
1.4 Web Servers (cont’d)
1.4.3 Apache
• Apache (open source, fast, reliable)
– Directives (operation control):
ServerName
ServerRoot
ServerAdmin,
DocumentRoot
Alias
Redirect
DirectoryIndex
UserDir
http://httpd.apache.org/
19
1.4 Web Servers (cont’d)
1.4.4 IIS
• Internet Information Server
- Operation is maintained through a program with a GUI
interface
20
1.5 Uniform Resource Locators (URLs)
21
1.5 Uniform Resource Locators
22
1.5 Uniform Resource Locators
23
1.6 Multipurpose Internet Mail Extensions
(MIME)
• Originally developed for e-mail
• Used to specify to the browser the form of a file
returned by the server (attached by the server to the
beginning of the document)
24
1.6 Multipurpose Internet Mail Extensions
(MIME)
1.6.1 Type specifications
– Form:
type/subtype
– Examples: text/plain, text/html, image/gif, image/jpeg
• Server gets type from the requested file name’s suffix (.html implies
text/html)
25
1.6 Multipurpose Internet Mail Extensions
(MIME)
• 1.6.2 Experimental Document Types
• Subtype begins with x-
• e.g., video/x-msvideo
• Experimental types require the server to send a helper
application or plug-in so the browser can deal with the
file
26
1.7 The Hypertext Transfer Protocol (HTTP)
27
1.7 HTTP (cont’d)
28
1.7.1 The Request Phase
• Request Phase
• General Form:
1.HTTP method domain part of URL HTTP version
2.Header fields
3.Blank line
4.Message body
• An example of the first line of a request:
GET /degrees.html HTTP/1.1
29
1.7.1 The Request Phase
• Few request methods are defined by HTTP.
• Get and post methods are frequently used.
30
• Following the first line of an HTTP communication is any number of header
fields, most of which are optional.
• The format of a header field is the field name followed by a colon and a HTTP
Headers
32
1.7.1 The Request Phase
• Can communicate with server without a browser
telnet blanca.uccs.edu http
This command creates a connection to the http port on the
blanca.uccs.edu server
The connection to the server is now complete, and HTTP commands
are given
GET /respond.html HTTP/1.1
Host: blanca.uccs.edu
33
1.7.2 The Response Phase
• General Form:
• Status line
• Response header fields
• blank line
• Response body
• Status line format: includes the HTTP version used, a three-digit
status code and a short textual explanation of the status code.
• HTTP version status code explanation
• e.g. HTTP/1.1 200 OK
(Current version is 1.1)
34
1.7.2 The Response Phase (cont’d)
• Status code is a three-digit number; first digit specifies the general status
1 => Informational
2 => Success
3 => Redirection
4 => Client error
5 => Server error
• After the status line, the server spends a response header, which can
contain several lines of information about the response, each in the form
of a field. The only essential field of the header is Content-type.
35
1.7.2 The Response Phase (cont’d)
200 : OK
201 : Created
202 : Accepted
204 : No Content
301 : Moved Permanently
302 : Moved Temporarily
400 : Bad Request
401 : Unauthorized
403 : Forbidden
404 : Not Found
500 : Internal Server Error
503 : Service Unavailable
504: Gateway Timeout
505: HTTP Version Not Supported
36
1.7.2 The Response Phase (cont’d)
HTTP/1.1 200 OK
Date: Tues, 18 May 2004 16:45:13 GMT
Server: Apache (Red-Hat/Linux)
Last-modified: Tues, 18 May 2004 16:38:38 GMT
Etag: "841fb-4b-3d1a0179"
Accept-ranges: bytes
Content-length: 364
Connection: close
Content-type: text/html, charset=ISO-8859-1
• Both request headers and response headers must be followed by a blank line
37
Unit – 1 Continued
Chapter 2
38
2.1 Origins and Evolution of HTML and XHTML (extensible
hypertext markup language)
1. paragraphs
•Text is normally placed in paragraph elements
•Paragraph Elements
• The <p> tag breaks the current line and inserts a blank line - the new line gets the beginning of the
content of the paragraph
• The browser puts as many words of the paragraph’s content as will fit in each line
<!DOCTYPE html>
<!-- greet.hmtl
A trivial document
-->
<html lang =“en″>
<head> <title> Our first document </title>
<meta charset =“ utf-8”/>
</head>
<body>
<p>
Greetings from your Webmaster!
</p>
</body>
</html>
2.4 Basic Text Markup (continued)
2.Line breaks
• The effect of the <br /> tag is the same as that of <p>, except for the blank line
• No closing tag! / indicates both beginning and closing
• 1, 2, and 3 use font sizes that are larger than the default font size
• Heading tags always break current line so there content always appear on
new line, browser usually insert some vertical spaces before and after all
headings.
<!DOCTYPE html>
<html lang =“en″>
<head> <title> Our first document </title>
<meta charset =“ utf-8”/>
</head>
<body>
<h1> Aidan’s Airplanes (h1) </h1>
<h2> The best in used airplanes (h2) </h2>
<h3> "We’ve got them by the hangarful" (h3) </h3>
<h4> We’re the guys to see for a good used airplane (h4) </h4>
<h5> We offer great prices on great planes (h5) </h5>
<h6> No returns, no guarantees, no refunds,
all sales are final (h6) </h6>
</body>
</html>
2.4 Basic Text Markup (continued)
5.Blockquotations
• Content of <blockquote>
• To set a block of text off from the normal flow in a document
• Browsers often indent, and sometimes italicize
6.Font Styles and Sizes (can be nested)
• Boldface - <b>
• Italics - <i>
2.4 Basic Text Markup (continued)
There are few tags called content based tags. These tags are not affected by
<blockquote>
•Emphasis tag, <em>,-specifies the content is special.(specifies it in italic
•Strong tag <strong> species the strong element bold
• <code> tag is used to specify the monospace font usually used for program code.
•The meta element Used to provide additional information about a document, with attributes,
not content.
•The 2 attributes that are used are name & conent. commonly used name attribute is
keywords <meta name =“keywords” content=“binary trees, lists, stacks ” />