Chapter 6 New
Chapter 6 New
Overview
When DNS was not into existence, one had to download a Host file containing host names
and their corresponding IP address. But with increase in number of hosts of internet, the size
of host file also increased. This resulted in increased traffic on downloading this file. To
solve this problem the DNS system was introduced.
Domain Name System helps to resolve the host name to an address. It uses a hierarchical
naming scheme and distributed database of IP addresses and associated names
IP Address
IP address is a unique logical address assigned to a machine over the network. An IP address
exhibits the following properties:
IP address is the unique address assigned to each host present on Internet.
IP address is 32 bits (4 bytes) long.
IP address consists of two components: network component and host component.
Each of the 4 bytes is represented by a number from 0 to 255, separated with dots. For
example 137.170.4.124
IP address is 32-bit number while on the other hand domain names are easy to remember names. For
example, when we enter an email address we always enter a symbolic string such as
[email protected].
Absolute URL is a complete address of a resource on the web. This completed address
comprises of protocol used, server name, path name and file name.
For example http:// www.tutorialspoint.com / internet_technology /index.htm. where:
http is the protocol.
tutorialspoint.com is the server name.
index.htm is the file name.
The protocol part tells the web browser how to handle the file. Similarly we have some other
protocols also that can be used to create URL are:
FTP
https
Gopher
mailto
news
Relative URL
Relative URL is a partial address of a webpage. Unlike absolute URL, the protocol and
server part are omitted from relative URL.
Relative URLs are used for internal links i.e. to create links to file that are part of same website as the
WebPages on which you are placing the link.
For example, to link an image on
tutorialspoint.com/internet_technology/internet_referemce_models, we can use the relative
URL which can take the form like /internet_technologies/internet-osi_model.jpg.
Difference between Absolute and Relative URL
Absolute URL Relative URL
Used to link web pages on different websites Used to link web pages within the same website.
Changes when the server name or directory Remains same even of we change the server name or
name changes directory name.
Edu Education
au Australia
in India
cl Chile
fr France
us United States
za South Africa
uk United Kingdom
jp Japan
es Spain
de Germany
ca Canada
ee Estonia
hk Hong Kong
In the above diagram each subtree represents a domain. Each domain can be partitioned into
sub domains and these can be further partitioned and so on.
Name Server
Name server contains the DNS database. This database comprises of various names and their
corresponding IP addresses. Since it is not possible for a single server to maintain entire
DNS database, therefore, the information is distributed among many DNS servers.
Hierarchy of server is same as hierarchy of names.
The entire name space is divided into the zones
Zones
Zone is collection of nodes (sub domains) under the main domain. The server maintains a
database called zone file for every zone.
If the domain is not further divided into sub domains then domain and zone refers to the same thing.
The information about the nodes in the sub domain is stored in the servers at the lower levels
however; the original server keeps reference to these lower levels of servers.
Types of Name Servers
Following are the three categories of Name Servers that manages the entire Domain Name
System:
Root Server
Primary Server
Secondary Server
Root Server
Root Server is the top level server which consists of the entire DNS tree. It does not contain
the information about domains but delegates the authority to the other server
Primary Servers
Primary Server stores a file about its zone. It has authority to create, maintain, and update the
zone file.
Secondary Server
Secondary Server transfers complete information about a zone from another server which
may be primary or secondary server. The secondary server does not have authority to create
or update a zone file.
DNS Working
DNS translates the domain name into IP address automatically. Following steps will take you
through the steps included in domain resolution process:
When we type www.tutorialspoint.com into the browser, it asks the local DNS
Server for its IP address.
Here the local DNS is at ISP end.
When the local DNS does not find the IP address of requested domain name, it
forwards the request to the root DNS server and again enquires about IP address of it.
The root DNS server replies with delegation that I do not know the IP address of
www.tutorialspoint.com but know the IP address of DNS Server.
The local DNS server then asks the com DNS Server the same question.
The com DNS Server replies the same that it does not know the IP address of
www.tutorialspont.com but knows the address of tutorialspoint.com.
Then the local DNS asks the tutorialspoint.com DNS server the same question.
Then tutorialspoint.com DNS server replies with IP address of
www.tutorialspoint.com.
Now, the local DNS sends the IP address of www.tutorialspoint.com to the computer
that sends the request.
The acronym for Domain Name System is DNS. It is a naming system that works
hierarchically and is decentralized for computers, servers (web servers), services, resources,
network devices and components that are present on large networks such as the public
Internet.
For example, in layman terms, it is a phonebook for computers on the Internet.
It translates and maps alphabetic domain names (websites' web addresses or names) to the
numeric Internet Protocol (IP) addresses of computers or servers. And it also does the
reverse process. DNS uses User Datagram Protocol (UDP). DNS service uses port number
53.
Technically, computers or technically the routers (default gateway) use DNS servers to
contact to get any domains translated and converted to an IP address of the server hosting a
website. The entry for DNS servers could be few or many, as there would be multiple DNS
servers. The examples are OpenDNS servers, or Google DNS servers.
It is a system that uses at least one DNS server to resolve DNS-names. DNS is used because
computers and servers do not understand human-readable alphabetic domain names, where
humans do not understand and remember numeric IP addresses, which the computers and
servers can.
DNS service or server is an Internet service in general, thus maps or translates human
readable domain names (website names or URL, Uniform Resource Locator) into machine
or Computer readable IP (Internet Protocol) addresses.
Example
Domain name = www.example.com whose Server IP address is,
say = 253.136.27.2
Working of DNS
The working of DNS is explained below in stepwise manner −
Step 1 − Every website has a domain name/ IP address associated with it.
Step 2 − Now IP is a bit complicated to share (as no one wants to write 192.168.224.23 or
some random IP to access Tutorials point) so people came up with an idea of domain names
which basically stores the IP address mapped to their name.
Step 3 − Now, a DNS translates every domain name to its IP address so every browser can
access that particular website.
Step 4 − DNS has eased the process of web surfing as we write tutorialspoint.com to reach a
website instead of some complicated 32-128 bit address.
Given below is the diagram of DNS −
Types of Records:
Every domain, whether it is a single host or top –level domain, can have a set of resource
records associated with it.
When a resolve gives a domain name to DNS, what t gets back are the resource records
associated with the name. The primary function od DNS is to map domain names onto
resource records.
A resource record is five tuple. The format is
Domain_name Time_to_live Class Type Value
Domain_ name: Tell the domain to which record belongs
Time_to_live: Gives the indication of how stable the record is. Information that is highly
stage is assigned a large value and one which are highly volatile are assigned small values
Class: For Internet information this is IN, for non—Internet Information , other codes can be
used, these are rarely seen.
Type: What type of record it is. The most important types is listed is:
Type Meaning Value
SOA Start of Authority Parameters for this zone
A IP address of host 32-bit integer
MX Mail exchange Priority, domain willing to accept
mail
NS Name Server Name of server for domain
CNAME Canonical name Domain Name
PTR Pointer Alias of an IP Address
HINFO Host Description CPU and OS in ASCII
TXT Text Uninterrupted ASCII text
SOA: Provides the name of primary source of information about the name servers’s zone.
The e-mail address of administration, a unique serial number, various flags and timeouts.
A record: It holds 32-bit IP address for some host. Some hosts have two or more network
connections, in which case they will have one type A resource record pernetwork connection.
MX record: It specifies the name of host prepared to accept e-mail for specified domain. It is
used because not every machine is prepared ot accept e-mail. If someone wants to send
emailto Ex [email protected], the sendind host neds to find a mail server at Microsoft.com
that is willing to accept e-mail. The MX record can provide this information.
CNAME: records allow alias to be created.Ex a person familiar with internet naming in
general and waiting to send a message to someone whose login name is paul in CSEin MIT
might guess that [email protected] will work. Actually this address will not work, because the
domain for MIT cse is lcs.mit.edu. However as service to people who do not know this MIT
could create a CNAME rntry to point people and programs in the right direction.
Cs.mit.edu 86400 IN CNAME lcs.mit.edu
PTR: points to another name. It is always used to associate a name with an IP address to
allow lookups of IP address and return the name of the corresponding machine. These are
called reverse lookups
HINFO: Allow people to find out what kind of machine and operating system a domain
corresponds to.
FTP
FTP represents File transfer protocol and it is a standard internet protocol supported by
TCP/IP used for transmitting the files from one host to another. FTP needs TCP as a
transport protocol to help the reliable end to end connections and executes two types of
connections in managing data transfers.
The FTP clients initiate the first connection, referred to as the control connection, to
wellknown port 21 (the clients port is typically ephemeral). It is on this part that an FTP
server listens for it and accepts new connections. The control connection is issued for all of
the control commands a client user uses to log on to the server, manipulate files, and
terminate a session. This is also the relationship across which the FTP server will transmit
messages to the client in response to their control commands.
The second connection used by FTP is defined as the data connection. Typically, the data
connection is established on the server port 20. It depends on how the data connection is
established; both the client and server can use ephemeral ports. It is across the connection
that FTP shares the information.
FTP opens a data connection when a user concerns a command requiring a data transfer,
including a request to retrieve a file or to view a list of the files available. Therefore, an
entire FTP session can open and close without a data connection ever having been opened.
In other words, when a client starts an FTP session, the control connections open while the
control connection is open, and the data connection can be opened and closed multiple times
if several files are transferred.
Advantages of FTP
The advantages of FTP are as follows −
Speed − The FTP is one of the quickest ways to transfer documents from one device
to another.
Security − It can create the FTP server. We need to log in with the username and
password.
Efficient − It is higher efficient as we do not require all the services to obtain the
whole file.
Back & forth movement − FTP enables us to send the files back and forth.
Disadvantages of FTP
The standard requirement of the market is that all FTP transmissions should be encrypted.
However, not all FTP providers are equal and not all provider's support encryption. FTP
serves two operations, such as sending and receiving huge files on a network. The size limit
of the file is 2GB that can transmit.
Passwords and file text are sent in clear text that enables unwanted eavesdropping.
Therefore, it is quite possible that attackers can carry out the brute force attack by trying to
guess the FTP password.
It is not compatible with every system.
When using File Transfer Protocol (FTP), the user implements some or all of the
following operations −
cd Changes the directory on the private host. A pathname can be determined but must
conform to the directory structure of the remote host.
Icd Change the directory on the localhost. It is equal to the cd command. A pathname
can be determined but must conform to the directory structure of the localhost.
Is Lists the contents of the remote directory
dir Lists the contents of the private directory. It is similar to the ls command; the list
generated by dir is treated as data and requires a data connection.
Transferring Files
It can use the following commands to copy files between FTP clients and servers.
quit − It can disconnect from the remote host and removes FTP. Some
implementations use the BYE subcommand.
Close − It can disconnect from the remote host but leaves the FTP client running.
It can issue an open command to establish a new control connection.
There two types of Connections in FTP are as follows −
Control Connection
There are two steps −
The server issues a positive open on the well-known port 21 and waits for a client.
The client uses an ephemeral port and issues an active open.
The connection remains open during the whole process.
Data Connection
The data connection facilitates the well-known port 20 at the server site. The following steps
display how FTP creates a data connection.
The user, not the server, issues a passive open using an ephemeral port.
The client assigns this port number to the server using the PORT command.
The server receives the port number and issues an active open using the wellknown
port 20, and the received ephemeral port number.
WWW
WWW stands for World Wide Web. A technical definition of the World Wide Web is : all the
resources and users on the Internet that are using the Hypertext Transfer Protocol (HTTP).
A broader definition comes from the organization that Web inventor Tim Berners-Lee helped
found, the World Wide Web Consortium (W3C).
The World Wide Web is the universe of network-accessible information, an embodiment of
human knowledge.
In simple terms, The World Wide Web is a way of exchanging information between computers
on the Internet, tying them together into a vast collection of interactive multimedia resources.
Internet and Web is not the same thing: Web uses internet to pass over the information.
Evolution
World Wide Web was created by Timothy Berners Lee in 1989 at CERN in Geneva. World
Wide Web came into existence as a proposal by him, to allow researchers to work together
effectively and efficiently at CERN. Eventually it became World Wide Web.
The following diagram briefly defines evolution of World Wide Web:
WWW Architecture/ Web Model
WWW architecture is divided into several layers as shown in the following diagram:
Identifiers and Character Set
Uniform Resource Identifier (URI) is used to uniquely identify resources on the web
and UNICODE makes it possible to built web pages that can be read and write in human
languages.
Syntax
XML (Extensible Markup Language) helps to define common syntax in semantic web.
Data Interchange
Resource Description Framework (RDF) framework helps in defining core representation of
data for web. RDF represents data about resource in graph form.
Taxonomies
RDF Schema (RDFS) allows more standardized description of taxonomies and
other ontological constructs.
Ontologies
Web Ontology Language (OWL) offers more constructs over RDFS. It comes in following
three versions:
OWL Lite for taxonomies and simple constraints.
OWL DL for full description logic support.
OWL for more syntactic freedom of RDF
Rules
RIF and SWRL offers rules beyond the constructs that are available
from RDFs and OWL. Simple Protocol and RDF Query Language (SPARQL) is SQL like
language used for querying RDF data and OWL Ontologies.
Proof
All semantic and rules that are executed at layers below Proof and their result will be used to
prove deductions.
Cryptography
Cryptography means such as digital signature for verification of the origin of sources is used.
User Interface and Applications
On the top of layer User interface and Applications layer is built for user interaction.
WWW Operation
WWW works on client- server approach. Following steps explains how the web works:
1. User enters the URL (say, http://www.tutorialspoint.com) of the web page in the
address bar of web browser.
2. Then browser requests the Domain Name Server for the IP address corresponding to
www.tutorialspoint.com.
3. 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.
4. 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.
5. Now the web browser receives the web page, It interprets it and display the contents of
web page in web browser’s window.
HTTP
The Hypertext Transfer Protocol (HTTP) is an application-level protocol for distributed,
collaborative, hypermedia information systems. This is the foundation for data
communication for the World Wide Web (i.e. internet) since 1990. HTTP is a generic and
stateless protocol which can be used for other purposes as well using extensions of its request
methods, error codes, and headers.
Basically, HTTP is a TCP/IP based communication protocol, that is used to deliver data
(HTML files, image files, query results, etc.) on the World Wide Web. The default port is
TCP 80, but other ports can be used as well. It provides a standardized way for computers to
communicate with each other. HTTP specification specifies how clients' request data will be
constructed and sent to the server, and how the servers respond to these requests.
Basic Features
There are three basic features that make HTTP a simple but powerful protocol:
HTTP is connectionless: The HTTP client, i.e., a browser initiates an HTTP request
and after a request is made, the client waits for the response. The server processes the
request and sends a response back after which client disconnect the connection. So
client and server knows about each other during current request and response only.
Further requests are made on new connection like client and server are new to each
other.
HTTP is media independent: It means, any type of data can be sent by HTTP as
long as both the client and the server know how to handle the data content. It is
required for the client as well as the server to specify the content type using
appropriate MIME-type.
HTTP is stateless: As mentioned above, HTTP is connectionless and it is a direct
result of HTTP being a stateless protocol. The server and client are aware of each
other only during a current request. Afterwards, both of them forget about each other.
Due to this nature of the protocol, neither the client nor the browser can retain
information between different requests across the web pages.
Basic Architecture
The following diagram shows a very basic architecture of a web application and
depicts where HTTP sits:
The HTTP protocol is a request/response protocol based on the client/server based
architecture where web browsers, robots and search engines, etc. act like HTTP
clients, and the Web server acts as a server.
Client
The HTTP client sends a request to the server in the form of a request method, URI,
and protocol version, followed by a MIME-like message containing request
modifiers, client information, and possible body content over a TCP/IP connection.
Server
The HTTP server responds with a status line, including the message's protocol version
and a success or error code, followed by a MIME-like message containing server
information, entity meta information, and possible entity-body content.
HTTP Connection and Methods
S.N.
1 GET
The GET method is used to retrieve information from the given server using a given URI.
Requests using GET should only retrieve data and should have no other effect on the data.
2 HEAD
Same as GET, but transfers the status line and header section only.
3 POST
A POST request is used to send data to the server, for example, customer information, file
upload, etc. using HTML forms.
4 PUT
Replaces all current representations of the target resource with the uploaded content.
5 DELETE
Removes all current representations of the target resource given by a URI.
6 CONNECT
Establishes a tunnel to the server identified by a given URI.
7 OPTIONS
Describes the communication options for the target resource.
8 TRACE
Performs a message loop-back test along the path to the target resource.
HTML TAGS
Tag Description