0% found this document useful (0 votes)
5 views26 pages

CN Unit 5

Uploaded by

anirudda1908
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)
5 views26 pages

CN Unit 5

Uploaded by

anirudda1908
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
You are on page 1/ 26

1 CN UNIT-5

UNIT V Principles of Network Applications


Principles of Network Applications, The Web and HTTP, Electronic Mail in the Internet, DNS—
The Internet’s Directory Service, Peer-to-Peer Applications Video Streaming and Content
Distribution Networks
Principles of Network Applications:
The Principles of Network Applications are fundamental concepts that govern the design and
development of applications that run on a computer network. These principles encompass several
key aspects of network applications, including:
 Network Application Architectures
 Processes Communicating
 The Interface Between the Process and the Computer Network
 Transport Services Available to Applications
 Transport Services Provided by the Internet
 Application-Layer Protocols
1. Network Application Architectures refer to the overall design and structure of a network
application. It encompasses how the application is divided into different components, and how
these components interact with each other. There are several commonly used network
application architectures, including:
 Client-Server Architecture: In this architecture, one component acts as a client and
makes requests to a server component, which provides the requested services. This
architecture is commonly used in web applications, where the client is a web browser
and the server is a web server.
 Peer-to-Peer Architecture: In this architecture, every component is both a client and
a server, and each component can communicate directly with any other component.
This architecture is commonly used in file-sharing applications, where each user’s
device acts as both a client and a server.
 Three-Tier Architecture: In this architecture, the application is divided into three
components: a client component, a middleware component, and a database
component. The client component makes requests to the middleware component,
which communicates with the database component to retrieve or update data. This
architecture provides a layer of abstraction between the client and the database, which
can improve performance and scalability.
2. Processes Communicating refers to the communication between multiple processes in a
computer network. Processes can be thought of as individual programs or tasks running on a
device, and they may be located on the same device or on different devices connected to the
network.
 Communication between processes is facilitated by the use of protocols, which define
the rules and formats for exchanging data. The communication between processes
can be either synchronous or asynchronous, meaning that either both processes must
be available to communicate at the same time or the communication can occur at
different times.
 In a network application, communication between processes is essential for the
application to function correctly. For example, in a client-server architecture, the
client process makes requests to the server process, and the server process returns the

Mr. D. Sanjeeva Reddy M. Tech., Assistant Professor


2 CN UNIT-5

requested information. In a peer-to-peer architecture, each process can communicate


directly with any other process.
 It’s important to consider the communication between processes when designing a
network application. Factors such as the reliability of communication, the security of
communication, and the performance of the communication must be taken into
account. The choice of protocols used for communication will depend on the
requirements of the application and the network infrastructure.
3. The Interface between the Process and the Computer Network refers to the connection
between a process running on a device and the underlying computer network. This interface
determines how the process communicates with other processes and with the network itself.
The interface between a process and the computer network is usually provided by a network
stack, which is a collection of protocols and services that handle the communication between the
process and the network. The network stack translates the process’s requests and data into the
appropriate network protocols, and vice versa, allowing the process to communicate over the
network.
The network stack typically includes several layers, each with its own specific responsibilities.
The layers may include:
1. Application Layer: This layer provides the interface between the process and the
network stack. It defines the protocols and services used by the process to
communicate with the network.
2. Transport Layer: This layer provides the underlying transport services that enable
the process to communicate with other processes over the network. These services
include protocols such as TCP (Transmission Control Protocol) and UDP (User
Datagram Protocol).
3. Network Layer: This layer provides the basic mechanisms for routing data between
devices on the network. The Internet Protocol (IP) is the most commonly used
network layer protocol.
4. Link Layer: This layer provides low-level communication services between devices
on the same physical network. The link layer is responsible for error detection and
correction, and for determining the best path for data to travel over the network.
4. Transport Services Available to Applications are the services provided by the network stack
that enable applications to communicate with each other over a computer network. These
services are responsible for ensuring that data is reliably delivered between applications, and
they provide the underlying communication infrastructure for the application.
There are several transport services available to applications, including:
1. TCP (Transmission Control Protocol): TCP is a reliable, connection-oriented
transport service that provides error-checking and flows control to ensure that data is
delivered accurately. Applications that require reliable data delivery, such as email
or file transfer, typically use TCP.
2. UDP (User Datagram Protocol): UDP is an unreliable, connectionless transport
service that does not provide error checking or flow control. Applications that require
low latency or high speed, such as video streaming or online gaming, typically use
UDP.
3. SCTP (Stream Control Transmission Protocol): SCTP is a reliable, multi-homed
transport service that provides error checking and flow control. SCTP can handle

Mr. D. Sanjeeva Reddy M. Tech., Assistant Professor


3 CN UNIT-5

multiple streams of data between applications, allowing for efficient communication


