Application Layer
Application Layer
File Transfer Protocol(FTP) is an application layer protocol that moves files between
local and remote file systems. It runs on top of TCP, like HTTP. To transfer a file, 2
TCP connections are used by FTP in parallel: control connection and data connection.
What is File Transfer Protocol?
FTP is a standard communication protocol. There are various other protocols like
HTTP which are used to transfer files between computers, but they lack clarity and
focus as compared to FTP. Moreover, the systems involved in connection are
heterogeneous, i.e. they differ in operating systems, directories, structures, character
sets, etc the FTP shields the user from these differences and transfers data efficiently
and reliably. 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.
File Transfer Protocol
Types of FTP
There are different ways through which a server and a client do a file transfer using
FTP. Some of them are mentioned below:
Anonymous FTP: Anonymous FTP is enabled on some sites whose files
are available for public access. A user can access these files without
having any username or password. Instead, the username is set to
anonymous, and the password is to the guest by default. Here, user access
is very limited. For example, the user can be allowed to copy the files but
not to navigate through directories.
Password Protected FTP: This type of FTP is similar to the previous
one, but the change in it is the use of username and password.
FTP Secure (FTPS): It is also called as FTP Secure Sockets Layer (FTP
SSL). It is a more secure version of FTP data transfer. Whenever FTP
connection is established, Transport Layer Security (TLS) is enabled.
FTP over Explicit SSL/TLS (FTPES): FTPES helps by upgrading FTP
Connection from port 21 to an encrypted connection.
Secure FTP (SFTP): SFTP is not a FTP Protocol, but it is a subset of
Secure Shell Protocol, as it works on port 22.
How Does FTP Work?
FTP is a client server protocol that has two communication channel, command channel
for conversation control and data channel for file content.
Here are steps mentioned in which FTP works:
A user has to log in to FTP Server first, there may be some servers where
you can access to content without login, known as anonymous FTP.
Client can start a conversation with server, upon requesting to download a
file.
The user can start different functions like upload, delete, rename, copy
files, etc. on server.
FTP can work on different modes like Active and Passive modes. For more, you can
refer to Difference between Active and Passive FTP.
SMTP
SMTP (Simple Mail Transfer Protocol) is a protocol for managing Internet’s
electronic mail. It is an application layer protocol. It uses TCP due to its reliable data
transfer service. TCP establishes SMTP connections at port 25. SMTP uses persistent
connections. The same TCP connection can be used to send multiple emails, once the
connection has been established. Only 7-bit ASCII content is to be directly sent. Other
content needs to be encoded to 7-bit ASCII and then decoded at the receiving end.
DNS uses distributed servers so that data remains distributed in places and per server
load decreases. But SMTP never uses intermediate mail servers. Mail sent by user A
to B will go directly from A’s server to B’s server, and nowhere in between.
HTTP
HTTP is a client-server protocol. It is IP based communication protocol that is used
to deliver data from server to client or vice-versa. Any type of content can be
exchanged as long as the server and client are compatible with it.
SMTP is a persistent type of TCP It can use both Persistent and Non-
connection. persistent.
Does not support session management or Supports session management and cookies
cookies. to maintain state.
Has a smaller message size limit Has a larger message size limit compared
compared to HTTP. to SMTP.
1. An email address: This is a unique identifier for each user, typically in the
format of [email protected].
2. An email client: This is a software program used to send, receive and
manage emails, such as Gmail, Outlook, or Apple Mail.
3. An email server: This is a computer system responsible for storing and
forwarding emails to their intended recipients.
To send an email:
Advantages Or Disadvantages:
Advantages of email:
Disadvantages of email:
Domain Name System (DNS) is a hostname for IP address translation service. 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.
What is the Need of DNS?
Every host is identified by the IP address but remembering numbers is very difficult
for people also the IP addresses are not static therefore a mapping is required to change
the domain name to the IP address. So DNS is used to convert the domain name of the
websites to their numerical IP address.
Types of Domain
There are various kinds of domain:
1. Generic domains: .com(commercial), .edu(educational), .mil(military),
.org(nonprofit organization), .net(similar to commercial) all these are
generic domains.
2. Country domain: .in (India) .us .uk
3. 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 for example to find the IP addresses of geeksforgeeks.org then
we have to type
nslookup www.geeksforgeeks.org
Types of DNS
Organization of Domain
It is very difficult to find out the IP address associated with a website because there
are millions of websites and with all those websites we should be able to generate the
IP address immediately, there should not be a lot of delays for that to happen
organization of the database is very important.
Name-to-Address Resolution
The above representation is showing the DNS Message format in which some fields
are set to 0s for query messages.
Identification: The identification field is made up of 16 bits which are used
to match the response with the request sent from the client-side. The
matching is carried out by this field as the server copies the 16-bit value of
identification in the response message so the client device can match the
queries with the corresponding response received from the server-side.
Flags: It is 16 bits and is divided into the following Fields :