You are on page 1of 59

m  

 m 

   
  
Client, Server & Communication
Internet - Basic
Protocols Ȃ TCP/IP,HTTP,FTP,SMTP,POP,IMAP
World wide web
HTTP request message format
HTTP response message format
Web Server
Web client
HTML Ȃ History, Versions, Elements, URL, List, Tables,
Frames, Forms
Client/Server Technology

Client/Server technology involves the client and


server, both having processing capabilities.

The client request for a service and the server


processes this request and sends a reply.
Standalone (Single User)
Host Centric (Multi User)
Client/Server
Network Operating System
Types of services provided by different servers
File Servers
Groupware Servers
Ȃ Mail Servers
Ȃ Newsgroup Servers
Ȃ Calendar Servers
Ȃ Workflow Servers
Database Servers
Transaction Servers

Web Technology is based on Client Server Model


R  
G The Internet is a communication system that allows
computers around the world to communicate and to
exchange of the data with each other.

G This also allows to access their resources, such as


files, services, or other people.
History of Internet :
G 1964: ARPANET project
G 1969: The ARPANET is put in operation with the use of a
protocol for communications called NCP
G 1973: The scientists take their revenge by developing their own
network through universities and by using an improved protocol
of communication named TCP / IP (Transfer Control Protocol
Protocol/Internet Protocol). The protocol IP makes sure that
every computer connected with the network has an unique
address and that each is capable of communicating with the
others. This protocol is used on several platforms to allow a
communication from these.
G 1989: Tim Berners-Lee creates the bases of what will become
World Wide Web.
G 1995: It's this year when the term "Internet" entered the
vocabulary of most people
—
Protocol is a description of the rules computers must
follow to communicate with each other.

TCP/IP is the communication protocol for the


Internet.
TCP/IP is TCP and IP working together.
TCP takes care of the communication between your
application software (i.e. your browser) and your
network software.
IP takes care of the communication with other
computers.
TCP is responsible for breaking data down into IP
packets before they are sent, and for assembling the
packets when they arrive.
IP is responsible for sending the packets to the correct
destination.
TCP/IP uses 32 bits, or four numbers between 0 and
255, to address a computer.
R Addresses
Each computer must have an IP address before it can
connect to the Internet.
Each IP packet must have an address before it can be
sent to another computer.
omain Names
A name is much easier to remember than a 12 digit number.
Names used for TCP/IP addresses are called domain names.
alpha.com is a domain name.
When you address a web site, like http://www.alpha.com, the
name is translated to a number by a Domain Name Server
(DNS).
All over the world, DNS servers are connected to the Internet.
DNS servers are responsible for translating domain names into
TCP/IP addresses.
When a new domain name is registered together with a TCP/IP
address, DNS servers all over the world are updated with this
information.
OTT - Oyper Text Transfer rotocol
HTTP takes care of the communication between a web
server and a web browser.
HTTP is used for sending requests from a web client (a
browser) to a web server, returning web content (web
pages) from the server back to the client.
OTT S - Secure OTT
HTTPS takes care of secure communication between a
web server and a web browser.
HTTPS typically handles credit card transactions and
other sensitive data.
SMT - Simple Mail Transfer rotocol
SMTP is used for transmission of e-mails.
MRME - Multi-purpose Rnternet Mail Extensions
The MIME protocol lets SMTP transmit multimedia
files including voice, audio, and binary data across
TCP/IP networks.
RMA - Rnternet Message Access rotocol
IMAP is used for storing and retrieving e-mails.
 - ost ffice rotocol
POP is used for downloading e-mails from an e-mail
server to a personal computer.
jT - jile Transfer rotocol
FTP takes care of transmission of files between
computers.
OC - ynamic Oost Configuration rotocol
DHCP is used for allocation of dynamic IP addresses to
computers in a network.
AR - Address Resolution rotocol
ARP is used by IP to find the hardware address of a
computer network card based on the IP address.
RAR - Reverse Address Resolution rotocol
RARP is used by IP to find the IP address based on the
hardware address of a computer network card.
O—
HTTP stands for Oypertext Transfer rotocol. It is
an TCP/IP based communication protocol which is
used to deliver virtually all files and other data,
collectively called resources, on the World Wide Web.
These resources could be HTML files, image files,
query results, or anything else.
A browser is works as an HTTP client because it sends
requests to an HTTP server which is called Web server.
The Web Server then sends responses back to the
client. The standard and default port for HTTP servers
to listen on is 80 but it can be changed to any other
port like 8080 etc.
The format of the request and response messages are
similar and will have following structure:

An initial line CRLF


Zero or more header lines CRLF
A blank line ie. a CRLF
An optional message body like file, query data or query
output.
Rnitial Line : Request
The initial line is different for the request than for the response.
A request line has three parts, separated by spaces:
An HTTP Method Name
The local path of the requested resource.
The version of HTTP being used.
Here is an example of initial line for Request Message.
GET /path/to/file/index.html HTTP/1.0
ET is the most common HTTP method. Other methods could
be POST, HEAD etc.
The path is the part of the URL after the host name. This path is
also called the request Uniform Resource Identifier (URI). A URI
is like a URL, but more general.
The HTTP version always takes the form [OTT /x.x[, uppercase.
Rnitial Line : Response
The initial response line, called the status line, also has
three parts separated by spaces:
The version of HTTP being used.
A response status code that gives the result of the
request.
An English reason phrase describing the status code.
Here is an example of initial line for Response
Message.
HTTP/1.0 200 OK or HTTP/1.0 404 Not Found
Oeader Lines
Header lines provide information about the request or response,
or about the object sent in the message body.
The header lines are in the usual text header format, which is:
one line per header, of the form "Header-Name: value", ending
with CRLF. It's the same format used for email and news
postings, defined in RFC 822.
A header line should end in CRLF, but you should handle LF
correctly.
The header name is not case-sensitive.
Any number of spaces or tabs may be between the ":" and the
value.
Header lines beginning with space or tab are actually part of the
previous header line, folded into multiple lines for easy reading.
Here is an example of one header line
User-agent: Mozilla/3.
0r
Gold or Last-Modified: Fri, 31 Dec 1999 23:59:59 GMT
The Message Body
An HTTP message may have a body of data sent after
the header lines. In a response, this is where the
requested resource is returned to the client (the most
common use of the message body), or perhaps
explanatory text if there's an error. In a request, this is
where user-entered data or uploaded files are sent to
the server. If an HTTP message includes a body, there
are usually header lines in the message that describe
the body. In particular:
The Content-Type: header gives the MIME-type of
the data in the body, such as text/html or image/gif.
The Content-Length: header gives the number of
bytes in the body.
The ET Method
The GET method means retrieve whatever information (in the
form of an entity) is identified by the Request-URI. If the
Request-URI refers to a data-producing process, it is the
produced data which shall be returned as the entity in the
response and not the source text of the process, unless that text
happens to be the output of the process.
A conditional GET method requests that the identified resource
be transferred only if it has been modified since the date given by
the If-Modified-Since header. The conditional GET method is
intended to reduce network usage by allowing cached entities to
be refreshed without requiring multiple requests or transferring
unnecessary data.
The GET method can also be used to submit forms. The form
data is URL-encoded and appended to the request URI
The OEA Method
A HEAD request is just like a GET request, except it
asks the server to return the response headers only,
and not the actual resource (i.e. no message body).
This is useful to check characteristics of a resource
without actually downloading it, thus saving
bandwidth. Use HEAD when you don't actually need a
file's contents.
The response to a HEAD request must never contain a
message body, just the status line and headers.
The ST Method
A POST request is used to send data to the server to be processed
in some way, like by a CGI script. A POST request is different
from a GET request in the following ways:
There's a block of data sent with the request, in the message
body. There are usually extra headers to describe this message
body, like Content-Type: and Content-Length:
The request URI is not a resource to retrieve; it's usually a
program to handle the data you're sending.
The HTTP response is normally program output, not a static file.
The most common use of POST, by far, is to submit HTML form
data to CGI scripts. In this case, the Content-Type: header is
usually application/x-www-form-urlencoded, and the
Content-Length: header gives the length of the URL-encoded
form data. The CGI script receives the message body through
STDIN, and decodes it. Here's a typical form submission, using
POST:
Header Fields
Allow
Authorization
Content-Encoding
Content-Length
Content-Type
Date
Expires
From
If-Modified-Since
Last-Modified
Location
Pragma
Referer
Server
User-Agent
WWW-Authenticate
HTTP Status Code

1xx: Information
2xx: Successful
3xx: Redirection
4xx: Client Error
5xx: Server Error
Http Message Example

To retrieve the file at the URL


http://www.somehost.com/path/file.html
first open a socket to the host www.somehost.com,
port 80 (use the default port of 80 because none is
specified in the URL). Then, send something like the
following through the socket:

GET /path/file.html HTTP/1.0 From:


someuser@alpha.com User-Agent: HTTPTool/1.0
[blank line here]
The server should respond with something like the following, sent
back through the same socket:

HTTP/1.0 200 OK
Date: Fri, 31 Dec 1999 23:59:59 GMT
Content-Type: text/html
Content-Length: 1354
<html>
<body>
<h1>Happy New Millennium!</h1> (more file contents) . . .
</body>
</html> After sending the response, the server closes the socket.
Web Server

A web server can be referred to as either the hardware


(the computer) or the software (the computer
application) that helps to deliver content that can be
accessed through the internet.

Web Client

Actually web browser


Is a machine that request information
O
o HTML stands for Hyper Text Markup Language
o An HTML file is a text file containing small markup
tags
o The markup tags tell the Web browser how to display
the page
o An HTML file must have an htm or html file
extension
o An HTML file can be created using a simple text editor
o The html files are viewed in a web browser.
o Fire fox, Internet Explorer, Netscafe, opera are few well
known web browsers.
o To view the output, correct path of the html file has to
be typed into the address box of the web browser .
o The web browser has to be refreshed to view the
changes made in the html file
O 
o The tags in HTML are enclosed by angle brackets(<,>).
o Html tags normally come in pair s like <b></b>.
o Html tags are not case sensitive ,<b>means the same
as <B>.
o <html> </html> are the starting and ending tags.
o Html files has two major parts,head and body.
o <title> </title>tags are the major tag used with in
<head></head> tags
o <title> tag tells the browser what has to be displayed in
the title bar of the web browser.
Formatting
<i>
This text is italic
</i>

<small>
This text is small
</small>

This text contains


<sub>
subscript
</sub>
<b>This text is bold</b>

<strong>
This text is strong
</strong>

<big>
This text is big
</big>

<em>
This text is emphasized
</em>
<p>The pre tag is good for displaying computer
code:</p>

<pre>
for i = 1 to 10
print i
next i
</pre>
o <BODY> encloses the content that has to be
displayed in the browser.
o <p> tag encloses the paragraph.

Attribute
o Attributes provide additional information to an HTML

element.
o Attributes always come in name/value pairs like this:

name="value".
o Attributes are always specified in the start tag of an

HTML element.
o The following tag defines an HTML table: <table>.
With an added border attribute, you can tell the
browser that the table should have no borders:

<table border="0">

o Attribute values should always be enclosed in quotes.


Double style quotes are the most common, but single
style quotes are also allowed.
o Headings are defined with the <h1> to <h6> tags. <h1>
defines the largest heading. <h6> defines the smallest
heading.
o Paragraphs are defined with the <p> tag.

o HTML automatically adds an extra blank line before

and after a headings and paragraph.


Line Break
o The <br> tag is used when you want to end a line, but

don't want to start a new paragraph. The <br> tag


forces a line break wherever you place it.
o The <br> tag is an empty tag. It has no closing tag.
Comments
o The comment tag is used to insert a comment in the

HTML source code. A comment will be ignored by


the browser. You can use comments to explain your
code, which can help you when you edit the source
code at a later date.
o <!-- This is a comment -->

o Note that you need an exclamation point after the

opening bracket, but not before the closing bracket.


ð
A URL is another word for a web address.
A URL can be composed of words, such as
Dzalpha.com", or an Internet Protocol (IP) address:
192.68.20.50. Most people enter the name of the
website when surfing, because names are easier to
remember than numbers.
ðRL - ðniform Resource Locator
When you click on a link in an HTML page, an
underlying <a> tag points to an address on the world
wide web.
A Uniform Resource Locator (URL) is used to address
a document (or other data) on the world wide web.
A web address, like this:
http://www.alpha.com/html/default.asp follows these
syntax rules:
scheme://host.domain:port/path/filename Explanation:
scheme - defines the type of Internet service. The most common
type is http
host - defines the domain host (the default host for http is www)
domain - defines the Internet domain name, like alpha.com
:port - defines the port number at the host (the default port
number for http is 80)
path - defines a path at the server (If omitted, the document must
be stored at the root directory of the web site
filename - defines the name of a document/resource
Common websites start with http://. Pages starting with http:// are
not encrypted, so all information exchanged between your
computer and the Internet can be "seen" by hackers.
Secure websites start with https://. The "s" stands for "secure".
Here, the information exchanged will be encrypted, making it
useless to hackers.
<html>

<head>
<title>
</title>
</head>

<body>
<p>This is my first paragraph.</p>
</body>

</html>
Html entities
o Some characters like the < character, have a special

meaning in HTML, and therefore cannot be used in


the text.
o To display a less than sign (<) in HTML, we have to use

a character entity.
o A character entity has three parts: an ampersand (&),

an entity name or a # and an entity number, and finally


a semicolon (;).
ù To display a less than sign in an HTML document we
must write: &lt; or &#60;
o Normally HTML will truncate spaces in your text. If
you write 10 spaces in your text HTML will remove 9 of
them.
o To add spaces(non breaking space) to your text, use
the &nbsp; character entity.
Links
o HTML uses a hyperlink to link to another document

on the Web.
o The <a> tag is used to create an anchor to link from,
the href attribute is used to address the document to
link to, and the words between the open and close of
the anchor tag will be displayed as a hyperlink.
o With the target attribute, you can define where the

linked document will be opened.

<a href="http://www.IntelliBitz.com/"
target="_blank">Visit IntelliBitz!</a>
o The name attribute is used to create a named anchor.
o When using named anchors we can create links that
can jump directly into a specific section on a page,
instead of letting the user scroll around to find what
he/she is looking for.
Frames
o With frames, you can display more than one Web page

in the same browser window.


o The disadvantages of using frames are:

ù The web developer must keep track of more HTML


documents
ù It is difficult to print the entire page
o The <frameset> tag defines how to divide the window
into frames
o Each frameset defines a set of rows or columns
o The values of the rows/columns indicate the amount
of screen area each row/column will occupy
o The <frame> tag defines what HTML document to put
into each frame

<frameset cols="25%,75%">
<frame src="frame_a.htm">
<frame src="frame_b.htm">
</frameset>
Tables
o Tables are defined with the <table> tag.

o A table is divided into rows (with the <tr> tag)


o Each row is divided into data cells (with the <td> tag).

o A data cell can contain text, images, lists, paragraphs,


forms, horizontal rules, tables, etc.
<table border="1">

<tr>
<td>row 1, cell 1</td>
<td>row 1, cell 2</td>
</tr>

<tr>
<td>row 2, cell 1</td>
<td>row 2, cell 2</td>
</tr>
</table>
<table border="1">
<tr>
<th>Heading</th>
<th>Another Heading</th>
</tr>
<tr>
<td>row 1, cell 1</td>
<td>row 1, cell 2</td>
</tr>
<tr>
<td>row 2, cell 1</td>
<td>row 2, cell 2</td>
</tr>
</table>
List
o An unordered list is a list of items. The list items are

marked with bullets (typically small black circles).


o An ordered list is also a list of items. The list items are

marked with numbers.


o A definition list is not a list of items. This is a list of

terms and explanation of the terms.


<ul>
<li>Coffee</li>
<li>Milk</li>
</ul>
<ol>
<li>Coffee</li>
<li>Milk</li>
</ol>

<dl>
<dt>Coffee</dt>
<dd>Black hot drink</dd>
<dt>Milk</dt>
<dd>White cold drink</dd>
</dl>
Image
o With HTML you can display images in a document.

o The src attribute of img tag should be assigned with

the path of the file.


o Img tag has no closing tag.

<img src="boat.gif" alt="Big Boat">


o The "alt" attribute tells the reader what he or she is
missing on a page if the browser can't load images.
o The browser will then display the alternate text instead
of the image.
o It is a good practice to include the "alt" attribute for
each image on a page, to improve the display
Forms
HTML forms are used to pass data to a server.
A form can contain input elements like text fields,
checkboxes, radio-buttons, submit buttons and more.
A form can also contain select lists, textarea, fieldset,
legend, and label elements.
The <form> tag is used to create an HTML form:

<form>
.
  
.
</form>
Text jields
<input type="text" /> defines a one-line input field
that a user can enter text into:
<form>
First name: <input type="text" name="firstname"
/><br />
Last name: <input type="text" name="lastname" />
</form> How the HTML code above looks in a
browser:
First name:
Last name:
assword jield
<input type="password" /> defines a password field:
<form>
Password: <input type="password" name="pwd" />
</form> How the HTML code above looks in a
browser:
Password:
Similar for
Radio Button
Check Box
Submit

You might also like