0% found this document useful (0 votes)
15 views21 pages

Unit 5 Application Layer

The document covers the Application Layer of computer networks, focusing on protocols such as DNS, HTTP, SMTP, and FTP, along with concepts like electronic mail, data compression, and cryptography. It explains how DNS translates domain names to IP addresses, the structure of the World Wide Web, and the functionalities of various protocols for data transfer and communication. Additionally, it discusses data compression techniques and cryptographic methods for securing information.
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)
15 views21 pages

Unit 5 Application Layer

The document covers the Application Layer of computer networks, focusing on protocols such as DNS, HTTP, SMTP, and FTP, along with concepts like electronic mail, data compression, and cryptography. It explains how DNS translates domain names to IP addresses, the structure of the World Wide Web, and the functionalities of various protocols for data transfer and communication. Additionally, it discusses data compression techniques and cryptographic methods for securing information.
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/ 21

KCS603: Computer Networks

Unit-05
Application Layer
Instructor: Md. Shahid
Syllabus: Domain name system, WWW and HTTP.
Electronic mail, FTP, remote login, Network
management, data compression, cryptography- basic
concepts.

Domain name system (DNS)

To identify an entity, TCP/IP protocols use the IP address, which uniquely


identifies the connection of a host to the Internet. However, people prefer
to use names instead of numeric addresses. Therefore, we need a system that can
map a name to an address or an address to a name. And, that system is DNS. DNS,
which is a client/server program, is a supporting program used by other
application programs such as e-mail.

Figure-0.1 shows an example of how a DNS client/server program can support an


e-mail program to find the IP address of an e-mail recipient. A user of an e-mail
program (for example, Gmail) knows the e-mail address of the recipient; however,
the IP protocol needs the IP address. The DNS client program sends a request to a
DNS server to map (translate) the e-mail address to the corresponding IP address.
DNS server

Fig 0.1 Example of using the DNS service

Domain Name Space


In the Internet, the domain name space (tree) was originally divided into three
different sections: generic domains, country domains, and the inverse domain.

1. Generic domains : The generic domains define registered hosts according to


their generic behavior. Each node in the tree defines a domain, which is an
index to the domain name space database.
Fig -02 Generic domains
2. Country Domains: The country domains section uses two-character country
abbreviations (e.g., “in” for India). Second levels can be organizational, or
they can be more specific, national designations.

Fig -03 Country domains


3. Inverse Domain (deprecated): It is used to map an address to a name.

Fig 0.4 Inverse domain

Note— Mapping a name to an address or an address to a name is called


name-address resolution.
World Wide Web
World Wide Web, which is also known as a Web, is a collection of websites
or web pages stored in web servers and connected to local computers
through the internet. These websites contain text pages, digital images,
audios, videos, etc. Users can access the content of these sites from any
part of the world over the internet using their devices such as computers,
laptops, cell phones, etc. The WWW, along with internet, enables the
retrieval and display of text and media to your device. The WWW today is a
distributed client/server service, in which a client using a browser can
access a service using a server.

Fig -0.5 Architecture of WWW

Hypertext Transfer Protocol (HTTP)


The HTTP is an application layer protocol used mainly to access data on the
WWW. It functions as a combination of FTP and SMTP. It uses the services of TCP
on well-known port 80.

Fig-0.6 HTTP transaction

Note— HTTP is an in-band protocol.

Note— In-band protocols refer to communication protocols where control signals,


data, and any other information share the same communication channel. In the
case of HTTP, both control information (such as requests and responses) and the
actual data (web pages, images, etc.) are transmitted over the same connection.

Note— HTTP (Hypertext Transfer Protocol) is a stateless protocol. The server does
not retain any information about the state of the client's previous interactions.

Electronic mail
One of the most popular Internet services is electronic mail (e-mail). 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.

The basic components of an email system are: User Agent (UA), Mail Transfer
Agent (MTA), Mail Box, and Spool file:

1. User Agent (UA) :

The UA is normally a program which is used to send and receive mail.


Sometimes, it is called as mail reader. It accepts variety of commands for
composing, receiving and replying to messages as well as for manipulation of
the mailboxes.

2. Mail Transfer Agent (MTA):

MTA is actually responsible for transfer of mail from one system to another. To
send a mail, a system must have client MTA and system MTA. It transfers mail
to mailboxes of recipients if they are connected in the same machine. It delivers
mail to peer MTA if destination mailbox is in another machine. The delivery from
one MTA to another MTA is done by SMTP.

3. Mailbox :
It is a file on local hard drive to collect mails. Delivered mails are present in this
file. The user can read it delete it according to his/her requirement. To use e-
mail system each user must have a mailbox . Access to mailbox is only to
owner of mailbox.

4. 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 users have to send 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.

File Transfer Protocol (FTP)


o FTP is the standard mechanism provided by TCP/IP 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.
FTP uses the services of TCP. It needs two TCP connections. The well-known port
21 is used for the control connection and the well-known port 20 for the data
connection.

FTP application software – FileZilla, WISE-FTP, etc.

TFTP vs FTP

TFTP (Trivial File Transfer Protocol) and FTP (File Transfer Protocol) are both used
for transferring files between different devices over a network, but they have
some key differences:

