0% found this document useful (0 votes)
71 views12 pages

R22 CCN - Unit 5 Notes

The document discusses the architecture and functioning of electronic mail (e-mail) systems, detailing four scenarios of e-mail exchange and the roles of user agents, message transfer agents, and message access agents. It explains the Simple Mail Transfer Protocol (SMTP) for sending mail, as well as Post Office Protocol (POP3) and Internet Mail Access Protocol (IMAP4) for retrieving mail. Additionally, it covers the Hypertext Transfer Protocol (HTTP) and the structure of the World Wide Web, including the use of Uniform Resource Locators (URLs) and the Domain Name System (DNS).

Uploaded by

saikumarvit
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)
71 views12 pages

R22 CCN - Unit 5 Notes

The document discusses the architecture and functioning of electronic mail (e-mail) systems, detailing four scenarios of e-mail exchange and the roles of user agents, message transfer agents, and message access agents. It explains the Simple Mail Transfer Protocol (SMTP) for sending mail, as well as Post Office Protocol (POP3) and Internet Mail Access Protocol (IMAP4) for retrieving mail. Additionally, it covers the Hypertext Transfer Protocol (HTTP) and the structure of the World Wide Web, including the use of Uniform Resource Locators (URLs) and the Domain Name System (DNS).

Uploaded by

saikumarvit
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
You are on page 1/ 12

VNRVJIET CCN – Unit-5

III B.Tech II Semester – ECE (R22)

COMPUTER COMMUNICATION NETWORKS


Subject Code: 22PC1EC305

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.

First scenario in e-mail

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

Prepared by C.Kaushik, Asst. Prof., ECE Dept. 1


VNRVJIET CCN – Unit-5

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.

Prepared by C.Kaushik, Asst. Prof., ECE Dept. 2


VNRVJIET CCN – Unit-5

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.

Simple Mail Transfer Protocol (SMTP):


The actual 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). As we said before, two pairs of MTA client/server programs
are used in the most common situation (fourth scenario).

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

Prepared by C.Kaushik, Asst. Prof., ECE Dept. 3


VNRVJIET CCN – Unit-5

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.

Commands and Responses:


SMTP uses commands and responses to transfer messages between an MTA client and an
MTA server. Each command or reply is terminated by a two-character (carriage return and
line feed) end-of-line token.
Commands: Commands are sent from the client to the server. The format of a command
consists of a keyword followed by zero or more arguments.
Keyword Argument(s)
HELO Sender's host name
MAIL FROM Sender of the message
DATA Body of the mail

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

Message Access Agent: POP and IMAP


The first and the second stages of mail delivery use SMTP. However, SMTP is not involved
in the third stage because SMTP is a push protocol; it pushes the message from the client to
the server. In other words, the direction of the bulk: data (messages) is from the client to the
server. On the other hand, the third stage needs a pull protocol; the client must pull messages
from the server. The direction of the bulk data is from the server to the client. The third stage
uses a message access agent. Currently two message access protocols are available: Post
Office Protocol, version 3 (POP3) and Internet Mail Access Protocol, version 4 (IMAP4).

Post Office Protocol version 3 (POP3):


Post Office Protocol, version 3 (POP3) is simple and 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.
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

Prepared by C.Kaushik, Asst. Prof., ECE Dept. 4


VNRVJIET CCN – Unit-5

computer (e.g., a laptop). The mail is read but kept in the system for later retrieval and
organizing.

Internet Mail Access Protocol, version 4 (IMAP4):


Another mail access protocol is Internet Mail Access Protocol, version 4 (IMAP4). IMAP4 is
similar to POP3, but it has more features; IMAP4 is more powerful and more complex.
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. In addition, POP3 does not allow
the user to partially check the contents of the mail before downloading. IMAP4 provides the
following extra functions:
• A user can check the e-mail header prior to downloading.
• A user can search the contents of the e-mail for a specific string of characters prior to
downloading.
• 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.
• A user can create, delete, or rename mailboxes on the mail server.
• A user can create a hierarchy of mailboxes in a folder for e-mail storage.

Multi-Purpose Internet Mail Extensions (MIME):


MIME is a development to the Internet email protocol that enables its users to exchange
several kinds of data files over the Internet, including images, audio, and video.
The MIME is required if the text in character sets other than the American Standard Code for
Information Interchange (ASCII). Virtually, all human-written Internet email and a fairly
large proportion of automated email is transmitted via Simple Mail Transfer Protocol (SMTP)
in MIME format.
MIME was designed mainly for SMTP, but the content types defined by MIME standards are
important also in communication protocols outside of email, such as Hypertext Transfer
Protocol (HTTP).
Advantages of MIME:
MIME has several advantages over SMTP.
• Users can send different kinds of binary attachments via email.
• Multiple attachments of different types can be included in the same email.
• There are no limits on message length.
• Multipart messages are supported.

