0% found this document useful (0 votes)
16 views169 pages

Unit V CN Revised

Uploaded by

sakshiravte4
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views169 pages

Unit V CN Revised

Uploaded by

sakshiravte4
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 169

Unit V

The Application Layer


• Layers below the application
layer are there to provide
reliable transport, but they do
not do real work for users.

• In this chapter we will study


some real network
applications. 2

BLM431 Computer Networks Dr.Refik Samet


The Application Layer
• In the application layer there is also
need for support protocols, to allow the
applications to function.
• One of them is DNS which
handles naming within the
Internet.
• Three real applications:
1. Electronic Mail
2. The World Wide Web 3

3. Multimedia BLM431 Computer Networks Dr.Refik Samet


1. DNS – The Domain Name
System

• 7.1.1. The DNS Name Space


• 7.1.2. Resource Records
• 7.1.3. Name Servers

BLM431 Computer Networks Dr.Refik Samet


DNS

• DNS is a hostname for IP address


translation service.
• DNS is a distributed database implemented
in a hierarchy of name servers.
• It is an application layer protocol for
message exchange between clients and
servers.
• DNS stands for Domain Name System.
• DNS is a directory service that provides a mapping between the
name of a host on the network and its numerical address.
• DNS is required for the functioning of the internet.
• Each node in a tree has a domain name, and a full domain name is a
sequence of symbols specified by dots.
• DNS is a service that translates the domain name into IP addresses.
This allows the users of networks to utilize user-friendly names
when looking for other hosts instead of remembering the IP
addresses.
• For example, suppose the FTP site at EduSoft had an IP address of
132.147.165.50, most people would reach this site by specifying
ftp.EduSoft.com. Therefore, the domain name is more reliable than
IP address.
Domain

• DNS is broken up into domains, a logical organization


of computers that exist in a larger network. Below is an
example of the hierarchy of domain naming on the
Internet.
• Genericdomain: .com(commercial) .edu(educational) .
mil(military) .org(non profit organization) .net(similar to
commercial) all these are generic domain.
• Country domain .in (india) .us .uk
• Inverse domain if we want to know what is the domain
name of the website. Ip to domain name mapping. So
DNS can provide both the mapping for example to find
the ip addresses of geeksforgeeks.org then we have to
type nslookup www.geeksforgeeks.org.
Top-level general-purpose domains:
• Commercial (com)
• Educational institutions (edu)
• Governments (gov)
• Certain international organizations (int)
• Armed forces (mil)
• Network providers (net)
• Nonprofit organizations (org)

8
Inverse Domain
• Inverse domain is used to map an address to a name.
• For example, a client send a request to the server for
performing a particular task, server finds a list of
authorized client. The list contains only IP
addresses of the client.
• The server sends a query to the DNS server to map
an address to a name to determine if the client is on
the authorized list.
• This query is called an inverse query.
• This query is handled by first level node called arpa.
• Internet is divided into over 200 top- level
domains, where each domain covers many
hosts.
• Each domain is partitioned into
subdomains, and these are further
partitioned, and so on.
• All these domains can be represented by a
tree.

12
7.1.1. The DNS Name Space

A portion of the Internet domain name space.

BLM431 Computer Networks Dr.Refik Samet 15


Name Space

• The names assigned to the machines must be


carefully selected from a name space with
complete control over the binding between the
names and IP addresses.
• There are two types of name spaces: Flat name
spaces and Hierarchical names.

• Flat namespace, usually used for small internets