Port number: TFTP uses UDP port 69 while FTP uses TCP ports 20 and 21.

Authentication: TFTP doesn't provide any authentication mechanism, while FTP


requires a username and password for authentication.

File transfer modes: FTP supports two file transfer modes, ASCII and binary, while
TFTP only supports binary mode.

Transfer reliability: TFTP is less reliable than FTP because it doesn't have error
checking mechanisms, whereas FTP has various mechanisms to ensure reliable file
transfer, such as checksums and acknowledgments.

File size: TFTP can only transfer files up to 32 MB in size, whereas FTP can transfer
files of any size.
Firewall and NAT traversal: FTP can be problematic in certain network
environments due to its use of multiple ports, which can be blocked by firewalls
and Network Address Translation (NAT) devices. TFTP, on the other hand, only
uses a single port, which can make it easier to use in some network environments.

Overall, TFTP is a simpler and faster protocol compared to FTP, but it's less
reliable and secure. TFTP is commonly used in scenarios where file transfers need
to be quick and simple, such as for booting diskless workstations or updating
firmware on network devices. FTP, on the other hand, is more commonly used in
scenarios where security and reliability are important, such as for transferring
large files or sensitive data.

TELNET protocol
(Remote login)
Telnet is an application layer protocol used on the Internet or local area network
to provide a bidirectional interactive text-oriented communication facility using a
virtual terminal connection.

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 When a user logs into a local computer, then it is known as local login.
o When the workstation running terminal emulator, the keystrokes entered
by the user are accepted by the terminal driver. The terminal driver then
passes these characters to the operating system which in turn, invokes
the desired application program.
o However, the operating system has special meaning to special characters.
For example, in UNIX some combination of characters have special
meanings such as control character with "z" means suspend. Such
situations do not create any problem as the terminal driver knows the
meaning of such characters. But, it can cause the problems in remote
login.

Remote login
o When the user wants to access an application program on a remote computer,
then the user must perform remote login.

SMTP
o SMTP stands for Simple Mail Transfer Protocol.
o SMTP is a set of communication guidelines that allow software to transmit an electronic
mail over the internet is called Simple Mail Transfer Protocol.
o It is a program used for sending messages to other computer users based on e-mail
addresses.
o It provides a mail exchange between users on the same or different computers, and it
also supports:
o It can send a single message to one or more recipients.
o Sending message can include text, voice, video or graphics.
o It can also send the messages on networks outside the internet.
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

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.

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 SNMP has two components Manager and agent.
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.

Data compression
Data Compression is also referred to as bit-rate reduction or source coding. This
technique is used to reduce the size of large files. The advantage of data
compression is that it helps us save our disk space and time in the data
transmission.

There are mainly two types of data compression techniques –

1. Lossless Data Compression


2. Lossy Data Compression

Lossless data compression is used to compress the files without losing


an original file's quality and data. Simply, we can say that in lossless
data compression, file size is reduced, but the quality of data remains the
same.

Lossy data compression is used to compress larger files into smaller files. In this
compression technique, some specific amount of data and quality are removed
(loss) from the original file. It takes less memory space from the original file due
to the loss of original data and quality. This technique is generally useful for us
when the quality of data is not our first priority.

Cryptography
Cryptography is the art of achieving security by encoding messages to make them
unreadable for unauthorized parties.

Terminology

Plaintext (PT) : Actual message [ readable format]


Ciphertext (CT): Converted message [ unreadable format]

Encryption (E) : Process of converting PT to CT

Decryption (D) : Process of converting CT to PT

Cryptography Techniques

1. Symmetric key ( Example, DES and ADES) [ 1 key for E and D ]


2. Asymmetric key ( Example, RSA ) [ Different key for E and D ]

RSA algorithm

Algorithm:

1. Choose two large prime numbers P and Q


2. Calculate N= P*Q
3. Select the public key E (i.e., the encryption key) such that it is not a factor of
(p-1)*(q-1).
4. Select the private key D (i.e., the decryption key ) such that the following
equation is true:
(D*E) mod (p-1)(q-1)=1
5. For encryption, calculate the cipher text CT from the plain text PT as
follows:
CT = PTE mod N

6. Send CT as the cipher text to the receiver.


7. For decryption, calculate the plain text PT from the cipher text CT as
follows:
PT = CTD mod N

Example 01- My toy RSA key is N = 187, e = 107. You observe a ciphertext c
= 2. What is the plaintext?
(Note: 187 = 11 ∗ 17.)

Solution
1. P= 11 and Q = 17
2. N = 187
3. E = 107
4. Select private key (D): (D x E) mod (P-1)(Q-1)=1
(D*107) mod 160 =1
(3*107) mod 160 =1
321 mod 160 =1 [ In modular arithmetic, the modulo operator
(%) gives the remainder of the division of one
number by another. In this case, we are
calculating the remainder when 321 is divided
by 160.]
Therefore D= 3

5. CT = 2 ( Given )
6. Send CT to receiver
7. Calculate PT

PT= 2 3
mod 187

8 mod 187 = 8

Therefore, Plain Text = 8

You might also like