UNIT-V
Domain Name System (DNS) in Application Layer
Last Updated: 29-07-2020
DNS is a host name to IP address translation service. DNS is a distributed database implemented in
a hierarchy of name servers. It is an application layer protocol for message exchange between
clients and servers.
Requirement
Every host is identified by the IP address but remembering numbers is very difficult for the people
and also the IP addresses are not static therefore a mapping is required to change the domain name
to IP address. So DNS is used to convert the domain name of the websites to their numerical IP
address.
Domain :
There are various kinds of DOMAIN :
1. Generic domain : .com(commercial) .edu(educational) .mil(military) .org(non profit
organization) .net(similar to commercial) all these are generic domain.
2. Country domain .in (india) .us .uk
3. Inverse domain if we want to know what is the domain name of the website. Ip to domain
name mapping.So DNS can provide both the mapping for example to find the ip addresses
of geeksforgeeks.org then we have to type nslookup www.geeksforgeeks.org.
Organization of Domain
It is Very difficult to find out the ip address associated to a website because there are millions of
websites and with all those websites we should be able to generate the ip address immediately,
there should not be a lot of delay for that to happen organization of database is very important.
DNS record – Domain name, ip address what is the validity?? what is the time to live ?? and all
the information related to that domain name. These records are stored in tree like structure.
Namespace – Set of possible names, flat or hierarchical . Naming system maintains a collection of
bindings of names to values – given a name, a resolution mechanism returns the corresponding
value –
Name server – It is an implementation of the resolution mechanism.. DNS (Domain Name
System) = Name service in Internet – Zone is an administrative unit, domain is a subtree.
Name to Address Resolution
The host request the DNS name server to resolve the domain name. And the name server returns
the IP address corresponding to that domain name to the host so that the host can future connect to
that IP address.
Hierarchy of Name Servers
Root name servers – It is contacted by name servers that can not resolve the name. It contacts
authoritative name server if name mapping is not known. It then gets the mapping and return the IP
address to the host.
Top level server – It is responsible for com, org, edu etc and all top level country domains like uk,
fr, ca, in etc. They have info about authoritative domain servers and know names and IP addresses
of each authoritative name server for the second level domains.
Authoritative name servers This is organization’s DNS server, providing authoritative hostName
to IP mapping for organization servers. It can be maintained by organization or service provider. In
order to reach cse.dtu.in we have to ask the root DNS server, then it will point out to the top level
domain server and then to authoritative domain name server which actually contains the IP
address. So the authoritative domain server will return the associative ip address.
Domain Name Server
The client machine sends a request to the local name server, which , if root does not find the
address in its database, sends a request to the root name server , which in turn, will route the query
to an intermediate or authoritative name server. The root name server can also contain some
hostName to IP address mappings . The intermediate name server always knows who the
authoritative name server is. So finally the IP address is returned to the local name server which in
turn returns the IP address to the host.
SNMP
o SNMP stands for Simple Network Management Protocol.
o SNMP is a framework used for managing devices on the internet.
o It provides a set of operations for monitoring and managing the internet.
SNMP Concept
o SNMP has two components Manager and agent.
o The manager is a host that controls and monitors a set of agents such as routers.
o It is an application layer protocol in which a few manager stations can handle a set of agents.
o The protocol designed at the application level can monitor the devices made by different manufacturers and
installed on different physical networks.
o It is used in a heterogeneous network made of different LANs and WANs connected by routers or
gateways.
Managers & Agents:
o A manager is a host that runs the SNMP client program while the agent is a router that runs the SNMP
server program.
o Management of the internet is achieved through simple interaction between a manager and agent.
o The agent is used to keep the information in a database while the manager is used to access the values in
the database. For example, a router can store the appropriate variables such as a number of packets received
and forwarded while the manager can compare these variables to determine whether the router is congested
or not.
o Agents can also contribute to the management process. A server program on the agent checks the
environment, if something goes wrong, the agent sends a warning message to the manager.
Management with SNMP has three basic ideas:
o A manager checks the agent by requesting the information that reflects the behavior of the agent.
o A manager also forces the agent to perform a certain function by resetting values in the agent database.
o An agent also contributes to the management process by warning the manager regarding an unusual
condition.
Management Components
o Management is not achieved only through the SNMP protocol but also the use of other protocols that can
cooperate with the SNMP protocol. Management is achieved through the use of the other two protocols:
SMI (Structure of management information) and MIB(management information base).
o Management is a combination of SMI, MIB, and SNMP. All these three protocols such as abstract syntax
notation 1 (ASN.1) and basic encoding rules (BER).
SMI
The SMI (Structure of management information) is a component used in network management. Its main function is
to define the type of data that can be stored in an object and to show how to encode the data for the transmission
over a network.
MIB
o The MIB (Management information base) is a second component for the network management.
o Each agent has its own MIB, which is a collection of all the objects that the manager can manage. MIB is
categorized into eight groups: system, interface, address translation, ip, icmp, tcp, udp, and egp. These
groups are under the mib object.
SNMP
SNMP defines five types of messages: GetRequest, GetNextRequest, SetRequest, GetResponse, and Trap.
GetRequest: The GetRequest message is sent from a manager (client) to the agent (server) to retrieve the value of a
variable.
GetNextRequest: The GetNextRequest message is sent from the manager to agent to retrieve the value of a
variable. This type of message is used to retrieve the values of the entries in a table. If the manager does not know
the indexes of the entries, then it will not be able to retrieve the values. In such situations, GetNextRequest message
is used to define an object.
GetResponse: The GetResponse message is sent from an agent to the manager in response to the GetRequest and
GetNextRequest message. This message contains the value of a variable requested by the manager.
SetRequest: The SetRequest message is sent from a manager to the agent to set a value in a variable.
Trap: The Trap message is sent from an agent to the manager to report an event. For example, if the agent is
rebooted, then it informs the manager as well as sends the time of rebooting.
What is E-mail?
E-mail is defined as the transmission of messages on the Internet. It is one of the most commonly used features over
communications networks that may contain text, files, images, or other attachments. Generally, it is information that
is stored on a computer sent through a network to a specified individual or group of individuals.
Email messages are conveyed through email servers; it uses multiple protocols within the TCP/IP suite. For
example, SMTP is a protocol, stands for simple mail transfer protocol and used to send messages whereas other
protocols IMAP or POP are used to retrieve messages from a mail server. If you want to login to your mail account,
you just need to enter a valid email address, password, and the mail servers used to send and receive messages.
o Message envelope: It depicts the email's electronic format.
o Message header: It contains email subject line and sender/recipient information.
o Message body: It comprises images, text, and other file attachments.
In 1971, as a test e-mail message, Ray Tomlinson sent the first e-mail to himself. This email was contained the text
"something like QWERTYUIOP." However, the e-mail message was still transmitted through ARPANET, despite
sending the e-mail to himself. Most of the electronic mail was being sent as compared to postal mail till 1996.
Differences between email and webmail
The term email is commonly used to describe both browser-based electronic mail and non-browser-based electronic
mail today. The AOL and Gmail are browser-based electronic mails, whereas Outlook for Office 365 is non-
browser-based electronic mail. However, to define email, a difference was earlier made as a non-browser program
that needed a dedicated client and email server. The non-browser emails offered some advantages, which are
enhanced security, integration with corporate software platforms, and lack of advertisements.
Email can be used in different ways: it can be used to communicate either within an organization or personally,
including between two people or a large group of people. Most people get benefit from communicating by email
with colleagues or friends or individuals or small groups. It allows you to communicate with others around the world
and send and receive images, documents, links, and other attachments. Additionally, it offers benefit users to
communicate with the flexibility on their own schedule.
There is another benefit of using email; if you use it to communicate between two people or small groups that will
beneficial to remind participants of approaching due dates and time-sensitive activities and send professional follow-
up emails after appointments.
History of E-mail
As compared to ARPANet or the Internet, email is much older. The early email was just a small advance, which is
known as a file directory in nowadays. It was used to just put a message in other user's directory in the place where
they were able to see the message by logging in. For example, the same as leaving a note on someone's desk.
Possibly MAILBOX was used at Massachusetts Institute of Technology, which was the first email system of this
type from 1965. For sending messages on the same computer, another early program was SNDMSG.
ater in 1972, Ray Tomlinson invented email to remove some difficulties. Tomlinson worked (Like many of the
Internet inventors) for Newman and Bolt Beranek as an ARPANET contractor. To denote sending messages from
one computer to another, he picked up the @ symbol from the keyboard. Then, it became easy to send a message to
another with the help of Internet standards; they were only required to propose name-of-the-user@name-of-the-
computer. One of the first users of the new system was Internet pioneer Jon Postel. Also, describing as a "nice
hack," credited goes to Jon Postel.
With the World Wide Web (WWW), email became available with a simple user interface that was offered by
providers like Hotmail and Yahoo. And, users did not require to pay any charges on these platforms. Now everyone
wanted at least one email address as it is much simple and affordable, and the medium was adopted by millions of
people.
Advantages of Email
There are many advantages of email, which are as follows:
o Cost-effective: Email is a very cost-effective service to communicate with others as there are several email
services available to individuals and organizations for free of cost. Once a user is online, it does not include
any additional charge for the services.
o Email offers users the benefit of accessing email from anywhere at any time if they have an Internet
connection.
o Email offers you an incurable communication process, which enables you to send a response at a
convenient time. Also, it offers users a better option to communicate easily regardless of different
schedules users.
o Speed and simplicity: Email can be composed very easily with the correct information and contacts. Also,
minimum lag time, it can be exchanged quickly.
o Mass sending: You can send a message easily to large numbers of people through email.
Disadvantages of Email
o Impersonal: As compared to other forms of communication, emails are less personal. For
example, when you talk to anyone over the phone or meeting face to face is more
appropriate for communicating than email.
o Misunderstandings: As email includes only text, and there is no tone of voice or body
language to provide context. Therefore, misunderstandings can occur easily with email. If
someone sends a joke on email, it can be taken seriously. Also, well-meaning information
can be quickly typed as rude or aggressive that can impact wrong. Additionally, if
someone types with short abbreviations and descriptions to send content on the email, it
can easily be misinterpreted.
o Malicious Use: As email can be sent by anyone if they have an only email address.
Sometimes, an unauthorized person can send you mail, which can be harmful in terms of
stealing your personal information. Thus, they can also use email to spread gossip or false
information.
o Accidents Will Happen: With email, you can make fatal mistakes by clicking the wrong
button in a hurry. For instance, instead of sending it to a single person, you can
accidentally send sensitive information to a large group of people. Thus, the information
can be disclosed, when you have clicked the wrong name in an address list. Therefore, it
can be harmful and generate big trouble in the workplace.
o Spam: Although in recent days, the features of email have been improved, there are still
big issues with unsolicited advertising arriving and spam through email. It can easily
become overwhelming and takes time and energy to control.
o Information Overload: As it is very easy to send email to many people at a time, which
can create information overload. In many modern workplaces, it is a major problem
where it is required to move a lot of information and impossible to tell if an email is
important. And, email needs organization and upkeep. The bad feeling is one of the other
problems with email when you returned from vacation and found hundreds of unopened
emails in your inbox.
o Viruses: Although there are many ways to travel viruses in the devices, email is one of the
common ways to enter viruses and infect devices. Sometimes when you get a mail, it might
be the virus come with an attached document. And, the virus can infect the system
when you click on the email and open the attached link. Furthermore, an anonymous
person or a trusted friend or contact can send infected emails.
o Pressure to Respond: If you get emails and you do not answer them, the sender can get
annoyed and think you are ignoring them. Thus, this can be a reason to make pressure on your
put to keep opening emails and then respond in some way.
o Time Consuming: When you get an email and read, write, and respond to emails that can take up vast
amounts of time and energy. Many modern workers spend their most time with emails, which may be
caused to take more time to complete work.
o Overlong Messages: Generally, email is a source of communication with the intention of brief messages.
There are some people who write overlong messages that can take much time than required.
o Insecure: There are many hackers available that want to gain your important information, so email is a
common source to seek sensitive data, such as political, financial, documents, or personal messages. In
recent times, there have various high-profile cases occurred that shown how email is insecure about
information theft.
Popular email sites
There are some free email website examples
include the following:
o AOL
o Zoho
o Gmail
o ProtonMail
o Com
o Microsoft Outlook
o Yahoo Mail
Introduction to World Wide Web
The World Wide Web (WWW) is a collection of documents and other web resources which are
identified by URLs, interlinked by hypertext links, and can be accessed and searched by browsers
via the Internet.
World Wide Web is also called the Web and it was invented by Tim Berners-Lee in 1989.
Website is a collection of web pages belonging to a particular organization.
The pages can be retrieved and viewed by using browser.
Let us go through the scenario shown in above fig.
The client wants to see some information that belongs to site 1.
It sends a request through its browser to the server at site 2.
The server at site 1 finds the document and sends it to the client.
Client (Browser):
Web browser is a program, which is used to communicate with web server on the Internet.
Each browser consists of three parts: a controller, client protocol and interpreter.
The controller receives input from input device and use the programs to access the documents.
After accessing the document, the controller uses one of the interpreters to display the document on
the screen.
Server:
A computer which is available for the network resources and provides service to the other computer
on request is known as server.
The web pages are stored at the server.
Server accepts a TCP connection from a client browser.
It gets the name of the file required.
Server gets the stored file. Returns the file to the client and releases the top connection.
Uniform Resource Locater (URL)
The URL is a standard for specifying any kind of information on the Internet.
The URL consists of four parts: protocol, host computer, port and path.
The protocol is the client or server program which is used to retrieve the document or file. The
protocol can be ftp or http.
The host is the name of computer on which the information is located.
The URL can optionally contain the port number and it is separated from the host name by a colon.
Path is the pathname of the file where the file is stored.
HTTP
o HTTP stands for HyperText Transfer Protocol.
o It is a protocol used to access the data on the World Wide Web (www).
o The HTTP protocol can be used to transfer the data in the form of plain text, hypertext, audio, video, and so
on.
o This protocol is known as HyperText Transfer Protocol because of its efficiency that allows us to use in a
hypertext environment where there are rapid jumps from one document to another document.
o HTTP is similar to the FTP as it also transfers the files from one host to another host. But, HTTP is simpler
than FTP as HTTP uses only one connection, i.e., no control connection to transfer the files.
o HTTP is used to carry the data in the form of MIME-like format.
o HTTP is similar to SMTP as the data is transferred between client and server. The HTTP differs from the
SMTP in the way the messages are sent from the client to the server and from server to the client. SMTP
messages are stored and forwarded while HTTP messages are delivered immediately.
Features of HTTP:
o Connectionless protocol: HTTP is a connectionless protocol. HTTP client initiates a request and waits for
a response from the server. When the server receives the request, the server processes the request and sends
back the response to the HTTP client after which the client disconnects the connection. The connection
between client and server exist only during the current request and response time only.
o Media independent: HTTP protocol is a media independent as data can be sent as long as both the client
and server know how to handle the data content. It is required for both the client and server to specify the
content type in MIME-type header.
o Stateless: HTTP is a stateless protocol as both the client and server know each other only during the
current request. Due to this nature of the protocol, both the client and server do not retain the information
between various requests of the web pages.
HTTP Transactions
The above figure shows the HTTP transaction between client and server. The client initiates a transaction by sending
a request message to the server. The server replies to the request message by sending a response message.
Messages
HTTP messages are of two types: request and response. Both the message types follow the same message format.
Request Message: The request message is sent by the client that consists of a request line, headers, and sometimes a
body.
Response Message: The response message is sent by the server to the client that consists of a status line, headers,
and sometimes a body.
Uniform Resource Locator (URL)
o A client that wants to access the document in an internet needs an address and to facilitate the access of
documents, the HTTP uses the concept of Uniform Resource Locator (URL).
o The Uniform Resource Locator (URL) is a standard way of specifying any kind of information on the
internet.
o The URL defines four parts: method, host computer, port, and path.
o Method: The method is the protocol used to retrieve the document from a server. For
example, HTTP.
o Host: The host is the computer where the information is stored, and the computer is
given an alias name. Web pages are mainly stored in the computers and the computers are
given an alias name that begins with the characters "www". This field is not mandatory.
o Port: The URL can also contain the port number of the server, but it's an optional field. If the
port number is included, then it must come between the host and path and it should be separated
from the host by a colon.
o Path: Path is the pathname of the file where the information is stored. The path itself
contain slashes that separate the directories from the subdirectories and files.