0% found this document useful (0 votes)
35 views103 pages

1.application Layer

The document provides an overview of the Domain Name System (DNS), explaining its role in translating human-readable domain names into machine-readable IP addresses. It discusses the structure of DNS, including flat and hierarchical name spaces, and the advantages of a distributed DNS system over a centralized one. Additionally, it outlines the types of name servers, the process of DNS resolution, and the importance of DNS in the functioning of the Internet.
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)
35 views103 pages

1.application Layer

The document provides an overview of the Domain Name System (DNS), explaining its role in translating human-readable domain names into machine-readable IP addresses. It discusses the structure of DNS, including flat and hierarchical name spaces, and the advantages of a distributed DNS system over a centralized one. Additionally, it outlines the types of name servers, the process of DNS resolution, and the importance of DNS in the functioning of the Internet.
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/ 103

1.

APPLICATION LAYER
1.INTRODUCTION

OSI MODEL TCP/IP MODEL


• Internet : ”The Internet is a vast network that connects computers all over the world.”
• “An IP address is a unique address that identifies a device on the internet or a local
network.”
• Just as humans can be identified in many ways, Internet hosts can also identified by names
• – Hostname (e.g., gmail.co.in, iitj.ac.in) these are mnemonic, user friendly for Humans
• – IP Address (e.g., 121.7.106.83, 172.17.0.10) these are structured numeric digits, user
friendly for Routers
• The Internet needs to have a directory system that can map a name to an address. • The
Internet is so huge today, a central directory system cannot hold all the mapping.
• A better solution - distribute the directory information among many computers in the world.
• The host that needs mapping can contact the closest computer holding the needed
information.
• This method is used by the Domain Name System (DNS).
• DNS : or the Domain Name System, translates human readable
domain names (for example, www.amazon.com) to machine readable IP
addresses (for example, 192.0.2.44).
OR
• “The domain name system (DNS) is a naming database in which internet
domain names are located and translated into Internet Protocol (IP)
addresses.”
• Consider an example where a user wants to transfer a file to a file server identified by name
"afileserver.com". However, to transmit the file, the underlying network needs the IP address
of the server.
• The following six steps map the host name to an IP address:
i) The user passes the host name to the file transfer client (Example: afileserver.com).
ii) The file transfer client passes the host name to the DNS client(DNS resolver).
iii) The DNS client in the computer sends a query with the file server name to a DNS server
(Each computer knows the IP address of one DNS server),
iv) The DNS server responds with the IP address of the desired file transfer server (Example
20.100.50.2).
v) The DNS client passes the IP address to the file transfer client.
vi) The file transfer client now uses the received IP address to access the file server.
Design for DNS:

• – Centralized
• – Distributed

• The problems with a centralized design include:

– A single point of failure: DNS server crashes, so does the entire Internet!
– Traffic volume: A single DNS server would have to handle all DNS queries generated from
hundreds of millions of hosts
–– Maintenance: The single DNS server would have to keep records for all Internet hosts.
Management of it becomes very difficult!
• A Distributed Domain Name System (DNS) is a system that distributes the
responsibilities of resolving domain names to IP addresses across multiple servers or
nodes.
• Advantages of distributed domain name system
1.Improved Fault Tolerance:
2. Increased Scalability
3. Reduced Latency
4. Enhanced Security
5. Resistance to Censorship
Name Space

A namespace is a context within which the names of all objects must be unambiguously resolvable.

• 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 -usually used for small internets
hierarchical -a hierarchical system used by large internets, including the Internet
Flat name space
In a flat namespace, each host name consists of a sequence of characters without any further structure. A
single authority maintains a table of the host names and assigned internet addresses to avoid naming
conflicts and to regulate the names.
• Advantages:
1. Names are convenient and short.
2. They are stored at a central location, so access is easier.
• Disadvantages:
1. Cannot be used for large system like Internet for both technical and administrative reasons.
2. The potential for conflicts increases as number of sites increases.
Flat name space
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
Advantages
1. The name is made up of several parts; each defining a level in a hierarchy.
2. The authority to assign names can be decentralized. This reduces burden on a single entity.
3. Flexible and extensible.
4. Even if the prefix chosen for a host is taken by another organization i.e. part of the address is the same,
whole address is different. For example, compsc.acollege.edu compsc.anothercollege.edu are different
addresses.
• Disadvantages
1. Requires communication and coordination between several authorities.
2. Modifications are difficult to make.
Hierarchical name space:
Sr. No. Flat Name Space Hierarchical Name Space