• Domain names, a hierarchical system used by
large internets, including the Internet
Flat namespace
• Flat namespace, each host name consists of a sequence
of characters without any further structure.
• A single authority maintains a table of the host names
and assigned internet addresses to avoid naming
conflicts and to regulate the names.
• For the Internet, the Internet Network Information
Center (INIC) is the authority.
The mapping between host names and internet addresses
is easy for a flat namespace.
• Typically, each host maintains a file containing a table
of internet addresses and the corresponding host names.
Flat Name Space
Hierarchical Name Space
• In hierarchical name space, each name consists of
several parts.
• First part defines the nature of the organization,
second part defines the name of an organization,
third part defines department of the organization,
and so on.
• In hierarchical name space, the authority to assign
and control the name spaces can be decentralized.
• Authority for names in each partition is passed to
each designated agent
Hierarchical Name Space
• Resolver sends a UDP packet to a
local DNS server, which then looks
up the name and returns the IP
address to the resolver, which then
returns it to the caller.
• Armed with the IP address, the program
can then establish a TCP connection
with the destination or send it UDP
packets.
BLM431 Computer Networks Dr.Refik Samet 21
The 8 steps in a DNS lookup:
• A user types ‘example.com’ into a web browser and the query travels
into the Internet and is received by a DNS recursive resolver.
• The resolver then queries a DNS root nameserver (.).
• The root server then responds to the resolver with the address of a
Top Level Domain (TLD) DNS server (such as .com or .net), which
stores the information for its domains. When searching for
example.com, our request is pointed toward the .com TLD.
• The resolver then makes a request to the .com TLD.
• The TLD server then responds with the IP address of the domain’s
nameserver, example.com.
• Lastly, the recursive resolver sends a query to the domain’s
nameserver.
• The IP address for example.com is then returned to the resolver from
the nameserver.
• The DNS resolver then responds to the web browser with the IP
address of the domain requested initially.
7.1.2. Resource Records
• Every domain, whether it is a single
host or a top-level domain, can have a
set of resource records associated with
it.
• For a single host, the most common
resource record is just its IP address, but
many other kinds of resource records
also exist.

26
7.1.2. Resource Records

• When a resolver gives a domain name


to DNS, what it gets back are the
resource records associated with that
name.
• Thus, the primary function of DNS is
to map domain names onto resource
records.

27
7.1.2. Resource Records

• A resource record is a five-tuple.


• Resource records are presented as
ASCII text, one line per resource
record.
• The format we will use is as follows:
• Domain_name Time_to_live
Class Type Value
28
7.1.2. Resource Records
Domain_name
• It tells the domain to which this
record applies.
• Normally, many records exist for
each domain and each copy of the
database holds information about
multiple domains.
• This field is thus the primary search
key used to satisfy queries.
29
7.1.2. Resource Records
Time_to_live
• It gives an indication of how stable
the record is.
• Information that is highly stable is
assigned a large value, such as
86400 (the number of seconds in 1
day).

Information that is highly
volatile is assigned a small value,
such as 60 (1 minute).
BLM431 Computer Networks Dr.Refik Samet 30
7.1.2. Resource Records
• Class
• For Internet information, it is always
IN.
• Type
• It tells what kind of record this is
• The most important types are listed
in following figure.

BLM431 Computer Networks Dr.Refik Samet 31


7.1.2. Resource Records

The principal DNS resource records types.

BLM431 Computer Networks Dr.Refik Samet 32


7.1.2. Resource Records
• Value
• This field can be a number, a
domain name, or an ASCII string.
• The semantics depend on the record
type.
• Following figure depicts part of a
database for the cs.vu.nl domain
shown on slide number 12.
BLM431 Computer Networks Dr.Refik Samet 33
7.1.2. Resource Records

A portion of a possible DNS database for cs.vu.nl.

BLM431 Computer Networks Dr.Refik Samet 34


7.1.3. Name Servers
• In theoty at least, a single name
server could contain the entire DNS
database and respond to all queries
about it.
• In practice, this server would be
so overloaded as to be useless.
• Futhermore, if it ever went down,
the entire Internet would be
crippled.
BLM431 Computer Networks Dr.Refik Samet 35
7.1.3. Name Servers
• To avoid the problems associated
with having only a single source of
information, the DNS name space
is divided into nonoverlapping
zones.

BLM431 Computer Networks Dr.Refik Samet 36


7.1.3. Name Servers

Part of the DNS name space showing the division into zones.

37
7.1.3. Name Servers

How a resolver looks up a remote name in eight steps.

BLM431 Computer Networks Dr.Refik Samet 38


7.2. Electronic Mail
• The first e-mail systems simply
consisted of file transfer protocols, with
the convention that the first line of each
message (i.e., file) contained the
recipient’s address.

BLM431 Computer Networks Dr.Refik Samet 39


7.2. Electronic Mail

• Architecture and
Services
• The User Agent
• Message Formats
• Message Transfer
• Final Delivery

BLM431 Computer Networks Dr.Refik Samet 41


7.2. Electronic Mail

• Architecture and
Services
• The User Agent
• Message Formats
• Message Transfer
• Final Delivery

BLM431 Computer Networks Dr.Refik Samet 42


