R22 CCN - Unit 5 Notes
R22 CCN - Unit 5 Notes
UNIT – V
APPLICATION LAYER
Electronic Mail:
One of the most popular Internet services is electronic mail (e-mail). The general architecture
of an e-mail system contains three main components: user agent, message transfer agent, and
message access agent.
Architecture:
To explain the architecture of e-mail, we give four scenarios. We begin with the simplest
situation and add complexity as we proceed. The fourth scenario is the most common in the
exchange of email.
First Scenario: In the first scenario, the sender and the receiver of the e-mail are users on the
same system; they are directly connected to a shared system. The administrator has created
one mailbox for each user where the received messages are stored. A mailbox is part of a
local hard drive, a special file with permission restrictions. Only the owner of the mailbox has
access to it. When Alice, a user, needs to send a message to Bob, another user, Alice runs a
user agent (VA) program to prepare the message and store it in Bob's mailbox. The message
has the sender and recipient mailbox addresses (names of files). Bob can retrieve and read the
contents of his mailbox at his convenience, using a user agent.
Second Scenario: In the second scenario, the sender and the receiver of the e-mail are users
on two different systems. The message needs to be sent over the Internet. Here we need user
agents (UAs) and message transfer agents (MTAs).
Alice needs to use a user agent program to send her message to the system at her own site.
The system (sometimes called the mail server) at her site uses a queue to store messages
waiting to be sent. Bob also needs a user agent program to retrieve messages stored in the
mailbox of the system at his site. The message, however, needs to be sent through the Internet
from Alice's site to Bob's site. Here two message transfer agents are needed: one 'client and
one server. Like most client/server programs on the Internet, the server needs to run all the
time because it does not know when a client will ask for a connection. The client, on the other
hand, can be alerted by the system when there is a message in the queue to be sent.
Third Scenario: In the third scenario, Bob, as in the second scenario, is directly connected to
his system. Alice, however, is separated from her system. Either Alice is connected to the
system via a point-to-point WAN, such as a dial-up modem, a DSL, or a cable modem; or she
is connected to a LAN in an organization that uses one mail server for handling e-mails-all
users need to send their messages to this mail server.
Alice still needs a user agent to prepare her message. She then needs to send the message
through the LAN or WAN. This can be done through a pair of message transfer agents (client
and server). Whenever Alice has a message to send, she calls the user agent which, in tum,
calls the MTA client. The MTA client establishes a connection with the MTA server on the
system, which is running all the time. The system at Alice's site queues all messages
received. It then uses an MTA client to send the messages to the system at Bob's site; the
system receives the message and stores it in Bob's mailbox. At his convenience, Bob uses his
user agent to retrieve the message and reads it.
Fourth Scenario: In the fourth and most common scenario, Bob is also connected to his mail
server by a WAN or a LAN. After the message has arrived at Bob's mail server, Bob needs to
retrieve it. Here, we need another set of client/server agents, which we call message access
agents (MAAs). Bob uses an MAA client to retrieve his messages. The client sends a request
to the MAA server, which is running all the time, and requests the transfer of the messages.
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.
Second, note that Bob needs another pair of client/server programs: message access
programs. This is so 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.
SMTP is used two times, between the sender and the sender's mail server and between the
two mail servers. As we will see shortly, another protocol is needed between the mail server
and the receiver. SMTP simply defines how commands and responses must be sent back and
forth. Each network is free to choose a software package for implementation.
Responses: Responses are sent from the server to the client. A response is a three-digit code
that may be followed by additional textual information.
Code Description
211 System status or help reply
214 Help message
220 Service ready
computer (e.g., a laptop). The mail is read but kept in the system for later retrieval and
organizing.
Unlike SMTP, the HTTP messages are not destined to be read by humans; they are read and
interpreted by the HTTP server and HTTP client (browser).
SMTP messages are stored and forwarded, but HTTP messages are delivered immediately.
The commands from the client to the server are embedded in a request message. The contents
of the requested file or other information are embedded in a response message.
HTTP Transaction: Below figure illustrates the HTTP transaction between the client and
server. Although HTTP uses the services of TCP, HTTP itself is a stateless protocol. The
client initializes the transaction by sending a request message. The server replies by sending a
response.
Messages: The formats of the request and response messages are similar; both are shown in
below figure. A request message consists of a request line, a header, and sometimes a body.
A response message consists of a status line, a header, and sometimes a body.
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. Let us go through the scenario shown in the above figure. The
client needs to see some information that it knows belongs to site A. It sends a request
through its browser, a program that is designed to fetch Web documents. The request, among
other information, includes the address of the site and the Web page, called the URL. The
server at site A finds the document and sends it to the client. When the user views the
document, she finds some references to other documents, including a Web page at site B. The
reference has the URL for the new site. The user is also interested in seeing this document.
The client sends another request to the new site, and the new page is retrieved.
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. 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 previously
such as FTP.
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 normally 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.
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 computer, port, and path.
The protocol is the client/server program used to retrieve the document. Many different
protocols can retrieve a document; among them are FTP or HTTP. The most common today
is HTTP.
The host is the computer on which the information is located, although the name of the
computer can be an alias. Web pages are usually stored in computers, and computers are
given alias names that usually begin with the characters "www". This is not mandatory,
however, as the host can be any name given to the computer that hosts the Web page.
The URL can optionally contain the port number of the server. If the port is included, it is
inserted between the host and the path, and it is separated from the host by a colon.
Path is the pathname of the file where the information is located. Note that the path can itself
contain slashes that, in the UNIX operating system, separate the directories from the
subdirectories and files.
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 have
different labels, which guarantees the uniqueness of the domain names.
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.
Fully Qualified Domain Name: If a label is terminated by a null string, it is called a fully
qualified domain name (FQDN). An FQDN is a domain name that contains the full name of a
host. It contains all labels, from the most specific to the most general, that uniquely define the
name of the host.
For example, the domain name: “ challenger.ate.tbda.edu. “ is a FQDN.
Note that the name must end with a null label, but because null means nothing, the label ends
with a dot (.).
Partially Qualified Domain Name: 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.
DNS in Internet:
DNS is a protocol that can be used in different platforms. In the Internet, the domain name
space (tree) is divided into three different sections: generic domains, country domains, and
the inverse domain.
Generic Domains: The generic domains define registered hosts according to their generic
behaviour. Each node in the tree defines a domain, which is an index to the domain name
space database.
Label Description
com Commercial organizations
edu Educational institutions
gov Government institutions
org Nonprofit organizations
Country Domains: The country domains section uses two-character country abbreviations
(e.g., us for United States). Second labels can be organizational, or they can be more specific,
national designations. The United States, for example, uses state abbreviations as a
subdivision of us (e.g., ca.us.).
Inverse Domain: The inverse domain is used to map an address to a name. This may happen,
for example, when a server has received a request from a client to do a task. Although the
server has a file that contains a list of authorized clients, only the IP address of the client
(extracted from the received IP packet) is listed. The server asks its resolver to send a query
to the DNS server to map an address to a name to determine if the client is on the authorized
list.
SNMP uses the concept of manager and agent. That is, a manager, usually a host, controls
and monitors a set of agents, usually routers.
Role of SNMP:
SNMP has some very specific roles in network management. It defines the format of the
packet to be sent from a manager to an agent and vice versa. It also interprets the result and
creates statistics (often with the help of other management software). The packets exchanged
contain the object (variable) names and their status (values). SNMP is responsible for reading
and changing these values.
Role of SMI:
SMI defines the general rules for naming objects, defining object types (including range and
length), and showing how to encode objects and values.
SM1 does not define the number of objects an entity should manage or name the objects to be
managed or define the association between the objects and their values.
Role of MIB:
We hope it is clear that we need another protocol. For each entity to be managed, this
protocol must define the number of objects, name them according to the rules defined by
SMI, and associate a type to each named object. This protocol is MIB. MIB creates a set of
objects defined for each entity similar to a database (mostly metadata in a database, names
and types without values).
The above figure shows the basic model of FTP. 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.
The control connection remains connected during the entire interactive FTP session. The data
connection is opened and then closed for each file transferred. It opens each time commands
that involve transferring files are used, and it closes when the file is transferred. In other
words, 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.