Download as pdf or txt
Download as pdf or txt
You are on page 1of 50

Chapter-8

The Application Layer


Domain Name System

2
Domain Name System

◉ People prefer to use easy-to-remember names instead of IP


addresses
◉ Domain names are alphanumeric names for IP addresses e.g.
ssasit.ac.in
◉ The domain name system (DNS) is an Internet-wide distributed
database that translates between domain names and IP
addresses

3
Domain Name System

4
Host file

◉ When the Internet was small, mapping was done by using a host file.
◉ The host file had only two columns: name and address.
◉ Every host could store the host file on its disk and update it
periodically from a master host file.
◉ When a program or a user wanted to map a name to an address, the
host consulted the host file and found the mapping.
◉ Today, however, it is impossible to have one single host file

5
Domain Name System

◉ This huge amount of information is divided into smaller parts and store
each part on a different computer
◉ Name space that maps each address to a unique name can be organized in
two ways: flat or hierarchical
◉ Flat Name Space : In a flat name space, a name is assigned to an address.
◉ A name in this space is a sequence of characters without structure. The
names may or may not have a common section.

6
Domain Name System

◉ Hierarchical Name Space :


◉ In a hierarchical name space, each name is made of several parts.
◉ The first part can define the nature of the organization,
◉ the second part can define the name of an organization,
◉ the third part can define departments in the organization, and so on.
◉ A central authority can assign the part of the name that defines the nature
of the organization and the name of the organization.

7
Domain Name Space

◉ Host names are divided into several pieces called domains


◉ The names are defined in an inverted-tree structure with the root at the top.
◉ Each node in the tree has a label, which is a string with a maximum of 63
characters.
◉ The root label is a null string (empty string)
◉ The domain names are always read from the node up to the root.
◉ A full domain name is a sequence of labels separated by dots (.)

8
Domain Name Space

9
10
Domain Name Space

◉ Several domain names available,


some of them are generic such as
.com, .edu, .gov etc
◉ The generic domains define
registered hosts according to their
generic behaviour.
◉ Some are country level domain
names such as .au, .in, .us etc.

11
Domain Name System

◉ RESOLUTION
◉ Mapping a name to an address or an address to a name is called name-
address resolution
◉ A host that needs to map an address to a name or a name to an address calls
a DNS client called a resolver.
◉ The resolver accesses the closest DNS server with a mapping request. If the
server has the information, it satisfies the resolver
◉ otherwise, it either refers the resolver to other servers or asks other servers
to provide the information.

12
Domain Name System

◉ Types of resolution method


1. Recursive Resolution
2. Iterative Resolution:

13
Domain Name System

◉ Recursive Resolution:
◉ The client (resolver) can ask for a recursive answer from a name server.
◉ This means that the resolver expects the server to supply the final answer.
◉ If the server is the authority for the domain name, it checks its database and
responds.
◉ If the server is not the authority, it sends the request to another server (the
parent usually) and waits for the response.
◉ When the query is finally resolved the response travels back until it finally
reaches the requesting client.

14
Domain Name System

15
Domain Name System

◉ Iterative Resolution:
◉ If the client does not ask for a recursive answer the mapping can be done
iteratively.
◉ If the server is an authority for the name, it sends the answer. if it is not, it
returns the IP address of the server that it thinks can resolve the query.
◉ The client is responsible for repeating the query to this second server
◉ This process is called iterative because the client repeats the same query to
multiple servers.

16
17
Domain Name System

◉ Caching :
◉ Reduction of this search time would increase efficiency. DNS handles this
with a mechanism called caching.
◉ When a server asks for a mapping from another server and receives the
response, it stores this information in its cache memory before sending it to
the client.
◉ If the same or another client asks for the same mapping, it can check its
cache memory and solve the problem.

18
Electronic Mail

19
Electronic Mail

◉ Electronic mail is often referred to as E-mail and it is a method used


for exchanging digital messages.
◉ It allows a message to includes text, image, audio as well as video.
◉ This service allows one message to be sent to one or more than one
recipient

20
Architecture of Electronic Mail

21
Architecture of Electronic Mail

◉ It consists of two kinds of subsystems:


◉ the user agents, which allow people to read and send email,
◉ The message transfer agents, which move the messages
from the source to the destination.
◉ We will also refer to message transfer agents informally as
mail servers.

22
Architecture of Electronic Mail

◉ user agents:
◉ The user agent is a program that provides a graphical interface, or
sometimes a text- and command-based interface that lets users
interact with the email system.
◉ It includes a means to compose messages and replies to messages,
display incoming messages, and organize messages by filing,
searching, and discarding them
◉ A user agent runs on the same computer on which a user reads her
mail
23
Architecture of Electronic Mail

◉ The act of sending new messages into the mail system for delivery is
called mail submission.
◉ The message transfer agents are typically system processes
◉ They run in the background on mail server machines and are
intended to be always available.
◉ Their job is to automatically move email through the system from the
originator to the recipient with SMTP (Simple Mail Transfer
Protocol).

24
Architecture of Electronic Mail

◉ SMTP: It sends mail over connections and reports back the delivery
status and any errors.
◉ Feature of MTA
◉ Message transfer agents also implement mailing lists, in which an
identical copy of a message is delivered to everyone on a list of email
addresses.
◉ Other advanced features are carbon copies, blind carbon copies, high-
priority email, secret (i.e., encrypted) email, alternative recipients if
the primary one is not currently available etc.

25
Structure of Email

26
Structure of Email

◉ Envelope : It contains all


information that is required for
sending any e-mail such as
destination address, priority
and security level.
◉ The envelope is used by MTAs
for routing message.

27
Structure of Email