7.2.1. Architecture and Services
• What e-mail systems can do and how
they are organized?
• There are two subsystems in e-
mail systems
a) User agents allow people to read and
send e-mail.
b) Message transfer agents move
messages from the source to the
destination.
BLM431 Computer Networks Dr.Refik Samet 43
7.2.1. Architecture and Services
e-mail systems support five basic
functions
• Composition
• Transfer
• Reporting
• Displaying
• Disposition

BLM431 Computer Networks Dr.Refik Samet 44


7.2.1. Architecture and Services
A few of advanced features:
• Mailboxes
• Mailing list
• Carbon copies
• Blind carbon copies
• Etc.

BLM431 Computer Networks Dr.Refik Samet 45


7.2.1. Architecture and Services
• A key idea in e-mail systems is the
distinction between the envelope and
its contents.
• The envelope encapsulates the message
• It contains all the information
needed for transporting the message,
such as the destination address,
priority, and security level, all of which
are distinct from the message itself.
46
7.2.1. Architecture and Services
• Message inside the envelope consists
of two parts:
• The header and the body
• The header contains control
information for the user agents.
• The body is entirely for the
human recipient.

BLM431 Computer Networks Dr.Refik Samet 47


User agent
7.2.2. The User Agent

• A user agent is normally a program


(sometimes called a mail reader) that
accepts a variety of commands for
composing, receiving, and replying
to message, as well as for
manipulating mailboxes.
7.2.1. Architecture and Services

Envelopes and messages. (a) Paper mail. (b)


Electronic mail.
BLM431 Computer Networks Dr.Refik Samet 50
7.2.2. The User Agent
SENDING E-MAIL
• To send an e-mail message, a user must
provide the message, the destination
address, and possiply some other
parameters,
• The message can be produced with a
free- standing text editor, a word
processing program, etc
• Most e-mail systems support mailing lists,
so that a user can send same message to a
list of people with a single command.
51
7.2.2. The User Agent
READING E-MAIL
• Typically, when a user agent is started up, it
looks at the user’s mailbox for incoming e-
mail before displaying anything on the
screen.
• Then it may announce the number of
messages in the mailbox or display a
one- line summary of each one and wait
for a command.
51
7.2.2. Reading E-mail

An example display of the contents of a mailbox.

53
7.2.3 Message Formats – RFC 822

Messages consist of :
• a primitive envelope,
• some number of header
fields,
• a blank line,
• and then message body

BLM431 Computer Networks Dr.Refik Samet 54


EXAMPLE

From: [email protected]
To: [email protected]
Subject: An RFC 822 formatted message

This is the plain text body of the message.


Note the blank line between the header
information and the body of the message.
7.2.3 Message Formats – RFC 822
• Each header field consists of a single line
of ASCII text containing the field name, a
colon, and, for most fields, a value.

• In normal usage, the user agent builds a


message and passes it to the message
transfer agent, which then uses some of the
header fields to construct the actual
envelope.
56
7.2.3 Message Formats – RFC
822

RFC 822 header fields related to message transport.

BLM431 Computer Networks Dr.Refik Samet 57


Message Formats – RFC 822
(2)

Some fields used in the RFC 822 message header.

58
MIME – Multipurpose Internet
Mail Extensions
•In the early days of the ARPANET, e-
mail consisted exclusivly of text
messages written in English and
expressed in ASCII.
•For this environment, RFC 822 did the
job completely: it specified the headers
but left the content entirely up to the
users.
57
• Multipurpose Internet Mail Extension (MIME) is
a standard that was proposed by Bell
Communications in 1991 in order to expand the
limited capabilities of email.
• MIME is a kind of add-on or a supplementary
protocol that allows non-ASCII data to be sent
through SMTP.
• It allows the users to exchange different kinds of
data files on the Internet: audio, video, images,
application programs as well.
Working of MIME –

• Suppose a user wants to send an email through a user


agent and it is in a non-ASCII format so there is a
MIME protocol that converts it into 7-bit NVT ASCII
format.
• The message is transferred through the e-mail system
to the other side in the 7-bit format now MIME
protocol again converts it back into non-ASCII code
and now the user agent of the receiver side reads it
and then information is finally read by the receiver.
• MIME header is basically inserted at the beginning of
any e-mail transfer.
MIME – Multipurpose Internet Mail
Extensions
Problems with international languages:
• Languages with
accents (French,
German).
• Languages in non-Latin
alphabets (Hebrew, Russian).
• Languages without
alphabets (Chinese,
Japanese).
• Messages not containing text at
BLM431 Computer Networks Dr.Refik Samet 62
MIME – Multipurpose Internet
Mail Extensions
•A solution was proposed in RFC 1341 and
updated in RFCs 2045-2049.
•This solution, called MIME (Multipurpose
Internet Mail Extensions) is now widely
used.
•The basic idea of MIME is to continue
to use the RFC 822 format, but to add
srtucture to the message body and define
encoding rules for non-ASCII messages.
BLM431 Computer Networks Dr.Refik Samet 63
MIME Header:
• It is added to the original e-mail header section to define
transformation. There are five headers that we add to the
original header:

• 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.
• Content Id – It is used for uniquely identifying the message.
• Content description – It defines whether the body is actually
an image, video, or audio.
MIME (2)

RFC 822 headers added by MIME.

BLM431 Computer Networks Dr.Refik Samet 65


MIME (3)

The MIME types and subtypes defined in RFC 2045.


BLM431 Computer
Networks Dr.Refik
Samet 66
MIME (4)

67
7.2.4. Message Transfer

•The message transfer system is concerned


with relaying messages from the
originator to the recipient.

•The simplest way to do this is to establish


a transport connection from the source
machine to the destination machine and
then just transfer the message.
68
Message Transfer Agent
SMTP
7.2.4. Message Transfer
•SMTP – The Simple Mail Transfer
Protocol
•Within the Internet, e-mail is delivered by
having the source machine establish a TCP
connection to port 25 of the destination
machine.
•Listening to this port is an e-mail daemon that
speaks SMTP.

72
SMTP
• SMTP stands for Simple Mail Transfer Protocol.
• SMTP is a set of communication guidelines that allow
software to transmit an electronic mail over the internet is
called Simple Mail Transfer Protocol.
• It is a program used for sending messages to other
computer users based on e-mail addresses.
• It provides a mail exchange between users on the same or
different computers, and it also supports:
• It can send a single message to one or more recipients.
• Sending message can include text, voice, video or
graphics.
• It can also send the messages on networks outside the
internet.
• 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
• Local user or client-end utility known as the mail user
agent (MUA) A Mail User Agent (MUA), also referred to as
an email client, is a computer application that allows you to
send and retrieve email.
• Server known as mail submission agent (MSA) A message
submission agent (MSA), or mail submission agent, is a
computer program or software agent that receives electronic
mail messages from a mail user agent (MUA) and cooperates
with a mail transfer agent (MTA) for delivery of the mail.
• Mail transfer agent (MTA) An MTA is just an element of the
email delivery process. It receives an email from the
mail/message submission agent (MSA), which, in turn,
receives it from the mail user agent (MUA).
• Mail delivery agent (MDA) Mail Delivery Agent (MDA) is
invoked by the MTA to file incoming emails in the proper
user’s mailbox.
Working of SMTP
• Composition of Mail: A user sends an e-mail by composing
an electronic mail message using a Mail User Agent (MUA). Mail
User Agent is a program which is used to send and receive mail.
The message contains two parts: body and header. The body is
the main part of the message while the header includes
information such as the sender and recipient address. The
header also includes descriptive information such as the subject
of the message. In this case, the message body is like a letter
and header is like an envelope that contains the recipient's
address.
• Submission of Mail: After composing an email, the mail client
then submits the completed e-mail to the SMTP server by using
SMTP on TCP port 25.
• Delivery of Mail: E-mail addresses contain two parts: username
of the recipient and domain name. For example,
[email protected], where "vivek" is the username of the recipient
and "gmail.com" is the domain name.
• If the domain name of the recipient's email
address is different from the sender's domain
name, then MSA will send the mail to the Mail
Transfer Agent (MTA).
• Receipt and Processing of Mail: Once the
incoming message is received, the exchange
server delivers it to the incoming server (Mail
Delivery Agent) which stores the e-mail where it
waits for the user to retrieve it.
• Access and Retrieval of Mail: The stored email
in MDA can be retrieved by using MUA (Mail User
Agent). MUA can be accessed by using login and
password.
Message Transfer

Transferring a message
from
[email protected]
to
[email protected].

BLM431 Computer Networks Dr.Refik Samet 81


Advantages of SMTP:
• If necessary, the users can have a dedicated server.
• It allows for bulk mailing.
• Low cost and wide coverage area.
• Offer choices for email tracking.
• reliable and prompt email delivery.

