You are on page 1of 15

TCSS460 Client/Server Architecture Web Server

AGENDA Client-Server Computing Web Server HTTP Protocol IP Address Port Number Domain Name System URL
1

References
The following materials are used to make this presentation.
Dr. Sam Chungs own thoughts. Dr. M. L. Lius lecture material in TCSS 558. Dr. Steve Hankss lecture material in the previous TCSS 460

Client / Server Computing


Client process Client process Client process

Client process

Over a network Using a protocol

Server process

Issues in Client-Server Computing


What distinguishes the client from the server? What advantages? What disadvantages? What technical challenges? What alternatives?

Client-Server Computing for Internet Applications


Request Reply Web Browser NOS Client HTTP, TCP, IP .html .html Web Server NOS Server
5

Web Server
Specialized software that responds to client requests by providing resources
When users enter URL into Web browsers, they request specific documents from Web server It maps URL to a file(s) on server and returns the requested document to client. It communicates with client using HTTP, which is a protocol for transferring requests and files over the Internet.

Examples of Web Server


Internet Information Services (IIS) 6.0
A commercial product from Microsoft on Windows Server 2003. http://www.microsoft.com/WindowsServer2003/iis/ default.mspx

Apache HTTP Server


An open source product from Apache Software Foundation http://httpd.apache.org/

Which Web Server?


Market Share for Top Servers Across All Domains August 1995 - April 2004

The April 2004 Netcraft Web Server Survey


