0% found this document useful (0 votes)
8 views17 pages

Understanding Domain Name System (DNS)

The document discusses the Domain Name System (DNS) and its role in mapping host names to IP addresses, emphasizing the need for a distributed system to manage the vast amount of data on the Internet. It explains the hierarchical structure of domain names, the concept of zones, and the types of DNS servers, including primary and secondary servers. Additionally, it covers the File Transfer Protocol (FTP) and TELNET, detailing how they facilitate file transfers and remote access to servers, respectively.

Uploaded by

basavarajbenkond
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views17 pages

Understanding Domain Name System (DNS)

The document discusses the Domain Name System (DNS) and its role in mapping host names to IP addresses, emphasizing the need for a distributed system to manage the vast amount of data on the Internet. It explains the hierarchical structure of domain names, the concept of zones, and the types of DNS servers, including primary and secondary servers. Additionally, it covers the File Transfer Protocol (FTP) and TELNET, detailing how they facilitate file transfers and remote access to servers, respectively.

Uploaded by

basavarajbenkond
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1 Computer Networks

MODULE V
APPLICATION LAYER
Domain Name System
To identify an entity, TCP/IP protocols use the IP address, which uniquely identifies the
connection of a host to the Internet. People prefer to use names instead of numeric addresses.
Therefore, a system is required that can map a name to an address or an address to a name.

A central directory system cannot hold all the mapping as the internet is huge. If the central
computer fails, the whole communication network will collapse. A better solution is to distribute the
information among many computers, the host that needs mapping can contact the closest computer
holding the needed information and this method is called Domain Naming System (DNS).

Figure 5.1 shows how TCP/IP uses a DNS Client and a DNS Server to map a name to an address.
User wants to use a file transfer client to access the corresponding file transfer server running on a
remote host. The user knows the file transfer server name i.e. [Link].

Figure 5.1 Purposes of DNS

The following six steps map the host name to an IP address.

1. The User passes the host name to the file transfer client.
2. The file transfer client passes the host name to the DNS Client.
3. Each Computer, after being booted, knows the address of one DNS Server. The DNS Client sends
a message to a DNS server with a query that gives the file transfer name using the known IP
address of the DNS Server.
4. The DNS Server responds with IP address of the desired file transfer server.
5. The DNS Server passes the IP address of the desired file transfer client.
6. The file transfer client now uses the received IP Addresses to access the file transfer server.

[Link] BLDEA’s [Link].P.G.H CET


2 Computer Networks

The purpose of accessing internet is to make a connection between the file transfer client and server
and also the connection between DNS client and DNS Server. We need to have at least two connections
First mapping the name to an IP address and second is for transferring files.

Name Space
The names assigned to machines must be carefully selected from a name space with complete
control over the binding between the names and IP addresses i.e. the names must be unique because
the addresses are unique. A name space that maps each address to a unique name can be organized in
two ways: flat or hierarchical.
Flat Name Space: A name is assigned to an address. A name in this space is a sequence of
characters without structure. The names may or may not have a common section, if they do, it has no
meaning. The main disadvantage of a flat name space is that it cannot be used in a large system such as
the Internet because it must be centrally controlled to avoid ambiguity and duplication.

Hierarchical Name Space: Each name is made of several parts. The first part can define the
nature of the organization, the second part can define the name of an organization, the third part can
define departments in the organization, and so on. The authority to assign and control the name spaces
can be decentralized. A central authority can assign the part of the name that defines the nature of the
organization and the name of the organization. The responsibility of the rest of the name can be given to
the organization itself. The organization can add suffixes (or prefixes) to the name to define its host or
resources. The management of the organization need not worry that the prefix chosen for a host is taken
by another organization because, even if part of an address is t same, the whole address is different.

Domain Name Space

To have a hierarchical name space, a domain name space was designed and the names are
defined in an inverted-tree structure with the root at the top. The tree can have only 128 levels: level 0
(root) to level 127 as shown in the Figure 5.2.

Figure 5.2 Domain Name Space

Label: Each node in the tree has a label, which is a string with a maximum of 63 characters. The root
label is a null string (empty string). DNS requires that children of a node (nodes that branch from the
same node) have different labels, which guarantees the uniqueness of the domain names.

[Link] BLDEA’s [Link].P.G.H CET


3 Computer Networks

Figure 5.3 Domain names and Labels

Figure 5.4 Domains

