0% found this document useful (0 votes)
4 views57 pages

Application Layer in Computer Networks

This document outlines the Application Layer of computer networks, detailing key topics such as client-server applications, protocols, and various services like HTTP, FTP, and DNS. It discusses network application architecture, including client-server and peer-to-peer models, and emphasizes the importance of transport services such as reliability, throughput, propagation time, and security. Additionally, it covers the components of the World Wide Web, including web pages, URLs, and the role of search engines and SEO in enhancing web visibility.

Uploaded by

happy worker
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)
4 views57 pages

Application Layer in Computer Networks

This document outlines the Application Layer of computer networks, detailing key topics such as client-server applications, protocols, and various services like HTTP, FTP, and DNS. It discusses network application architecture, including client-server and peer-to-peer models, and emphasizes the importance of transport services such as reliability, throughput, propagation time, and security. Additionally, it covers the components of the World Wide Web, including web pages, URLs, and the role of search engines and SEO in enhancing web visibility.

Uploaded by

happy worker
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

.

IN
C
Faculty:

N
SY
BCS502 – COMPUTER NETWORKS Prof. Ashok Herur

U
[Link]@[Link]
VT Mobile: 91641 01399
Module 5

.IN
C
N
Application Layer

SY
U
VT

Computer Networks - Prof Ashok Herur 2


Main topics in Module 5

• Client-Server applications and Protocols

.IN
• The Web (www) and HTTP

C
N
• FTP – File Transfer Protocol

SY
• Electronic mail

U
• DNS – Domain Name Service VT
• TELNET

• Secure Shell (SSH)

Computer Networks - Prof Ashok Herur 3


Application Layer

• A collection of applications that are useful for the users !

.IN
• Networks exist to support these applications.

C
• Popular applications, in the 1970’s and 1980’s:

N
• Text email

SY
• File transfer

U
• Remote access to computers
• In 1990’s:
VT
• World Wide Web (www) – surfing, searching, ecommerce.

Computer Networks - Prof Ashok Herur 4


Application Layer

• After 2000:

.IN
• VoIP (Voice over IP)

C
Videoconferencing – Skype, Facetime, Google Hangouts, ..
• YouTube

N
• Movies on Demand – Netflix

SY
• Multiplayer Online games

U
Social networking – Facebook, Instagram, Twitter

VT
Messaging Apps - WhatsApp, WeChat
• Payment Apps – Google Pay, PayTM
• Transport Apps – Ola, Uber
• Location-based Apps – Maps, traffic, services (shops, hotels, petrol pumps,..)

Computer Networks - Prof Ashok Herur 5


Principles of Network applications

• Network application programs should be capable of running on different end

.IN
systems, and be able to communicate with each other over the network.

C
• For example, in a Web application, there are two distinct programs that

N
communicate with each other:

SY
• The Browser program running in the user’s host (laptop, smartphone, etc);
• The Web Server program running in the Web Server host.

U
VT
• As another example, in a video-on-demand application, like Netflix, there is:
• A Netflix-provided program running in the user’s host (TV, smartphone);
• The Netflix Server program running in the Netflix Server host.

Computer Networks - Prof Ashok Herur 6


Network Application Architecture

• Network application architecture is one of the following two types:

.IN
• Client-server architecture

C
• Peer-to-Peer (P2P) architecture

N
• In a Client-server architecture, there is an always-on host, called the Server,

SY
which services requests from many other hosts, called Clients.

U
• As an example, a Web Server services requests from many browsers
VT
running on Client hosts.
• It responds by sending the requested object.

Computer Networks - Prof Ashok Herur 7


Client-Server architecture

• Here, the server has a fixed, well-known IP address.

.IN
• Since it is always on, and since it services many requests, the address is

C
fixed for quick access.

N
• Common applications using this architecture include the Web, FTP, email.

SY
• Often, a single server is incapable of handling the volume of requests.

U
• There are multiple servers housed in a data centre.
VT
• Further, there could be multiple data centres spread across the globe.
• Google (search engine) has 19 data centres across the globe.

Computer Networks - Prof Ashok Herur 8


P2P architecture

• Here, there is minimal (or no) reliance on dedicated servers.