70% of the web sites on the Internet are using Apache (http://news.netcraft.com/archives/web_server_survey.html)
8

Which Web Server?


Developer Apache Microsoft SunONE Zeus March Percent 2004 32280582 67.20 10099760 1651575 762716 21.02 3.44 1.59 April Percent Change 2004 33329879 66.99 -0.21 10691683 1661229 763302 21.49 3.34 1.53 0.47 -0.10 -0.06

HTTP Protocol
A protocol to transfer documents written in the HTML language
It serves a document based on a request involving a URL (GET) It serves information (only) about a document (HEAD) It receives information to process in a serverspecific way (based on the URI) (POST) It returns status information about the request 2xx => success, 3xx => redirected, 4xx => client error, 5xx => server error It supports caching, user authentication, redirection, etc.
10

Typical HTTP Configuration


WebBrowser Browser Web (Client process) (Client process)
Textual/ /Graphical Graphicaldisplay displayof ofHTML HTML Textual Client-sidecaching caching Client-side Usercustomization customization User

Sending HTTP (and other) requests Parsing HTTP response

Using the TCP/IP protocol Listening at port 80 Returning (HTTP) documents and meta-information

Web WebServer Server (Server (ServerProcess) Process)


Server-side Server-sidecaching caching Process Processinitiation initiation/ /control control
11

Security Security/ /authentication authentication

Accessing Web Servers


Through local Web servers or remote web servers Through domain name or Internet Protocol (IP) address
Why domain name? Do you know the domain name of the computer on which Web server resides? repos.insttech.washington.edu

12

Local or Remote Web Servers


Local web server
Resides on users machines Machine name, localhost, or 127.0.0.1

Remote web server


Resides on different machines Domain name or IP address

13

The Internet Topology

an Internet host subnets The Internet backbone The Internet Topology Model

14

The Internet Topology


The internet consists of an hierarchy of networks, interconnected via a network backbone. Each network has a unique network address. Computers, or hosts, are connected to a network. Each host has a unique ID within its network. Each process running on a host is associated with zero or more ports. A port is a logical entity for data transmission.
15

IP Address - IPv4
Unique address for locating computers on Internet In IP version 4, each address is 32 bit long. The address space accommodates 232 (4.3 billion) addresses in total. Addresses are divided into 5 classes (A through E)
byte 0 byte 1 byte 2 byte 3

class A address 0 class B address 1 0 class C address 1 1 0 multcast address 1 1 1 0 reserved address 1 1 1 1 0 multicast group
reserved reserved

network address host portion

16

More IP Addresses
Subdividing the host portion of an Internet address:
byte 0 byte 1 network address byte 2 byte 3 host portion

class B address

10

A class A/C address space can also be similarly subdivided.. Which portion of the host address is used for the subnet identification is determined by a subnet mask.

subnet address local host address

17

Dotted Decimal IP Address


For human readability, Internet addresses are written in a dotted decimal notation:
nnn.nnn.nnn.nnn, where each nnn group is a decimal value in the range of 0 through 255. 127.0.0.1 128.208.246.1

18

Domain Name System


For network applications, a domain name must be mapped to its corresponding Internet address. Processes known as domain name system servers provide the mapping service, based on a distributed database of the mapping scheme. The mapping service is offered by thousands of DNS servers on the Internet, each responsible for a portion of the name space, called a zone. The servers that have access to the DNS information (zone file) for a zone is said to have authority for that zone.

19

Domain Name System (DNS)


For user friendliness, each Internet address is mapped to a symbolic name, using the DNS, in the format of:
<computer-name>.<subdomain hierarchy>.<organization>.<sector name>{.<country code>} e.g., repos.insttech.washington.edu

20

Domain Name System (DNS)

root

top-level domain com edu gov net in the U.S. org mil
country code

organization

Top-level domain name has to be applied for. Subdomain hierachy and names are assigned by the organization.

... ...
subdomain

host name

21

Domain Name Hierarchy


. (root domain)

.au ... .ca ... .us ... .zw country code

.com

.gov

.edu

.mil

.net

.org

ucsb.edu ...

calpoly.edu

...

cs ...

ece ...

csc ...

ee english ... wireless

22

Name Lookup and Resolution


If a domain name is used to address a host, its corresponding IP address must be obtained for the lower-layer network software. The mapping, or name resolution, must be maintained in some registry. For runtime name resolution, a network service called DNS lookup is needed to translate a fully qualified host name(s) to a corresponding IP address.
23

Logical Ports
host A host B

...

process

...

port

Each host has 65536 ports. The Internet

24

Well Known Ports


Each Internet host has 216 (65,535) logical ports. Each port is identified by a number between 1 and 65535, and can be allocated to a particular process. Port numbers between 1 and 1023 are reserved for processes which provide wellknown services.

25

Well-known ports
Assignment of some well-known ports
Protocol echo daytime ftp telnet smtp time finger http RMI Registry special web server Port 7 13 21 23 25 37 79 80 1099 8080 Service IPC testing provides the current date and time file transfer protocol
remote, command-line terminal session

simple mail transfer protocol provides a standard time provides information about a user web server
registry for Remote Method Invocation

web server which supports servlets, JSP, or ASP

26

Choosing a port to run your program


For our programming exercises: when a port is needed, choose a random number above the well known ports: 1,024- 65,535. If you are providing a network service for the community, then arrange to have a port assigned to and reserved for your service.

27

The Uniform Resource Identifier (URI)


Resources to be shared on a network need to be uniquely identifiable. On the Internet, a URI is a character string which allows a resource to be located. There are two types of URIs:
URL (Uniform Resource Locator) It points to a specific resource at a specific location Location transparency - No URN (Uniform Resource Name) It points to a specific resource at a nonspecific location. Location transparency - Yes
28

URL
A URL has the format of:
protocol://host address[:port]/directory path/file name#section
A sampl e URL:

http://www.csc.calpoly.edu:8080/~mliu/CSC369/hw.html # hw1
section name file name host name protocol of server directory path port number of server process

Other protocols that can appear in a URL are: file ftp gopher news telnet WAIS

29

Relative Path
The path in a URL is relative to the document root of the server.
http://repos.insttech.washington.edu/~chungsa/i ndex.htm

A URL may appear in a document in a relative form: < a href=another.html> and the actual URL referred to will be another.html preceded by the protocol, hostname, directory path of the document .
30

You might also like