◉ The message inside the envelope consists of two separate parts: the
header and the body.
◉ The header contains control information for the user agents.
◉ The body is entirely for the human recipient

28
File Transfer Protocol(FTP)

29
File Transfer Protocol(FTP)

◉ It is an application layer protocol that moves files between local and remote
file systems.
◉ To transfer a file, 2 TCP connections are used by FTP in parallel: control
connection and data connection.
◉ Control connection : For sending control information like user identification,
password, commands to change the remote directory, commands to retrieve
and store files, etc.
◉ The control connection is initiated on port number 21

30
File Transfer Protocol(FTP)

31
File Transfer Protocol(FTP)

◉ data connection : For sending the actual file, FTP makes use of a
data connection. A data connection is initiated on port number 20.

32
File Transfer Protocol(FTP)

◉ Speed: One of the biggest advantages of FTP is speed. The FTP is one of the
fastest way to transfer the files from one computer to another computer.
◉ Efficient: It is more efficient as we do not need to complete all the operations to
get the entire file.
◉ Security: To access the FTP server, we need to login with the username and
password. Therefore, we can say that FTP is more secure.
◉ Back & forth movement: FTP allows us to transfer the files back and forth.
Suppose you are a manager of the company, you send some information to all
the employees, and they all send information back on the same server.

33
Disadvantages of FTP

◉ file size limit is the drawback of FTP only 2 GB size files can be
transferred.
◉ multiple receivers are not supported by the FTP.
◉ FTP does not encrypt the data this is one of the biggest drawbacks
of FTP.

34
World Wide Web (WWW)

35
World Wide Web (WWW)
◉ World Wide Web, which is also known as a Web, is a collection of websites or
web pages stored in web servers and connected to local computers through the
internet
◉ Pages are generally viewed with a program called a browser.
◉ Client/Browser
◉ The Client/Web browser is basically a program that is used to communicate with
the webserver on the Internet.
◉ Firefox, Internet Explorer, and Chrome are examples of popular browsers
◉ The browser fetches the page requested, interprets the content, and displays the
page, properly formatted, on the screen

◉ 36
◉ Architecture of WWW:
◉ The WWW is mainly a distributed client/server service where a client using
the browser can access the service using a server.

 The client wants to see


some information that
belongs to site 1.
 It sends a request through
its browser to the server at
site 1.
 The server at site 1 finds
the document and sends it
to the client.
37
 Each page may contain links to other pages anywhere in the world.
 Users can follow a link by clicking on it, which then takes them to the page pointed
to
 The idea of having one page point to another, now called hypertext

38
Components of Web

◉ There are 3 components of web:


◉ Uniform Resource Locator (URL): Serves as system for resources on
web.
◉ HyperText Transfer Protocol (HTTP): Specifies communication of
browser and server.
◉ Hyper Text Markup Language (HTML): Defines structure, organisation
and content of webpage.

39
World Wide Web (WWW)

◉ Each page is assigned a URL (Uniform Resource Locator)


◉ EX: http://www.cs.washington.edu/index.html

◉ URLs have three parts: the protocol (also known as the scheme), the DNS
name of the machine on which the page is located, and the path uniquely
indicating the specific page (a file to read or program to run on the machine).
◉ This URL consists of three parts: the protocol (http), the DNS name of the
host (www.cs.washington.edu), and the path name (index.html).

40
World Wide Web (WWW)

◉ The request-response protocol for fetching pages is a simple text-based


protocol that runs over TCP, It is called HTTP (HyperText Transfer
Protocol).
◉ It is generally used for creating web pages.
◉ It is mainly used to define the contents, structure, and organization of the
web page

41
HTTP—The HyperText Transfer Protocol

42
HTTP—The Hyper Text Transfer Protocol

◉ HTTP is a simple request-response protocol that normally runs over TCP


◉ It specifies what messages clients may send to servers and what responses they
get back in return
◉ The HTTP is similar to FTP because HTTP is used to transfer the files and it
mainly uses the services of TCP.
◉ Also, HTTP is much simpler than FTP because there is only one TCP
connection, no separate control connection
◉ It mainly uses the services of the TCP on the well-known port that is port 80

43
HTTP—The Hyper Text Transfer Protocol

◉ This protocol is used to transfer the data in the form of plain text,
hypertext, audio as well as video, and so on
◉ It is a stateless protocol: here is no connection among two requests
that are being consecutively carried out on the same connection.
◉ Client and the server know each other only during the current
requests
◉ The HTTP cookies provide in making use of stateful sessions

44
Working of HTTP

◉ It makes use of Client-server architecture


◉ Browser acts as the HTTP client and this client mainly communicates with the
webserver that is hosting the website

45
Format of request and response messages

46
Request Line and Status line

47
Request Type Name of Method Actions
This method is used to request a
GET
document from the server.
This method mainly requests
HEAD information about a document and not
the document itself
This method sends some information
POST
from the client to the server.
This method sends a document from
PUT
the server to the client.
This method echoes the incoming
TRACE
request.
CONNECT This method means reserved
In order to inquire about the available
OPTION
options.
48
HTTP—The Hyper Text Transfer Protocol

◉ HTTP Version: The current version of the HTTP is 1.1.


◉ Status Code
◉ The status code is the field of the response message. The status code
consists of three digits.
◉ Status Phrase
◉ This field is also used in the response message and it is used to explain the
status code in the form of text.

49
HTTP—The Hyper Text Transfer Protocol

◉ Header
◉ The header is used to exchange the additional information between the
client and the server. The header mainly consists of one or more header
lines. Each header line has a header name, a colon, space, and a header
value
◉ Body
◉ It can be present in the request message or in the response message. The
body part mainly contains the document to be sent or received.

50

You might also like