between applications.
4. DCCP (Datagram Congestion Control Protocol): DCCP is a transport service that
provides congestion control for applications that do not require reliable data delivery.
Transport Services Provided by the Internet The choice of transport service will depend on the
requirements of the application, including reliability, performance, and security requirements.
For example, an application that requires reliable data delivery, such as email, would use TCP,
while an application that requires low latency and high speed, such as online gaming, would use
UDP.
5. Transport Services Provided by the Internet: The Internet provides two primary transport
services for applications: TCP (Transmission Control Protocol) and UDP (User Datagram
Protocol).
1. TCP: TCP is a reliable, connection-oriented transport service that provides error-
checking and flows control to ensure that data is delivered accurately. Applications
that require reliable data delivery, such as email or file transfer, typically use TCP.
TCP establishes a reliable connection between two devices and ensures that data is
transmitted in the correct order and without errors.
2. UDP: UDP is an unreliable, connectionless transport service that does not provide
error checking or flow control. Applications that require low latency or high speed,
such as video streaming or online gaming, typically use UDP. Because UDP does not
provide error checking or flow control, it is faster and more efficient than TCP, but it
may not be suitable for applications that require reliable data delivery.
6. Application-layer protocols are data exchange protocols used to allow communication
between applications on different devices. They operate at the highest layer of the OSI (Open
Systems Interconnection) model, which is the application layer. Application-layer protocols
define the rules for exchanging data between applications, such as formatting, error detection
and correction, and security. Examples of application-layer protocols include HTTP, HTTPS,
FTP, SMTP, POP3, IMAP, and many others. They are used in various applications such as web
browsing, email, file transfer, and more.

World Wide Web (WWW):

The World Wide Web (WWW), often called the Web, is a system of interconnected webpages
and information that you can access using the Internet. It was created to help people share and
find information easily, using links that connect different pages together. The Web allows us to
browse websites, watch videos, shop online, and connect with others around the world through
our computers and phones.

All public websites or web pages that people may access on their local computers and other
devices through the internet are collectively known as the World Wide Web or W3. Users can
get further information by navigating to links interconnecting these pages and documents. This
data may be presented in text, picture, audio, or video formats on the internet.

Mr. D. Sanjeeva Reddy M. Tech., Assistant Professor


4 CN UNIT-5

WWW stands for World Wide Web and is commonly known as the Web. The WWW was started
by CERN in 1989. WWW is defined as the collection of different websites around the world,
containing different information shared via local servers (or computers).

Web pages are linked together using hyperlinks which are HTML-formatted and, also referred
to as hypertext, these are the fundamental units of the Internet and are accessed
through Hypertext Transfer Protocol (HTTP). Such digital connections, or links, allow users to
easily access desired information by connecting relevant pieces of information. The benefit of
hypertext is it allows you to pick a word or phrase from the text and click on other sites that have
more information about it.

The basic model of how the web works is shown in the figure below. Here the browser is
displaying a web page on the client machine. When the user clicks on a line of text that is linked
to a page on the abd.com server, the browser follows the hyperlink by sending a message to the
abd.com server asking it for the page.

Here the browser displays a web page on the client machine when the user clicks on a line of
text that is linked to a page on abd.com, the browser follows the hyperlink by sending a message
to the abd.com server asking for the page.

Working of WWW
A Web browser is used to access web pages. Web browsers can be defined as programs which
display text, data, pictures, animation and video on the Internet. Hyperlinked resources on the
World Wide Web can be accessed using software interfaces provided by Web browsers. Initially,
Web browsers were used only for surfing the Web but now they have become more universal.
The below diagram indicates how the Web operates just like client-server architecture of the
internet. When users request web pages or other information, then the web browser of your
system request to the server for the information and then the web server provide requested
services to web browser back and finally the requested service is utilized by the user who made
the request.

Mr. D. Sanjeeva Reddy M. Tech., Assistant Professor


5 CN UNIT-5

World Wide Web

Web browsers can be used for several tasks including conducting searches, mailing, transferring
files, and much more. Some of the commonly used browsers are Internet Explorer, Opera Mini,
and Google Chrome.
Features of WWW
 WWW is open source.
 It is a distributed system spread across various websites.
 It is Cross-Platform.
Components of the Web
There are 3 components of the web:
 Uniform Resource Locator (URL): URL serves as a system for resources on the
web.
 Hyper Text Transfer Protocol (HTTP): HTTP specifies communication of
browser and server.
 Hyper Text Markup Language (HTML): HTML defines the structure,
organization and content of a web page.
Difference Between WWW and Internet
WWW Internet

It is originated in 1989. It is originated in 1960.

WWW is an interconnected network of websites and Internet is used to connect a


documents that can be accessed via the Internet. computer with other computer .

Internet used protocols such


WWW used protocols such as HTTP
as TCP/IP

It is based on software. It is based on hardware.

Mr. D. Sanjeeva Reddy M. Tech., Assistant Professor


6 CN UNIT-5

HTTP:

HTTP stands for Hypertext Transfer Protocol. It is the main way web browsers and servers
communicate to share information on the internet. Tim Berner invents it. HyperText is the type
of text that is specially coded with the help of some standard coding language called HyperText
Markup Language (HTML). HTTP/2 is the new version of HTTP. HTTP/3 is the latest
version of HTTP, which is published in 2022.
When you visit a website, HTTP helps your browser request and receive the data needed to
display the web pages you see. It is a fundamental part of how the internet works, making it
possible for us to browse and interact with websites. In this article, we are going to discuss the
Full form of HTTP along with its working, advantages, and disadvantages.

