0% found this document useful (0 votes)
30 views33 pages

Unit 1 Application Layer

The document covers the application layer of networking, focusing on the Domain Name System (DNS), electronic mail architecture, and file transfer protocols. It explains how DNS translates domain names into IP addresses, the structure and hierarchy of domain names, and the processes involved in name resolution. Additionally, it details the components of electronic mail systems and their respective roles in sending and receiving messages.

Uploaded by

chamangoti01
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)
30 views33 pages

Unit 1 Application Layer

The document covers the application layer of networking, focusing on the Domain Name System (DNS), electronic mail architecture, and file transfer protocols. It explains how DNS translates domain names into IP addresses, the structure and hierarchy of domain names, and the processes involved in name resolution. Additionally, it details the components of electronic mail systems and their respective roles in sending and receiving messages.

Uploaded by

chamangoti01
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/ 33

Unit 1

Application layer
Contents :
 Domain name system
 Name space-flat name space, hierarchical name space
 Domain name space -label ,domain name, fqdn, pqdn
 Distribution of domain name space-hierarchy of name servers, zone, root
server, primary and secondary servers.
 DNS in the internet: generic domains, country domains, inverse domain
 Resolution-resolver, mapping names to address, mapping addresses to
names, recursive resolution, iterative resolution, caching

 Electronic mail-
 Architecture-first scenario, second scenario, third scenario, fourth
scenario
 User agent-services of user agent, types of ua format of e-mail
 Mime-mime header
 Message transfer agent-smtp
 Message access agent: pop and imap

 File transfer
 Ftp-communication over data control connection, file type, data structure,
transmission mode, anonymous ftp
 Domain name system

The domain name system (DNS) is like the internet’s phone book. It helps you
find websites by translating easy-to-remember names (like www.example.com)
into the numerical IP addresses (like 192.0.2.1) that computers use to locate each
other on the internet. Without DNS, you would have to remember long strings of
numbers to visit your favorite websites.

Domain name system (DNS) is a hostname used for IP address translation


services. DNS is a distributed database implemented in a hierarchy of name
servers. It is an application layer protocol for message exchange between clients
and servers. It is required for the functioning of the internet.

Types of domain
there are various kinds of domains:
 Generic domains: .com(commercial), .edu(educational), .mil(military),
.org(nonprofit organization), .net(similar to commercial) all these are generic
domains.
 Country domain: .in (india) .us .uk
 Inverse domain: if we want to know what is the domain name of the website.
IP to domain name mapping. So DNS can provide both the mapping

Namespace: set of possible names, flat or hierarchical. The naming system


maintains a collection of bindings of names to values – given a name, a
resolution mechanism returns the corresponding value.

Domain name system

The domain name system (DNS) works on client server model. It uses udp protocol
for transport layer communication. DNS uses hierarchical domain based naming
scheme. The DNS server is configured with fully qualified domain names (fqdn)
and email addresses mapped with their respective internet protocol addresses.
o DNS stands for domain name system.
o DNS is a directory service that provides a mapping between the name of a
host on the network and its numerical address.
o DNS is required for the functioning of the internet.
o Each node in a tree has a domain name, and a full domain name is a
sequence of symbols specified by dots.
o DNS is a service that translates the domain name into IP addresses. This
allows the users of networks to utilize user-friendly names when looking for
other hosts instead of remembering the IP addresses.
o For example, suppose the ftp site at edusoft had an IP address of
132.147.165.50, most people would reach this site by specifying
ftp.edusoft.com. Therefore, the domain name is more reliable than IP
address.

 Name space-flat name space, hierarchical name space


1. Name space : A namespace is a set of symbols used to identify and
differentiate objects within a system. Namespaces ensure that each name
within the system is unique, preventing naming conflicts.

2. Flat namespace : In a flat namespace, every name is unique and is not


organized in any structured way. It is like a simple list where each name must
be different from all others. Flat namespaces are straightforward but can
become difficult to manage as the number of names grows because it
becomes harder to ensure uniqueness and to organize or search through the
names.