1. Each name consists of sequence of characters Each name is made of several parts , each
without any further structure. defining a level in a hierarchy.

2. Names are stored at central location. Names are distributed.

3. Centralized control. Decentralized control.

4. Easy to resolve names to addresses. Resolution is more complex due to the


hierarchical structure.

5. As the names are drawn from a single set of Even if part of the names are same, the
identifiers, the potential for conflicts increases. whole address is unique.

6. Easy to implement. Difficult to implement.

7. Does not require communication and Requires communication and coordination


coordination between several authorities. between several authorities.
• 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).
• 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 last node up to the root.
– The last label is the label of the root (null).
• At the root of the DNS namespace, there are a number of top-level domains (TLDs), such
as .com, .net, and .org. These TLDs are further divided into second-level domains, and so
on.
• For example, consider the domain name "example.com". "com" is the top-level domain,
and "example" is the second-level domain. "Example.com" can have subdomains beneath
it, such as "www.example.com" and "mail.example.com". Each subdomain can also
have further subdomains beneath it, forming a tree-like structure.
DOMAIN NAME SPACE
• The DNS name space is the set of all domain names that are registered in the DNS.
• domain namespace is a name service provided by the Internet for (TCP/IP).
• require communication and coordination between several authorities.
Domain Purpose

com Commercial organizations

edu Educational institutions

gov Government institutions

mil Military groups

net Major network support centers

org Nonprofit organizations and others

int International organizations


• A domain name can be of two types :
• i. Fully Qualified Domain Name (FQDN)
• ii. Partially Qualified Domain Name (PQDN)
• A fully qualified domain name (FQDN) is the complete domain name for a specific computer,
or host, on the internet.
• A domain name is a Fully Qualified Domain Name if the name ends in a null string i.e. at
the root.
• It contains the full name of the host machine from the most specific to the most general
• Technically, if a top-level domain "A" contains a subdomain "B" that in turn contains
subdomain "C", the full domain name for "C" is "C.B.A.".
• The label ends with a dot.
• For example, pg.compsc.mycollege.edu. is the FQDN of a server named "pg" installed at the
"compsc" department in college "mycollege". The label "edu" represents a top level domain.
• A A Partially Qualified Domain Name is a domain name that lacks the complete
hierarchy of labels necessary to make it a FQDN; a PQDN does not provide the full path
needed to locate a specific resource on the Internet.
• PQDN is a partial name which does not end at the root ie a PQDN starts from a node, but
it does not reach the root.
• It cannot be used independently because it doesn't give the full path to the domain.
• We can only use a PQDN within the context of a particular parent domain.
• We can then find the FQDN of a partially-specified domain name by appending the absolute
name of the parent domain to the partial name.
• For example, we can say that the domain "ug" is a PQDN.
• The DNS server can differentiate between a FQDN and PQDN from the trailing dot. The
PQDN does not have the trailing dot.
• 1. The entire hostname has a maximum of ___________
a) 255 characters
b) 127 characters
c) 63 characters
d) 31 characters

• 2. A DNS client is called _________


a) DNS updater
b) DNS resolver
c) DNS handler
d) none of the mentioned

• 3. Servers handle requests for other domains _______


a) directly
b) by contacting remote DNS server
c) it is not possible
d) none of the mentioned
• 4. DNS database contains _______
a) name server records
b) hostname-to-address records
c) hostname aliases
d) all of the mentioned
• 5. If a server has no clue about where to find the address for a hostname then _______
a) server asks to the root server
b) server asks to its adjcent server
c) request is not processed
d) none of the mentioned

• 6. Which one of the following allows client to update their DNS entry as their IP address change?
a) dynamic DNS
b) mail transfer agent
c) authoritative name server
d) none of the mentioned
• 7. The right to use a domain name is delegated by domain name registers which are accredited by _______
a) internet architecture board
b) internet society
c) internet research task force
d) internet corporation for assigned names and numbers
• 8. The domain name system is maintained by _______
a) distributed database system
b) a single server
c) a single computer
d) none of the mentioned

• 9. Which one of the following is not true?