.IN
• The application exploits direct communication between pairs of intermittently

C
connected hosts, called peers.

N
• These peers are not owned by the service provider but instead are desktops

SY
and laptops owned by the end users (in homes and offices).

U
• A popular P2P application is the file-sharing application (BitTorrent, InShare,
VT
Zapya, etc).
• This architecture is distributed, scalable and cost effective, since it does not
need server infrastructure (data centres) and server bandwidth.

Computer Networks - Prof Ashok Herur 9


P2P architecture

• Since there are no fixed servers, peers must rely on some method to locate

.IN
fellow peers.

C
• The most basic approach is a centralized directory where resources are

N
indexed on a central server, and peers query this server for a lookup to find

SY
the peer with the desired resource, and then make a connection to the peer.
• BitTorrent uses a centralized directory server, calling it the Tracker.

U
VT
• Note that while resource lookup is still client-server, the actual resource
transmission, which accounts for the bulk of the network capacity usage, is
P2P.

Computer Networks - Prof Ashok Herur 10


Peer discovery

.IN
C
N
SY
U
VT

Computer Networks - Prof Ashok Herur 11


Processes

• When applications communicate with each other, there are processes on

.IN
both sides that enable the communication (sending and receiving data).

C
• In applications that use the Client-Server architecture, like the Web, the

N
browser on the client is a client process and the one running on the server is
the server process.

SY
• A process sends message into, and receives messages from, the network

U
through a software interface called a socket.
VT
• It is the interface between the Application layer and the Transport layer (in
the TCP / IP Reference model).
• It is also referred to as Application Programming Interface (API).

Computer Networks - Prof Ashok Herur 12


Socket

.IN
C
N
SY
U
VT

Computer Networks - Prof Ashok Herur 13


Socket addressing

• A process on a host has to have an unique identity.

.IN
• Two pieces of information are needed here:

C
• The address of the host (IP address);

N
• An identifier that specifies the process on the host (Port number).

SY
• The combination of the above two is the socket address.

U
• Popular applications have been assigned specific Port numbers by IANA:
VT
• Web server – Port number 80
• Mail server (using SMTP protocol) – Port number 25.

Computer Networks - Prof Ashok Herur 14


.IN
C
Transport services available to Applications

N
SY
U
VT

Computer Networks - Prof Ashok Herur 15


Transport services available to Applications
• When a network application is developed, one must choose one of the

.IN
available Transport layer protocols.

C
• This is done by studying the services provided by those protocols, and choose

N
the one that best suits the needs of the application.

SY
• Like how we choose to travel to a distant place – By our own car, or a bus,
train, plane, etc.

U
• Each one has different pros and cons, and none is the ideal mode of
VT
transport for everyone.

Computer Networks - Prof Ashok Herur 16


Transport services available to Applications
• The services offered by the Transport layer protocols can broadly be classified

.IN
under the following heads:
• Reliable data transfer

C
• Throughput

N
• Propagation time (delay)

SY
• Security aspects

U
VT

Computer Networks - Prof Ashok Herur 17


Transport services – Reliable data transfer
• Reliability means that:

.IN
• Data that is corrupted due to noise should be detected and dealt with;
• Packets are not lost (due to buffer overruns or due to an error in the IP

C
Header);

N
• Packets are not delivered (to the Application) in improper sequence.

SY
• Many applications (Financial transactions, email, remote host access, etc) do

U
not tolerate the data loss mentioned above.
VT
• Some loss-tolerant applications (notably multimedia applications such as
conversational audio / video) can tolerate some amount of data loss.

Computer Networks - Prof Ashok Herur 18


Transport services – Throughput
• Throughput is the rate at which the sending process can deliver bits to the

.IN
receiving process.

C
• The available throughput will fluctuate with time because:

N
• The bandwidth along the network path is shared with other sessions (of

SY
differing throughput needs);
• Sessions come on, get completed and closed at different points in time.

U
• Can an application request a guaranteed throughput from the Transport layer
VT
protocol?
• And does it need such a guarantee?

Computer Networks - Prof Ashok Herur 19


Transport services – Throughput
• Bandwidth-sensitive applications are those that are virtually useless in the