HTTP stands for “Hypertext Transfer Protocol.” It is a set of rules for sharing data on the World
Wide Web (WWW). HTTP helps web browsers and servers communicate, allowing people to
access and share information over the internet.
Key Points
 Basic Structure: HTTP forms the foundation of the web, enabling data
communication and file sharing.
 Web Browsing: Most websites use HTTP, so when you click on a link or download
a file, HTTP is at work.
 Client-Server Model: HTTP works on a request-response system. Your browser
(client) asks for information, and the website’s server responds with the data.
 Application Layer Protocol: HTTP operates within the Internet Protocol Suite,
managing how data is transmitted and received.

Hyper Text:

The protocol used to transfer hypertext between two computers is known as HyperText Transfer
Protocol. HTTP provides a standard between a web browser and a web server to establish
communication. It is a set of rules for transferring data from one computer to another. Data such
as text, images, and other multimedia files are shared on the World Wide Web. Whenever a web
user opens their web browser, the user indirectly uses HTTP. It is an application protocol that is
used for distributed, collaborative, hypermedia information systems.

Working of HTTP [Hypertext Transfer Protocol]:

First of all, whenever we want to open any website we first open a web browser after that we
will type the URL of that website (e.g., www.facebook.com ).
This URL is now sent to the Domain Name Server (DNS). Then DNS first checks records for
this URL in their database, and then DNS will return the IP address to the web browser
corresponding to this URL. Now the browser is able to send requests to the actual server.
After the server sends data to the client, the connection will be closed. If we want something else
from the server we should have to re-establish the connection between the client and the server.

Mr. D. Sanjeeva Reddy M. Tech., Assistant Professor


7 CN UNIT-5

Characteristics of HTTP
HTTP is IP based communication protocol that is used to deliver data from server to client or
vice-versa.
 The server processes a request, which is raised by the client, and also server and client
know each other only during the current bid and response period.
 Once data is exchanged, servers and clients are no longer connected.
 It is a request and response protocol based on client and server requirements.
 It is a connection-less protocol because after the connection is closed, the server does
not remember anything about the client and the client does not remember anything
about the server.
 It is a stateless protocol because both client and server do not expect anything from
each other but they are still able to communicate.
Cookies in HTTP
An HTTP cookie (web cookie, browser cookie) is a little piece of data that a server transmits to
a user’s web browser.
Advantages of HTTP
 Memory usage and CPU usage are low because of fewer simultaneous connections.
 Since there are few TCP connections hence network congestion is less.
 The error can be reported without closing the connection.
Disadvantages of HTTP
 HTTP requires high power to establish communication and transfer data.
 HTTP is less secure because it does not use any encryption method like HTTPS and
uses TLS to encrypt regular HTTP requests and responses.

Mr. D. Sanjeeva Reddy M. Tech., Assistant Professor


8 CN UNIT-5

Electronic Mail

Electronic mail, commonly known as email, is a method of exchanging messages over the
internet. Here are the basics of email:

1. An email address: This is a unique identifier for each user, typically in the format of
[email protected].
2. An email client: This is a software program used to send, receive and manage emails,
such as Gmail, Outlook, or Apple Mail.
3. An email server: This is a computer system responsible for storing and forwarding
emails to their intended recipients.

To send an email:

1. Compose a new message in your email client.


2. Enter the recipient’s email address in the “To” field.
3. Add a subject line to summarize the content of the message.
4. Write the body of the message.
5. Attach any relevant files if needed.
6. Click “Send” to deliver the message to the recipient’s email server.
7. Emails can also include features such as cc (carbon copy) and bcc (blind carbon copy)
to send copies of the message to multiple recipients, and reply, reply all, and forward
options to manage the conversation.
Electronic Mail (e-mail) is one of most widely used services of Internet. This service allows an
Internet user to send a message in formatted manner (mail) to the other Internet user in any
part of world. Message in mail not only contain text, but it also contains images, audio and videos
data. The person who is sending mail is called sender and person who receives mail is
called recipient. It is just like postal mail service.
Components of E-Mail System: The basic components of an email system are : User Agent
(UA), Message Transfer Agent (MTA), Mail Box, and Spool file. These are explained as
following below.
1. User Agent (UA) : The UA is normally a program which is used to send and receive
mail. Sometimes, it is called as mail reader. It accepts variety of commands for
composing, receiving and replying to messages as well as for manipulation of the
mailboxes.
2. Message Transfer Agent (MTA): MTA is actually responsible for transfer of mail
from one system to another. To send a mail, a system must have client MTA and
system MTA. It transfers mail to mailboxes of recipients if they are connected in the
same machine. It delivers mail to peer MTA if destination mailbox is in another
machine. The delivery from one MTA to another MTA is done by Simple Mail
Transfer Protocol.
3. Mailbox: It is a file on local hard drive to collect mails. Delivered mails are present
in this file. The user can read it delete it according to his/her requirement. To use e-
mail system each user must have a mailbox. Access to mailbox is only to owner of
mailbox.

Mr. D. Sanjeeva Reddy M. Tech., Assistant Professor


9 CN UNIT-5

4. Spool file : This file contains mails that are to be sent. User agent appends outgoing
mails in this file using SMTP.
Services provided by E-mail system:
 Composition – The composition refers to process that creates messages and answers.
For composition any kind of text editor can be used.
 Transfer – Transfer means sending procedure of mail i.e. from the sender to