a) multiple hostnames may correspond to a single IP address
b) a single hostname may correspond to many IP addresses
c) a single hostname may correspond to a single IP address
d) none of the mentioned
10. In a ______ name space, a name is assigned to an address. A name in this space is a sequence of characters without structure.
a.flat
b.hierarchical
c.organized
d.none of the above
11.Each node in the tree has a _______, which is a string with a maximum of ___ characters.
a.label; 127
b.name; 255
c.label; 63
d.none of the above
12. The root of the DNS tree is _______.
a.string of characters
b.a string of 63 characters
c.an empty string
d.none of the above
1. Answer: a
Explanation: An entire hostname can have a maximum of 255 characters. Although each label must
be from 1 to 63 characters long. Host name is actually a label that is given to a device in a network.

2. Answer: b
Explanation: DNS client also known as DNS resolver also known as DNS lookup helps to resolve
DNS requests using an external DNS server.

3. Answer: b
Explanation: Whenever a request is received at server from other domains, it handles this situation
by contacting remote DNS server.

4. Answer: d
Explanation: Domain Name system not only deals with mapping IP addresses with the hostname
but also deals with exchange of information in the server.

5. Answer: a
Explanation: Root name servers are actually very important and critical as they are the first step in
translating human readable hostnames into IP addresses for carrying out communication.
6. Answer: a
Explanation: Dynamic DNS or in short DDNS or DynDNS helps in automatically updating a
name server in the DNS. This does not require manual editing.
7. Answer: d
Explanation: The ICANN (Internet Corporation for Assigned Names and Numbers) deals with IP address
space allocation, protocol identifier assignment, generic and country code Top Level domain name system
management (gTLD and ccTLD).
8.Answer: a
Explanation: A domain name system is maintained by a distributed database system. It is a collection of
multiple, logically interrelated databases distributed over a computer network.
9.Answer: a
Explanation: It need not be that a single hostname will correspond to a ip address. For example
facebook.com and fb.com both correspond to same ip address. So there can be multiple hostnames for a
single ip address.
10. A. Flat

11. C. label; 63

12.C. an empty string


SR. NO. FQDN PQDN
1. Path from a node to the root Path does not contain the root
2. Can be used independently Cannot be used independently,
3. No additional suffix needs to be added. The full domain name of the parents
hould be added as suffix.
4. Ends with a dot Does not end with a dot
5. Requires more space to store. Requires less space in DNS tables
6. Used when the host needs to be identified Typically used in the internal network.
independently
7. Eg. ug.compsc.mycollege.edu. Eg. ug.compsc
DISTRIBUTION OF NAME SPACE

• Name server contains the DNS database.


• This database comprises of various names and their corresponding IP addresses. Since it
is not possible for a single server to maintain entire DNS database, therefore, the
information is distributed among many DNS servers.
• Hierarchy of server is same as hierarchy of names.
• The entire name space is divided into the zones
• Zones
• Zone is collection of nodes (sub domains) under the main domain. The server maintains a database called zone
file for every zone.A DNS zone is a portion of the DNS namespace that is managed by a specific organization
or administrator. A DNS zone is an administrative space which allows for more granular control of DNS
components
• The information about the nodes in the sub domain is stored in the servers at the lower
levels however; the original server keeps reference to these lower levels of servers.
• Types of Name Servers
Following are the three categories of Name Servers that manages the entire
Domain Name System:
• Root Server
• Primary Server
• Secondary Server
• Root Server
Root Server is the top level server which consists of the entire DNS tree. A Root Zone File,
central to the DNS hierarchy, is a comprehensive database comprising all top-level domains
(TLDs).
• Primary Servers
Primary Server stores a file about its zone. It has authority to create, maintain, and update the
zone file.
• Secondary Server
The primary server contains the original zone files and the secondary secures a copy.
Maintaining two sets of nameservers hold record information that will be obtainable by end
users. Having this extra set adds redundancy to your domain but queries routed to the
healthiest resource, also assist in load balancing. Secondary DNS should also be part of your
DNS strategy with the increasing security threats
• DNS Working
• DNS translates the domain name into IP address automatically. Following steps
included in domain resolution process:
• When we type www.tutorialspoint.com into the browser, it asks the local DNS
Server for its IP address.
• When the local DNS does not find the IP address of requested domain name, it
forwards the request to the root DNS server and again enquires about IP
address of it.
• The root DNS server replies with delegation that I do not know the IP address of
www.tutorialspoint.com but know the IP address of com DNS Server.
• The local DNS server then asks the com DNS Server the same question.
• The com DNS Server replies the same that it does not know the IP address of
www.tutorialspont.com but knows the address of tutorialspoint.com.
• Then the local DNS asks the tutorialspoint.com DNS server the same question.
• Then tutorialspoint.com DNS server replies with IP address of www.tutorialspoint.com.
• Now, the local DNS sends the IP address of www.tutorialspoint.com to the computer that
sends the request.
DNS IN THE INTERNET