.IN
absence of the required throughput.
• Many multimedia applications fall in this category, though a few can adjust

C
the coding schemes and settle for a slightly lower throughput.

N
SY
• Bandwidth-elastic applications are those that can make use of as much, or as
little, throughput that is available at the moment.

U
• Email, file transfer, Web transfer fall in this category.
VT

Computer Networks - Prof Ashok Herur 20


Transport services – Propagation time (delay)
• A transport-layer protocol can also provide / should provide some timing

.IN
guarantees.

C
• Interactive real-time applications definitely need such a guarantee.

N
• Eg.: Internet telephony, videoconferencing, multiplayer games, etc.

SY
• Even for non-real-time applications, a lower delay would always be preferable,
though a tight constraint is not placed.

U
VT

Computer Networks - Prof Ashok Herur 21


Transport services – Security
• A transport protocol can provide applications with one or more security

.IN
services, like:
• End-to-end encryption;

C
• End-point authentication;

N
• Data integrity (a check to find out if the data has been tampered with).

SY
• Note that the traditional TCP does not provide a facility for the above features.

U
VT
• If they are required, then the application should use an enhanced feature of
TCP, called Transport Layer Security (TLS).
• Note that TLS is not a third protocol (besides TCP and UDP).
• The special TLS code should be used in the application development.

Computer Networks - Prof Ashok Herur 22


Transport services – Security
• TLS has its own socket API that is similar to the traditional socket API.

.IN
• When an application uses TLS, the sending process passes cleartext data to

C
the TLS socket.

N
• TLS in the sending host then encrypts the data and passes it on to the TCP

SY
socket.

U
• The reverse happens on the receiver side.
VT

Computer Networks - Prof Ashok Herur 23


Transport services – Requirements of network
applications

.IN
C
N
SY
U
VT

Computer Networks - Prof Ashok Herur 24


.IN
C
The Web and HTTP

N
SY
U
VT

Computer Networks - Prof Ashok Herur 25


The World Wide Web (www)
• The World Wide Web (WWW), commonly referred to as the web, is a vast and

.IN
interconnected network of digital information that is accessible through the
internet.

C
• It consists of a collection of web pages, documents, multimedia content, and

N
SY
resources linked together using hyperlinks.
• The web allows users to access, share, publish, and interact with a diverse

U
range of content, including text, images, videos, audio, and interactive
VT
applications.

Computer Networks - Prof Ashok Herur 26


Components of WWW
• Web pages are individual documents containing information, often presented

.IN
in HTML format, that can include text, images, multimedia, and links.

C
• These web pages are grouped together to form websites, which are hosted on

N
web servers and accessible via web browsers.

SY
• Hyperlinks, often called links, are clickable elements within web content that
connect to other web pages, websites, or resources.

U
VT
• Clicking on a hyperlink navigates the user to the linked content, enabling
seamless exploration across the web.

Computer Networks - Prof Ashok Herur 27


Components of WWW
• Uniform Resource Locator (URL) is a web address that specifies the location of

.IN
a specific resource on the web.

C
• URL consists of a protocol (such as HTTP or HTTPS), a domain name (e.g.,

N
[Link]), and a path to the resource.

SY
• Web browsers are software applications used to access and view web content.
They interpret HTML and other web technologies to render web pages in a

U
readable and interactive format for user.
VT
• Web servers are computers that store web content and respond to user
requests by sending the requested web pages and resources back to the
user’s browser.

Computer Networks - Prof Ashok Herur 28


Components of WWW
• Hyper Text Transfer Protocol (HTTP) and HTTPS: HTTP is the protocol used for

.IN
transferring data between a web browser and a web server. HTTPS is a secure
version of HTTP that encrypts data to enhance security and privacy during

C
data transmission.

N
SY
• Search engines index web content, making it searchable and discoverable for
users. They use algorithms to rank and present search results based on user

U
queries, enabling efficient access to relevant information.
VT
• Search Engine Optimization (SEO) is the practice of optimizing websites to
improve their visibility in search engine results. By following SEO best
practices, website owners increase the chances of their sites appearing
higher in search rankings.
Computer Networks - Prof Ashok Herur 29
SEO
• When website owners implement the SEO strategies effectively, they send