Example: mac addresses in networking are a form of a flat namespace. Each


device's network interface card (nic) is assigned a unique mac address.

3. Hierarchical namespace : A hierarchical namespace is organized in a tree-


like structure, where names are arranged in a hierarchy. This makes it easier
to manage, search, and maintain the namespace, especially as it grows
larger. Each level in the hierarchy can have a unique identifier, and names
can be composed of multIPle levels. Example: www.example.com
Key differences:

Points Flat namespace Hierarchical namesapce


Structure No structure; just a list of Tree-like structure
unique names with different
levels.
Scalability: Less scalable; harder to More scalable; easier to
manage as it grows. manage and navigate.
Managem Simple to implement More complex to
ent implement but easier to
organize and use.

Distribution of domain name space

DNS is a hierarchical and distributed system used to translate human-


readable domain names into IP addresses.

The domain name space is a hierarchical structure consisting of various


levels, with each level representing a part of the domain name. The hierarchy
is as follows:

 Hierarchy of name servers

Name servers are responsible for resolving domain names to IP addresses.


They are organized hierarchically as follows:

1. Root servers: the highest level in the DNS hierarchy. They contain
information about the tlds and delegate requests to the appropriate tld
name servers. There are 13 sets of root servers, named a through m,
distributed globally.

Represented by a single dot ("."). This is the top of the hierarchy

2. Top-level domain (tld) servers: these servers are responsible for the top-
level domains. They maintain information about the second-level domains
within their tld. For instance, the .com tld servers manage domains like
example.com, google.com, etc. Directly below the root. Examples include
.com, .org, .net, country codes like .uk, .jp, and others.

3. Second-level domains: directly below the tlds. For example, in


example.com, "example" is the second-level domain.

4. Subdomains: below the second-level domains.

for example, in www.example.com, "www" is a subdomain.

5. Authoritative name servers: these servers are responsible for specific


domains and provide answers to queries about those domains. They can be
further divided into:

6. Primary (master) servers: these contain the original read-write copy of all
the domain's DNS records. This server holds the original copy of the zone file
and is the authoritative source for the DNS records in that zone. It allows
updates and modifications to the zone file.

7. Secondary (slave) servers: these contain read-only copies of the domain's


DNS records, replicated from the primary server. They provide redundancy
and load balancing. This server holds a copy of the zone file, obtained from the
primary server. It provides redundancy and helps distribute the load of DNS
queries. Secondary servers query the primary server at regular intervals to
ensure they have the latest zone data

 Zones

A zone is a part of the domain name space that is managed by a particular


authoritative name server. Zones can contain multIPle domains or
subdomains.

Zone files: these files contain the mappings of domain names to IP addresses
and other DNS records. Each zone has a primary server where the original
zone file is stored and one or more secondary servers where copies of the
zone file are stored.
 Root servers

Root servers form the foundation of the DNS hierarchy. They handle queries
for records in the root zone and refer requests to the appropriate tld servers.
They are critical for the operation of the internet.

 DNS in internet

DNS is a tcp/IP protocol used on different platforms. The domain name space is
divided into three different sections: generic domains, country domains, and
inverse domain.

Generic domains

o It defines the registered hosts according to their generic behavior.


o Each node in a tree defines the domain name, which is an index to the DNS
database.
o It uses three-character labels, and these labels describe the organization
type.
o

Label DescrIPtion

Aero Airlines and aerospace companies

Biz Businesses or firms

Com Commercial organizations

Coop Cooperative business organizations


Edu Educational institutions

Gov Government institutions

Info Information service providers

Int International organizations

Mil Military groups

Museum Museum & other nonprofit organizations

Name Personal names

Net Network support centers

Org Nonprofit organizations

Pro Professional individual organizations


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) in place of three
character organizational abbreviations.

Inverse domain