• DNS is a directory service that provides a mapping between the name of a host on the
network and its numerical address.
• DNS is required for the functioning of the internet.
• The domain name space is divided into three different sections: generic domains,
country domains, and inverse domain.
1. Generic Domain
• It defines the registered hosts according to their generic behavior.
• As of now, there are currently 21 generic top-level domains within the root zone,
• It uses three-character labels, and these labels describe the organization type.
• It allows organizations to be grouped by organizational types.
• generic (.com, .info, .net, .org), which can be used for general purposes;
• sponsored (.aero, .asia, .cat, .coop, .edu, .gov, .int, .jobs, .mil, .mobi, .tel, .travel, and .xxx), which can
only be used by entities engaged within the specific industry;

• generic restricted (.biz, .name, .pro), which can be use only for their specified purposes and

• infrastructure (.arpa), is a special category that contains only one TLD i.e. the address and routing
parameter area (ARPA).You cannot register the domain as a TLD as it is typically only used for
technical web infrastructure motives. and it is operated by IANA. [3]
2. Country Domain
• The format of country domain is same as a generic domain, but it uses two-character country
abbreviations (e.g., us for the United States, uk- for United Kingdom ,in-for India) in place of
three character organizational abbreviations.
3. Inverse Domain
• Inverse domains, also known as reverse DNS, perform the opposite function of traditional
DNS. Instead of translating domain names to IP addresses, inverse domains translate IP
addresses to domain names.
• They are commonly used in email servers and security applications. For example, an inverse
domain in DNS may reveal that the IP address 192.168.0.1 corresponds to
"router.example.com."
RESOLUTION

• Mapping a domain name to an IP Address is known as Name-Address Resolution. The


Domain Name Server (DNS) Resolver performs this operation by consulting name servers.
• In order to find a resolution of name-address host calls DNS client(resolver). The resolver
accesses the closest DNS server with a mapping request.
• If it has the information, it respond to DNS client otherwise resolver is referred to other
servers or other servers are asked to provide the information. After the resolver, gets the
response, it checks whether the response is correct or not. If the response is correct, the
response is passed to the process that requested it, else the name query fails.
• A resolution can be of two types – iterative and recursive.
• 1. Recursive Resolution –
Here, the client requires the Local Server to give either the requested mapping or an error message.
A DNS Query is generated by the application program to the resolver to fetch the destination IP
Address. The Query is then forwarded to the local DNS Server. If it knows the IP Address, it sends a
response to the resolver. Assuming, it does not know the IP Address, it sends the query to the root
name server.
• The root name server contains information about at least one server of Top Level Domain. The query
is then sent to the respective Top-Level Domain server. If it contains the mapping, the response is
sent back to the root server and then to the host’s local server. If it doesn’t contain the mapping, it
should contain the IP Address of the destination’s local DNS Server. The local DNS server knows the
destination host’s IP Address. The information is then sent back to the top-level domain server, then
to the root server and then to the host’s Local DNS Server, and finally to the host.
• 2. Iterative Resolution –
The main difference between iterative and recursive resolution is that here each server that does
not know the mapping sends the IP Address of the next server to the one requested it. Here, the
client allows the server to return the best answer it can give as a match or as a referral. A DNS
Query is generated by the application program to the resolver to fetch the destination IP Address.
The Query is then forwarded to the local DNS Server. Assuming, it does not know the IP Address, it
sends the query to the root name server.
• The root name server returns the IP Address of the Top-Level Domain Server to the Local Server.
The Top-Level Domain server is contacted by the Local Server and it returns either the IP of the
destination host or its local DNS Server. If it returns the server’s address, then by contacting the
destination’s Local DNS Server, we get the IP Address of the destination host. The
response/mapping is then passed from the host’s local DNS server to the resolver and then finally
to the host.
Sr.No Recursive Resolution Iterative Resolution
1 The DNS server returns the response The server sends back the address
by asking other servers. of another server which can resolve
the query.
2. The client communicates with a single The client may have to
DNS server. communicate with multiple servers.
3. Faster process. Slower Process.
4. Requires inter-server communication. Does not require inter-server
communication.
5. Servers supporting recursive This does not happen in iterative
resolution are vulnerable to attacks resolution.
like Denial of service by flooding
servers with fake requests which a
forwarded to other servers too.
CATCHING