Domain Name: Each node in the tree has a domain name. A full domain name is a sequence of labels
separated by dots (.). The domain names are always read from the node up to the root. The last label is
the label of the root (null). This means that a full domain name always ends in a null label, which means
the last character is a dot because the null string is nothing. Figure 5.3 shows some domain names.

If a label is terminated by a null string, it is called a fully qualified domain name (FQDN). If a label
is not terminated by a null string, it is called a partially qualified domain name (PQDN). A PQDN starts
from a node, but it does not reach the root. It is used when the name to be resolved belongs to the same
site as the client. Here the resolver can supply the missing part, called the suffix, to create an FQDN.

Domain A domain is a subtree of the domain name space. The name of the domain is the domain name
of the node at the top of the subtree. Figure 5.5 shows some domains. Note that a domain may itself be
divided into domains.

[Link] BLDEA’s [Link].P.G.H CET


4 Computer Networks

Distribution of Name Space

The information contained in the domain name space must be stored. It is very inefficient and
also unreliable to have just one computer store such a huge amount of information. It in inefficient
because responding to requests from all over the world places a heavy load on the system. It is also not
reliable because any failure makes the data inaccessible.

Hierarchy of Name Servers To distribute the information among many computers called DNS servers.
One way to do this is to divide the whole space into many domains based on the first level. i.e. We let
the root stand alone and create as many domains (subtrees) as there are first-level nodes. Because a
domain created in this way could be very large, DNS allows domains to be divided further into smaller
domains (subdomains). Each server can be responsible (authoritative) for either a large or a small
domain i.e. We have a hierarchy of servers in the same way that we have a hierarchy of names.

Figure 5.5 Hierarchy of Name servers

Zone: Since the complete domain name hierarchy cannot be stored on a single server; it is divided
among many servers. What a server is responsible for or has authority over is called a zone. We can
define a zone as a contiguous part of the entire tree. If a server accepts responsibility for a domain and
does not divide the domain into smaller domains, the domain and the zone refer to the same thing. The
server makes a database called a zone file and keeps all the information for every node under that
domain.

If a server divides its domain into subdomains and delegates part of its authority to other servers,
domain and zone refer to different things. The information about the nodes in the subdomains is stored
in the servers at the lower levels, with the original server keeping some sort of reference to these lower-
level servers.

The original server does not free itself from responsibility totally: It still has a zone, but the
detailed information is kept by the lower-level servers (see Figure 5.6). A server can also divide part of its
domain and delegate responsibility but still keep part of the domain for itself. In this case, its zone is
made of detailed information for the part of the domain that is not delegated and references to those
parts that are delegated.

[Link] BLDEA’s [Link].P.G.H CET


5 Computer Networks

Figure 5.6 Zone

Root Server: A root server is a server whose zone consists of the whole tree. A root server usually does
not store any information about domains but delegates its authority to other servers, keeping references
to those servers. There are several root servers, each covering the whole domain name space. The
servers are distributed all around the world.

Primary and Secondary Servers

DNS defines two types of servers: primary and secondary.


A primary server is a server that stores a file about the zone for which it is an authority. It is
responsible for creating, maintaining, and updating the zone file. It stores the zone file on a local disk.
A secondary server is a server that transfers the complete information about a zone from another
server (primary or secondary) and stores the file on its local disk.
The secondary server neither creates nor updates the zone files. If updating is required, it must
be done by the primary server, which sends the updated version to the secondary.
The primary and secondary servers are both authoritative for the zones they serve. The idea is
not to put the secondary server at a lower level of authority but to create redundancy for the data so
that if one server fails, the other can continue serving clients. A server can be a primary server for a
specific zone and a secondary server for another zone.

DNS Messages

DNS has two types of messages: query and response. Both types have the same format. The
query message consists of a header and question records , the response message consists of a header,
question records, answer records, authoritative records and additional records (see Figure 5.7 ).

Header Both query and response messages have the same header format with some fields set to
zero for the query messages. The header is 12 bytes, and its format is shown in Figure 5.8. The
identification subfield is used by the client to match the response with the query. The client uses a
different identification number each time it sends a query. The server duplicates this number in the
corresponding response. The flags subfield is a collection of subfields that define the type of the
message, the type of answer requested, the type of desired resolution (recursive or iterative), and so on

[Link] BLDEA’s [Link].P.G.H CET


6 Computer Networks

Figure 5.7 Purposes of DNS