recipient.
 Reporting – Reporting refers to confirmation for delivery of mail. It help user to
check whether their mail is delivered, lost or rejected.
 Displaying – It refers to present mail in form that is understand by the user.
 Disposition – This step concern with recipient that what will recipient do after
receiving mail i.e save mail, delete before reading or delete after reading.

Advantages of email:
1. Convenient and fast communication with individuals or groups globally.
2. Easy to store and search for past messages.
3. Ability to send and receive attachments such as documents, images, and videos.
4. Available 24/7.

Disadvantages of email:

1. Risk of spam and phishing attacks.


2. Can lead to decreased face-to-face communication and loss of personal touch.
Features Of Electronic Mail
 Spontaneity: In a couple of seconds, you may send a message to anybody on the
globe.
 Asynchronous: You may send the e-mail and let the recipient view it at their leisure.
 Attachments of data, pictures, or music, frequently in compressed forms, can be
delivered as an e-mail to a person anywhere in the world.
 Addresses can be stored in an address book and retrieved instantly.
 Through an e-mail, a user can transfer multiple copies of a message to various
individuals.
Components Of Electronic Mail
The following are the essential components of an e-mail system:
1. User Agent (UA)
2. Message Transfer Agent (MTA)
3. Message Access Agent

Mr. D. Sanjeeva Reddy M. Tech., Assistant Professor


10 CN UNIT-5

User Agent (UA)


The User-Agent is a simple software that sends and receives mail. It is also known as a mail reader.
It supports a wide range of instructions for sending, receiving, and replying to messages and
manipulating mailboxes.
Some of the services supplied by the User-Agent are listed below:
 Reading a Message
 Sending a reply to a Message
 Message Composition
 Forwarding a Message
 Handling the Message
Message Transfer Agent
The Message Transfer Agent manages the actual e-mail transfer operation (MTA). Simple Mail
Transfer Protocol sends messages from one MTA to another. A system must have a client MTA
and a system MTA to send an e-mail. If the recipients are connected to the same computer, it sends
mail to their mailboxes. If the destination mailbox is on another computer, it sends mail to the
receiver's MTA.
Message Access Agent
The Simple Mail Transfer Protocol is used for the first and second stages of e-mail delivery.
The pull protocol is mainly required at the third stage of e-mail delivery, and the message access
agent is used at this point.
POP and IMAP4 are the two protocols used to access messages.

Architecture of Electronic Mail

Types of electronic mail:


There are various types of email services and protocols catering to different needs and preferences.
Here are some common types:
1. Web-Based Email: Web-based email services are accessed through a web browser, eliminating
the need for dedicated email client software. Users can access their emails from any internet-

Mr. D. Sanjeeva Reddy M. Tech., Assistant Professor


11 CN UNIT-5

enabled device with a browser, making it a convenient and widely-used option. For example,
Gmail, Yahoo Mail, Outlook.com.
2. Client-Based Email: Client-based email requires dedicated email client software installed on
the user's device for access. These applications offer a more feature-rich and often customizable
experience compared to web-based email clients. For example, Microsoft Outlook, Mozilla
Thunderbird.
3. Secure Email Services: Secure email services prioritize end-to-end encryption and advanced
security features to protect user privacy and sensitive information.
4. Business or Corporate Email: Tailored for business use, corporate email services often include
collaboration tools, shared calendars, and enhanced security features to meet the specific needs of
organizations. For example, Microsoft Exchange, Google Workspace.
5. Disposable Email Services: Disposable email services provide temporary email addresses for
short-term use. Users often utilize them for activities like online registrations or verifications,
maintaining privacy. For example, Guerrilla Mail, 10 Minute Mail.
6. Encrypted Email Protocols: Encrypted email protocols focus on securing the content of
emails. Technologies like PGP and S/MIME employ encryption techniques to ensure
confidentiality in email communication. For example, PGP (Pretty Good Privacy), S/MIME
(Secure/Multipurpose Internet Mail Extensions).
7. POP3 (Post Office Protocol 3): POP3 retrieves emails from the server to the local device,
typically deleting them from the server. It is commonly used when users want to download and
store emails locally.

Email- protocols
Email protocols are a collection of protocols that are used to send and receive emails properly.
The email protocols provide the ability for the client to transmit the mail to or from the intended
mail server. Email protocols are a set of commands for sharing mails between two computers..

Types of Email Protocols:

Three basic types of email protocols involved for sending and receiving mails are:
 SMTP
 POP3
 IMAP

SMTP (Simple Mail Transfer Protocol):

Simple Mail Transfer Protocol is used to send mails over the internet. SMTP is an application
layer and connection-oriented protocol. SMTP is efficient and reliable for sending emails. SMTP
uses TCP as the transport layer protocol.
It handles the sending and receiving of messages between email servers over a TCP/IP network.
This protocol along with sending emails also provides the feature of notification for incoming
mails. When a sender sends an email then the sender’s mail client sends it to the sender’s mail

Mr. D. Sanjeeva Reddy M. Tech., Assistant Professor


12 CN UNIT-5

