Unit - 2 Application Layer
Unit - 2 Application Layer
SUBJECT CODE:3150710
SEMESTER: 5TH FACULTY NAME: Prof. Bhaumik Gelani
Email id: bhaumik.gelani@ljku.edu.in
SUBJECT NAME: Computer Networks Mobile : +91 99092 49440
DEPARETMENT: CSE & IT
Subject Overview
2 Application Layer 17
3 Transport Layer 25
4 Network Layer 25
5 The Link layer and Local area networks 18
1
9/4/2023
Reference Books
Sr. No. Book Name Author Publication
1 Computer Networking- A Top-Down approach, Kurose and Pearson
5th edition Ross
2 Computer Networks- A Top-Down approach, Behrouz Mc Graw Hill
Forouzan
3 Computer Networks (4th edition) Andrew Prentice Hall
Tanenbaum
Unit - 2
Application Layer
1. Principles of Computer Applications
2. Electronic Mail (SMTP, MIME) & Management
3. FTP
4. DNS
5. WWW (WEB)
6. HTTP
7. Socket Programming with TCP and UDP
2
9/4/2023
Internet Applications
• Internet Applications can be described as the type of applications that use the
internet for operating successfully, that is, by using the internet for fetching,
sharing and displaying the information from the respective server systems.
Cont..
1. Internet telephony :
• Internet telephony (e.g. Skype) is another common communications
service made possible by the creation of the Internet.
• VoIP stands for Voice-over-Internet Protocol, referring to the protocol that
underlies all Internet communication.
2. Job search:
• Nowadays, many people search for their jobs online as it is quicker and
there is a larger variety of job vacancies present.
• People can publish resume online for prospective job.
• Some of the web sites providing this service are naukri.com, monster.com,
summerjob.com, recuritmentindia.com etc.
3
9/4/2023
Cont..
3. Online Shopping:
• The internet has also facilitated the introduction of a new market concept
consisting of virtual shops.
• They provide information about products or services for sale through
www servers.
• Using the internet services customers can submit specific product queries
and request specific sales quotes.
• For example amazon.com
4. Stock market updates:
• Selling or buying shares sitting on computer through internet.
• Several websites like ndtvprofit.com, moneypore.com, provide
information regarding investment
Cont..
5. Travel:
• One can use internet to gather information about various tourist place.
• It can be used for booking Holiday tours, hotels, train, bus, flights and
cabs.
• Some of the web sites providing this service are goibibo.com,
makemytrip.com, olacabs.com.
6. Voicemail:
• Voicemail is a system of sending messages over the phone.
• Calls are answered by a machine which connects you to the person you
want to leave a message for, and they can listen to their messages later.
4
9/4/2023
Cont..
7. Research:
• Research papers are present online which helps in the researcher doing
aliterature review.
8. Video conferencing:
• It enables direct face-to-face communication across networks via web
cameras, microphones, and other communication tools.
• Video conferencing can enable individuals in distant locations to
participate in meetings on short notice, with time and money savings.
• The technology is also used for telecommuting, in which employees work
from home.
Cont..
9. Online payments:
• The rising boom of online payments in India has given way to many new
entrants in the industry such as Paytm etc who are majorly wallet driven
payment companies.
• This growth has been driven by rapid adoption led by the increasing use of
smartphones, tablets and speedy access to internet through broadband, 4G
etc
10. Social Networking:
• Social networking is the use of internet-based social media programs to
make connections with friends, family, classmates, customers and clients.
• Social networking can be done for social purposes, business purposes or
both.
5
9/4/2023
1) Client-Server architecture
2) P2P (Peer to Peer) architecture
Cont..
1) Client-Server Architecture:
6
9/4/2023
Cont..
2) P2P Architecture:
• It has no dedicated server in a data
center. The peers are the computers
which are not owned by the service
provider.
• Most of the peers reside in the homes,
offices, schools, and universities.
• The peers communicate with each other
without passing the information through
a dedicated server, this architecture is
known as peer-to-peer architecture.
• The applications based on P2P
architecture includes file sharing and
internet telephony.
7
9/4/2023
Cont..
Cont..
• A client program runs only when it requests for a service from the server while the server
program runs all time as it does not know when its service is required.
• A server provides a service for many clients not just for a single client.
• Therefore, we can say that client-server follows the many-to-one relationship. Many
clients can use the service of one server.
• 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.
8
9/4/2023
Cont..
• 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.
Cont..
• P2P (Peer to Peer ) model:
• The peer to peer computing architecture contains nodes that are equal
participants in data sharing.
• All the tasks are equally divided between all the nodes.
• The nodes interact with each other as required as share resources.
• A diagram to better understand peer to peer computing is as follows:
9
9/4/2023
Cont..
• Peer to peer networks are usually formed by groups of a dozen or less computers.
• These computers all store their data using individual security but also share data
with all the other nodes.
• The nodes in peer to peer networks both use resources and provide resources.
• So, if the nodes increase, then the resource sharing capacity of the peer to peer
network increases.
• This is different than client server networks where the server gets overwhelmed
if the nodes increase.
• Since nodes in peer to peer networks act as both clients and servers, it is difficult
to provide adequate security for the nodes. This can lead to denial of service
attacks.
• Most modern operating systems such as Windows and Mac OS contain software
to implement peer to peer networks.
2. Electronic Mail
(SMTP, MIME) & Management
10
9/4/2023
Cont..
• The Person who sends the email is referred to as the Sender while the
person who receives an email is referred to as the Recipient.
Cont..
• Need of an Email:
1. We can send the same message to several peoples at the same time.
2. It is a very fast and efficient way of transferring information.
3. The email system is very fast as compared to the Postal system.
4. Information can be easily forwarded to coworkers without retyping it.
11
9/4/2023
Cont..
• Structure of Email:
Cont..
• Header
• The header part of the email generally contains the sender's address as
well as the receiver's address and the subject of the message.
• Body
• The Body of the message contains the actual information that is meant for
the receiver.
12
9/4/2023
Cont..
• Email Address:
• In order to deliver the email, the mail handling system must make use
of an addressing system with unique addresses.
Cont..
• Local Part
• It is used to define the name of the special file, which is commonly
called a user mailbox; it is the place where all the mails received for
the user is stored for retrieval by the Message Access Agent.
• Domain Name
• It is the second part of the address is Domain Name.
• Both local part and domain name are separated with the help of @.
13
9/4/2023
Cont..
• Working of E-mail:
Cont..
• Email working follows the client server approach. In this client is the
mailer i.e. the mail application or mail program and server is a device that
manages emails.
• Following example will take you through the basic steps involved in
sending and receiving emails and will give you a better understanding of
working of email system:
2. Person A composes the messages using a mailer program i.e. mail client
and then select Send option.
14
9/4/2023
Cont..
Cont..
• Email Protocols:
1. SMTP
2. MIME
3. POP3
4. IMAP
15
9/4/2023
Cont..
• SMTP:
Cont..
16
9/4/2023
Cont..
• 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.
Cont..
• Components of SMTP:
17
9/4/2023
Cont..
• 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.
Cont..
• 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.
18
9/4/2023
Cont..
• 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.
• MIME:
• MIME stands for Multipurpose Internet Mail Extensions.
• It is used to extend the capabilities of Internet e-mail protocols such as
SMTP.
• The MIME protocol allows the users to exchange various types of digital
content such as:
• Pictures, audio, video, and various types of documents and files in the
e-mail.
• MIME is an e-mail extension protocol, i.e., it does not operate
independently, but it helps to extend the capabilities of e-mail in
collaboration with other protocols such as SMTP.
19
9/4/2023
Cont..
• MIME Header:
• MIME adds five additional fields to the header portion of the actual e-mail to
extend the properties of the simple email protocol.
Cont..
• MIME Header:
20
9/4/2023
Cont..
• 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.
• 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.
• Content-Type Encoding:
• It defines the method used for encoding the message.
• Like 7-bit encoding, 8-bit encoding, etc.
Cont..
• Content Id:
• It is used for uniquely identifying the message.
• Content description:
• It defines whether the body is actually an image, video, or audio.
21
9/4/2023
Cont..
Cont..
22
9/4/2023
Cont..
23
9/4/2023
Cont..
• POP3 and IMAP are the protocols that are used to retrieve mail from the mailbox
at the mail server to the recipient’s computer. Both are message accessing agents
(MAA).
• The two protocols POP3 and IMAP are used when both the sender and recipient
of mail are connected to the mail server by WAN or LAN.
• The SMTP protocol transfers the mail from client’s computer to the mail server
and from one mail server to another mail server.
• POP3 has a limited functionality whereas, the IMAP has extra features over
POP3.
Cont..
24
9/4/2023
Cont..
• The IMAP is a client-server protocol like POP3 and most other TCP/IP
application protocols.
• The IMAP4 protocol functions only when the IMAP4 must reside on the server
where the user mailboxes are located.
• In c the POP3 does not necessarily require the same physical server that provides
the SMTP services.
• Therefore, in the case of the IMAP protocol, the mailbox must be accessible to
both SMTP for incoming mails and IMAP for retrieval and modifications.
• The IMAP uses the Transmission Control Protocol (TCP) for communication to
ensure the delivery of data and also received in the order.
• The IMAP4 listens on a well-known port, i.e., port number 143, for an incoming
connection request from the IMAP4 client.
Cont..
• IMAP follows Client-server Architecture and is the most commonly used email
protocol.
• Once the communication is set up the server listens on port 143 by default which
is non-encrypted.
25
9/4/2023
Cont..
Cont..
• POP3 Vs IMAP
BASIS FOR
POP3 IMAP
COMPARISON
Basic To read the mail ithas to be downloaded first. The mail content can be checked partially
before downloading.
Organize The user can not organize mails in the mailbox The user can organize the mails on the server.
of the mail server.
Folder The user can not create, delete or rename The user can create, delete or rename
mailboxes on a mail server. mailboxes on the mail server.
Content A user can not search the content of mail for A user can search the content of mail for
prior downloading. specific string of character before
downloading.
Partial Download The user has to download the mail for The user can partially download the mail if
accessing it. bandwidth is limited.
Functions POP3 is simple and has limited functions. IMAP is more powerful, more complex and
has more features over POP3.
26
9/4/2023
3. FTP
• 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.
• It is also used for downloading the files to computer from other servers.
Cont..
• Objectives of FTP
1. It provides the sharing of files.
2. It is used to encourage the use of remote computers.
3. It transfers the data more reliably and efficiently.
27
9/4/2023
Cont..
• Mechanism of FTP:
Cont..
28
9/4/2023
Cont..
• 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.
Cont..
• 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.
29
9/4/2023
Cont..
• FTP Clients
• FTP client is a program that implements a file transfer protocol which
allows you to transfer files between two hosts on the internet.
• It allows a user to connect to a remote host and upload or download
the files.
• 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.
• 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.
Cont..
• Advantages of FTP:
• 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.
• Efficient:
• It is more efficient as we do not need to complete all the operations to get the
entire file.
• Security:
• To access the FTP server, we need to login with the username and password.
• Therefore, we can say that FTP is more secure.
30
9/4/2023
TFTP
• Trivial File Transfer Protocol (TFTP) is a simple protocol used for
transferring files.
• TFTP uses the User Datagram Protocol (UDP) which enables data to be
sent between communication partners without sharing a fixed connection.
Cont..
• TFTP is a simpler version of FTP and it doesn’t have all its functions for
example, you cannot list, delete or rename files or directories on a remote
server.
• In fact, TFTP can only be used to send and receive files between the two
computers.
• TFTP doesn’t support user authentication and all data is sent in clear text.
31
9/4/2023
Cont..
• TFTP messages:
Cont..
32
9/4/2023
Cont..
• Advantages and Disadvantages of TFTP:
• Advantages:
1. It utilizes the User Datagram Protocol (UDP) protocol.
2. It is very easy to use and implement.
3. It needs minimum coding.
4. It needs minimum memory utilization.
5. It is a faster file transfer protocol.
• Disadvantages
1. It doesn't offer file security as compared to FTP.
2. It doesn't list the directory's contents.
3. It is an unsecured FTP.
4. There is no encryption or authentication mechanism.
Service FTP uses TCP service which is a TFTP uses UDP service which is
connection-oriented service. connection-less service.
FTP software is larger than TFTP. TFTP software is smaller than FTP
Software and fits into readonly memory of the
diskless workstation.
Commands/Message FTP have many commands. TFTP have only five messages.
33
9/4/2023
Cont..
Error handling Can recover from errors during transfer Does not have error recovery
4. DNS
• Each node in a tree has a domain name, and a full domain name is a
sequence of symbols specified by (.) dots.
34
9/4/2023
Cont..
Cont..
35
9/4/2023
Cont..
Cont..
• 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.
36
9/4/2023
Cont..
• Generic Domains:
Cont..
• Generic domain labels:
Label Description
37
9/4/2023
Cont..
• Country Domains:
• The format of country domain is same as a generic domain, but it uses two-
character country abbreviations (e.g., us for the United States) in place of
three character organizational abbreviations.
• For example,
• Australia the country domain is “.au”, Inida is “.in” and UK is “.uk”etc.
Cont..
• Country Domains :
38
9/4/2023
Cont..
• Generic domain labels:
Label Description
.ar Argentina
.am Armenia
.au Australia
.br Brazil
.ge Germany
.in India
.jp Japan
Cont..
• Inverse Domains:
• 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.
39
9/4/2023
Cont..
• Inverse Domains :
5. WWW (WEB)
40
9/4/2023
Cont..
• The WWW, along with internet, enables the retrieval and display of text
and media to your device.
• Components of the Web:
• There are 3 components of the web:
1. Uniform Resource Locator (URL):
• serves as a system for resources on the web.
2. HyperText Transfer Protocol (HTTP):
• specifies communication of browser and server.
3. Hyper Text Markup Language (HTML):
• defines the structure, organization and content of a webpage.
Cont..
• World Wide Web Works:
41
9/4/2023
Cont..
Cont..
42
9/4/2023
6. HTTP
Cont..
• The HTTP mainly uses the services of the TCP on the well-known port
that is port 80.
43
9/4/2023
Cont..
• Working of HTTP:
Cont..
44
9/4/2023
Cont..
• At the time when a client makes a request for some information (say client
clicks on the hyperlink) to the webserver.
• The browser then sends a request message to the HTTP server for the
requested objects.
• After that the following things happen:
1. There is a connection that becomes open between the client and the
webserver through the TCP.
2. After that, the HTTP sends a request to the server that mainly collects
the requested data.
3. The response with the objects is sent back to the client by HTTP
4. At last, HTTP closes the connection.
Cont..
• Let us take a look at the format of the request message and response
message:
45
9/4/2023
Cont..
Cont..
• Request Type
• This field is used in the request line.
• The are several request types that are defined and these are mentioned
in the table given below;
Name of Method Actions
GET • This method is used to request a document from the server.
• This method mainly requests information about a document and not the
HEAD
document itself
POST • This method sends some information from the client to the server.
PUT • This method sends a document from the server to the client.
TRACE • This method echoes the incoming request.
CONNECT • This method means reserved
OPTION • In order to inquire about the available options.
46
9/4/2023
Cont..
• URL:
• URL is a Uniform Resource locator and it is mainly a standard way of
specifying any kind of information on the Internet.
• HTTP Version:
• The current version of the HTTP is 1.1.
• Status Code:
• The status code is the field of the response message.The status code
consists of three digits.
Cont..
• Status Phrase:
• This field is also used in the response message and it is used to explain
the status code in the form of text.
47
9/4/2023
Cont..
• Advantages of HTTP
1. There is no runtime support required to run properly.
2. HTTP is usable over the firewalls and global application is possible.
3. HTTP is platform-independent.
4. HTTP reports the errors without closing the TCP connection.
48
9/4/2023
Cont..
• Difference between Persistent and Non-Persistent Connections:
Cont..
• Persistent Connection:
49
9/4/2023
Cont..
• Non-Persistent Connection:
50
9/4/2023
Cont..
• Socket
• “A socket is one endpoint of a two-way communication link between two
programs running on the network.”
Cont..
51
9/4/2023
Cont..
Cont..
• Method:
public Socket accept() returns the socket and establish a connection between server
and client.
52
9/4/2023
Cont..
ss=new ServerSocket(Port_no);
• Example:
ServerSocket ss=new ServerSocket(1111);
Cont..
53
9/4/2023
Cont..
Cont..
54
9/4/2023
Cont..
Cont..
55
9/4/2023
Cont..
Cont..
56
9/4/2023
QUESTIONS
1. What is Internet? List and explain Internet Applications.
Cont..
9. Write a short note:POP3 and IMAP.
57
9/4/2023
Subject Overview
2 Application Layer 17
3 Transport Layer 25
4 Network Layer 25
5 The Link layer and Local area networks 18
58