Unit4 - Application Layer

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 41

U18AII4201_COMPUTER

NETWORKS
● To study the basic taxonomy and terminology
of the computer networking and enumerate
the layers of OSI model and TCP/IP model.
● To acquire knowledge of Application layer
and Presentation layer paradigms and protocols
● To study Session layer design issues,
Course Transport layer services, and protocols
Objectives: ● To gain core knowledge of Network layer
routing protocols and IP addressing.
● To study data link layer concepts, design
issues, and protocols
● To study the fundamentals and basics of
Physical layer, and will apply them in
Course Outcomes:
After successful completion of this course, the
students can

CO 1: Understand the
CO 2: Design error control,
functionality and protocols
flow control and routing
operating in each layer of
protocols
OSI reference model

CO 3: Construct network
CO 4: Apply terror control,
traffic characteristics and
flow control and routing
congestion control
protocols
mechanism
Domain Name System–
Electronic
APPLICATION Mail(SMTP,MIME,IMAP)–
LAYER FileTransfer(FTP)– WWW(HTTP)-
TLS/SSL- IP Security
Domain Name System
• An application layer protocol defines how the application processes running on different systems,
pass the messages to each other.
• DNS stands for Domain Name System.
• 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.
• Each node in a tree has a domain name, and a full domain name is a sequence of symbols
specified by dots.
• 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.
• 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 google.com. Therefore, the domain name is more reliable than
IP address.
Domain Name System
• 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.
Domain Name System
Generic Domains
• It defines the registered hosts
according to their generic behavior.
• Each node in a tree defines the
domain name, which is an index to
the DNS database.
• It uses three-character labels, and
these labels describe the
organization type.
Domain Name System
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
Domain Name System
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.
Domain Name System
Working of DNS
• DNS is a client/server network communication protocol.
• DNS clients send requests to the server while DNS servers send responses to the client.
• 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.
• DNS implements a distributed database to store the name of all the hosts available on the internet.
• 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.
Electronic Mail(SMTP,MIME,IMAP)
Simple Mail Transfer Protocol (SMTP)
• Email is emerging as one of the most valuable services on the internet
today.
• Most internet systems use SMTP as a method to transfer mail from
one user to another.
• SMTP is a push protocol and is used to send the mail whereas POP
(post office protocol) or IMAP (internet message access protocol) are
used to retrieve those emails at the receiver’s side.
Electronic Mail(SMTP,MIME,IMAP)
SMTP Fundamentals
• SMTP is an application layer protocol.
• The client who wants to send the mail opens a TCP connection to the
SMTP server and then sends the mail across the connection.
• The SMTP server is an always-on listening mode.
• As soon as it listens for a TCP connection from any client, the SMTP
process initiates a connection through port 25.
• After successfully establishing a TCP connection the client process
sends the mail instantly.
Electronic Mail(SMTP,MIME,IMAP)
• SMTP Protocol- The SMTP model is of two types:
1. End-to-end method
2. Store-and- forward method
• The end-to-end model is used to communicate between different organizations whereas
the store and forward method is used within an organization.
• An SMTP client who wants to send the mail will contact the destination’s host SMTP
directly, in order to send the mail to the destination.
• The SMTP server will keep the mail to itself until it is successfully copied to the
receiver’s SMTP.
• The client SMTP is the one that initiates the session so let us call it client- SMTP and the
server SMTP is the one that responds to the session request so let us call it receiver-SMTP.
• The client- SMTP will start the session and the receiver-SMTP will respond to the
request.
Electronic Mail(SMTP,MIME,IMAP)
Model of SMTP system
• In the SMTP model user deals with the
user agent (UA), for example, Microsoft
Outlook, Netscape, Mozilla, etc.
• In order to exchange the mail using TCP,
MTA is used.
• The user sending the mail doesn’t have to
deal with MTA as it is the responsibility of
the system admin to set up a local MTA.
• The MTA maintains a small queue of mails
so that it can schedule repeat delivery of
mails in case the receiver is not available.
• The MTA delivers the mail to the
mailboxes and the information can later be
downloaded by the user agents.
Electronic Mail(SMTP,MIME,IMAP)
Both the SMTP-client and SMTP-server should have 2 components:
1.User-agent (UA)
2.Local MTA
Communication between sender and the receiver :
• The sender’s user agent prepares the message and sends it to the MTA.
• The MTA’s responsibility is to transfer the mail across the network to
the receiver’s MTA.
• To send mails, a system must have a client MTA, and to receive mails,
a system must have a server MTA.
Electronic Mail(SMTP,MIME,IMAP)
SENDING EMAIL:
Mail is sent by a series of request and response messages between the client and the server.
• The message which is sent across consists of a header and a body.
• A null line is used to terminate the mail header and everything after the null line is considered as the body of the message, which is a
sequence of ASCII characters.
• The message body contains the actual information read by the receipt.
RECEIVING EMAIL:
The user agent at the server-side checks the mailboxes at a particular time of intervals.
• If any information is received, it informs the user about the mail.
• When the user tries to read the mail it displays a list of emails with a short description of each mail in the mailbox.
• By selecting any of the mail users can view its contents on the terminal.
Some SMTP Commands:
• HELO – Identifies the client to the server, fully qualified domain name, only sent once per session
• MAIL – Initiate a message transfer, fully qualified domain of originator
• RCPT – Follows MAIL, identifies an addressee, typically the fully qualified name of the addressee, and for multiple addressees use one
RCPT for each addressee
• DATA – send data line by line
Electronic Mail(SMTP,MIME,IMAP)
Multipurpose Internet Mail Extension (MIME) is a standard that was proposed by Bell
Communications in 1991 in order to expand the limited capabilities of email.
• MIME is a kind of add-on or a supplementary protocol that allows non-ASCII data to be sent
through SMTP.
• It allows the users to exchange different kinds of data files on the Internet: audio, video, images,
application programs as well.
Why do we need MIME?
Limitations of Simple Mail Transfer Protocol (SMTP):
1. SMTP has a very simple structure
2. Its simplicity however comes with a price as it only sends messages in NVT 7-bit ASCII format.
3. It cannot be used for languages that do not support 7-bit ASCII format such as French, German, Russian,
Chinese and Japanese, etc. so it cannot be transmitted using SMTP. So, in order to make SMTP more
broad, we use MIME.
4. It cannot be used to send binary files or video or audio data.
Electronic Mail(SMTP,MIME,IMAP)
• Purpose and Functionality of MIME –
Growing demand for Email Messages as people also want to express themselves in terms of Multimedia.
• So, MIME another email application is introduced as it is not restricted to textual data.
• MIME transforms non-ASCII data at the sender side to NVT 7-bit data and delivers it to the client SMTP.
• The message on the receiver side is transferred back to the original data.
• As well as we can send video and audio data using MIME as it transfers them also in 7-bit ASCII data.