Figure 5.8 Header of DNS Message

. The number of question records subfield contains the number of queries in the question section
of the message. The number of answer records subfield contains the number of answer records in the
answer section of the response message. Its value is zero in the query message. The number of
authoritative records subfield contains the number of authoritative records in the authoritative section
of a response message. Its value is zero in the query message.

The number of additional records subfield contains the number additional records in the
additional section of a response message. Its value is zero in the query message. This is a section
consisting of one or more question records. It is present on both query and response messages.

Authoritative Section: This section gives information (domain name) about one or more
authoritative servers for the query.

Additional Information Section: This section provides additional information that may help the
resolver. For example, a server may give the domain name of an authoritative server to the resolver in
the authoritative section, and include the IP address of the same authoritative server in the additional
information section.

[Link] BLDEA’s [Link].P.G.H CET


7 Computer Networks

File Transfer Protocol


File Transfer Protocol (FTP) is the standard provided by TCP/IP for copying a file from one host to another.
Transferring files from one system to another seems simple and straightforward, but sometimes two systems may
use different file name conventions. Two systems may have different ways to represent text and data. Two
systems may have different directory structures. FTP in a very simple and elegant approach to solve these hurdles.

FTP differs from other client/server applications in that it establishes two connections between the hosts.
One connection is used for data transfer, the other for control information (commands and responses). The
control connection uses very simple rules of communication.

Figure 5.9 File Transfer Protocol

We need to transfer only a line of command or a line of response at a time. The data connection needs
more complex rules due to the variety of data types transferred.

The client has three components: user interface, client control process, and the client data transfer
process. The server has two components: the server control process and the server data transfer process. The
control connection is made between the control processes. The data connection is made between the data
transfer processes. Separation of commands and data transfer makes FTP more efficient.

Two Connections
The control connection remains connected during the entire interactive FTP session. The data connection
is opened and then closed for each file transfer activity. It opens each time commands that involve transferring
files are used, and it closes when the file is transferred. When a user starts an FTP session, the control connection
opens. While the control connection is open, the data connection can be opened and closed multiple times if
several files are transferred. FTP uses two well-known TCP ports: Port 21 is used for the control connection, and
port 20 is used for the data connection.

Control Connection
For control communication FTP uses NVT ASCII Character set as used by TELNET. Communication is
achieved through commands and responses. Commands are sent from client to the server and responses are sent
from the server to the client. Every FTP Commands generates at least one response and it has two parts: a three
digit number followed by text. The numeric part defines the code and the text part defined needed parameters.

[Link] BLDEA’s [Link].P.G.H CET


8 Computer Networks

The first digit defines the status of the command. The second digit defines the area in which the applies.
The third digit provides additional information.

Data Connection

The data connection uses the port 20 at the server site; the creation of data connection is different form
the control connection. The following shows the steps.

1. The client issues a passive open using an ephemeral port and it is done by the client as it is going to issue the
commands for transferring files.
2. Using the port command the client sends this port number to the server.
3. The server receives the port number and issues an active open using the well know port 20 and the received
ephemeral port number.

Communication over Data Connection

File Type

FTP can transfer one of the following file types across the data connection: an ASCII file, EBCDIC file or
image file.

Data Structure

FTP can transfer a file across the data connection by using one of the following interpretations about the
structure of the data: file structure, record structure, and page structure. The file structure format used by
default, has no structure, the file is a continuous stream of bytes. In the record structure, the file is divided into
records. This can be used only with text files. In the page structure, the file is divided into pages, with each page
having a page number and a page header. The pages can be stored and accessed randomly or sequentially.

Transmission Mode

FTP can transfer a file across the data connection by using one of the following three transmission modes:
stream mode, block mode and compressed mode. The stream mode is the default mode. Data are delivered from
FTP to TCP as a continuous stream of bytes. In block mode, data can be delivered from FTP to TCP in blocks. Each
block is preceded by a 3-byte header. The first byte is called the block descriptor; the next 2 bytes define the size
of the block in bytes.

File Transfer

File transfer occurs over the data connection under the control of the commands sent over the
control connection. File transfer in FTP means one of three things: retrieving a file (server to client),
storing a file (client to server) and directory (server to client).

[Link] BLDEA’s [Link].P.G.H CET


9 Computer Networks