.IN
signals to search engines that their website is valuable and relevant to specific
search queries.

C
• For example, if a website sells organic skincare products, they would want

N
to optimize their website for keywords related to organic skincare, such as

SY
“natural skincare,” “chemical-free skincare,” or “organic beauty products.”
• By strategically placing these keywords in their website’s content and URLs,

U
the website owner increases the likelihood of their site ranking higher
VT
when users search for those terms.
• Additionally, search engines consider other factors when determining website
visibility, such as the website’s loading speed, mobile-friendliness, and user
experience.

Computer Networks - Prof Ashok Herur 30


Web cache
• A web cache is a server computer located either on the public Internet or

.IN
within an enterprise that stores recently accessed web pages to improve
response time for users when the same content is requested within a certain

C
time after the original request.

N
SY
• Most web browsers also implement a browser cache by writing recently
obtained data to a local data storage device

U
VT
• Enterprise firewalls often cache Web resources requested by one user for the
benefit of many users.

Computer Networks - Prof Ashok Herur 31


Key components of a website
• HTML (Hypertext Markup Language): HTML determines how the different

.IN
elements are organized (defines its structure and content) and presented to
the visitors.

C
• CSS (Cascading Style Sheets): CSS is responsible for the visual presentation

N
SY
and layout of a website. It adds style (font, spacing, etc) colour, and aesthetic
appeal to the web pages, making them visually appealing and engaging.

U
• JavaScript: JavaScript enhances the user experience by adding interactivity
VT
and dynamic elements to web pages. It allows websites to respond to user
actions, such as clicking on buttons or scrolling through content.

Computer Networks - Prof Ashok Herur 32


HTTP
• Hypertext Transfer Protocol (HTTP) is an Application layer protocol for

.IN
distributed, collaborative, information systems like the World Wide Web,
where hypertext documents include hyperlinks to other resources that the

C
user can easily access, for example by a mouse click or by tapping the screen.

N
• HTTP/1 was finalized as version 1.0 in 1996. It evolved (as version 1.1) in 1997.

SY
• Its secure variant named HTTPS is used by more than 85% of websites.

U
• HTTP/2, published in 2015, provides a more efficient version of HTTP/1.
VT
• As of January 2024, it is used by 36% of websites and supported by almost all web
browsers (over 98% of users).

• HTTP/3 was published in 2022.


• It is now used on 28% of websites, and is supported by most web browsers.

Computer Networks - Prof Ashok Herur 33


HTTP
• HTTP functions as a Request - Response protocol in the Client-Server model.

.IN
• The client (process on a browser) submits an HTTP request message to the

C
server.

N
• The server, which provides resources such as HTML files and other content

SY
returns a response message to the client.

U
• HTTP defines the structure of these messages, and how the messages are
VT
exchanged.
• It uses TCP as the transport layer protocol for a reliable, end-to-end transfer.

Computer Networks - Prof Ashok Herur 34


HTTP – Persistent and non-persistent connections
• As with the TCP handshake, the Request - Response way of working takes

.IN
time to initiate and transfer the requested web page.

C
• Therefore, in many applications, where the client and the server interact for

N
an extended period of time, the TCP connection is kept “open” for a

SY
(configurable) amount of time.
• This is called Persistent connection (default mode of operation)

U
• On the other hand, in non-Persistent connection mode, a new TCP connection
VT
is opened for each request.

Computer Networks - Prof Ashok Herur 35


HTTP – Persistent and non-persistent connections

.IN
C
N
SY
U
VT

Computer Networks - Prof Ashok Herur 36


HTTP – Message format
• An HTTP request contains a series of lines that each end with a Carriage

.IN
return (cr) character (takes to the beginning of a line), followed by a Line feed
(lf) character (takes to next line)

C
• The first line is called the Request line, and subsequent ones are called Header

N
lines.

SY
• The Request line has 3 fields: Method field, the URL field and the HTTP

U
version field.
VT
• The Method field can take on different values, but generally is GET, but can
also be PUT, DELETE, POST, and HEAD.
• The GET method is used when the browser requests something that is identified in the
URL field.
• The PUT method allows an user to upload an object to a specific path on the server.
Computer Networks - Prof Ashok Herur 37
HTTP – Request Message format