Disadvantages of SMTP:
• SMTP’s common port can be blocked by several firewalls.
• SMTP security is a bigger problem.
• Its simplicity restricts how useful it can be.
• Just 7 bit ASCII characters can be used.
• If a message is longer than a certain length, SMTP servers
may reject the entire message.
POP3
• The POP protocol is an abbreviation for Post Office
Protocol. As we all know, SMTP is a message
transport agent. When a message is transmitted,
SMTP is used to transfer it from the client to the
server, and then to the receiving server.
• The message is transmitted from the receiving
server to the real server via the Message Access
Agent.
• The Message Access Agent supports two
protocols: POP3 and IMAP.
POP(Post Office Protocol):

• Post Office Protocol is used to retrieve email for a single


client.
• POP3 version is the current version of POP used. It is an
application layer protocol.
• It allows to access mail offline and thus, needs less internet
time.
• To access the message it has to be downloaded. POP allows
only a single mailbox to be created on the mail server.
• POP does not allow search facilities
• Some of the POP commands are LOG IN, STAT, LIST,
RETR, DELE, RSET, and QUIT.
IMAP(Internet Message Access Protocol):

• Internet Message Access Protocol is used to retrieve mails for


multiple clients. There are several IMAP versions: IMAP,
IMAP2, IMAP3, IMAP4, etc. IMAP is an application layer
protocol. IMAP allows to access email without downloading
them and also supports email download.
• The emails are maintained by the remote server. It enables all
email operations such as creating, manipulating, delete the
email without reading it. IMAP allows you to search emails.
• It allows multiple mailboxes to be created on multiple mail
servers and allows concurrent access. Some of the IMAP
commands are: IMAP_LOGIN, CREATE, DELETE,
RENAME, SELECT, EXAMINE, and LOGOUT.
• The IMAP protocol synchronizes all the devices with the
main server. Let's suppose we have three devices desktop,
mobile, and laptop as shown in the above figure.
• If all these devices are accessing the same mailbox, then it
will be synchronized with all the devices.
• Here, synchronization means that when mail is opened by
one device, then it will be marked as opened in all the
other devices, if we delete the mail, then the mail will also
be deleted from all the other devices.
• So, we have synchronization between all the devices. In
IMAP, we can see all the folders like spam, inbox, sent,
etc.
7.2.5. Final Delivery

(a) Sending and reading mail when the receiver has a permanent
Internet connection and the user agent runs on the same machine as
the message transfer agent. (b) Reading e-mail when the
receiver has a dial-up connection to an ISP.
BLM431 Computer Networks
Dr.Refik Samet
74
7.2.5. Final Delivery - POP3

75
7.2.5. Final Delivery - IMAP
• IMAP – Internet Message Access Protocol
•IMAP assumes that all the e-mail will remain
on the server indefinitely in multiple
mailboxes.
•But POP3 basically assumes that the user will
clear out the mailbox on every contact and
work off-line after that.
•IMAP – provides extensive mechanisms
for reading message or even parts of
messages. Dr.Refik Samet
A compariso n o f P O P 3 and IMAP.
BL M431 C omp ute r Ne two rks

77
Dr.Refik Samet
SNMP

• SNMP stands for Simple Network Management


Protocol.
• SNMP is a framework used for managing devices on
the internet.
• It provides a set of operations for monitoring and
managing the internet.
• The purpose of SNMP is to provide network devices,
such as routers, servers and printers, with a common
language for sharing information with a network
management system (NMS)
Architecture of SNMP
There are mainly three main components in SNMP architecture:
• SNMP Manager: It is a centralized system used to monitor the network. It
is also known as a Network Management Station (NMS). A router that runs
the SNMP server program is called an agent, while a host that runs the
SNMP client program is called a manager.
• SNMP agent: It is a software management software module installed on a
managed device. The manager accesses the values stored in the database,
whereas the agent maintains the information in the database. To ascertain if
the router is congested or not, for instance, a manager can examine the
relevant variables that a router stores, such as the quantity of packets
received and transmitted.
• Management Information Base: MIB consists of information on
resources that are to be managed. This information is organized
hierarchically. It consists of objects instances which are essentially
variables. A MIB, or collection of all the objects under management by the
manager, is unique to each agent. System, interface, address translation, IP,
UDP, and EGP , ICMP, TCP are the eight categories that make up MIB.
Object Identifier (OID)

• An address on a device that represents a specific piece of information.