TELNET
A Server program can provide a specific service to its corresponding client program. The FTP server is designed
to let the FTP Client to store or retrieve files on the server site but it is impossible to have a client server pair for
each type of service that is required so the number of servers becomes intractable. Hence specific client/ server
program for the set of common services and a generic client /server programs that allow the client site to log into
computer at the server site and use the services available. We refer to these generic pairs as remote logging.

TELNET is an abbreviation for TErminaL NETwork. It is the standard TCP/IP protocol for virtual terminal service
as proposed by the International Organization for Standards (ISO). TELNET enables the establishment of a
connection to a remote system in such a way that the local terminal appears to be a terminal at the remote
system. It requires a logging name and password. TELNET is almost replaced by SSH (Secure Shell) still it is in use
for the two reasons.

1. The simple plaintext architecture of TELNET allows us to explain the issues and challenges related to the
concept of remote logging, which is also used is SSH when it serves as a remote logging protocol.
2. Networks administrators use TELNET for diagnostics and debugging purposes.

Local versus Remote Logging


When a user logs into a local timesharing system, it is called local logging. As a user types at a terminal or at a
workstation running a terminal emulator, the keystrokes are accepted by the terminal driver. The terminal driver
passes the characters to the operating system. The operating system in turn, interprets the combination of
characters and invokes the desired application program or utility.

When a user wants to access an application program or utility located on a remote machine, she performs
remote logging. Here the TELNET client and server programs come into use. The user sends the keystrokes to the
terminal driver, where the local operating system accepts the characters but does not interpret them. The
characters are sent to the TELNET client, which transforms the characters to a universal character set called
Network Virtual Terminal (NVT) characters and delivers them to the local TCP/IP protocol stack.

The commands or text, in NVT form, travel through the Internet and arrive at the TCP/IP stack at the remote
machine. Here the characters are delivered to the operating system and passed to the TELNET server, which
changes the characters to the corresponding characters understandable by the remote computer. It is designed to
receive characters from a terminal driver. The solution is to add a piece of software called a pseudo terminal
driver which pretends that the characters are coming from a terminal. The operating system then passes the
characters to the appropriate application program.

Network Virtual Terminal


The mechanism to access a remote computer is complex. This is so because every computer and its operating
system accept a special combination of characters as tokens. For example, the end-of-file token in a computer
running the DOS operating system is Ctrl + z, while the UNIX operating system recognizes Ctrl + d. We are dealing
with heterogeneous systems. If we want to access any remote computer in the world, we must first know what
type of computer we will be connected to and we must also install the specific terminal emulator used by that
computer.

[Link] BLDEA’s [Link].P.G.H CET


10 Computer Networks

Figure 5.10 Local vs Remote Logging

Figure 5.11 Concept of NVT

TELNET solves this problem by defining a universal interface called the network virtual terminal (NVT)
character set. The client TELNET translates characters (data or commands) that come from the local terminal into
NVT form and delivers them to the network. The server TELNET translates data and commands from NVT form
into the form acceptable by the remote computer. For an illustration of this concept, see Figure [Link] of
NVT.
NVT uses two sets of characters, one for data and the other for control. Both are 8-bit bytes. For data, NVT
is an 8-bit character set in which the 7 lowest-order bits are the same as ASCII and the highest-order bit is 0. To
send control characters between computers (from client to server or vice versa), NVT uses an 8-bit character set in
which the highest-order bit is set to 1.

[Link] BLDEA’s [Link].P.G.H CET


11 Computer Networks

Electronics Mail
One of the most popular Internet services is electronic mail (e-mail). Its architecture consists of several
components. This application allows users to exchange messages .The messages sent by electronic mail were short
and consisted of text only, today it is much more complex. It allows a message to include text, audio, and video. It
also allows one message to be sent to one or more recipients.
Architecture

Figure 5.12 Common Scenario

In the common scenario, the sender and the receiver of the e-mail are users (or application programs or
Alice and Bob), they are directly connected via a LAN or a WAN to two mail servers. The administrator has created
one mailbox for each user where the received messages are stored. A mailbox is part of a server hard drive, a
special file with permission restrictions. Only the owner of the mailbox has access to it. The administrator has also
created a queue to store messages waiting to be sent. The general architecture of an e-mail system including the
three main components: user agent (UA), message transfer agent (MTA), and message access agent (MAA).

