Unit 5 Application Layer
Unit 5 Application Layer
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.
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:
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.
Objectives of FTP
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.
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.
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.
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
Cryptography Techniques
RSA algorithm
Algorithm:
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