.IN
C
N
SY
U
VT

Computer Networks - Prof Ashok Herur 38


HTTP – Request Message format
• The DELETE method is used to delete that one had earlier PUT on the Web.

.IN
• The POST method is used when the user fills out a Form with more details for a specific
search (the Entity body is now used to describe the Request in detail, by including key

C
search words).

N
• The HEAD method is used by developers for debugging, wherein the request is responded

SY
with an HTTP message but without the requested object.

• The Header lines contain information about various things, including:

U
• The host on which the object resides (for use of Web proxy caches);
VT
• If the connection should be Persistent or Non-persistent;
• The browser type (Chrome, Firefox, Mozilla,..) that is making the request;
• Language preference (if the requested object is available in that language).

Computer Networks - Prof Ashok Herur 39


HTTP – Response Message format
• The first line is called the Status line, and subsequent ones are called Header

.IN
lines.

C
• The Status line indicates the HTTP version (/1, /1.1, /2 or /3), followed by the

N
code and phrase representing the status of the Request (found what was

SY
requested, not found, not found in the specific language, etc).
• The Header part contains details like Time Stamp, Server type (Apache, etc),

U
length of the content (object) in bytes, the content type (Text /HTML, etc), the
VT
Last-modified time, etc.
• The Entity body is a large part of the message and contains the requested
object itself.

Computer Networks - Prof Ashok Herur 40


HTTP – Response Message format

.IN
C
N
SY
U
VT

Computer Networks - Prof Ashok Herur 41


Cookies
• Cookies are small files of information that a web server generates and sends

.IN
to a web browser.
• Web browsers store the cookies they receive for a predetermined period of

C
time, or for the length of a user's session on a website.

N
SY
• They attach the relevant cookies to any future requests that the user makes to
the web server.

U
• Cookies help inform websites about the user, enabling the websites to
VT
personalize the user experience.
• For example, ecommerce websites use cookies to know what merchandise users have
placed in their shopping carts.
• In addition, some cookies are necessary for security purposes, such as authentication
cookies.
Computer Networks - Prof Ashok Herur 42
Cookies
• The customer has earlier shopped on

.IN
ebay and has a cookie 8734.

C
Now, when he tries to buy on Amazon
(with a http request), the server creates

N
a cookie 1678 and tells the client

SY
browser to note it down (in a cookie file).

U
VT • All subsequent requests (within a
specified time) will contain this cookie
number in the header line.

• The cookie is stored in the database and


also tagged with the transactions.

Computer Networks - Prof Ashok Herur 43


.IN
C
Electronic mail (email)

N
SY
U
VT

Computer Networks - Prof Ashok Herur 44


Electronic mail
• Most internet systems use Simple Mail Transfer Protocol (SMTP), an

.IN
application layer protocol, to transfer mail from one user to another.

C
• At a high-level view, the Internet email system has 3 major components:

N
• User agents

SY
• Mail servers
• SMTP

U
VT
• Microsoft Outlook, Apple Mail, Web-based Gmail, Gmail app on a smartphone
are some of the popular User Agents.

Computer Networks - Prof Ashok Herur 45


Electronic mail
• When an user has completed composing the mail, his / her User Agent sends

.IN
the mail to it’s own, always-on server where it is placed in the outgoing
message queue.

C
• When the turn comes up, the message is forwarded to the server of the

N
SY
recipient, using the SMTP protocol (over a TCP connection).
• If it cannot be delivered for any reason, it retries after every 30 minutes.

U
• If it cannot be delivered within a set time (a day or two), the sender is
VT
informed about the inability to deliver the message.
• When delivered, it is stored in the mailbox of the recipient (like a mailbox
in the physical Post Office).

Computer Networks - Prof Ashok Herur 46


Electronic mail

.IN
C
N
SY
U
VT

Computer Networks - Prof Ashok Herur 47


Electronic mail
• When the recipient comes online, his / her user agent retrieves the message

.IN
from the mailbox in his / her server, using one of the following protocols:
• the earlier POP (Post Office Protocol), or