server and then it is sent to the receiver mail server through SMTP. SMTP commands are used
to identify the sender and receiver email addresses along with the message to be sent.
Some of the SMTP commands are HELLO, MAIL FROM, RCPT TO, DATA, QUIT, VERIFY,
SIZE, etc. SMTP sends an error message if the mail is not delivered to the receiver hence, reliable
protocol.

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. For
more details please refer to the POP Full-Form article.

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. Some of
the IMAP commands are: IMAP_LOGIN, CREATE, DELETE, RENAME, SELECT,
EXAMINE, and LOGOUT.

MIME (Multipurpose Internet Mail Extension Protocol):

Multipurpose Internet Mail Extension Protocol is an additional email protocol that allows non-
ASCII data to be sent through SMTP. It allows users to send and receive different types of data
like audio, images, videos and other application programs on the Internet. It allows to send
multiple attachments with single message. It allows to send message of unlimited length.
Functions of Email

1. Message Sending and Receiving: The core function of email is to send and
receive messages between users.
2. Attachment Support: Users can attach files, such as documents, images, and
videos, to their emails, facilitating the sharing of information.
3. Organization: Email clients often provide tools for organizing messages into
folders, tagging, and prioritizing to help users manage their communications
effectively.
4. Spam Filtering: Most email services include spam filters to reduce unwanted or
malicious emails, enhancing user experience and security.

Mr. D. Sanjeeva Reddy M. Tech., Assistant Professor


13 CN UNIT-5

5. Integration with Other Tools: Many email services integrate with other
applications (calendars, task managers, CRM systems) to streamline workflows
and improve productivity.
6. Marketing and Newsletters: Businesses use email for marketing purposes,
sending newsletters, promotions, and updates to customers.
7. Collaboration: Email facilitates collaboration through group emails and the
ability to share documents and feedback among teams.

DNS

An application layer protocol defines how the application processes running on different systems,
pass the messages to each other.

o DNS stands for Domain Name System.


o DNS is a directory service that provides a mapping between the name of a host on the
network and its numerical address.
o DNS is required for the functioning of the internet.
o Each node in a tree has a domain name, and a full domain name is a sequence of symbols
specified by dots.
o 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.
o 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.

DNS is a TCP/IP protocol used on different platforms. The domain name space is divided into
three different sections: generic domains, country domains, and inverse domain.

Mr. D. Sanjeeva Reddy M. Tech., Assistant Professor


14 CN UNIT-5

Generic Domains
o It defines the registered hosts according to their generic behavior.
o Each node in a tree defines the domain name, which is an index to the DNS database.
o It uses three-character labels, and these labels describe the organization type.

Label Description

aero Airlines and aerospace companies

biz Businesses or firms

com Commercial Organizations

coop Cooperative business Organizations

edu Educational institutions

gov Government institutions

info Information service providers

int International Organizations

Mr. D. Sanjeeva Reddy M. Tech., Assistant Professor


15 CN UNIT-5

mil Military groups

museum Museum & other nonprofit organizations

name Personal names

net Network Support centers

org Nonprofit Organizations

pro Professional individual Organizations

Country Domain

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.

Inverse Domain

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. To determine

Mr. D. Sanjeeva Reddy M. Tech., Assistant Professor


16 CN UNIT-5

whether the client is on the authorized list or not, it sends a query to the DNS server and ask for
mapping an address to the name.

Working of DNS
o DNS is a client/server network communication protocol. DNS clients send requests to the.
server while DNS servers send responses to the client.
o Client requests contain a name which is converted into an IP address known as a forward
DNS lookup while requests containing an IP address which is converted into a name known
as reverse DNS lookups.
o DNS implements a distributed database to store the name of all the hosts available on the
internet.
o If a client like a web browser sends a request containing a hostname, then a piece of
software such as DNS resolver sends a request to the DNS server to obtain the IP address
of a hostname. If DNS server does not contain the IP address associated with a hostname,
then it forwards the request to another DNS server. If IP address has arrived at the resolver,
which in turn completes the request over the internet protocol.

DNS Message Format


DNS allows you to interact with devices on the Internet without having to remember long strings
of numbers. Changing of information between client and server is carried out by two types of
DNS messages:
 Query message
 Response message.
The format is similar for both types of messages. The information is held up in up to five different
sections of DNS message format. The query message is having two sections- header and question
records.
The response message consists of five sections:
 Header
 Question
 Records
 Answer records
 Authoritative records
 Additional records

Mr. D. Sanjeeva Reddy M. Tech., Assistant Professor


17 CN UNIT-5

The above representation is showing the DNS Message format in which some fields are set to 0s
for query messages.
 Identification: The identification field is made up of 16 bits which are used to match
the response with the request sent from the client-side. The matching is carried out
by this field as the server copies the 16-bit value of identification in the response
message so the client device can match the queries with the corresponding response
received from the server-side.
 Flags: It is 16 bits and is divided into the following Fields:

Here is the description of each subfield of the Flags field:


 QR (query/response): It is a 1-bit subfield. If its value is 0, the message is of request
type and if its value is 1, the message is of response type.
 opcode: It is a 4-bit subfield that defines the type of query carried by a message. This
field value is repeated in the response. Following is the list of opcode values with a
brief description:
o If the value of the opcode subfield is 0 then it is a standard query.

Mr. D. Sanjeeva Reddy M. Tech., Assistant Professor


18 CN UNIT-5