The inverse domain is used for mapping an address to a name. When the server
has received a request from the client, and the server contains the files of only
authorized clients. To determine whether the client is on the authorized list or not,
it sends a query to the DNS server and ask for mapping an address to the name.

Working of DNS

o DNS is a client/server network communication protocol. DNS clients send


requests to the. Server while DNS servers send responses to the client.
o Client requests contain a name which is converted into an IP address known
as a forward DNS lookups while requests containing an IP address which is
converted into a name known as reverse DNS lookups.
o DNS implements a distributed database to store the name of all the hosts
available on the internet.
o If a client like a web browser sends a request containing a hostname, then a
piece of software such as DNS resolver sends a request to the DNS server to
obtain the IP address of a hostname. If DNS server does not contain the IP
address associated with a hostname, then it forwards the request to another
DNS server. If IP address has arrived at the resolver, which in turn completes
the request over the internet protocol.

Resolver
Mapping a domain name to an IP address is known as name-address resolution.
 DNS is designed as a client -server application.
 A host that needs to map an address to a name or a name to an address calls a
DNS client called a resolver.
 The resolver accesses the closest DNS server with a mapping request.
 If the server has the information it satisfies the resolver ;otherwise, it either
refers the resolver to other servers or asks other servers to provide the
information.
 After the resolver receives the mapping, it interprets the response to see if it is
a real resolution or an error, and finally delivers the result to the process that
requested it.

DNS resolution involves translating between human-readable domain names and


machine-readable IP addresses. Here’s a detailed explanation of the various
concepts.
Mapping Names To Addresses
This process involves converting a domain name (like www.example.com) into its
corresponding IP address (like 93.184.216.34). This is typically done using the DNS
system.
1. user request: when a user types a domain name in their web browser.
2. DNS query: the request is sent to a DNS resolver.
3. DNS response: the resolver returns the IP address associated with the domain
name.
Example :
- user types www.example.com.
- resolver queries the DNS hierarchy (root, tld, authoritative servers).
- resolver returns 93.184.216.34.
Mapping Addresses To Names
This process, known as reverse DNS lookup, involves finding the domain name
associated with an IP address.
1. IP request: when an application needs to resolve an IP address back to a domain
name.
2. ptr record query: the request queries DNS servers for ptr (pointer) records.
3. DNS response: the resolver returns the domain name associated with the IP
address.
Example :
- application needs to resolve 93.184.216.34.
- resolver queries DNS servers for ptr records.
- resolver returns www.example.com.
Recursive Resolution
In recursive resolution, a DNS resolver takes full responsibility for resolving a
domain name query on behalf of the client, contacting multIPle DNS servers if
necessary.
1. client request: the client sends a DNS query to the recursive resolver.
2. recursive queries: the recursive resolver queries other DNS servers (root, tld,
and authoritative servers) until it finds the answer.
3. response: the recursive resolver returns the final IP address to the client.
Iterative Resolution
In iterative resolution, the DNS resolver performs part of the query and then
directs the client to the next DNS server to query.
1. client request: the client sends a DNS query to a DNS resolver.
2. iterative queries: the DNS resolver returns the address of the next DNS server
the client should query.
3. client continues: the client queries the next DNS server, repeating the process
until the final IP address is found.
Caching
Caching is the process of storing DNS query results temporarily to reduce the load
on DNS servers and speed up subsequent queries.
1. Storing responses: when a DNS resolver gets a response, it stores the result in its
cache for a certain duration (ttl - time to live).
2. Cache hits: for future queries for the same domain, the resolver can return the
cached result without contacting other DNS servers.
3. Cache expiry: once the ttl expires, the cached entry is removed, and the resolver
must query the DNS servers again for the fresh data.
4. Example:
- resolver stores the result www.example.com -> 93.184.216.34 for TTL duration.
- subsequent queries for www.example.com are answered from the cache.
- after TTL expires, the resolver must perform the DNS queries again.
These processes ensure efficient and reliable domain name resolution, allowing
users to access websites and services using easily memorable names rather than
numeric IP addresses.

