NIKICN
NIKICN
BELGAVI, KARNATAKA-590018
A Report on
By
• A pair of processes provide services to the users of the Internet, human or programs.
• A pair of processes, however, need to use the services provided by the transport
layer for communication because there is no physical communication at the
application layer.
• There are three common transport-layer protocols in the TCP/IP suite: UDP, TCP,
and SCTP.
• Most standard applications have been designed to use the services of one of these
protocols.
• When we write a new application, we can decide which protocol we want to use.
The choice of the transport layer protocol seriously affects the capability of the
application processes.
UDP Protocol:
TCP Protocol:
SCTP Protocol:
• In UDP communication, the client and server use only one socket each.
• The socket created at the server site lasts forever; the socket created at the client
site is closed (destroyed) when the client process terminates.
• In other words, different clients use different sockets, but the server creates only
one socket and changes only the remote socket address each time a new client
makes a connection.
• This is logical, because the server does know its own socket address, but does not
know the socket addresses of the clients who need its services; it needs to wait for
the client to connect before filling this part of the socket address.
• There are multiple clients, but only one server. Each client is served in each iteration
of the loop in the server.
• There is no connection establishment or connection termination. Each client sends
a single datagram and receives a single datagram.
• If a client wants to send two datagrams, it is considered as two clients for the server.
The second datagram needs to wait for its turn. The diagram also shows the status
of the socket after each action.
Server Process:
• The server makes a passive open, in which it becomes ready for the communication,
but it waits until a client process makes the connection.
• It creates an empty socket. It then binds the socket to the server and the well-known
port, in which only part of the socket (the server socket address) is filled (binding
can happen at the time of creation depending on the underlying language).
• The server then issues a receive request command, which blocks until it receives a
request from a client. The server then fills the rest of the socket (the client socket
section) from the information obtained in the request.
• The request is the process and the response is sent back to the client. The server
now starts another iteration waiting for another request to arrive (an infinite loop).
that in each iteration, the socket becomes only half-filled again; the client socket
address is erased. It is totally filled only when a request arrives.
Client Process:
• The idea of the Web was first proposed by Tim Berners-Lee in 1989 at CERN†, the
European Organization for Nuclear Research, to allow several researchers at
different locations throughout Europe to access each others, researches.
• The commercial Web started in the early 1990s.
• The Web today is a repository of information in which the documents, called web
pages, are distributed all over the world and related documents are linked together.
• The popularity and growth of the Web can be related to two terms in the above
statement: distributed and linked.
• Distribution allows the growth of the Web. Each web server in the world can add a
new web page to the repository and announce it to all Internet users without
overloading a few servers.
• Linking allows one web page to refer to another web page stored in another server
somewhere else in the world.
• The linking of web pages was achieved using a concept called hypertext, which was
introduced many years before the advent of the Internet.
• The idea was to use a machine that automatically retrieved another document stored
in the system when a link to it appeared in the document. The Web implemented
this idea electronically to allow the linked document to be retrieved when the link
was clicked by the user.
• Today, the term hypertext, coined to mean linked text documents, has been changed
to hypermedia, to show that a web page can be a text document, an image, an audio
file, or a video file.
• The purpose of the Web has gone beyond the simple retrieving of linked documents.
Today, the Web is used to provide electronic shopping and gaming.
Architecture:
Example 26.1: Assume we need to retrieve a scientific document that contains one
reference to another text file and one reference to a large image.
• A variety of vendors offer commercial browsers that interpret and display a web
page, and all of them use nearly the same architecture.
• Each browser usually consists of three parts: a controller, client protocols, and
interpreters.
• The controller receives input from the keyboard or the mouse and uses the client
programs to access the document.
• After the document has been accessed, the controller uses one of the interpreters to
display the document on the screen.
• The client protocol can be one of the protocols described later, such as HTTP or
FTP. The interpreter can be HTML, Java, or JavaScript, depending on the type of
document. Some commercial browsers include Internet Explorer, Netscape
Navigator, and Firefox.
Web Server:
• The web page is stored at the server. Each time a request arrives, the corresponding
document is sent to the client.
• To improve efficiency, servers normally store requested files in a cache in memory;
memory is faster to access than a disk.
• A server can also become more efficient through multithreading or multiprocessing.
In this case, a server can answer more than one request at a time. Some popular web
servers include Apache and Microsoft Internet Information Server.
• A web page, as a file, needs to have a unique identifier to distinguish it from other
web pages.
• To define a web page, we need three identifiers: host, port, and path. However,
before defining the web page, we need to tell the browser what client server
application we want to use, which is called the protocol.
• This means we need four identifiers to define the web page. The first is the type of
vehicle to be used to fetch the web page; the last three make up the combination
that defines the destination object (web page).
• Protocol. The first identifier is the abbreviation for the client-server program that
we need in order to access the web page. Although most of the time the protocol is
HTTP (Hyper Text Transfer Protocol), which we will discuss shortly, we can also
use other protocols such as FTP (File Transfer Protocol).
• Host. The host identifier can be the IP address of the server or the unique name
given to the server. IP addresses can be defined in dotted decimal notation, as
described in Chapter 18 (such as 64.23.56.17); the name is normally the domain
name that uniquely defines the host, such as forouzan.com.
• Port. The port, a 16-bit integer, is normally predefined for the client-server
application. For example, if the HTTP protocol is used for accessing the web page,
the well-known port number is 80. However, if a different port is used, the number
can be explicitly given.
• Path. The path identifies the location and the name of the file in the underlying
operating system. The format of this identifier normally depends on the operating
system. In UNIX, a path is a set of directory names followed by the file name, all
separated by a slash. For example, /top/next/last/my file is a path that uniquely
defines a file named my file, stored in the directory last, which itself is part of the
directory next, which itself is under the directory top. In other words, the path lists
the directories from the top to the bottom, followed by the file name.
• To combine these four pieces together, the uniform resource locator (URL) has been
designed; it uses three different separators between the four pieces as shown below:
protocol://host/path Used most of the time
protocol://host:port/path Used when port number is needed
Web Documents:
• Static documents are fixed-content documents that are created and stored in a
server. The client can get a copy of the document only. Static documents are fixed-
content documents that are created and stored in a server.
• The client can get a copy of the document only. In other words, the contents of the
file are determined when the file is created, not when it is used. Of course, the
contents in the server can be changed, but the user cannot change them.
• When a client accesses the document, a copy of the document is sent. The user can
then use a browser to see the document. Static documents are prepared using one of
several languages: Hyper Text Markup Language (HTML), Extensible Markup
Language (XML), Extensible Style Language (XSL), and Extensible Hypertext
Markup Language (XHTML).
• Active document we need a program or a script to be run at the client site. These
are called active documents.
• For example, suppose we want to run a program that creates animated graphics on
the screen or a program that interacts with the user.
• The program definitely needs to be run at the client site where the animation or
interaction takes place.
• When a browser requests an active document, the server sends a copy of the
document or a script.
• The document is then run at the client (browser) site. One way to create an active
document is to use Java applets, a program written in Java on the server.
• It is compiled and ready to be run. The document is in bytecode (binary) format.
Another way is to use Java Scripts but download and run the script at the client site.