When Alice, a user, needs to send a message to Bob, another user, Alice runs a user agent (UA) program to
prepare the message and send it to her mail server. The mail server at her site uses a queue to store messages
waiting to be sent. The message needs to be sent through the internet from Alice’s Site to Bob’s Site using an
MTA. Two messages transfer agents are needed: Client and Server. Figure 5.20 shows the concept.

The server needs to run all the time because it does not know when a client will ask connection. The client
can be triggered by the system when there is a message in the queue to be sent. The UA at the Bob’s Site allows a
Bob to read the received messages. Bob uses an MAA Client to retrieve the messages from an MAA server running
on the second server.

There are two important points here. First, Bob cannot bypass the mail server and use the MTA server
directly. To use MTA server directly, Bob would need to run the MTA server all the time because he does not know
when a message will arrive. This implies that Bob must keep his computer on all the time if he is connected to his
system through a LAN. If he is connected through a WAN, he must keep the connection up all the time. Neither of
these situations is feasible today.

[Link] BLDEA’s [Link].P.G.H CET


12 Computer Networks

Second, Bob needs another pair of client/server programs: message access programs. This is because an
MTA client/server program is a push program: the client pushes the message to the server. Bob needs a pull
program. The client needs to pull the message from the server. Figure 26.10 shows the difference

User Agent

The first component of an electronic mail system is the user agent (VA). It provides service to the user to
make the process of sending and receiving a message easier. A user agent is a software package (program) that
composes , reads, replies to, and forwards messages. It also handles mailboxes.

There are two types of user agents: command-driven and GUI-based.

Command-Driven user agents belong to the early days of electronic mail. They are still present as the
underlying user agents in servers. A command-driven user agent accepts a one-character command from the
keyboard to perform its task. For example, a user can type the character r, at the command prompt, to reply to
the sender of the message, or type the character R to reply to the sender and all recipients. Some examples of
command-driven user agents are mail, pine, and elm.

GUI-Based Modem user agents are GUI-based. They contain graphical-user interface (GUI) components
that allow the user to interact with the software by using both the keyboard and the mouse. They have graphical
components such as icons, menu bars, and windows that make the services easy to access. Some examples of GUI-
based user agents are Eudora and Microsoft's Outlook.

Sending mail

To send mail, the user, through the UA, creates mail that looks very similar to postal mail. It has an
envelope and a message. The envelope contains the sender and the receiver addresses. The message contains the
header and the body. The header of the message defines the sender, the receiver, the subject of the message, and
some other information. The body of the message contains the actual information to be read by the recipient.

Receiving mail
The user agent is triggered by the user (or a timer). If a user has mail, the UA informs the user with a
notice. If the user is ready to read the mail, a list is displayed in which each line contains a summary of the
information about a particular message in the mailbox. The summary includes the sender mail address, the
subject, and the time the mail was sent or received. The user can select any of the messages and display its
contents on the screen.

Addresses
To deliver mail, a mail handling system must use an addressing system with unique addresses. In the
Internet, the address consists of two parts: a local part and a domain name, separated by an @ sign.
Local Part: The local part defines the name of a special file, called the user mailbox, where all the mail
received for a user is stored for retrieval by the message access agent.
Domain Name: The second part of the address is the domain name. An organization selects one or more
hosts to receive and send e-mail; the hosts are sometimes called mail servers or exchangers. The domain name
assigned to each mail exchanger either comes from the DNS database or is a logical name.

[Link] BLDEA’s [Link].P.G.H CET


13 Computer Networks

Mailing list or group list

Electronic mail allows one name, to represent several different e-mail addresses; this is called a mailing
list. Every time a message is to be sent, the system checks the recipient's name against the alias database; if there
is a mailing list for the defined alias, separate messages, one for each entry in the list, must be prepared and
handed to the MTA.

POP3 (Post Office Protocol, version 3)

Post Office Protocol, version 3 (POP3) is simple but limited in functionality. The client POP3 software is
installed on the recipient computer; the server POP3 software is installed on the mail server.
Mail access starts with the client when the user needs to download e-mail from the mailbox on the mail
server. The client opens a connection to the server on TCP port 110. It then sends its user name and password to
access the mailbox. The user can then list and retrieve the mail messages, one by one. Figure 5.21 shows an
example of downloading using POP3.
POP3 has two modes: the delete mode and the keep mode. In the delete mode, the mail is deleted from
the mailbox after each retrieval. In the keep mode, the mail remains in the mailbox after retrieval. The delete
mode is normally used when the user is working at her permanent computer and can save and organize the
received mail after reading or replying. The keep mode is normally used when the user accesses her mail away
from her primary computer (e.g., a laptop). The mail is read but kept in the system for later retrieval and
organizing.
POP3 is deficient in several ways. It does not allow the user to organize her mail on the server; the user
cannot have different folders on the server. It does not allow the user to partially check the contents of the mail
before downloading.