Property Iterative resolution Recursive resolution

Server Returns the requested mapping


Returns the best match or a referral
response or an error message

Each server that does not know the


Query Only the local server sends the
mapping sends the IP address of the
propagation query to the next server
next server

Higher load on servers since each Lower load on servers since only
Server load
server in the chain must be queried the local server is queried

Response Longer response time since multiple Shorter response time since only
time servers may need to be queried one or a few servers are queried

Lower cache hit rate since referrals Higher cache hit rate since
Cache usage
are returned instead of mappings mappings are returned directly

Lower security since each server in Higher security since only the
Security the chain may potentially modify the local server is trusted to return a
response valid response
1. Electronic mail
Electronic mail allows a message to include text, audio, and video.
It also allows one message to be sent to one or more recipients. E-
mail system has three main components:
1. User agent,
2. Message transfer agent
3. Message access agent

Email architecture :
First scenario :

When the sender and the receiver of an e-mail are on the same
system, we need only two user agents
Second scenario :

When the sender and the receiver of an e-mail are on different


systems, we need two uas and a pair of mtas (client and server).
Third scenario:

When the sender/ receiver is connected to the mail server via a


LAN or a WAN , we need two UAs and two pairs of MTAs (client and
server).
Fourth scenario :

When both sender and receiver are connected to the mail server via
LAN or WAN, we need two UA, two pairs of MTA and a pair of MAA.
User agent
• The first component of an electronic mail system is the user agent(UA).
• It provides service to the user to make the process of sending and
receiving a message easier.

1. Composing Messages:
 A user agent helps the user to compose (create) an e-mail. User
agent provides a template on the screen,which helps the user.
 Some even have built in editor that can do spell checking, grammar
checking, cut, copy, paste etc. text formatting functions.

2. Reading Messages:
 Next function of user agent is to read incoming messages. User agent
first checks the mail in the incoming mail box. User agent shows a
one line summary of every received mail.
 Every e-mail contains number field, flag showing status of e-mail like
new, read, replied etc., size of message, the sender and the optional
subject field.
3. Replying to Messages:
 After reading a message, user sent reply by using user agent.
 The user agent allows the user to reply to the original sender or to
reply all recipients of the messages.
4. Forwarding Messages:
 User agent allows the receiver to forward the message, with or
without extra comments, to a third party.
5. Handling Mail Boxes:
 A user agent creates two mail boxes i.e., inbox and outbox.
 Inbox keeps all the received e-mails until they are deleted by the
user. The outbox keeps all the sent e-mails until the user deletes
them.
Types of User Agent:
1. Command Driven:
 Command driven user agents belong to the early days of e-mail.
 A command driven user agent normally accepts one character from
the keyboard to perform its task, e.g. mail, pine and elm.
2. GUI Based:
 Modern user agents are GUI-based, which contains graphical user
interface that allow the user to use keyboard and mouse, e.g.
Outlook, Netscape, Eudor(a)
Sending Mail:
 To send mail, user creates a mail. E-mail has an envelope and a
message as shown in Fig. 1.22.

27/11/2015

Fig. 1.22: Format of E-mail


 The fields in email message are explained below:
Envelope:
 The envelope contains sender and receiver addresses.
Message:
 Message contains header and body. In header, sender, receiver,
date, subject of e-mail are defined. Body part contains actual
information to be read by the recipient.
Receiving Mail:
 If user has a mail, UA informs the user. A list is displayed to the
user in which summary of e-mail is mentioned.
 The user can selects any of the messages and display its contents on
the screen.
Addresses:
 To deliver a mail, a mail handling system must use an addressing
system with unique addresses.
 E-mail address contains two parts, local port and a domain name,
separated by @ sign (Refer Fig. 1.23).
 Local port defines the name of user mail box.

1.23: E-mail Address Fig. 1.24