Features of MIME –
1. It is able to send multiple attachments with a single message.
2. Unlimited message length.
3. Binary attachments (executables, images, audio, or video files) may be divided if needed.
4. MIME provided support for varying content types and multi-part messages.
Electronic Mail(SMTP,MIME,IMAP)
Working of MIME
• Suppose a user wants to send an email through a user agent and it is in a non-ASCII format so there
is a MIME protocol that converts it into 7-bit NVT ASCII format.
• The message is transferred through the e-mail system to the other side in the 7-bit format now
MIME protocol again converts it back into non-ASCII code and now the user agent of the receiver
side reads it and then information is finally read by the receiver.
• MIME header is basically inserted at the beginning of any e-mail transfer.
MIME with SMTP and POP
• SMTP transfers the mail being a message transfer agent from the sender’s side to the mailbox of the
receiver side and stores it and MIME header is added to the original header and provides additional
information.
• while POP being the message access agent organizes the mails from the mail server to the receiver’s
computer. POP allows the user agent to connect with the message transfer agent.
Electronic Mail(SMTP,MIME,IMAP)
MIME Header:
• It is added to the original e-mail header section to define transformation. There
are five headers that we add to the original header:
1.MIME-Version – Defines the version of the MIME protocol. It must have the
parameter Value 1.0, which indicates that message is formatted using MIME.
2.Content-Type – Type of data used in the body of the message. They are of different
types like text data (plain, HTML), audio content, or video content.
3.Content-Type Encoding – It defines the method used for encoding the message. Like
7-bit encoding, 8-bit encoding, etc.
4.Content Id – It is used for uniquely identifying the message.
5.Content description – It defines whether the body is actually an image, video, or
audio.
Electronic Mail(SMTP,MIME,IMAP)
• Internet Message Access Protocol (IMAP) is an application layer protocol
that operates as a contract for receiving emails from the mail server.
• It was designed by Mark Crispin in 1986 as a remote access mailbox
protocol, the current version of IMAP is IMAP4.
• It is used as the most commonly used protocol for retrieving emails.
• This term is also known as Internet mail access protocol, Interactive mail
access protocol, and Interim mail access protocol.
Electronic Mail(SMTP,MIME,IMAP)
Features of IMAP :
• It is capable of managing multiple mailboxes and organizing them into
various categories.
• Provides adding of message flags to keep track of which messages are being
seen.
• It is capable of deciding whether to retrieve email from a mail server before
downloading.
• It makes it easy to download media when multiple files are attached.
Electronic Mail(SMTP,MIME,IMAP)
Working of IMAP :
• IMAP follows Client-server Architecture and is the
most commonly used email protocol.
• It is a combination of client and server process running
on other computers that are connected through a
network.
• This protocol resides over the TCP/IP protocol for
communication.
• Once the communication is set up the server listens on
port 143 by default which is non-encrypted.
• For the secure encrypted communication port, 993 is
used.
Electronic Mail(SMTP,MIME,IMAP)
Advantages :
• It offers synchronization across all the maintained sessions by the user.
• It provides security over POP3 protocol as the email only exists on the IMAP server.
• Users have remote access to all the contents.
• It offers easy migration between the devices as it is synchronized by a centralized server.
• There is no need to physically allocate any storage to save contents.
Disadvantages :
• IMAP is complex to maintain.
• Emails of the user are only available when there is an internet connection.
• It is slower to load messages.
• Some emails don’t support IMAP which makes it difficult to manage.
• Many browser-based solutions are unavailable due to not support of IMAP.
FTP
• File Transfer Protocol(FTP) is
an application layer protocol
that moves files between local
and remote file systems.
• It runs on the top of TCP, like
HTTP.
• To transfer a file, 2 TCP
connections are used by FTP in
parallel: control connection and
data connection.
FTP
• What is control connection?
For sending control information like user identification, password, commands
to change the remote directory, commands to retrieve and store files, etc., FTP
makes use of control connection. The control connection is initiated on port
number 21.
• What is data connection?
For sending the actual file, FTP makes use of a data connection. A data
connection is initiated on port number 20.
• FTP sends the control information out-of-band as it uses a separate control
connection. Some protocols send their request and response header lines and
the data in the same TCP connection.
• For this reason, they are said to send their control information in-band. HTTP
and SMTP are such examples.
FTP
FTP Session :
When an FTP session is started between a client and a server, the client initiates a control TCP
connection with the server-side.
• The client sends control information over this.
• When the server receives this, it initiates a data connection to the client-side.
• Only one file can be sent over one data connection.
• But the control connection remains active throughout the user session.
• As we know HTTP is stateless i.e. it does not have to keep track of any user state.
• But FTP needs to maintain a state about its user throughout the session.
Data Structures : FTP allows three types of data structures :
1. File Structure – In file-structure there is no internal structure and the file is considered to be a
continuous sequence of data bytes.
2. Record Structure – In record-structure the file is made up of sequential records.
3. Page Structure – In page-structure the file is made up of independent indexed pages.
FTP
• Advantages of FTP(File Transfer Protocol):-
• speed is one of the advantages of FTP(File Transfer Protocol).
• File sharing also comes in the category of advantages of FTP in this between
two machines file can be shared on the network.
• Efficiency is more in FTP.
• Disadvantages of FTP(File Transfer Protocol):-
• file size limit is the drawback of FTP only 2 GB size files can be transferred.
• multiple receivers are not supported by the FTP.
• FTP does not encrypt the data this is one of the biggest drawbacks of FTP.
FTP
• 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 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.
HTTP
• HTTP stands for HyperText Transfer Protocol.
• It is invented by Tim Berner. HyperText is the type of text which is specially coded with the
help of some standard coding language called as HyperText Markup Language (HTML).
• HTTP/2 is latest version of HTTP, which was published on May 2015.
• The protocols that are used to transfer hypertext between two computers is known as
HyperText Transfer Protocol.
• HTTP provides standard between a web browser and web server to establish communication.
• It is set of rules for transferring data from one computer to another.
• Data such as text, images, and other multimedia files are shared on the World Wide Web.
Whenever a web user opens their web browser, user indirectly uses HTTP.
• It is an application protocol which is used for distributed, collaborative, hypermedia
information systems.
HTTP
• First of all, whenever we want to open any website
then first we open web browser after that we will type
URL of that website (e.g., www.facebook.com ).
• This URL is now sent to Domain Name Server (DNS).
• Then DNS first check records for this URL in their
database, then DNS will return IP address to web
browser corresponding to this URL.
• Now browser is able to sent request to actual server.
• After server sends data to client, connection will be
closed.
• If we want something else from server we should have
to re-establish connection between client and server.
HTTP
History
• Tim Berners Lee and his team at CERN gets credit for inventing original HTTP and associated
technologies.
HTTP version 0.9 –
• This was first version of HTTP which was introduced in 1991.
HTTP version 1.0 –
• In 1996, RFC 1945 (Request For Comments) was introduced in HTTP version 1.0.
HTTP version 1.1 –
• In January 1997, RFC 2068 was introduced in HTTP version 1.1. Improvements and updates to HTTP
version 1.1 standard were released under RFC 2616 in June 1999.
• The HTTP version 2.0 specification was published as RFC 7540 on May 14, 2015.
• HTTP version 3.0 is based on previous RFC draft. It is renamed as HyperText Transfer Protocol QUIC
which is a transport layer network protocol developed by Google.
HTTP
• Characteristics of HTTP: HTTP is IP based communication protocol which is used to
deliver data from server to client or vice-versa.
• Server processes a request, which is raised by client and also server and client knows
each other only during current request and response period.
• Any type of content can be exchanged as long as server and client are compatible with it.
• Once data is exchanged then servers and client are no more connected with each other.
• It is a request and response protocol based on client and server requirements.
• It is connection less protocol because after connection is closed, server does not
remember anything about client and client does not remember anything about server.
• It is stateless protocol because both client and server does not expecting anything from
each other but they are still able to communicate.
HTTP
Advantages :
• Memory usage and CPU usage are low because of less simultaneous connections.
• Since there are few TCP connections hence network congestion are less.
• Since handshaking is done at initial connection stage, then latency is reduced because there is no
further need of handshaking for subsequent requests.
• The error can be reports without closing connection.
• HTTP allows HTTP pipe-lining of request or response.
Disadvantages :
• HTTP requires high power to establish communication and transfer data.
• HTTP is less secure, because it does not use any encryption method like https use TLS to encrypt
normal http requests and response.
• HTTP is not optimized for cellular phone, and it is too gabby.
• HTTP does not offer genuine exchange of data because it is less secure.
• Client does not close connection until it receives complete data from server and hence server
needs to wait for data completion and cannot be available for other clients during this time.
TLS/SSL
• SSL stands for Secure Socket Layer while TLS stands for Transport Layer Security.
• Both Secure Socket Layer and Transport Layer Security are the protocols used to
provide the security between web browser and web server.
• The main differences between Secure Socket Layer and Transport Layer Security
is that.
• In SSL (Secure Socket Layer), Message digest is used to create master secret and
It provides the basic security services which are Authentication and
confidentiality.
• while In TLS (Transport Layer Security), Pseudo-random function is used to
create master secret.
• There are some differences between SSL and TLS which are given below:
TLS/SSL
S.No SSL TLS
1. SSL stands for Secure Socket Layer. TLS stands for Transport Layer Security.