Figure 5.13 POP3 Post Office Protocols Version 3

IMAP4 (Internet Mail Access Protocol Version 4)

It is similar to POP3 but has more features, powerful and more complex.
IMAP4 provides the following extra functions:
1. A user can check the e-mail header prior to downloading.
2. A user can search the contents of the e-mail for a specific string of characters prior to downloading.

[Link] BLDEA’s [Link].P.G.H CET


14 Computer Networks

3. A user can partially download e-mail. This is especially useful if bandwidth is limited and the e-mail contains
multimedia with high bandwidth requirements.
4. A user can create, delete, or rename mailboxes on the mail server.
5. A user can create a hierarchy of mailboxes in a folder for e-mail storage.
Mail Transfer Agent: SMTP

The mail transfer is done through message transfer agents. To send mail, a system must have the client
MTA, and to receive mail, a system must have a server MTA. The formal protocol that defines the MTA client and
server in the Internet is called the Simple Mail Transfer Protocol (SMTP). SMTP is used two times, between the
sender and the sender's mail server and between the two mail servers. SMTP defines how commands and
responses must be sent back and forth.

Mail transfer Phases

The process of transferring a mail message occurs in three phases: connection establishment, mail transfer, and
connection termination.

Connection Establishment: Once client has made a TCP connection to the port 25 , the SMTP server starts the
connection phase which involves three steps .

1. The server sends a code 220 to tell the client that it is ready to receive the mail. If the server is not ready it
sends the code 421.
2. The client sends the HELO message to identify itself using its domain name address this is necessary to
inform the server of the domain of the client.
3. The server responds with a code 250 depending on the situation.

Message Transfer: After connection is established between the SMTP client and SERVER a single message
between a sender and one or more recipients can be exchanged which involves 8 steps.

1. The Client sends a MAIL FROM message to introduce the sender of the message. It includes the mail
address of the sender. This is required to give the server the return address mail for returning errors and
reporting messages.
2. The server responds with code 250.
3. The client sends the RCPT TO (Recipient) message which includes the mail address of the recipient.
4. The server responds with a code 250 depending on the situation.
5. The client sends DATA message to initialize the message transfer.
6. The server responds with a code 354.
7. The client sends the contents of the message in consecutive lines. Each line is terminated by a two
character end of line token.
8. The server responds with a code 250(OK).

Connection Termination: After the message is transferred successfully the client terminates the connection which
involves two steps

1. The client sends the QUIT command.


2. The server responds with code 221.

[Link] BLDEA’s [Link].P.G.H CET


15 Computer Networks

World Wide Web

The World Wide Web (WWW) is a repository of 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 statements: distributed and linked. Distribution allows the growth of the web.
Each web server in the world can add a new 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 the concept called hypertext. The term
hypertext has 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 document. The web page is used
to provide electronic shopping and gaming.

Architecture

The WWW is a distributed client-server service, in which a client using a browser can access a service using
a server. The service provided is distributed over many locations called sites. Each site holds one or more
documents, referred to as Web pages. Each web page can contain a link to other pages in the same site or at other
sites. The pages can be retrieved and viewed by using browsers. Each web page is a file with a name and address.

Web Client (Browser)

A variety of vendors offer commercial browsers that interpret and display a Web document, and all use
nearly the same architecture. Each browser usually consists of three parts: a controller, client protocol, and
interpreters. Shows in figure 5.14.

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 such as FTP or HTTP. The
interpreter can be HTML, Java, or JavaScript, depending on the type of document.

Figure 5.14 Browser

Web Server
The Web page is stored at the server. Each time a client request arrives, the corresponding document is
sent to the client. To improve efficiency, servers store requested files in a cache in memory; memory is faster to
access than 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.

[Link] BLDEA’s [Link].P.G.H CET


16 Computer Networks

Uniform Resource Locator