MIME
 E-mail system has one limitation, it can send messages only in NVT 7-

bit ASCII. It cannot be used for languages like German, Russian,


Chinese, Japanese and Hebrew. Also it cannot be used to send
binary files or video or audio data.
 The Multipurpose Internet Mail Extensions (MIME) is a protocol that

allows non-ASCII data to be sent through e-mail.


 MIME transforms non-ASCII data at sender site to NVT (Network
Virtual Terminal) ASCII and delivers them to the client MTA to be
sent through the Internet. The message at the receiving site is
transformed back to the original data
 Suppose a user (Amar) wants to send an email through user agent
and it is in a non- ASCII format so there is a MIME protocol which
converts it into 7-bit NVT ASCII format

 Message is transferred through e-mail system to the


other side in 7-bit format now MIME protocol again converts it back
into non-ASCII code and now the user agent of receiver side reads it
and then information is finally read by the receiver (Bhushan).
 MIME header is basically inserted at the beginning of any e-mail
transfer. MIME defines five headers namely,

Fig. 1.26: MIME Headers

 MIME headers in Fig. 1.26 are explained below:


1. MIME-Version header defines version of MIME protocol. It must
have the parameter value 1.1, which indicates that message is
formatted using MIME.
2. Content-Type header defines type of data used in the body of
message. They are of different types like text data (plain, HTML),
image, audio content or video content.
3. Content-Type-Encoding header defines the method used for
encoding the message into 0s and 1s for transport like 7-bit
encoding, 8-bit encoding, Base64 etc.
4. Content-Id header is used for uniquely identifying the whole
message in a multiple message environment.
5. Content-Description header defines whether the body is
actually image, video or audio.

** Working of MIME
Features of mime protocol
1. It supports multIPle attachments in a single e-mail.
2. It supports the non-ascii characters.
3. It supports unlimited e-mail length.
4. It supports multiple languages.
Advantage of the mime

The mime protocol has the following advantages:

1. It is capable of sending various types of files in a message, such as text,


audio, video files.
2. It also provides the facility to send and receive emails in different languages
like hindi, french, japanese, chinese etc.
3. It also provides the facility of connecting html and css to email, due to which
people can design email as per their requirement and make it attractive and
beautiful.
4. It is capable of sending the information contained in an email regardless of
its length.
5. It assigns a unique id to all e-mails.

Message Transfer Agent: SMTP


 The mail transfer is done by Message Transfer Agents (MTA). To send
mail, a system must have client MTA and to receive mail, a system
must have server MTA.
 The protocol that defines the communication between MTA client
and MTA server is called Simple Mail Transfer Protocol (SMTP).
 SMTP is a TCP/IP protocol that specifies how computers exchange
electronic mail. SMTP is used twice, between the sender and the
sender’s mail server and between the two mail servers.
 Another protocol i.e. POP3 or IMAP4 is needed between the mail
server and the receiver. POP3/
SMTP SMTP
IMAP4

LAN LAN

or or
WAN WAN

Internet
Mail server Mail server
Commands and Responses:
 SMTP uses commands and response to transfer messages between
MTA client and MTA server.

 Commands are sent by client to server. Command consists of a


keyword followed by zero or more arguments. SMTP uses 14
commands.
 Responses are sent from server to client. A
response is a three digit code.
Keyword Argument (s)
HELO Sender’s host
MAIL name Sender of
FROM the message
RCPT Intended recipient of
TO message Body of the
DATA mail
QUIT
RSET
Name of recipient to be
VRFY verified
NOOP
TURN
EXPN Mailing list to be
HELP expanded Command
SEND name
FROM Intended recipient of the
SMOL message
FROM Intended recipient of the
SMAL message Intended
FROM recipient of the message
Table 1.3: SMTP Responses
Code Descripti
on
Positive Completion Reply
211 System status or help reply
214 Help message
220 Service ready
221 Service closing transmission channel
250 Request command completed
251 User not local, the message will be forwarded
Positive Intermediate Reply
354 Start mail input