C
• the newer IMAP (Internet Message Access Protocol), or

N
• HTTP (when the recipient is using a web-based email or a smartphone app)

SY
• When POP is used, the recipient can choose to keep a copy or to delete it

U
from the server after it is downloaded.
VT
• Further, the mail server can only be accessed from one device.
• However, in the case of IMAP, the copy is always maintained for some
management functions, and can be accessed from multiple devices.

Computer Networks - Prof Ashok Herur 48


.IN
C
Domain Name System (DNS)

N
SY
U
VT

Computer Networks - Prof Ashok Herur 49


Domain Name System (DNS)
• Each one of us is known by our name and our Aadhaar number.

.IN
• Which one is more useful? And where?

C
• Just like humans, hosts on the Internet are also identified by a human-friendly

N
Hostname (of variable length) like [Link], but that will not provide

SY
any information about where the host is located within the Internet.
• DNS is the “Internet’s Directory Service” that provides the location (IP

U
address) of the host for the transfer of the request or of the information.
VT
• Routers effectively forward the packets using the fixed-length, hierarchical
IP address.

Computer Networks - Prof Ashok Herur 50


Domain Name System (DNS)
• The DNS is:

.IN
• A distributed database implemented in a hierarchy of DNS servers;
• An Application layer protocol that allows hosts to query the database;

C
• Also used by other Application layer protocols like HTTP and SMTP to translate

N
user-supplied host names to IP addresses.

SY
• A simple design for DNS would have just one DNS server that contains all the

U
mappings; The problems here would be: VT
• Risk of failure of the server – everything crashes.
• Huge traffic volume.
• Distance between the querying host and the server.
• Maintenance – Updating changes to the allocated IP addresses.

Computer Networks - Prof Ashok Herur 51


Domain Name System (DNS)
• In order to deal with the scale of operations, the DNS uses a large number of

.IN
servers organised in a hierarchical fashion and distributed across the world.
• No single DNS server has all the mappings for all of the hosts in the

C
N
internet.

SY
• Broadly, there are 3 classes of DNS servers:
• Root DNS servers;

U
VT
• Top-level domain (TLD) DNS servers;
• Authoritative DNS servers.

Computer Networks - Prof Ashok Herur 52


Hierarchy of DNS servers

.IN
C
N
SY
U
VT

Computer Networks - Prof Ashok Herur 53


Hierarchy of DNS servers - Working
• When a DNS client wants to determine the IP address for a particular

.IN
hostname (say, [Link]), it contacts one of the nearest Root DNS
servers (there are more than 1000 of them scattered across the world, and

C
managed by 12 different organisations, coordinated by IANA.

N
SY
• The Root DNS server returns the IP addresses of the TLD servers for the top-
level domain <.com>, which returns the IP addresses of an authoritative

U
server for [Link]. This, in turn, returns the IP address for the host name
VT
www. [Link]

• The top-level domains - .com, .edu, .org, .gov, and all the country level
domains like .in, .uk, .fr, there is a TLD server (or a cluster of them).

Computer Networks - Prof Ashok Herur 54


DNS caching
• Whenever a local DNS server receives a DNS reply, containing the mapping of

.IN
a hostname to an IP address, it stores that in its local memory.
• This is called DNS caching.

C
N
• When another query, for the same hostname, arrives at the DNS server, it can

SY
provide the desired IP address immediately.

U
• Since the mapping is not permanent, the cache is cleared (and updated)
VT
regularly.

• The DNS server can also cache the IP addresses of TLD servers, thereby
allowing it to bypass the Root DNS servers (in the query chain).

Computer Networks - Prof Ashok Herur 55


SSH (Secure Shell protocol)
• SSH runs on top of the TCP/IP protocol suite.

.IN
• SSH is "secure" because it incorporates encryption and authentication via a

C
process called Public key cryptography.

N
• Public key cryptography is a way to encrypt data, or sign data, with two

SY
different keys.
• One of the keys, the public key, is available for anyone to use.

U
• The other key, the private key, is kept secret by its owner.
VT

Computer Networks - Prof Ashok Herur 56


.IN
C
N
SY
U
VT

Computer Networks - Prof Ashok Herur 57

You might also like