o The value 1 corresponds to an inverse of query that implies finding


the domain name from the IP Address.
o The value 2 refers to the server status request. The value 3
specifies the status reserved and therefore not used.
 AA: It is an Authoritative Answer. It is a 1-bit subfield that specifies the server is
authoritative if the value is 1 otherwise it is non-authoritative for a 0 value.
 TC: It is Truncation. This is a 1-bit subfield that specifies if the length of the message
exceeds the allowed length of 512 bytes, the message is truncated when using UDP
services.
 RD: It is Recursion Desired. It is a 1-bit subfield that specifies if the value is set to 1
in the query message, then the server needs to answer the query recursively. Its value
is copied to the response message.
 RA: It is Recursion Available. It is a 1-bit subfield that specifies the availability of
recursive response if the value is set to 1 in the response message.
 Zero: It is a 3-bit reserved subfield set to 0.
 rCode: It stands for Response Code. It is a 4-bit subfield used to denote whether the
query was answered successfully or not. If not answered successfully then the status
of error is provided in the response. Following is the list of values with their error
status –
o The value 0 of rcode indicates no error.
o A value of 1 indicates that there is a problem with the format
specification.
o Value 2 indicates server failure.
o Value 3 refers to the Name Error that implies the name given by
the query does not exist in the domain.
o Value of 4 indicates that the request type is not supported by the
server.
o The value 5 refers to the nonexecution of queries by the server due
to policy reasons.
 Number of Questions- It is a 16-bit field to specify the count of questions in the
Question Section of the message. It is present in both query and response messages.
 A number of answer RRs- It is a 16-bit field that specifies the count of answer
records in the Answer section of the message. This section has a value of 0 in query
messages. The server answers the query received from the client. It is available only
in response messages.
 A number of authority RRs- It is a 16-bit field that gives the count of the resource
records in the Authoritative section of the message. This section has a value of 0 in
query messages. It is available only in response messages. It gives information that
comprises domain names about one or more authoritative servers.
 A number of additional RRs– It is a 16-bit field that holds additional records to
keep additional information to help the resolver. This section has a value of 0 in query
messages. It is available only in response messages.

Mr. D. Sanjeeva Reddy M. Tech., Assistant Professor


19 CN UNIT-5

CDN

Content Distribution Network and how does it work?


Over the last few years, there has been a huge increase in the number of Internet users. YouTube
alone has 2 billion users worldwide, while Netflix has over 160 million users. Streaming content
to such a wide demographic of users is no easy task. One can think that a straightforward
approach to this can be building a large data center, storing all the content in the servers, and
providing it to users worldwide. But there are issues that arise when this approach is followed-
1. Firstly, if the data center is in the USA and the user is in India there will be slower
delivery of content.
2. Secondly, a single data center represents a single point of failure.
3. Thirdly, if some content is being accessed frequently from a remote area then it is
likely to follow the same links, and this, in turn, results in wastage of bandwidth.
A CDN is essentially a group of servers that are strategically placed across the globe with the
purpose of accelerating the delivery of web content.
CDN’s primary purpose is to reduce the latency and reduce the delay between the
communication of request and response through the internet. As this world is so big and
everything is working on the internet that causes a lot of traffic on the internet or website that
results in reducing the speed and security.
CDN provides the fastest delivery of data across the network and protects the data from DDoS
attacks. It improves the efficiency of the communication between the client and the server. It
reduces bandwidth consumption, provides security, the fastest delivery of data, and improves
the customer experience.

A CDN-
1. Manages servers that are geographically distributed over different locations.
2. Stores the web content in its servers.
3. Attempts to direct each user to a server that is part of the CDN so as to deliver content
quickly.
The CDN is a collection of servers or a network of all the servers that deliver data all over the
world to the web user. It has three main components; each component has its own value and role
to play.
The first one is the Origin server which stores all the data spread all over the world. It is the
main server that handles every delivery and also it maintains the updated version of data.
The second one is the Edge server which stores temporary data means it stores a copy of the
original data temporarily. also, It is the one that delivers the data to the web user. The number
of Edge servers is many, the nearest Edge servers deliver the data to the web user so that there
should not be any delay in between the loading of the page on the web.
The third one is a DNS server that keeps track of the IP addresses. whenever a user sends a
request through the internet on the web browser then in response to that request the Origin Server
gives the IP address. By accessing that IP address, the user gets their data on the web.

Mr. D. Sanjeeva Reddy M. Tech., Assistant Professor


20 CN UNIT-5

Following image depicts the same:

Following Image depicts the difference between how a request is handled with and without a
CDNrespectively: WITHCDN(2SECONDS)

WITHOUTCDN(5SECONDS)

Mr. D. Sanjeeva Reddy M. Tech., Assistant Professor


21 CN UNIT-5

Benefits of CDN
● Security improvement- The DDOS mitigation improves the security as it contains some
security certificates and optimizations.
● Increase in content availability and redundancy- Hardware failures and more traffic can lead
to the website’s dysfunction. CDN can handle traffic and can withstand hardware disfunction
better than many servers.
● Better load times- The visitor has a fast page loading because a nearby CDN server is used
whenever a client search for a webpage. CDN also reduces the slow loading times by reducing
the bounce rates and increasing the amount of time people spend on site.
● Low bandwidth cost- The direct cost for hosting a website is bandwidth consumption cost.
With the help of caching and other optimizations, it minimizes the amount of data an origin
server must provide, thus reducing the hosting costs.