Transient Negative Completion


Reply
421 Service is not available
450 Mail box not available
451 Command aborted: local error
452 Command aborted: insufficient storage

Permanent Negative
Completion Reply
500 Syntax error, unrecognized command
501 Syntax error in parameters or arguments
502 Command not implemented
503 Bad sequence of commands
504 Command temporarily not implemented
550 Command is not executed, mail box unavailable
551 User not local
552 Requested action aborted, exceeded storage location
553 Requested action not taken, mail box name not
allowed
554 Transaction failed.
Advantages of smtp
 If necessary, the users can have a dedicated server.
 It allows for bulk mailing.
 Low cost and wide coverage area.
 Offer choices for email tracking.
 Reliable and prompt email delivery.

Disadvantages of smtp
 Smtp’s common port can be blocked by several firewalls.
 Smtp security is a bigger problem.
 Its simplicity restricts how useful it can be.
 Just 7-bit ASCII characters can be used.
 If a message is longer than a certain length, SMTP servers may reject the entire
message.
 Delivering your message will typically involve additional back-and-forth
processing between servers, which will delay sending and raise the likelihood
that it won’t be sent.
1. IMAP4:
 IMAP stands for Internet Mail Access Protocol. It was first proposed
in 1986. The current version is Internet Mail Access Protocol, version
4 (IMAP4).
 Another mail access protocol is IMAP4 is similar to POP3 but is
more powerful and more complex.
 POP3 not allows the user to organize mail on the server, the user
cannot have different folders on the server.
 POP3 also does not allow the user to partially check the content of
mail before downloading. All these drawbacks are overcome in
IMAP4.
 IMAP4 provides following functions:
(i) User can check e-mail header before downloading.
(ii) User can search the contents of the e-mail for a specific string of
characters before downloading.
(iii) User can partially download e-mail.
(iv) A user can create, delete or rename mailboxes on the mail server.
(v) User can create a hierarchy of mailboxes in a folder for storage.