OIDs can represent any measurable information such as uptime, fan speed,
or temperature, as well as configurable elements like maximum bandwidth
or device name .
SNMP Messages
Get
The SNMP Manager sends a Get query to the SNMP Agent in order to retrieve a
specific piece of device information, represented as an OID.

Response
The SNMP Agent retrieves the requested OID from the MIB and sends the data to
the SNMP Manager.

GetNext
This command requests the value of the next OID in the MIB tree. When you need
to obtain more than one piece of data from a network device, you can efficiently
use Get followed by GetNext instead of two separate Get commands.

GetBulk
Using this single command, the SNMP Manager can retrieve multiple pieces of
information from a network device. This command is supported by SNMP v2 and
later versions.
Inform
This is similar to a Trap command, but here the SNMP Manager
acknowledges receipt of the agent’s notification. This command is available
only in SNMP v2 and later.
Trap
This is an agent-initiated command through which the agent informs the
manager of specific events. For example, you can configure an agent to
notify the manager when CPU utilization on a specific device exceeds 80
percent for one minute.
Set
SNMP managers can use a Set command to change configurations on a
managed device.
Advantages of SNMP
 Agents are widely implemented.

 It is easy to implement.

 Agent level overhead is minimal.

 It is robust and extensible.

 Polling approach is good for LAN based managed object.

 It offers the best direct manager agent interface.

Limitation of SNMP
 It does not scale well.

 There is no object oriented data view.

 It has no standard control definition.

 It has many implementation specific (private MIB) extensions.

 It has high communication overhead due to polling


WWW
Architecture of WWW
Browser
WWW works on client- server approach. Following steps explains how the web
works:

• User enters the URL (say, http://www.tutorialspoint.com) of the web page in


the address bar of web browser.

• Then browser requests the Domain Name Server for the IP address
corresponding to www.tutorialspoint.com.

• After receiving IP address, browser sends the request for web page to the web
server using HTTP protocol which specifies the way the browser and web
server communicates.

• Then web server receives request using HTTP protocol and checks its search
for the requested web page. If found it returns it back to the web browser and
close the HTTP connection.

• Now the web browser receives the web page, It interprets it and display the
contents of web page in web browser’s window.
Components of Web:
URL
• Method:
The method is the protocol used to retrieve the
document from a server. For example, HTTP.
• Host:

The host is the computer where the information


is stored, and the computer is given an alias
name. Web pages are mainly stored in the
computers and the computers are given an
alias name that begins with the characters
"www". This field is not mandatory.

27.110
• Port:
The URL can also contain the port number of
the server, but it's an optional field. If the port
number is included, then it must come between
the host and path and it should be separated
from the host by a colon.
• Path:

Path is the pathname of the file where the


information is stored. The path itself contain
slashes that separate the directories from the
subdirectories and files.
27.111
1

27.112
Figure 27.16 Example 27.1

27.113
Figure 27.17 Example 27.2

27.114
URLs – Uniform Resource Locaters
Some common URLs.

CSC 450/550
WEB DOCUMENTS
Static Web pages:

• Static Web pages are very simple. It is written in


languages such as HTML, JavaScript, CSS, etc.
• For static web pages when a server receives a
request for a web page, then the server sends the
response to the client without doing any
additional process.
• And these web pages are seen through a web
browser. In static web pages, Pages will remain
the same until someone changes it manually.
Static document
Dynamic Web Pages

• Dynamic Web Pages are written in languages


such as CGI, AJAX, ASP, ASP.NET, etc.
• In dynamic web pages, the Content of pages is
different for different visitors.
• It takes more time to load than the static web
page.
• Dynamic web pages are used where the
information is changed frequently, for example,
stock prices, weather information, etc.
Dynamic document using server-
site script
Active document using client-site
script
27-3 HTTP

The Hypertext Transfer Protocol (HTTP) is a protocol


used mainly to access data on the World Wide Web.
HTTP functions as a combination of FTP and SMTP.

Topics discussed in this section:


HTTP Transaction
Persistent Versus Nonpersistent Connection

27.122
Note

HTTP uses the services of TCP on well-


known port 80.

27.123
HTTP
• HTTP stands for HyperText Transfer Protocol.
• It is a protocol used to access the data on the World
Wide Web (www).
• The HTTP protocol can be used to transfer the data in
the form of plain text, hypertext, audio, video, and so
on.
• This protocol is known as HyperText Transfer Protocol
because of its efficiency that allows us to use in a
hypertext environment where there are rapid jumps
from one document to another document.
• HTTP is used to carry the data in the form of MIME-
like format.
• HTTP is similar to SMTP as the data is transferred
between client and server. The HTTP differs from the
SMTP in the way the messages are sent from the
client to the server and from server to the client.
SMTP messages are stored and forwarded while
HTTP messages are delivered immediately.
 HTTP uses a client-server model where-
Web browser is the client.
Client communicates with the web server hosting the
website.
Features of HTTP:

Connectionless protocol:
• HTTP is a connectionless protocol.

• HTTP client initiates a request and waits for a

response from the server.


• When the server receives the request, the

server processes the request and sends back


the response to the HTTP client after which
the client disconnects the connection.
• The connection between client and server

exist only during the current request and


response time only.
2. Media independent:
 HTTP protocol is a media independent as data

can be sent as long as both the client and


server know how to handle the data content.
 It is required for both the client and server to

specify the content type in MIME-type header.

3. Stateless:
 HTTP is a stateless protocol as both the client

and server know each other only during the


current request.

27.128
HTTP Connections

HTTP connections can be of two types-

 Non-persistent HTTP connection


 Persistent HTTP connection
Non-persistent HTTP connection

 In a non-persistent connection, each


request/response pair uses a separate TCP
connection. After the server sends the
requested data to the client, the connection is
closed. For each subsequent request, a new
connection must be established.
Persistent Connection:

 Also known as HTTP keep-alive or HTTP


connection reuse, a persistent connection
allows multiple requests and responses to be
sent over a single TCP (Transmission Control
Protocol) connection. Once the connection is
established, it remains open for multiple
transactions between the client and the server.
HTTP request
 HTTP request is simply termed as the information or data that is
needed by Internet browsers for loading a website. This is simply
known as HTTP Request.
 There is some common information that is generally present in all
HTTP requests. These are mentioned below.

 HTTP Version
 URL
 HTTP Method
 HTTP Request Headers
 HTTP Body
<Method> <Request-URI> <HTTP-Version>
<Header-Name>: <Header-Value>
...
<Header-Name>: <Header-Value>

<Optional-Body>

//http
GET /index.html HTTP/1.1
Host: www.example.com
User-Agent: Mozilla/5.0
Accept: text/html
 Method: The HTTP method (e.g., GET, POST)
indicating the action to be performed.
 Request-URI: The resource being requested
(e.g., /index.html).
 HTTP-Version: The version of HTTP being used
(e.g., HTTP/1.1).
 Header-Name: The name of the header (e.g.,
Host, User-Agent).
 Header-Value: The value associated with the
header.
 Optional-Body: The body of the message,
typically present in POST requests.
HTTP Response

 HTTP Response is simply the answer to what


a Server gets when the request is raised.
There are various things contained in HTTP
Response, some of them are listed below.

 HTTP Status Code


 HTTP Headers
 HTTP Body
<HTTP-Version> <Status-Code> <Reason-Phrase>
<Header-Name>: <Header-Value>
...
<Header-Name>: <Header-Value>
<Optional-Body>
// http
HTTP/1.1 200 OK
Content-Type: text/html
Content-Length: 154

<html>
<body>
<h1>Welcome to Example.com!</h1>
</body>
</html>
 Status-Code: A three-digit code indicating the
result of the request (e.g., 200, 404).
 Reason-Phrase: A brief description of the
status code.
 Header-Name and Header-Value: Similar to
request messages.
 Optional-Body: The body of the response,
often containing HTML, JSON, or other data.
Table 27.1 Methods

27.140
Example
Request
GET /index.html HTTP/1.1
Method: GET (used to retrieve data)
Path: /index.html (resource requested)
HTTP Version: HTTP/1.1
Response
HTTP/1.1 200 OK
Date: Wed, 04 Dec 2024 10:00:00 GMT
Server: Apache/2.4.41 (Ubuntu)
Last-Modified: Tue, 03 Dec 2024 15:30:00 GMT
Content-Type: text/html
Content-Length: 349
Figure 27.14 Request and status lines
HTTP Status Code

 HTTP Status Codes are the 3-digit codes that tell the
message or simply tell us about the HTTP Request
whether it has been completed or not. There are
simply 5 types of status codes.

 Informational
 Successful
 Re-directional
 Client-Error
 Server-Error
Table 27.2 Status codes

27.144
Table 27.2 Status codes (continued)

27.145
HTTP caching

 The HTTP cache stores a response associated


with a request and reuses the stored response
for subsequent requests.

 There are several advantages to reusability.


First, since there is no need to deliver the
request to the origin server, then the closer the
client and cache are, the faster the response
will be.
 The most typical example is when the browser
itself stores a cache for browser requests.
private cache

 A private cache is a cache tied to a


specific client — typically a browser
cache. Since the stored response is
not shared with other clients, a
private cache can store a
personalized response for that user.
shared cache

 The shared cache is located


between the client and the server
and can store responses that can
be shared among users.
 And shared caches can be further
sub-classified into
 proxy caches and
 managed caches.
Proxy caching

 Proxy caching is a feature of proxy


servers that stores content on the
proxy server itself, allowing web
services to share those resources to
more users. The proxy server
coordinates with the source server
to cache documents such as files,
images and web pages.
Managed caches

 Managed caches are explicitly


deployed by service developers to
offload the origin server and to
deliver content efficiently.
 Examples include reverse proxies,
CDNs, and service workers in
combination with the Cache API.
Table 27.3 General headers
Table 27.4 Request headers
Table 27.5 Response headers
Table 27.6 Entity headers
Streaming Audio and Video

155
What is Streaming Technology

A technique for transferring data such that it can be processed


as a steady and continuous stream, client does not have to download the entire
file to view it.

Data
Source
Network

The portion in the buffer

The portion client is viewing


156
Advantages

 It reduces download time

 It provides steady service

 Slower systems can take advantage of streaming technology

 Provide service on demand

Applications are utilizing this technology are:


Streaming Video, IP telephony, Internet Radio, Distance learning,
Videoconferencing, Interactive games and so on

157
Disadvantages

 It is difficult to keep the service steady if the bandwidth is low

 The maintenance of streaming server is relatively expensive

 Packet loss may occur during the transmission

158
3 Types of delivery methods of
streaming media

 Streaming Stored Audio and Video

 Streaming Live Audio and Video

 Real-Time Interactive Audio and Video

159
Media Player or Helper Application

Three main streaming media companies or products are:


RealPlayer (RealNetworks),
Media Player (Microsoft) and
QuickTime (Apple).

Three basic tasks of media players:


 Decompression
 Jitter Removal
 Error Correction

160
Accessing Audio & Video
thru a Web server

Web
HTTP
Browser
Web Server
Client
With Audio
Files Files

Media
Player

161
Accessing Audio & Video
thru a Meta File

HTTP request /response


Client Web
Browser
for meta file
Web
meta file Server
HTTP

Media Audio/Video file


Player requested and sent
using HTTP

A meta file contains information of URL, type of encoding, etc


about the audio/video file that is to be streamed.
162
RTSP Diagram

HTTP request/response
Client Web
Browser Web
Server

meta file
RTSP Streaming Command
Streaming
Media Server
Player RTP Audio / Video
Content

HTTP is insufficient for user interaction. With streaming server


audio/video file can be sent over UDP,
163
Protocols

 RTSP: Real Time Streaming Protocol

 RTP : Real-time transfer Protocol

164
RTSP

 RTSP is a industry standard Internet application level protocol

 RTSP is a framework for delivering and transmission of multicast


data stream

 RTSP is a protocol that allows a media player to control the


transmission of a media stream for exchanging control information

165
RTSP Features

 RTSP works in the conjunction with RTP to deliver streaming audio


& video content

 RTSP maintains a server state during transmission unlike HTTP

 Client-Server architecture

 Overcome the limitations of HTTP. RTSP enhance HTTP functions

 RTSP provides the synchronization of events

166
RTP

 RTP is used to transmit real-time data

 RTP encapsulate segments

Payload Sequence Timestamp Synchronization Misc


type number source identifier

167
RTSP Operation

HTTP GET
Web Web HTTP
Browser Presentation Description File Server

Setup

Play
Medi Medi
a Media Stream a
RTSP
Player Pause Player

Teardown

168
Presentation Description File
<title> Music </title>
<session> <group language=en lipsync>
<switch>
<track type=audio
e=”PCMU/8000/1”
src=”rtsp://audio.com/music/audio.en/lofi”>
<track type=audio
e=”DV14/16000/2” pt=”90 DV14/8000/1”
src=”rtsp://audio.com/music/audio.en/hifi”>
</switch>
<track type=”video/jpeg”
src=”rtsp://video.com/music/video”>
</group> </session>

169

You might also like