Unit4 - Application Layer
Unit4 - Application Layer
Unit4 - Application Layer
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
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.