A peer-to-peer network is a simple network of computers. It first came into existence in the late
1970s. Here each computer acts as a node for file sharing within the formed network. Here each
node acts as a server and thus there is no central server in the network. This allows the sharing
of a huge amount of data. The tasks are equally divided amongst the nodes. Each node connected
in the network shares an equal workload. For the network to stop working, all the nodes need to
individually stop working. This is because each node works independently.

Mr. D. Sanjeeva Reddy M. Tech., Assistant Professor


22 CN UNIT-5

History of P2P Networks

Before the development of P2P, USENET came into existence in 1979. The network enabled the
users to read and post messages. Unlike the forums we use today, it did not have a central server.
It is used to copy the new messages to all the servers of the node.
 In the 1980s the first use of P2P networks occurred after personal computers were
introduced.
 In August 1988, the internet relay chat was the first P2P network built to share text
and chat.
 In June 1999, Napster was developed which was a file-sharing P2P software. It could
be used to share audio files as well. This software was shut down due to the illegal
sharing of files. But the concept of network sharing i.e P2P became popular.
 In June 2000, Gnutella was the first decentralized P2P file sharing network. This
allowed users to access files on other users’ computers via a designated folder.
Types of P2P networks
1. Unstructured P2P networks: In this type of P2P network, each device is able to
make an equal contribution. This network is easy to build as devices can be connected
randomly in the network. But being unstructured, it becomes difficult to find content.
For example, Napster, Gnutella, etc.
2. Structured P2P networks: It is designed using software that creates a virtual layer
in order to put the nodes in a specific structure. These are not easy to set up but can
give easy access to users to the content. For example, P-Grid, Kademlia, etc.
3. Hybrid P2P networks: It combines the features of both P2P networks and client-
server architecture. An example of such a network is to find a node using the central
server.

Features of P2P network

 These networks do not involve a large number of nodes, usually less than 12. All the
computers in the network store their own data but this data is accessible by the group.
 Unlike client-server networks, P2P uses resources and also provides them. This
results in additional resources if the number of nodes increases. It requires specialized
software. It allows resource sharing among the network.
 Since the nodes act as clients and servers, there is a constant threat of attack.
 Almost all OS today support P2P networks.

P2P Network Architecture

In the P2P network architecture, the computers connect with each other in a workgroup to share
files, and access to internet and printers.
 Each computer in the network has the same set of responsibilities and capabilities.
 Each device in the network serves as both a client and server.
 The architecture is useful in residential areas, small offices, or small companies where
each computer act as an independent workstation and stores the data on its hard drive.

Mr. D. Sanjeeva Reddy M. Tech., Assistant Professor


23 CN UNIT-5

 Each computer in the network has the ability to share data with other computers in
the network.
 The architecture is usually composed of workgroups of 12 or more computers.

How Does P2P Network Work?

Let’s understand the working of the Peer-to-Peer network through an example. Suppose, the user
wants to download a file through the peer-to-peer network then the download will be handled in
this way:
 If the peer-to-peer software is not already installed, then the user first has to install
the peer-to-peer software on his computer.
 This creates a virtual network of peer-to-peer application users.
 The user then downloads the file, which is received in bits that come from multiple
computers in the network that have already that file.
 The data is also sent from the user’s computer to other computers in the network that
ask for the data that exist on the user’s computer.
Thus, it can be said that in the peer-to-peer network the file transfer load is distributed among
the peer computers.

Applications of P2P Network:

 File sharing: P2P network is the most convenient, cost-efficient method for file
sharing for businesses. Using this type of network there is no need for intermediate
servers to transfer the file.
 Blockchain: The P2P architecture is based on the concept of decentralization. When
a peer-to-peer network is enabled on the blockchain it helps in the maintenance of a
complete replica of the records ensuring the accuracy of the data at the same time. At
the same time, peer-to-peer networks ensure security also.
 Direct messaging: P2P network provides a secure, quick, and efficient way to
communicate. This is possible due to the use of encryption at both the peers and
access to easy messaging tools.

Mr. D. Sanjeeva Reddy M. Tech., Assistant Professor


24 CN UNIT-5

 Collaboration: The easy file sharing also helps to build collaboration among other
peers in the network.
 File sharing networks: Many P2P file sharing networks like G2, and eDonkey have
popularized peer-to-peer technologies.
 Content distribution: In a P2P network, unline the client-server system so the clients
can both provide and use resources. Thus, the content serving capacity of the P2P
networks can actually increase as more users begin to access the content.
 IP Telephony: Skype is one good example of a P2P application in VoIP.

Advantages of P2P Network

 Easy to maintain: The network is easy to maintain because each node is independent
of the other.
 Less costly: Since each node acts as a server, therefore the cost of the central server
is saved. Thus, there is no need to buy an expensive server.
 No network manager: In a P2P network since each node manages his or her own
computer, thus there is no need for a network manager.
 Adding nodes is easy: Adding, deleting, and repairing nodes in this network is easy.
 Less network traffic: In a P2P network, there is less network traffic than in a client/
server network.