Post office protocol (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.
The exchange of commands and responses in 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. 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.
 In the keep mode, the mail remains in the mailbox after retrieval.
The keep mode is normally used when the user accesses her mail
away from her primary computer. The mail is read but kept in the
system for later retrieval and organizing. (e.g a laptop).
Limitations of pop3
1. It does not allow the user to organize her mail on the server
2. the user can not have different folders on the server. 3. Pop3
does not allow the user to partially check the contents of the mail
before downloading.

Difference between smtp and extended smtp


Smtp Extended smtp

Users were not verified in smtp In extended smtp, authentication


as a result of massive-scale scam of the sender is
emails being sent. done.

We cannot attach a multimedia


We can directly attach
file in smtp directly without the
multimedia file in esmtp.
help of mmie.

We cannot reduce the size of the We can reduce the size of the
email in smtp. email in extended smtp.

The main identification feature


Smtp clients open transmission for esmtp clients is to open a
with the command helo. transmission with the command
ehlo (extended hello).
Smtp vs pop vs imap
Smtp Pop Imap

Stands for simple mail transfer Stands for post office Stands for internet
protocol protocol. message access protocol.

Used for retrieving


Used for sending mail. Used for retrieving mail.
mail.

It is push protocol. It is pull protocol. It is pull protocol.

It work between sender’s mail server It work between


It works between receiver
to receiver’s mail server and sender receiver and receiver’s
and receiver’s mail server.
and sender’s mail server. mail server.

It download all the It store all mail on server


It does not store mail on server it just
mail when it and download when it get
send the mail.
connected to internet. request to download.

Works on tcp port Works on tcp port number


Works on tcp port number 25.
number 110. 143.

Connection oriented Connection oriented


Connection oriented protocol.
protocol. protocol.

It has persistence tcp It has persistence tcp


It has persistence tcp connection.
connection. connection.

stateless protocol. Stateful protocol. Stateful protocol.

It is in band protocol. It is in band protocol. It is in band protocol.

Not used at receiver side. Used at receiver side. Used at receiver side.
FTP
o Ftp stands for file transfer protocol.
o Ftp is a standard internet protocol provided by tcp/IP used for transmitting
the files from one host to another.
o It is mainly used for transferring the web page files from their creator to the
computer that acts as a server for other computers on the internet.
o It is also used for downloading the files to computer from other servers.

Objectives of FTP

o It provides the sharing of files.


o It is used to encourage the use of remote computers.
o It transfers the data more reliably and efficiently.

Why FTP? Although transferring files from one system to another is very simple
and straightforward, but sometimes it can cause problems. For example, two
systems may have different file conventions. Two systems may have different ways
to represent text and data. Two systems may have different directory structures.
Ftp protocol overcomes these problems by establishing two connections between
hosts. One connection is used for data transfer, and another connection is used for
the control connection.

Mechanism of FTP
The above figure shows the basic model of the ftp. The ftp client has three
components: the user interface, control process, and data transfer process. The
server has two components: the server control process and the server data
transfer process.

There are two types of connections in ftp:

o Control connection: the control connection uses very simple rules for
communication. Through control connection, we can transfer a line of
command or line of response at a time. The control connection is made
between the control processes. The control connection remains connected
during the entire interactive ftp session.
o Data connection: the data connection uses very complex rules as data types
may vary. The data connection is made between data transfer processes. The
data connection opens when a command comes for transferring the files and
closes when the file is transferred.

FTP clients

o Ftp client is a program that implements a file transfer protocol which allows
you to transfer files between two hosts on the internet.
o It allows a user to connect to a remote host and upload or download the
files.
o It has a set of commands that we can use to connect to a host, transfer the
files between you and your host and close the connection.
o The ftp program is also available as a built-in component in a web browser.
This gui based ftp client makes the file transfer very easy and also does not
require to remember the ftp commands.
Advantages of FTP:
o Speed: one of the biggest advantages of ftp is speed. The ftp is one of the
fastest way to transfer the files from one computer to another computer.
o Efficient: it is more efficient as we do not need to complete all the operations
to get the entire file.
o Security: to access the ftp server, we need to login with the username and
password. Therefore, we can say that ftp is more secure.
o Back & forth movement: ftp allows us to transfer the files back and forth.
Suppose you are a manager of the company, you send some information to
all the employees, and they all send information back on the same server.

Disadvantages of FTP:
o The standard requirement of the industry is that all the ftp transmissions
should be encrypted. However, not all the ftp providers are equal and not all
the providers offer encryption. So, we will have to look out for the ftp
providers that provides encryption.
o Ftp serves two operations, i.e., to send and receive large files on a network.
However, the size limit of the file is 2gb that can be sent. It also doesn't allow
you to run simultaneous transfers to multIPle receivers.
o Passwords and file contents are sent in clear text that allows unwanted
eavesdropping. So, it is quite possible that attackers can carry out the brute
force attack by trying to guess the ftp password.
o It is not compatible with every system.

Transmission mode :
Ftp transfer files using any of the following modes:
 Stream mode: it is the default mode. In stream mode, the data is transferred
from ftp to tcp in stream bytes. Here tcp is the cause for fragmenting data into
small segments. The connection is automatically closed if the transforming
data is in the stream bytes. Otherwise, the sender will close the connection.
 Block mode: in block mode, the data is transferred from ftp to tcp in the form
of blocks, and each block followed by a 3-byte header. The first byte of the
block contains the information about the block so it is known as the
description block and the other two bytes contain the size of the block.
 Compressed mode: this mode is used to transfer big files. As we know that,
due to the size limit we can not transfer big files on the internet, so the
compressed mode is used to decrease the size of the file into small and send it
on the internet.
Ftp commands
Sr. No. Command Meaning

1. cd Changes the working directory on the remote host

2. close Closes the ftp connection

3. quit Quits ftp

4. pwd Displays the current working directory on the remote host

5. dir or ls Provides a directory listing of the current working directory

6. help Displays a list of all client ftp commands

7. Remotehelp Displays a list of all server ftp commands

8. type Allows the user to specify the file type

9. struct Specifies the files structure

Applications of FTP
The following are the applications of ftp:
 Ftp connection is used by different big business organizations for transferring
files in between them, like sharing files to other employees working at
different locations or different branches of the organization.
 Ftp connection is used by it companies to provide backup files at disaster
recovery sites.
 Financial services use ftp connections to securely transfer financial documents
to the respective company, organization, or government.
 Employees use ftp connections to share any data with their co-workers.
Advantages
 MultIPle transfers: ftp helps to transfer multIPle large files in between the
systems.
 Efficiency: ftp helps to organize files in an efficient manner and transfer them
efficiently over the network.
 Security: ftp provides access to any user only through user id and password.
Moreover, the server can create multIPle levels of access.
 Continuous transfer: if the transfer of the file is interrupted by any means,
then the user can resume the file transfer whenever the connection is
established.
 Simple: ftp is very simple to implement and use, thus it is a widely used
connection.
 Speed: it is the fastest way to transfer files from one computer to another.

Disadvantages
 Less security: ftp does not provide an encryption facility when transferring
files. Moreover, the username and passwords are in plain text and not a
combination of symbols, digits, and alphabets, which makes it easier to be
attacked by hackers.
 Old technology: ftp is one of the oldest protocols and thus it uses multIPle
TCP/IP connections to transfer files. These connections are hindered by
firewalls.
 Virus: the ftp connection is difficult to be scanned for viruses, which again
increases the risk of vulnerability.
 Limited: the ftp provides very limited user permission and mobile device
access.
 Memory and programming: ftp requires more memory and programming
efforts, as it is very difficult to find errors without the commands.
 Communication over data control connection

Data connection

The data connection facilitates the well-known port 20 at the server site. The
following steps display how ftp creates a data connection.

 The user, not the server, issues a passive open using an ephemeral port.
 The client assigns this port number to the server using the port command.
 The server receives the port number and issues an active open using the
wellknown port 20, and the received ephemeral port number.

Communication over control connection

Ftp uses a similar approach as telnet or smtp to communicate across the control
connection. It uses the nvt ascii character set. Communication is achieved through
command and responses. Each command or response is only one short line;
therefore, we need not worry about file format or file structure.

Communication over the data connection

In this, the client must define the type of file to be transferred via transmission
mode. Before sending the document through the data connection, we arrange for
transmission through the control connection.

The heterogeneity problem is resolved by representing three attributes of


communication.

 File type
FTP can transfer ASCII, EBCDIC, or image files. The ASCII is the default file
share format, in this, each character is encoded by NVT ASCII. In ASCII or
EBCDIC the destination must be ready to accept files in this mode. The image
file format is the default format for transforming binary files.

 Data structure
Ftp uses following data structures :
1. File structure (default)
2. Record structure
3. Page structure
 Transmission mode

 The transmission mode

 File transfer
FTP commands to transfer files

mget It is used to copy multIPle files from the remote machine to the
local machine.

get It is used to copy a file from the server to the client device.

mput This command is used to copy many files from the user device to
the server device.

put This command is used to copy a file from the user device to the
server device.

FTP commands to connect to remote host

open This command is used to open the connection with another


system.

user This command is used to transfer the new user detail.

FTP command to terminate session

quit It is used to exit the FTP session (same as bye).

close It is used to terminate the ftp connection with a remote system.


Anonymous FTP

A user needs to have an account along with a password on the remote server
if he wants to use FTP.
Some sites have a set of files available for public access to enable
anonymous FTP.
A user does not need to have an account or password to access these
files. Instead the user can use anonymous as the user name and guest as the
password.

***

You might also like