• DNS cache refers to the temporary storage of information about previous DNS lookups
on a machine's OS or web browser.
• Keeping a local copy of a DNS lookup allows your OS or browser to quickly retrieve it and
thus a website's URL can be resolved to its corresponding IP much more efficiently.
• Advantages Of Caching
1. Caching speeds up resolution.
2. The same query need not be forwarded repeatedly.
• Disadvantages Of Caching
1. Requires additional memory.
2. If a server caches a mapping for a long time, it may send an outdated mapping to the
client.
E-MAIL

• Electronic Mail (e-mail) is one of most widely used services of Internet.


• This service allows an Internet user to send a message in formatted manner (mail) to
the other Internet user in any part of world.
• Message in mail not only contain text, but it also contains images, audio and videos data.
• The person who is sending mail is called sender and person who receives mail is
called recipient. It is just like postal mail service.
• Components of E-Mail System : The basic components of an email system are : User Agent (UA),
Message Transfer Agent (MTA), and Message Access Agent (MAA).
• 1.User Agent(UA)
• It is a program that is mainly used to send and receive an email. It is also known as an
email reader. User-Agent is used to compose, send and receive emails.
• Services provided by the User-Agent:
1.Reading the Message
2.Replying the Message
3.Composing the Message
4.Forwarding the Message.
5.Handling the Message.
• 2.Message Transfer Agent
• The actual process of transferring the email between two computers is done through the
Message Transfer Agent(MTA).
• In order to send an Email, a system must have an MTA client.
• In order to receive an email, a system must have an MTA server.
• The protocol that is mainly used to define the MTA client and MTA server on the internet
is called SMTP(Simple Mail Transfer Protocol).
• The SMTP mainly defines how the commands and responses must be sent back and forth
• 3.Message Access Agent
• While SMTP (Simple Mail Transfer Protocol) is the primary Mail Transfer
Agent (MTA) protocol used for transferring (pushing) mails between end
computers and mail servers, Mail Access Agent (MAA) protocols like
POP3/IMAP are used for retrieving (pulling) incoming mails from the
local mail servers
ARCHITECTURE OF EMAIL

• First Scenario (Sender & Receiver Connected to the same system)


• When the sender and the receiver of an E-mail are on the same system, then there is the
need for only two user agents.
• Second Scenario(Sender & Receiver Connected to the different system)
• In this scenario, the sender and receiver of an e-mail are basically users on the two
different systems. Also, the message needs to send over the Internet. In this case, we
need to make use of User Agents and Message transfer agents(MTA).
• Third Scenario ( One user is remote user)
• In this scenario, the sender is connected to the system via a point-to-point WAN it can be either a dial-up
modem or a cable modem. While the receiver is directly connected to the system like it was connected in
the second scenario.

• Also in this case sender needs a User agent(UA) in order to prepare the message. After preparing the
message the sender sends the message via a pair of MTA through LAN or WAN.
• Fourth Scenario (Both users are remote user )
• In this scenario, the receiver is also connected to his mail server with the help of WAN or LAN.
• When the message arrives the receiver needs to retrieve the message; thus there is a need for another
set of client/server agents. The recipient makes use of MAA(Message access agent) client in order to
retrieve the message.
• In this, the client sends the request to the Mail Access agent(MAA) server and then makes a request
for the transfer of messages.
• This scenario is most commonly used today.
• Format Of an Email
• An e-mail consists of three parts that are as follows :
1. Envelope
2. Header
3. Body
• 1. Envelope :
The envelope part encapsulates the message. It contains all information that is required for sending any e-
mail such as destination address, priority and security level. The envelope is used by MTAs for routing
message.
• 2. Header :
• The header consists of a series of lines. Each header field consists of a single line of ASCII text specifying field
name, colon and value. The main header fields related to message transport are :

• To: It specifies the DNS address of the primary recipient(s).


• Cc : It refers to carbon copy. It specifies address of secondary recipient(s).

• BCC: It refers to blind carbon copy. It is very similar to Cc. The only difference between Cc and Bcc is that it
allow user to send copy to the third party without primary and secondary recipient knowing about this.
• From : It specifies name of person who wrote message.
• Sender : It specifies e-mail address of person who has sent message.

