5th Unit CN 2024
5th Unit CN 2024
Unit-05
Application Layer
Syllabus: Domain name system, WWW and HTTP.
Electronic mail, FTP, remote login, Network management,
data compression, cryptography- basic concepts.
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.
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.
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:
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.
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.
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.
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
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
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:
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= 23 mod 187
8 mod 187 = 8