Unit 5 CN
Unit 5 CN
Application Layer
The Application Layer is the topmost layer in the OSI (Open Systems
Interconnection) model, directly interacting with end-user applications. Its
primary role is to provide services and interfaces that allow applications to
communicate over a network.
The Application Layer ensures that data is presented in a readable format and
handles aspects such as data compression, encryption, and error handling.
o In Client-server architecture, clients do not directly communicate with each other. For
example, in a web application, two browsers do not directly communicate with each
other.
o A server is fixed, well-known address known as IP address because the server is always
on while the client can always contact the server by sending a packet to the sender's IP
address.
It is a single-server based architecture which is incapable of holding all the requests from the
clients. For example, a social networking site can become overwhelmed when there is only one
server exists.
Client
A client is a program that runs on the local machine requesting service
from the server. A client program is a finite program means that the
service started by the user and terminates when the service is completed.
Server
A server is a program that runs on the remote machine providing
services to the clients. When the client requests for a service, then the
server opens the door for the incoming requests, but it never initiates the
service.
A server program is an infinite program means that when it starts, it runs
infinitely unless the problem arises. The server waits for the incoming
requests from the clients. When the request arrives at the server, then it
responds to the request.
It enables computers to locate and communicate with each other on the internet.
DNS is a directory service that provides a mapping between the name of a host on the
network and its numerical address.
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 ftp.EduSoft.com. Therefore, the domain name
is more reliable than IP address.
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.
LLLLLL Description
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.
FTP
File Transfer Protocol(FTP) is an application layer protocol which 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.
It can be invoked from the command prompt or some graphical user interface.
It also allows to update (delete, rename, move and copy) files at a server.
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.
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.
N Telnet
o The main task of the internet is to provide services to users. For example, users want to
run different application programs at the remote site and transfers a result to the local site.
This requires a client-server program such as FTP, SMTP. But this would not allow us to
create a specific program for each demand.
o The better solution is to provide a general client-server program that lets the user access
any application program on a remote computer. Therefore, a program that allows a user
to log on to a remote computer. A popular client-server program Telnet is used to meet
such demands. Telnet is an abbreviation for Terminal Network.
o Telnet provides a connection to the remote computer in such a way that a local terminal
appears to be at the remote side.
There are two types of login:
Local Login
o The network virtual terminal is an interface that defines how data and commands are sent
across the network.
o In today's world, systems are heterogeneous. For example, the operating system accepts a
special combination of characters such as end-of-file token running a DOS operating
system ctrl+z while the token running a UNIX operating system is ctrl+d.
o TELNET solves this issue by defining a universal interface known as network virtual
interface.
o The TELNET client translates the characters that come from the local terminal into NVT
form and then delivers them to the network. The Telnet server then translates the data
from NVT form into a form which can be understandable by a remote computer.
SMTP
o SMTP stands for Simple Mail Transfer Protocol.
o The main purpose of SMTP is used to set up communication rules between servers. The
servers have a way of identifying themselves and announcing what kind of
communication they are trying to perform. They also have a way of handling the errors
such as incorrect email address. For example, if the recipient address is wrong, then
receiving server reply with an error message of some kind.
Components of SMTP
Pau se
o First, we will break the SMTP client and SMTP server into two components
such as user agent (UA) and mail transfer agent (MTA). The user agent (UA)
prepares the message, creates the envelope and then puts the message in
the envelope. The mail transfer agent (MTA) transfers this mail across the
internet.
o SMTP allows a more complex system by adding a relaying system. Instead of
just having one MTA at sending side and one at receiving side, more MTAs
can be added, acting either as a client or server to relay the email.
o The relaying system without TCP/IP protocol can also be used to send the
emails to users, and this is achieved by the use of the mail gateway. The mail
gateway is a relay MTA that can be used to receive an email.
Working of SMTP
1. Composition of Mail: A user sends an e-mail by composing an electronic mail message
using a Mail User Agent (MUA). Mail User Agent is a program which is used to send
and receive mail. The message contains two parts: body and header. The body is the main
part of the message while the header includes information such as the sender and
recipient address. The header also includes descriptive information such as the subject of
the message. In this case, the message body is like a letter and header is like an envelope
that contains the recipient's address.
2. Submission of Mail: After composing an email, the mail client then submits the
completed e-mail to the SMTP server by using SMTP on TCP port 25.
3. Delivery of Mail: E-mail addresses contain two parts: username of the recipient and
domain name. For example, [email protected], where "vivek" is the username of the
recipient and "gmail.com" is the domain name.
If the domain name of the recipient's email address is different from the sender's domain
name, then MSA will send the mail to the Mail Transfer Agent (MTA). To relay the
email, the MTA will find the target domain. It checks the MX record from Domain Name
System to obtain the target domain. The MX record contains the domain name and IP
address of the recipient's domain. Once the record is located, MTA connects to the
exchange server to relay the message.
4. Receipt and Processing of Mail: Once the incoming message is received, the exchange
server delivers it to the incoming server (Mail Delivery Agent) which stores the e-mail
where it waits for the user to retrieve it.
5. Access and Retrieval of Mail: The stored email in MDA can be retrieved by using
MUA (Mail User Agent). MUA can be accessed by using login and password.
SNMP
o SNMP stands for Simple Network Management Protocol.
o SNMP is a framework used for managing devices on the internet.
o It provides a set of operations for monitoring and managing the internet.
SNMP Concept
o The manager is a host that controls and monitors a set of agents such as routers.
o It is an application layer protocol in which a few manager stations can handle a set of agents.
o The protocol designed at the application level can monitor the devices made by different
manufacturers and installed on different physical networks.
o It is used in a heterogeneous network made of different LANs and WANs connected by routers or
gateways.
Managers & Agents
o A manager is a host that runs the SNMP client program while the agent is a router that runs the
SNMP server program.
o Management of the internet is achieved through simple interaction between a manager and agent.
o The agent is used to keep the information in a database while the manager is used to access the
values in the database. For example, a router can store the appropriate variables such as a number
of packets received and forwarded while the manager can compare these variables to determine
whether the router is congested or not.
o Agents can also contribute to the management process. A server program on the agent checks the
environment, if something goes wrong, the agent sends a warning message to the manager.
o A manager also forces the agent to perform a certain function by resetting values in the agent
database.
o An agent also contributes to the management process by warning the manager regarding an
unusual condition.
Management Components
o Management is not achieved only through the SNMP protocol but also the use of other protocols
that can cooperate with the SNMP protocol. Management is achieved through the use of the other
two protocols: SMI (Structure of management information) and MIB(management information
base).
o Management is a combination of SMI, MIB, and SNMP. All these three protocols such as
abstract syntax notation 1 (ASN.1) and basic encoding rules (BER).
SMI
The SMI (Structure of management information) is a component used in network management.
Its main function is to define the type of data that can be stored in an object and to show how to
encode the data for the transmission over a network.
MIB
o The MIB (Management information base) is a second component for the network management.
o Each agent has its own MIB, which is a collection of all the objects that the manager can manage.
MIB is categorized into eight groups: system, interface, address translation, ip, icmp, tcp, udp,
and egp. These groups are under the mib object.
Working of WWW
A Web browser is used to access web pages. Web browsers can be defined as
programs which display text, data, pictures, animation and video on the Internet.
Hyperlinked resources on the World Wide Web can be accessed using software
surfing the Web but now they have become more universal.
Web browsers can be used for several tasks including conducting searches, mailing,
transferring files, and much more. Some of the commonly used browsers are Internet Explorer,
Opera Mini, and Google Chrome.
Features of WWW
It is Cross-Platform.
Uniform Resource Locator (URL): URL serves as a system for resources on the web.
Hyper Text Transfer Protocol (HTTP): HTTP specifies communication of browser and
server.
Hyper Text Markup Language (HTML): HTML defines the structure, organisation and
content of a web page.
HTTP stands for “Hypertext Transfer Protocol.” It is a set of rules for sharing
data on the World Wide Web (WWW). When you visit a website, HTTP helps
your browser request and receive the data needed to display the web pages you
see. It is a fundamental part of how the internet works, making it possible for us
to browse and interact with websites.
Basic Structure: HTTP forms the foundation of the web, enabling data
communication and file sharing.
Web Browsing: Most websites use HTTP, so when you click on a link or
download a file, HTTP is at work.
Application Layer Protocol: HTTP operates within the Internet Protocol Suite,
managing how data is transmitted and received.
There is some common information that is generally present in all HTTP requests.
These are mentioned below.
HTTP Version
URL
HTTP Method
HTTP Body
HTTP Request Headers generally store information in the form of key-value pairs
and must be present in each HTTP Request. The use of this Request Header is to
provide core information about the client’s information, etc.
HTTP Request Body
HTTP Request Body simply contains the information that has to be transferred.
HTTP Request has the information or data to be sent to these browsers.
HTTP Method
HTTP Methods are simply HTTP Verbs. In spite of being presentin so many HTTP
Methods, the most common HTTP Methods are HTTP GET and HTTP POST . These
two are generally used in HTTP cases. In HTTP GET, the information is received in
the form of a website.
HTTP Response is simply the answer to what a Server gets when the request is
raised. There are various things contained in the HTTP Response, some of them are
listed below.
HTTP Status Code
HTTP Headers
HTTP Body
Advantages of HTTP
Memory usage and CPU usage are low because of fewer simultaneous
connections.
Since there are few TCP connections, network congestion is less.
Since handshaking is done at the initial connection stage, latency is reduced
because there is no further need for handshaking for subsequent requests.
The error can be reported without closing the connection.
HTTP allows HTTP pipe-lining of requests or responses.
Disadvantages of HTTP
HTTP requires high power to establish communication and transfer data.
HTTP is less secure because it does not use any encryption method like HTTPS
and uses TLS to encrypt regular HTTP requests and responses.
HTTP is not optimized for cellular phones, and it is too gabby.
HTTP does not offer a genuine exchange of data because it is less secure.
The client does not close the connection until it receives complete data from the
server; hence, the server needs to wait for data completion and cannot be
available for other clients during this time.
Electronic 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.
Spool file : This file contains mails that are to be sent. User agent appends
outgoing mails in this file using SMTP. MTA extracts pending mail from spool
file for their delivery. E-mail allows one name, an alias, to represent several
different e-mail addresses. It is known as mailing list, Whenever user have to
sent a message, system checks recipient’s name against alias database. If mailing
list is present for defined alias, separate messages, one for each entry in the list,
must be prepared and handed to MTA. If for defined alias, there is no such
mailing list is present, name itself becomes naming address and a single message
is delivered to mail transfer entity.
Advantages of email:
3. Ability to send and receive attachments such as documents, images, and videos.
5. Available 24/7.
Disadvantages of email:
4. Potential for miscommunication due to lack of tone and body language in written
messages.
Network Security
All the measures used to safeguard a computer network's integrity and the
data on it are collectively referred to as network security. Network security is
crucial because it protects sensitive data from online threats and guarantees
the network's dependability. Multiple security measures are used in
successful network security plans to shield users and organizations from
malware and online threats like distributed denial of service.
o Message Integrity: Data integrity means that the data must arrive at the receiver exactly
as it was sent. There must be no changes in the data content during transmission, either
maliciously or accident, in a transit. As there are more and more monetary exchanges
over the internet, data integrity is more crucial. The data integrity must be preserved for
secure communication.
o End-point authentication: Authentication means that the receiver is sure of the sender?s
identity, i.e., no imposter has sent the message.
o Non-Repudiation: Non-Repudiation means that the receiver must be able to prove that
the received message has come from a specific sender. The sender must not deny sending
a message that he or she send. The burden of proving the identity comes on the receiver.
For example, if a customer sends a request to transfer the money from one account to
another account, then the bank must have a proof that the customer has requested for the
transaction.
Cryptography
Cryptography is a technique of securing information and communications through
the use of codes so that only those persons for whom the information is intended can
understand and process it. Thus, preventing unauthorized access to information.
The prefix “crypt” means “hidden” and the suffix “graphy” means “writing”.
In Cryptography, the techniques that are used to protect information are obtained
from mathematical concepts and a set of rule-based calculations known as
algorithms to convert messages in ways that make it hard to decode them. These
algorithms are used for cryptographic key generation, digital signing, and
verification to protect data privacy, web browsing on the internet and to protect
confidential transactions such as credit card and debit card transactions.
Types of Cryptography
2. Hash Functions
There is no usage of any key in this algorithm. A hash value with a fixed length is
calculated as per the plain text which makes it impossible for the contents of plain
text to be recovered. Many operating systems use hash functions to encrypt
passwords.
3. Asymmetric Key Cryptography
In Asymmetric Key Cryptography, a pair of keys is used to encrypt and decrypt
information. A sender’s public key is used for encryption and a receiver’s private
key is used for decryption. Public keys and Private keys are different. Even if the
public key is known by everyone the intended receiver can only decode it because he
alone knows his private key. The most popular asymmetric key cryptography
algorithm is the RSA algorithm.
Advantages of Cryptography
Cryptography can be used for access control to ensure that only parties with the
proper permissions have access to a resource.
For secure online communication, it offers secure mechanisms for transmitting
private information like passwords, bank account numbers, and other sensitive
data over the Internet.
It helps in the defense against various types of assaults including replay and man-
in-the-middle attacks .
Cryptography can help firms in meeting a variety of legal requirements including
data protection and privacy legislation.