• Return-Path: It is added by the message transfer agent. This part is used to specify how to
get back to the sender.

• Message Body
• The body of a message contains text that is the actual content/message that needs to be
sent, such as “Employees who are eligible for the new health care program should
contact their supervisors by next Friday if they want to switch.”
• The message body may also include signatures or automatically generated text that is
inserted by the sender’s email system.
Email Address
• An email address is the identification of an electronic mailbox.
• It has two parts, namely, a local part and the domain.
• The local part usually contains the username of the user while the domain name depends on what email
service provider you are using. The local part can contain words, numbers, or periods while the domain
name depends on what kind of service provider you are using.
MESSAGE TRANSFER AGENT: SMTP

• The email transmission is done by Message Transfer Agents.


• The email is sent by the MTA client to the MTA server.
• The protocol that defines the communication between MTA client and MTA server is called
Simple Mail Transfer Protocol (SMTP)
• Features of SMTP
i. SMTP is a Push Protocol i.e it pushes the message from the client to server.
ii. SMTP is a simple ASCII protocol i.e. all information in the email is sent in the form of ASCII
characters
iii. It uses TCP for communication at port 25.
iv. The MTA client and server establish a connection before communicating.
USE OF SMTP
SMTP COMMANDS AND RESPONSES

• To send mail, a system must contain client MTA and to receive a mail, a system must
have server MTA.
• SMTP transfers this message from client MTA to the server MTA. To send a mail, SMTP is
used two times: one between sender and sender’s mail server and the other between
the two mail servers.
TURN : Allows to switch Sender and recipient.
The first 5 commands are mandatory and must be supported by every SMTP
software.
• The response is sent back from the server to the client . It is 3 digit number which specifies
the result of the command,
• Ex. 450 means mailbox not available. 220 means service ready, 421 means service not ready.
Mail transfer phases
The process of transferring a mail messages occurs in 3 phases.
• Connection establishment
• Mail transfer
• Connection termination
• Connection establishment phase
i. The client makes a TCP connection to port 25
ii. The server sends code 220 (service ready) to tell the client that it is ready to receive mail. If
the server is not ready, it sends code 421 (service not available)
iii. The client sends the HELO message to identify itself, using its domain name address.
iv. The server responds with code 250 (request command completed).
Connection Establishment Phase
• Mail Transfer phase
i. Client sends MAIL FROM message with mail address of the sender
ii. The server responds with code 250 or some other appropriate code
iii. The client sends the RCPT TO message with mail address of the recipient
iv. The server responds with code 250 or some other appropriate code
v. The client sends the DATA message to initialize the message transfer.
vi. The server responds with code 354 (start mail input) or some other appropriate message
vii. The client sends the contents of the message in consecutive lines. Each line is terminated by a
two-character end-of-line token (carriage return(\r) and line feed(\n)).
viii. The server responds with code 250 (OK) or some other appropriate code
Mail Transfer Phase
• Connection Termination Phase
• i. The client sends the QUIT command.
• ii. The server respond with code 221 or some other appropriate code.
MIME (MULTIPURPOSE INTERNET MAIL EXTENSIONS )

• The mail transfer protocol i.e. SMTP (Simple Mail Transfer Protocol) allows only ASCII
characters to be included in the mail. It does not support characters from other
languages and scripts, images, audio, video etc.
• Multipurpose Internet Mail Extensions Protocol is a supplementary protocol used with
SMTP in order to allow non-ASCII data like images etc to be sent in the email .
• MIME transforms non ASCII data at the sender to ASCII data and delivers it to the client
MTA. The message at the receiving site is transformed back to the original data.
• MIME Header

• MIME specifies 5 headers which can be added to the original email headers. These are:

i. MIME-Version: It specifies the protocol version. Current version is 1.0.

ii. Content-Type: Specifies the type of data. Supported types are: text(plain/HTML), image,
audio, video, multipart, message, application.
iii. Content-Transfer-Encoding: This header defines the method used to encode the
messages into 0s and Is for transport. The five types of encoding methods are 7-bit, 8-bit,
Binary, Base64, and Quoted-printable.
iv. Content-ID: Uniquely identifies the whole message in a multiple message environment.

v. Content-Description: This header defines whether the body is image, audio, or video
MESSAGE ACCESS AGENT (POP & IMAP)