Disadvantages of P2P Network

 Data is vulnerable: Because of no central server, data is always vulnerable to getting


lost because of no backup.
 Less secure: It becomes difficult to secure the complete network because each node
is independent.
 Slow performance: In a P2P network, each computer is accessed by other computers
in the network which slows down the performance of the user.
 Files hard to locate: In a P2P network, the files are not centrally stored, rather they
are stored on individual computers which makes it difficult to locate the files.

Examples of P2P networks

P2P networks can be basically categorized into three levels.


 The first level is the basic level which uses a USB to create a P2P network between
two systems.
 The second is the intermediate level which involves the usage of copper wires in order
to connect more than two systems.
 The third is the advanced level which uses software to establish protocols in order to
manage numerous devices across the internet.
Some of the popular P2P networks are Gnutella, BitTorrent, eDonkey, Kazaa, Napster, and
Skype.

Mr. D. Sanjeeva Reddy M. Tech., Assistant Professor


25 CN UNIT-5

video CDN

A video CDN is a CDN that has been designed to support video stream delivery. The use of a CDN
for streaming video helps a stream reach viewers around the world,
minimizes latency and buffering time, and ensures that the stream's source or origin server are not
overwhelmed with requests.
While most CDNs are able to cache and deliver video content alongside HTML, images,
JavaScript, CSS style sheets, and other web content, video CDNs can be constructed exclusively
for streaming video. For instance, Netflix built out their own distributed network called Open
Connect to more efficiently deliver their video content.
CDN:
A content delivery network (CDN) is a group of connected servers that cache and deliver content
over the Internet. CDNs are spread out all over the world, enabling them to deliver content more
efficiently to a wider range of people than an origin server or a single data center can. A CDN
caches content whenever a user requests the content from a website that uses that CDN; to "cache"
means to temporarily store a file.
Suppose Bob hosts a website, bobisgreat.example.com, on a server in New York City, New York.
When Alice in Albany, New York (about 250 kilometers away), visits the website, it loads quickly,
since the website content has to travel only 250 kilometers. However, when Carlos tries to load
bobisgreat.example.com from his house in Los Angeles, California (about 4,800 kilometers away),
he has to wait a lot longer for the website to load.
If Bob uses a CDN service, the CDN can cache his website's content at locations close to both
Alice and Carlos. Suppose Bob's CDN caches his website at data centers in Albany and Los
Angeles, in addition to New York City. Now both Alice and Carlos hardly have to wait any time
at all for bobisgreat.example.com to load in their browsers.

uses of CDN for streaming video:

Minimizing distance to viewers reduces latency


The same principle described above applies for streaming video. The closer the video content is to
the viewer, the faster it will load and play. A CDN is likely to have a server closer to any given
viewer than the stream's point of origin.

Origin server is not overwhelmed


Using the many servers of a CDN means that the server where the stream originates will not
become overwhelmed with requests for the stream. A group of 200 servers can handle streaming
video to thousands of viewers far better than a single server can.

Streaming content does not exceed network bandwidth


A network can have only a certain amount of data pass through at once. This maximum amount is
called "bandwidth." If the amount of data passing through a network exceeds its bandwidth, data
delivery slows down to a huge degree, just as limiting cars to one lane slows down traffic on a
highway. If a stream is delivered from the multiple distributed servers of a CDN, it is less likely
that any one network will become overwhelmed with traffic in this way.

Mr. D. Sanjeeva Reddy M. Tech., Assistant Professor


26 CN UNIT-5

How can a stream be cached?


Streaming continuously transmits video files from a server to a client. However, streaming video
does not go to a user's device as one continuous file. Rather, streaming video is broken up into
smaller segments. Each segment is loaded and put in the correct order by the user's video player.
Each individual video segment can be cached by a CDN, just as an image, an HTML page, or a
snippet of JavaScript code can be cached by a CDN. When a user requests a stream, the CDN
begins caching the video segments as soon as they arrive from the stream's origin. When the next
user requests the same stream, the CDN can deliver those segments from the cache instead, which
is much faster.

How does a CDN cache a live stream?


 For video-on-demand streaming, in which the video is delivered from storage, caching the
video is fairly simple: the CDN requests the stored video from the origin server, the origin
server delivers it, and the CDN then caches the video.
 In live streaming, there is no stored version of the video ready to go. However, the process
is similar. The only difference is that the CDN caches the video segments as they are
created in real time, instead of caching a previously created video. The stream is then
served to viewers from the cache instead of directly from the stream's origin.
 Even though most viewers have to wait a few extra seconds for each segment to be cached,
if done efficiently this can actually make the stream closer to "live" than fetching the stream
directly from the origin server. Because a CDN is closer to viewers than the origin server,
serving the stream from the cache can cut down on round-trip time (RTT) to and from the
origin server. In addition, using a CDN reduces the possibility that bandwidth issues will
slow down the live stream for viewers.
Does the Cloudflare CDN work with video
Cloudflare Stream is a streaming service for delivering video via the Cloudflare CDN. Cloudflare's
global network ensures fast delivery and smooth video playback for viewers in any location;
Cloudflare operates within 100 milliseconds of 99% of the developed world.

Mr. D. Sanjeeva Reddy M. Tech., Assistant Professor

You might also like