CN Unit 5
CN Unit 5
CN Unit 5
UNIT – V
APPLICATION LAYER
Contents :
Domain name system
o The DNS Name Space
o Domain Resource Records
o Domain Resource Records
Electronic Mail
o Architecture Services
o SMTP
World Wide Web
o Architectural Overview
o HTTP
Streaming audio and video
o Digital Audio
o Digital Video
o Streaming Stored Media
o Streaming Live Media
o Real Time Conferencing
-o0o-
B.Tech III Year II Semester ECE Page 0 Mr. M. Yadaiah, Asst.Professor,CSE (GNITC)
Computer Networks Unit - V Application Layer
UNIT-5
APPLICATION LAYER
Application layer takes data from the user and convert the data in to the APDU by adding application
layer header.
Services provided by Application Layer:
Network Security
Authentication
Domain Name System
World Wide Web
Network Management through SNMP
File transfer and Access
e-Mail
Network Virtual Terminal
Multimedia
The Domain Name System (DNS) is a directory lookup service that provides a mapping between the
name of a host on the Internet and its numerical address.
The Domain Name System (DNS) is a supporting program that is used by other programs such as e-
mail. a DNS client/server program can support an e-mail program to find the IP address of an e-mail
recipient.
Four elements comprise the DNS:
Domain name space: DNS uses a tree-structured name space to identify resources on the
Internet.
DNS database: Conceptually, each node and leaf in the name space tree structure names a
set of information (e.g., IP address, type of resource) that is contained in a resource record
(RR).The collection of all RRs is organized into a distributed database.
Name servers: These are server programs that hold information about a portion of the
domain name tree structure and the associated RRs.
Resolvers: These are programs that extract information from name servers in response to
client requests. A typical client request is for an IP address corresponding to a given domain
name.
B.Tech III Year II Semester ECE Page 1 Mr. M. Yadaiah, Asst.Professor,CSE (GNITC)
Computer Networks Unit - V Application Layer
Name Space:
Name space maps each address to a unique name that can be organized in two ways: Flat
Name Space, Hierarchical Name Space
Flat Name Space:
o In this, a name is assigned to an address. A name in this space is a sequence of
characteristics without Structure.
o The names may or may not have a common section.
o Disadvantage: It cannot be used in a large system such as the internet because it must
be centrally controlled to avoid ambiguity and duplication.
Hierarchical Name Space:
o In this, each name is made of several parts.
o The first part can define the nature of the organization.
o The second part can define the name of the organization
o The third part can define the departments in the organization and so on.
o A central authority can assign the part of the name that defines the nature of the
organization and the name of the organization.
o The responsibility of the rest of the name can be given to the organization itself. The
organization can add suffixes (or prefixes) to the name to define its host or
resources.
o Domain Name Space:
To have a hierarchical name space, a domain name space was designed. In this
design the names are defined in an inverted-tree structure with the root at the
top. The tree can have only 128 levels: level 0 (root) to level 127.
B.Tech III Year II Semester ECE Page 2 Mr. M. Yadaiah, Asst.Professor,CSE (GNITC)
Computer Networks Unit - V Application Layer
Label:
Each node in the tree has a label, which is a string with a maximum of
63 characters.
The root label is a null string (empty string).
DNS requires that children of a node (nodes that branch from the same
node) have different labels, which guarantees the uniqueness of the
domain names.
Domain Name:
Each node in the tree has a domain name.
A full domain name is a sequence of labels separated by dots (.).
The domain names are always read from the node up to the root. The
last label is the label of the root (null). This means that a full domain
name always ends in a null label, which means the last character is a
dot because the null string is nothing.
B.Tech III Year II Semester ECE Page 3 Mr. M. Yadaiah, Asst.Professor,CSE (GNITC)
Computer Networks Unit - V Application Layer
null
Figure: Domains
DNS in Internet:
DNS is a protocol that can be used in different platforms.
In the Internet, the domain name space (tree) is divided into three different sections: Generic
Domains, Country Domains, and The Inverse Domain.
B.Tech III Year II Semester ECE Page 5 Mr. M. Yadaiah, Asst.Professor,CSE (GNITC)
Computer Networks Unit - V Application Layer
B.Tech III Year II Semester ECE Page 6 Mr. M. Yadaiah, Asst.Professor,CSE (GNITC)
Computer Networks Unit - V Application Layer
Inverse Domain:
o The inverse domain is used to map an address to a name.
o For example, when a server has received a request from a client to do a task.
Although the server has a file that contains a list of authorized clients, only the IP
address of the client (extracted from the received IP packet) is listed.
o The server asks its resolver to send a query to the DNS server to map an address to a
name to determine if the client is on the authorized list. This type of query is called
an inverse or pointer (PTR) query.
The response message consists of a header, question records, answer records, authoritative
records, and additional records.
B.Tech III Year II Semester ECE Page 8 Mr. M. Yadaiah, Asst.Professor,CSE (GNITC)
Computer Networks Unit - V Application Layer
o Authoritative Section
This section consist of one or more resource records. It is present only on
response messages. This section gives information (domain name) about one
or more authoritative servers for the query.
o Additional Information Section
This section consist of one or more resource records. It is present only on
response messages. This section provides additional information that may
help the resolver.
TYPES OF RECORDS
There are two types of records are used in DNS: Question Records and Resource Records.
The Question Records are used in the question section of the query and response messages.
The Resource Records are used in the answer, authoritative, and additional information
sections of the response message.
Question Record
o A question record is used by the client to get information from a server. This contains
the domain name.
Query Name: This is a variable length field containing a domain name. Each
count byte is a binary value between 0 and 63, count bytes are not ASCII.
Ex:
Query Type: This is a 2 byte filed containing the type of query. Some query
types are listed below.
IPv4 address
Query Class: This is a 2 Byte field specifying the protocol using DNS.
Internet has a value of 1.
Resource Record
o Each domain name (each node on the tree) is associated with a record called the
resource record. The server database consists of resource records. Resource records
are also what is returned by the server to the client.
Figure:
Resource Record Format
B.Tech III Year II Semester ECE Page 10 Mr. M. Yadaiah, Asst.Professor,CSE (GNITC)
Computer Networks Unit - V Application Layer
5.2 e-MAIL:
One of the most popular Internet services is electronic mail (e-mail).
At the beginning of the Internet era, the messages sent by electronic mail were short and consisted of
text only; they let people exchange quick memos. Today, electronic mail is much more complex.
It allows a message to include text, audio, and video. It also allows one message to be sent to one or
more recipients.
User Agent:
o It provides service to the user to make the process of sending and receiving a message
easier.
Composing Messages
A user agent helps the user compose the e-mail message to be sent out.
Most user agents provide a template on the screen to be filled in by the
user. Some even have a built-in editor that can do spell checking,
grammar checking, and other tasks expected from a sophisticated word
processor.
A user, of course, could alternatively use his or her favorite text editor
or word processor to create the message and import it, or cut and paste
it, into the user agent template.
Reading Messages
The second duty of the user agent is to read the incoming messages.
When a user invokes a user agent, it first checks the mail in the
incoming mailbox.
Most user agents show a one-line summary of each received mail.
Each e-mail contains the following fields.
1. A number field.
2. A flag field that shows the status of the mail such as new, already
read but not replied to, or read and replied to.
3. The size of the message.
B.Tech III Year II Semester ECE Page 11 Mr. M. Yadaiah, Asst.Professor,CSE (GNITC)
Computer Networks Unit - V Application Layer
4. The sender.
5. The optional subject field.
Replying to Messages
After reading a message, a user can use the user agent to reply to a
message.
A user agent usually allows the user to reply to the original sender or to
reply to all recipients of the message. The reply message may contain
the original message (for quick reference) and the new message.
Forwarding Messages
Replying is defined as sending a message to the sender or recipients of
the copy.
Forwarding is defined as sending the message to a third party. A user
agent allows the receiver to forward the message, with or without extra
comments, to a third party.
Handling Mailboxes
A user agent normally creates two mailboxes: an inbox and an
outbox.
Each box is a file with a special format that can be handled by the user
agent.
The inbox keeps all the received e-mails until they are deleted by the
user.
The outbox keeps all the sent e-mails until the user deletes them.
Most user agents today are capable of creating customized mailboxes.
Sending Mail
To send mail, the user, through the UA, creates mail that looks very
similar to postal mail. It has an envelope and a message.
Receiving Mail
If a user has mail, the UA informs the user with a notice.
If the user is ready to read the mail. a list is displayed in which each
line contains a summary of the information about a particular message
in the mailbox.
The summary usually includes the sender mail address, the subject, and
the time the mail was sent or received. The user can select any of the
messages and display its contents on the screen.
Addresses
To deliver mail, a mail handling system must use an addressing system
with unique addresses.
In the Internet, the address consists of two parts:
Local Part: defines the name of a special file, called the user
mailbox, where all the mail received for a user is stored for
retrieval by the message access agent.
Domain Name: The domain name assigned to each mail
exchanger either comes from the DNS database or is a logical
name.
Both local part and domain name are separated by an @ sign.
B.Tech III Year II Semester ECE Page 13 Mr. M. Yadaiah, Asst.Professor,CSE (GNITC)
Computer Networks Unit - V Application Layer
Figure: MIME
o MIME defines five headers that can be added to the original e-mail header section to
define the transformation parameters:
1. MIME-Version
2. Content-Type
3. Content-Transfer-Encoding
4. Content-Id
5. Content-Description
B.Tech III Year II Semester ECE Page 14 Mr. M. Yadaiah, Asst.Professor,CSE (GNITC)
Computer Networks Unit - V Application Layer
Figure: Content-Transfer-Encoding
B.Tech III Year II Semester ECE Page 15 Mr. M. Yadaiah, Asst.Professor,CSE (GNITC)
Computer Networks Unit - V Application Layer
B.Tech III Year II Semester ECE Page 16 Mr. M. Yadaiah, Asst.Professor,CSE (GNITC)
Computer Networks Unit - V Application Layer
B.Tech III Year II Semester ECE Page 17 Mr. M. Yadaiah, Asst.Professor,CSE (GNITC)
Computer Networks Unit - V Application Layer
B.Tech III Year II Semester ECE Page 18 Mr. M. Yadaiah, Asst.Professor,CSE (GNITC)
Computer Networks Unit - V Application Layer
The direction of the bulk data is from the server to the client. The third stage uses a
message access agent.
Currently two message access protocols are available: Post Office Protocol, version 3
(POP3) and Internet Mail Access Protocol, version 4 (IMAP4).
POP3:
Post Office Protocol, version 3 (POP3) is simple and limited in functionality.
The client POP3 software is installed on the recipient computer; the server
POP3 software is installed on the mail server.
Mail access starts with the client when the user needs to download e-mail from
the mailbox on the mail server.
The client opens a connection to the server on TCP port 110.
It then sends its user name and password to access the mailbox.
The user can then list and retrieve the mail messages, one by one.
B.Tech III Year II Semester ECE Page 19 Mr. M. Yadaiah, Asst.Professor,CSE (GNITC)
Computer Networks Unit - V Application Layer
B.Tech III Year II Semester ECE Page 20 Mr. M. Yadaiah, Asst.Professor,CSE (GNITC)
Computer Networks Unit - V Application Layer
Receiver (Bob) also needs a user agent program to retrieve messages stored in the mailbox of
the system at its site.
The message, needs to be sent through the Internet from sender's site to receiver's site.
Two message transfer agents are needed: one 'client and one server.
Like most client/server programs on the Internet, the server needs to run all the time because
it does not know when a client will ask for a connection.
The client, on the other hand, can be alerted by the system when there is a message in the
queue to be sent.
When the sender and the receiver of an e-mail are on different systems,
we need two VAs and a pair of MTAs (client and server).
B.Tech III Year II Semester ECE Page 21 Mr. M. Yadaiah, Asst.Professor,CSE (GNITC)
Computer Networks Unit - V Application Layer
When both sender and receiver are connected to the mail server via a LAN or a WAN, we
need two VAs, two pairs of MTAs (client and server), and a pair of MAAs (client and
server). This is the most common situation today.
B.Tech III Year II Semester ECE Page 22 Mr. M. Yadaiah, Asst.Professor,CSE (GNITC)
Computer Networks Unit - V Application Layer
B.Tech III Year II Semester ECE Page 23 Mr. M. Yadaiah, Asst.Professor,CSE (GNITC)
Computer Networks Unit - V Application Layer
The server at site A finds the document and sends it to the client. When the user views the
document, she finds some references to other documents, including a Web page at site B.
The reference has the URL for the new site. The user is also interested in seeing this
document.
The client sends another request to the new site, and the new page is retrieved.
B.Tech III Year II Semester ECE Page 24 Mr. M. Yadaiah, Asst.Professor,CSE (GNITC)
Computer Networks Unit - V Application Layer
o The protocol or method is the client/server program used to retrieve the document.
Ex: FTP or HTTP.
o The host is the computer on which the information is located, although the name of
the computer can be an alias. Web pages are usually stored in computers, and
computers are given alias names that usually begin with the characters "www". This
is not mandatory.
o The URL can optionally contain the port number of the server. If the port is included,
it is inserted between the host and the path, and it is separated from the host by a
colon.
o Path is the pathname of the file where the information is located.
WEB DOCUMENTS
The documents in the WWW can be grouped into three broad categories: Static, Dynamic,
and Active.
The category is based on the time at which the contents of the document are determined.
Static Documents:
o Static documents are fixed-content documents that are created and stored in a server.
o The client can get only a copy of the document. In other words, the contents of the
file are determined when the file is created, not when it is used.
o The contents in the server can be changed, but the user cannot change them. When a
client accesses the document, a copy of the document is sent.
o The user can then use a browsing program to display the document.
B.Tech III Year II Semester ECE Page 25 Mr. M. Yadaiah, Asst.Professor,CSE (GNITC)
Computer Networks Unit - V Application Layer
B.Tech III Year II Semester ECE Page 26 Mr. M. Yadaiah, Asst.Professor,CSE (GNITC)
Computer Networks Unit - V Application Layer
Active Documents
o For many applications, we need a program or a script to be run at the client site.
These are called active documents.
o For example, suppose we want to run a program that creates animated graphics on the
screen or a program that interacts with the user.
o The program definitely needs to be run at the client site where the animation or
interaction takes place.
o When a browser requests an active document, the server sends a copy of the
document or a script.
o The document is then run at the client (browser) site.
5.4 MULTIMEDIA
Multimedia means that computer information can be represented through audio, video, and animation
in addition to traditional media (i.e., text, graphics drawings, images).
The audio and video services into three broad categories: Streaming Stored Audio/Video, Streaming
Live Audio/Video, and Interactive Audio/Video.
Streaming stored audio/video refers to on-demand requests for compressed audio/video files.
B.Tech III Year II Semester ECE Page 27 Mr. M. Yadaiah, Asst.Professor,CSE (GNITC)
Computer Networks Unit - V Application Layer
Streaming live audio/video refers to the broadcasting of radio and TV programs through the
Internet.
Interactive audio/video refers to the use of the Internet for interactive audio/video applications.
DIGITIZING AUDIO AND VIDEO:
Before audio or video signals can be sent on the Internet, they need to be digitized.
Digitizing Audio:
o When sound is fed into a microphone, an electronic analog signal is generated which
represents the sound amplitude as a function of time. The signal is called an analog
audio signal.
o An analog signal, such as audio, can be digitized to produce a digital signal.
o According to the Nyquist theorem, if the highest frequency of the signal is f, we need
to sample the signal 21 times per second.
o Voice is sampled at 8000 samples per second with 8 bits per sample. This results in a
digital signal of 64 kbps.
o Music is sampled at 44,100 samples per second with 16 bits per sample. This results
in a digital signal of 705.6 kbps for monaural and 1.411 Mbps for stereo.
Digitizing Video:
o A video consists of a sequence of frames. If the frames are displayed on the screen
fast enough, we get an impression of motion. There is no standard number of frames
per second
o To avoid a condition known as flickering, a frame needs to be refreshed.
o The TV industry repaints each frame twice. This means 50 frames need to be sent, or
if there is memory at the sender site, 25 frames with each frame repainted from the
memory.
o Each frame is divided into small grids, called picture elements or pixels. For
blackand- white TV, each 8-bit pixel represents one of 256 different gray levels.
o For a color TV, each pixel is 24 bits, with 8 bits for each primary color (red, green,
and blue).
o To send video using lower-rate technologies, we need to compress the video.
Compression is needed to send video over the Internet.
Several standards have been defined such as GSM (13 kbps), G.729 (8 kbps),
and G.723.3 (6.4 or 5.3 kbps).
o Perceptual Encoding: MP3
The most common compression technique that is used to create CD-quality
audio is based on the perceptual encoding technique. This type of audio needs
at least 1.411 Mbps; this cannot be sent over the Internet without
compression.
MP3 (MPEG audio layer 3), a part of the MPEG standard , uses this
technique.
Perceptual encoding is based on the science of psychoacoustics, which is the
study of how people perceive sound. The idea is based on flaws in our
auditory system: Some sounds can mask other sounds. Masking can happen in
frequency and time.
In frequency masking, a loud sound in a frequency range can partially or
totally mask a softer sound in another frequency range.
In temporal masking, a loud sound can numb our ears for a short time even
after the sound has stopped.
MP3 uses these two phenomena, frequency and temporal masking, to
compress audio signals.
The technique analyzes and divides the spectrum into several groups. Zero
bits are allocated to the frequency ranges that are totally masked.
A small number of bits are allocated to the frequency ranges that are partially
masked. A larger number of bits are allocated to the frequency ranges that are
not masked.
MP3 produces three data rates: 96 kbps, 128 kbps, and 160 kbps. The rate is
based on the range of the frequencies in the original analog audio.
Video Compression:
o video is composed of multiple frames. Each frame is one image.
o To do video compression, first image must be compressed.
o There are two standards for Video Compression:
1. Joint Photographic Experts Group (JPEG) is used to compress images.
2. Moving Picture Experts Group (MPEG) is used to compress video.
o Image Compression: JPEG
If the picture is not in color (gray scale), each pixel can be represented by an
8-bit integer (256 levels).
If the picture is in color, each pixel can be represented by 24 bits (3 x 8 bits),
with each 8 bits representing red, blue, or green (RBG).
In JPEG, a gray scale picture is divided into blocks of 8 x 8 pixels.
B.Tech III Year II Semester ECE Page 29 Mr. M. Yadaiah, Asst.Professor,CSE (GNITC)
Computer Networks Unit - V Application Layer
Discrete Cosine Transform (DCT): In this step, each block of 64 pixels goes
through a transformation called the discrete cosine transform (DCT). The
transformation changes the 64 values so that the relative relationships between
pixels are kept but the redundancies are revealed.
Case 1: In this case, we have a block of uniform gray, and the value of each
pixel is 20. When we do the transformations, we get a nonzero value for the
first element (upper left corner); the rest of the pixels have a value of 0. The
value of T(0,0) is the average (multiplied by a constant) of the P(x,y) values
and is called the de value (direct current, borrowed from electrical
engineering). The rest of the values, called ae values, in T(m,n) represent
changes in the pixel values. But because there are no changes, the rest of the
values are 0s.
B.Tech III Year II Semester ECE Page 30 Mr. M. Yadaiah, Asst.Professor,CSE (GNITC)
Computer Networks Unit - V Application Layer
Case 3: In the third case, we have a block that changes gradually. That is,
there is no sharp change between the values of neighbouring pixels. When we
do the transformations, we get a de value, with many nonzero ac values also.
B.Tech III Year II Semester ECE Page 31 Mr. M. Yadaiah, Asst.Professor,CSE (GNITC)
Computer Networks Unit - V Application Layer
B.Tech III Year II Semester ECE Page 32 Mr. M. Yadaiah, Asst.Professor,CSE (GNITC)
Computer Networks Unit - V Application Layer
B.Tech III Year II Semester ECE Page 33 Mr. M. Yadaiah, Asst.Professor,CSE (GNITC)