2. SSL (Secure Socket Layer) supports Fortezza algorithm. TLS (Transport Layer Security) does not
supports Fortezza algorithm.

3. SSL (Secure Socket Layer) is the 3.0 version. TLS (Transport Layer Security) is the 1.0 version.

4. In SSL( Secure Socket Layer), Message digest is used to create In TLS(Transport Layer Security), Pseudo-random
master secret. function is used to create master secret.

5. In SSL( Secure Socket Layer), Message Authentication Code In TLS(Transport Layer Security), Hashed Message
protocol is used. Authentication Code protocol is used.

6. SSL (Secure Socket Layer) is complex than TLS(Transport Layer TLS (Transport Layer Security) is simple.
Security).

7. SSL (Secure Socket Layer) is less secured as compared to TLS (Transport Layer Security) provides high security.
TLS(Transport Layer Security).
IP Security
• The IP security (IPSec) is an Internet Engineering Task Force (IETF) standard suite of protocols
between 2 communication points across the IP network that provide data authentication, integrity,
and confidentiality.
• It also defines the encrypted, decrypted and authenticated packets.
• The protocols needed for secure key exchange and key management are defined in it.
Uses of IP Security
IPsec can be used to do the following things:
• To encrypt application layer data.
• To provide security for routers sending routing data across the public internet.
• To provide authentication without encryption, like to authenticate that the data originates from a
known sender.
• To protect network data by setting up circuits using IPsec tunneling in which all data is being sent
between the two endpoints is encrypted, as with a Virtual Private Network(VPN) connection.
IP Security
• Components of IP Security –
• It has the following components:
Encapsulating Security Payload (ESP) –
• It provides data integrity, encryption, authentication and anti replay. It also
provides authentication for payload.
Authentication Header (AH) –
• It also provides data integrity, authentication and anti replay and it does not
provide encryption.
• The anti replay protection, protects against unauthorized transmission of packets.
• It does not protect data’s confidentiality.
IP Security
Internet Key Exchange (IKE)
• It is a network security protocol designed to dynamically exchange encryption keys and find a way
over Security Association (SA) between 2 devices.
• The Security Association (SA) establishes shared security attributes between 2 network entities to
support secure communication.
• The Key Management Protocol (ISAKMP) and Internet Security Association which provides a
framework for authentication and key exchange.
• ISAKMP tells how the set up of the Security Associations (SAs) and how direct connections between
two hosts that are using IPsec.
• Internet Key Exchange (IKE) provides message content protection and also an open frame for
implementing standard algorithms such as SHA and MD5.
• The algorithm’s IP sec users produces a unique identifier for each packet.
• This identifier then allows a device to determine whether a packet has been correct or not. Packets
which are not authorized are discarded and not given to receiver.
IP Security
IP Security
Working of IP Security –
1. The host checks if the packet should be transmitted using IPsec or not. These packet traffic triggers the security
policy for themselves. This is done when the system sending the packet apply an appropriate encryption. The
incoming packets are also checked by the host that they are encrypted properly or not.
2. Then the IKE Phase 1 starts in which the 2 hosts( using IPsec ) authenticate themselves to each other to start a
secure channel. It has 2 modes. The Main mode which provides the greater security and the Aggressive
mode which enables the host to establish an IPsec circuit more quickly.
3. The channel created in the last step is then used to securely negotiate the way the IP circuit will encrypt data
across the IP circuit.
4. Now, the IKE Phase 2 is conducted over the secure channel in which the two hosts negotiate the type of
cryptographic algorithms to use on the session and agreeing on secret keying material to be used with those
algorithms.
5. Then the data is exchanged across the newly created IPsec encrypted tunnel. These packets are encrypted and
decrypted by the hosts using IPsec SAs.
6. When the communication between the hosts is completed or the session times out then the IPsec tunnel is
terminated by discarding the keys by both the hosts.

You might also like