Hyper Text Transfer Protocol (HTTP):


The Hypertext Transfer Protocol (HTTP) is a protocol used mainly to access data on the
World Wide Web. HTTP functions as a combination of FTP and SMTP. It is similar to
FTP because it transfers files and uses the services of TCP. However, it is much simpler than
FTP because it uses only one TCP connection. There is no separate control connection; only
data are transferred between the client and the server.
HTTP is like SMTP because the data transferred between the client and the server look like
SMTP messages. In addition, the format of the messages is controlled by MIME-like headers.

Prepared by C.Kaushik, Asst. Prof., ECE Dept. 5


VNRVJIET CCN – Unit-5

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.

HTTP transaction Request and response messages

World Wide Web (WWW):


The World Wide Web (WWW) is a repository of information linked together from points all
over the world. The WWW has a unique combination of flexibility, portability, and user-
friendly features that distinguish it from other services provided by the Internet.
Architecture: The WWW today is a distributed client-server service, in which a client using a
browser can access a service using a server. However, 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. Let us go through the scenario shown in the above figure. The

Prepared by C.Kaushik, Asst. Prof., ECE Dept. 6


VNRVJIET CCN – Unit-5

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.

Prepared by C.Kaushik, Asst. Prof., ECE Dept. 7


VNRVJIET CCN – Unit-5

Domain Name Space:


To have a hierarchical name space, a domain name space was designed. In this design the
names are defined in an inverted-tree structure with the root at the top.

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.

Prepared by C.Kaushik, Asst. Prof., ECE Dept. 8


VNRVJIET CCN – Unit-5

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.

Simple Network Management Protocol (SNMP):


The Simple Network Management Protocol (SNMP) is a framework for managing devices in
an internet using the TCPIIP protocol suite. It provides a set of fundamental operations for
monitoring and maintaining an internet.

Prepared by C.Kaushik, Asst. Prof., ECE Dept. 9


VNRVJIET CCN – Unit-5

SNMP uses the concept of manager and agent. That is, a manager, usually a host, controls
and monitors a set of agents, usually routers.

SNMP is an application-level protocol in which a few manager stations control a set of


agents. The protocol is designed at the application level so that it can monitor devices made
by different manufacturers and installed on different physical networks. In other words,
SNMP frees management tasks from both the physical characteristics of the managed devices
and the underlying networking technology. It can be used in a heterogeneous internet made of
different LANs and WANs connected by routers made by different manufacturers.
Managers and Agents:
A management station, called a manager, is a host that runs the SNMP client program. A
managed station, called an agent, is a router (or a host) that runs the SNMP server program.
Management is achieved through simple interaction between a manager and an agent.
The agent keeps performance information in a database. The manager has access to the
values in the database. For example, a router can store in appropriate variables the number of
packets received and forwarded. The manager can fetch and compare the values of these two
variables to see if the router is congested or not.
The manager can also make the router perform certain actions. For example, a router
periodically checks the value of a reboot counter to see when it should reboot itself. It reboots
itself, for example, if the value of the counter is 0. The manager can use this feature to reboot
the agent remotely at any time. It simply sends a packet to force a 0 value in the counter.
Management Components:
To do management tasks, SNMP uses two other protocols: Structure of Management
Information (SMI) and Management Information Base (MIB). In other words, management
on the Internet is done through the cooperation of the three protocols SNMP, SMI, and MIB,
as shown in below figure.

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.

Prepared by C.Kaushik, Asst. Prof., ECE Dept. 10


VNRVJIET CCN – Unit-5

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).

File Transfer Protocol (FTP):


Transferring files from one computer to another is one of the most common tasks expected
from a networking or internetworking environment. As a matter of fact, the greatest volume
of data exchange in the Internet today is due to file transfer.
File Transfer Protocol (FTP) is the standard mechanism provided by TCP/IP for copying a
file from one host to another. Although transferring files from one system to another seems
simple and straightforward, some problems must be dealt with first. For example, 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. All these
problems have been solved by FTP in a very simple and elegant approach.
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). Separation of commands and data transfer makes FTP more
efficient. The control connection uses very simple rules of communication. We need to
transfer only a line of command or a line of response at a time. The data connection, on the
other hand, needs more complex rules due to the variety of data types transferred. However,
the difference in complexity is at the FTP level, not TCP. For TCP, both connections are
treated the same.
FTP uses two well-known TCP ports: Port 21 is used for the control connection, and port 20
is used for the data connection.

Prepared by C.Kaushik, Asst. Prof., ECE Dept. 11


VNRVJIET CCN – Unit-5

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.

Prepared by C.Kaushik, Asst. Prof., ECE Dept. 12

You might also like