A client that wants to access a Web page needs the address. To facilitate the access of documents
distributed throughout the world, HTTP uses locators. The uniform resource locator (URL) is a standard for
specifying any kind of information on the Internet. The URL defines four things: protocol, host, port and Path. The
first is the type of vehicle to be used.
The PROTOCOL is the client/server program used to retrieve the document. Many different protocols can retrieve
a document; among them is FTP or HTTP. The most common today is HTTP.
The HOST is the computer on which the information is located or can be IP address of the server or the unique
name given to the server.
PORT: The port a 16-bit integer is predefined for the client and server application. If HTTP Protocol is used for
accessing the web pages the port number 80 is USED.
PATH is the pathname of the file where the information is located. The format of the identifier depends on the
operating system.

Web Documents

The documents in the WWW can be grouped into three broad categories: static, dynamic and active. The
category is based on the time at which the contents of the document are determined.

Static Documents
Static documents are fixed-content documents that are created and stored in a server. The client can get
only a copy of the document. The contents of the file are determined when the file is created, not when it is used.
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 can be prepared using one of the languages: HTML, XML, XSL and XHTML.
Dynamic Documents
A dynamic document is created by a Web server whenever a browser requests the document. When a
request arrives, the Web server runs an application program or a script that creates the dynamic document. The
server returns the output of the program or script as a response to the browser that requested the document.
Because a fresh document is created for each request, the contents of a dynamic document can vary from one
request to another. A very simple example of a dynamic document is the retrieval of the time and date from a
server. Time and date are kinds of information that are dynamic in that they change from moment to moment.
The client can ask the server to run a program such as the date program in UNIX and send the result of the
program to the client.
Common Gateway Interface (CGI): It is a technology that creates and handles dynamic documents. CGI is a set
of standards that defines how a dynamic document is written, how data are input to the program, and how the
output result is used.
Active Documents

For many applications, 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. Using Java Applets an active document
is created. The document is in bytecode (binary) format.

[Link] BLDEA’s [Link].P.G.H CET


17 Computer Networks

Hypertext Transfer Protocol (HTTP)


The Hypertext Transfer Protocol (HTTP) is a protocol used to define how the client-server programs can be
written to retrieve web pages form the web. An HTTP client sends a request; an HTTP server returns a response.
The server uses the port number 80. The client uses a temporary port number. HTTP functions as a combination of
FTP and SMTP. It is similar to FTP because it transfers files and uses the services of TCP. It is much simpler than FTP
because it uses only one TCP connection. Before any transaction between the client and the server takes place, a
connection needs to be established and after transaction the connection should be terminated.

Persistent Versus Non-persistent Connection

The hypertext concept embedded in web pages documents may require several requests and responses. If
the web pages, objects to be retrieved are located on different servers, than need to create a new TCP Connection
for retrieving each object. If some of the objects are located on the same server we have two choices: to retrieve
each object using new connection or to make a TCP connection and retrieve them all. The first method is referred
to as a non-persistent connection, the second as a persistent connection.

Non-persistent Connection
In a non-persistent connection, one TCP connection is made for each request/response.
The following lists the steps in this strategy:
1. The client opens a TCP connection and sends a request.
2. The server sends the response and closes the connection.
3. The client reads the data until it encounters an end-of-file marker; it then closes the connection.
In this strategy, if a file contains links to N different pictures in different files, the connection must be
opened and closed N+1 times. The non-persistent strategy imposes high overhead on the server because the
server needs N+1 different buffers and requires a slow start procedure each time a connection is opened.

Persistent Connection
In a persistent connection, the server leaves the connection open for more requests after sending a
response. The server can close the connection at the request of a client or if a time-out has been reached. The
sender sends the length of the data with each response. There are some occasions when the sender does not
know the length of the data. This is the case when a document is created dynamically or actively. In these cases,
the server informs the client that the length is not known and closes the connection after sending the data so the
client knows that the end of the data has been reached. Time and resources are saved using persistent
connections. Only one set of buffer and variables needs to be set for the connection at each site. The round trip
time for connection established and connection termination is saved.

Proxy Server
HTTP supports proxy servers. A proxy server is a computer that keeps copies of responses to recent
requests. The HTTP client sends a request to the proxy server. The proxy server checks its cache. If the response is
not stored in the cache, the proxy server sends the request to the corresponding server. Incoming responses are
sent to the proxy server and stored for future requests from other clients.
The proxy server reduces the load on the original server, decreases traffic and improves latency. To use
the proxy server, the client must be configured to access the proxy instead of the target server.

[Link] BLDEA’s [Link].P.G.H CET

You might also like