• SMTP is a push protocol and it only sends the email from the MTA client to the senders
MTA server (stage 1) and from the senders MTA server to the receivers MTA server .To
retrieve messages from the mail server, the receiver uses a MAA.
• It uses a pull protocol which pulls messages from the server. Currently, the two most
widely used Message Access Protocols are Post Office Protocol, version 3 (POP3) and
Internet Mail Access Protocol, version 4 (IMAP4).
• POP3
• Post Office Protocol, version 3 (POP 3) is a simple protocol with limited functionality.
• The server POP3 software is installed on mail server and the client POP3 software is
installed on client computer. Ex. Microsoft's Outlook
• To download an email from the mail server, the following steps are performed
i. The client opens a connection to the server on TCP port 110
ii. It then sends its user name and password to access the mailbox.
iii. The server responds with an OK after verification.
iv. The user requests for a list of emails.
v. The server responds with the list of emails.
vi. The client retrieves the email messages one by one.
Advantages of POP3

• Offline Access: Emails downloaded via POP3 can be accessed offline, making it convenient for
users in areas with limited or intermittent internet connectivity.
• Simple Setup: Setting up a POP3 email account is straightforward, requiring minimal
configuration, which is ideal for users who prefer simplicity.
• Efficient Data Usage: POP3 downloads only new emails, reducing data usage compared to
other protocols that synchronize entire mailboxes.
• Local Control: Once downloaded, emails are managed locally on the client device, giving users
control over storage and organization without relying heavily on server resources.
• Cross-Platform Compatibility: POP3 is supported by most email clients and is compatible
across different operating systems and devices, ensuring widespread usability.
Disadvantages of POP3 protocol

1. If the emails are downloaded from the server, then all the mails are deleted from the server
by default. So, mails cannot be accessed from other machines unless they are configured to
leave a copy of the mail on the server.

2. Transferring the mail folder from the local machine to another machine can be difficult.

3. Since all the attachments are stored on your local machine, there is a high risk of a virus
attack if the virus scanner does not scan them. The virus attack can harm the computer.
4. The email folder which is downloaded from the mail server can also become corrupted.

5. The mails are stored on the local machine, so anyone who sits on your machine can access
the email folder.
IMAP4
• IMAP4 Internet Mail Access Protocol (IMAP) version 4 is more powerful and complex than
POP3.
• The features of IMAP makes it popular among the mail users.
• It uses TCP port no 143.
IMAP features:
i. User can check the e-mail header before downloading.
ii. User can partially download the emails.
iii. User can create, delete or rename mailboxes on the mail server.
iv. User can arrange mailboxes according to the hierarchy.
v. User can set up filters and examine text before downloading. This helps some ISPs to sort
mails as either important or spam (junk e-mail) and store these messages in corresponding
mailboxes.
• Advantages of IMAP4
I. Provides additional features to the user to perform a variety of operations on the mailbox.
II. Emails are on the server all the time, so they can be accessed anytime and from any place
III. More flexibility.
Disadvantages of IMAP4
I. Accessing emails requires an active internet connection.
II. Requires a larger mailbox size as compared to POP3.
III. IMAP is also a complicated protocol, and needs to be setup
POP3 IMAP4
Simple protocol that only allows downloading Advanced and more powerful protocol.
messages from the mailbox to the computer.
Uses port 110 Uses port 143...
All emails must be downloaded for reading All emails need not be downloaded
Once emails are downloaded, they can be accessed Active internet connection is required to access
without internet connection the Emails on the server.
Emails can be accessed only from a single device at Emails can be accessed from multiple devices at a
a time time.
Users cannot organize the emails in the mailbox Provides a facility to organize emails in the mailbox
The user cannot search, create, delete or rename The user can search, create, delete or rename
email on the mail server. email on the mail server
It works in two modes delete mode and. Keep Emails are always kept in the mailbox and also
mode other servers Deleted emails can be retrieved
Since emails are downloaded, the mailbox size can The size of the mailbox must be sufficiently large to
be smaller hold all emails.
Easy to setup and use Complicated to setup and use.
Speed is fast. Speed is slow.
• When users create an email account or set up an email client, they typically choose
between POP3 (Post Office Protocol version 3) and IMAP (Internet Message Access
Protocol) based on their specific needs and preferences.
• POP3 remains relevant in scenarios where users prioritize local email management,
offline access, and email backup.
• Microsoft Outlook, Mozilla Thunderbird, Apple Mail, and others, support POP3 for
downloading emails from email servers to the user's computer or mobile device
4. FILE TRANSFER PROTOCOL

• Transferring files from one computer to another is one of the most common tasks
expected from a networking or internetworking environment.
• The greatest volume of data exchange in the Internet today is due to file transfer.
Although transferring files from one computer to another seems simple and
straightforward, some issues need to be addressed:
• i. The two systems may use different file name conventions
• ii. The two systems may have different directory structures.
• iii. The two systems may have different ways to represent data.
• All of these problems have been solved by FTP.
• The HTTP protocol can be used to transfer files from a server to a client. However, FTP
is a better choice to transfer large files or to transfer files using different formats.
• File Transfer Protocol (FTP) is a standard network protocol used to copy a file from one
host to another over the Internet. In FTP, file transfer means one of three things:
• retrieving a file (server to client),
• storing a file (client to server), and
• directory listing (server to client).
• Features
I. It is used for copying a file from one host to another in a TCP/IP network.
II. FTP is built on the client-server architecture.
III. FTP uses the services of TCP.
IV. It needs two TCP connections: The well-known port 21 is used for the control
connection and the well-known port 20 for the data connection.
• FTP Connections
• FTP uses two types of connections:
Control Connection:
• The control connection is established between the client and the server to manage the
file transfer session.
• It handles commands and responses between the client and server, such as logging in,
changing directories, and initiating file transfers.
• This connection remains open during the entire FTP session.
Data Connection:
• The data connection is used to transfer the actual files or directory listings between the
client and the server.
FTP Model
• The FTP client has three components:
i. User interface
ii. Client control process
iii. Client data transfer process
• The FTP server has two components:
i. Server control processes
ii. Server data transfer processes
4.1 COMMUNICATION OVER CONTROL
CONNECTION
• The control connection is used for sending session commands between client and server. It
remains open for the entire duration of the session.
• FTP uses ASCII based commands over the control connection.
• The control connection uses very simple rules of communication.
i. The communication is request-response based.
ii. We need to transfer only a line of command or a line of response at a time.
iii. One command is sent by the client at a time and then it waits for a response before
sending the next command.
iv. The commands and responses are very small and terminated by an end-of-line token
consisting of two characters - Carriage return and line feed.
V. Commands sent from the FTP client control process, are in the form of ASCII uppercase,
which may or may not be followed by an argument. Ex.
• ABOR: Abort an active file transfer.
• CWD: Change working directory.
• DELE: Delete file.
• NLST: Returns a list of file names in a specified directory.
vi. Every FTP command generates at least one response.
vii. A response has two parts: a three-digit number followed by text. The numeric part
defines the code; the text part defines needed parameters or further explanations.
For example: 125: Data connection open, 150: File status OK etc.
4.2 COMMUNICATION OVER DATA CONNECTION

• The purpose of the data connection is the actual file transfer.


• As compared to the control connection, the data connection needs more complex rules due to the
variety of data types transferred.
• The data transfer is controlled by the control connection.
• Before sending the file through the data connection, we prepare for transmission through the control
connection.
• The client solves the heterogeneity problem by defining three important things:
i The file type
ii. Structure of data
iii. Transmission mode
i. File type: FTP can transfer ASCII, EBCDIC file or an image file. The default type is ASCII. The
image format is used for transferring binary files.
ii. Data structure: In addition to different representation types, FTP allows the structure of a file to
be specified. Three file structures are defined in FTP:
a. File-structure: Where there is no internal structure and the file is considered to be a
continuous sequence of data bytes.
b. Record-structure: Where the file is made up of sequential records.
c. Page-structure: where the file is made up of independent indexed pages.

iii. Transmission mode: Data transfer can be done in any of three modes:
a. Stream mode: Data is sent as a continuous stream
b. Block mode: FTP breaks the data into several blocks and then passes it on to TCP.
c. Compressed mode: Data is compressed and then sent.
4.3 ANONYMOUS FTP

• FTP was designed for account-based access to files on a server. This means, a user needs to
have an account on a remote system for navigating the directories, hierarchy and retrieving
files after authentication.
• Anonymous FTP extends this idea by allowing users without accounts to use FTP for
retrieving "public" data.
• To do this, a user connects to FTP server using anonymous as a user-id and sending an
identifying string, typically an email address, as password. Once connected in this manner, the
user can examine the server's file repository and download files using FTP's standard
capabilities.
• Anonymous FTP servers typically implement various security measures to prevent
anonymous users from accessing any thing but an area designated for public information.
Thank You..

You might also like