0% found this document useful (0 votes)
4 views

Unit-5_Application Layer Protocols

The document discusses Application Layer protocols, particularly focusing on the World Wide Web (WWW) and Hypertext Transfer Protocol (HTTP). It explains the architecture of the WWW, the role of web clients and servers, the structure of Uniform Resource Locators (URLs), and the types of web documents. Additionally, it covers HTTP message formats, connection types, and the use of cookies for maintaining state in web interactions.

Uploaded by

Geetanjali Patil
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Unit-5_Application Layer Protocols

The document discusses Application Layer protocols, particularly focusing on the World Wide Web (WWW) and Hypertext Transfer Protocol (HTTP). It explains the architecture of the WWW, the role of web clients and servers, the structure of Uniform Resource Locators (URLs), and the types of web documents. Additionally, it covers HTTP message formats, connection types, and the use of cookies for maintaining state in web interactions.

Uploaded by

Geetanjali Patil
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 93

Unit-5:

Application Layer
Protocols

Presented By : Mr. Nikhil. G. Khodave


Lecturer, Department of Computer Engineering,(Diploma).
Application Layer Protocols

5.1 World Wide Web (WWW) and HTTP


5.1.1 World Wide Web (WWW)
 The Web today is a repository of information.
 webpages, are distributed all over the world and related documents are linked
together.
 The popularity and growth of the Web can be related to two terms: Distributed and
linked.
 Each web server in the world can add a new web page to the repository and announce it
to all Internet users.
 Distribution allows the growth of the Web.
 Linking allows one web page to refer to another web page stored in another server
somewhere else in the world. 1
Application Layer Protocols

5.1.1 World Wide Web (WWW)

 The linking of web pages was achieved using a concept called hypertext.

 Today, the term hypertext, coined to mean linked text documents, has been changed to
hypermedia, to show that a web page can be a text document, an image, an audio file,
or a video file.

 The purpose of the Web has gone beyond the simple retrieving of linked documents.

 Today, the Web is used to provide electronic shopping and gaming.

 One can use the Web to listen to radio programs or view television programs whenever
one desires without being forced to listen to or view these programs when they are
broadcast.

2
Application Layer Protocols

Architecture of WWW

 The WWW today is a distributed client-server service, in which a client using a browser
can access a service from a server.
 However, the service provided is distributed over many locations called sites. Each site
holds one or more web pages.
 Each web page, however, can contain some links to other web pages in the same or
other sites.
 web page can be simple or composite. A simple web page has no links to other web
pages; a composite web page has one or more links to other web pages.

3
Application Layer Protocols

Architecture of WWW
Application Layer Protocols

Web Client (Browser)

 A variety of vendors offer commercial browsers that interpret and display a web
page, and all of them use nearly the same architecture.
 Each browser usually consists of three parts: a controller, client protocols, and
interpreters.

4
Application Layer Protocols

Web Client (Browser)

 The controller receives input from the keyboard or the mouse and uses the client
programs to access the document.
 After the document has been accessed, the controller uses one of the interpreters to
display the document on the screen.
 The client protocol can be one of the protocols described later, such as HTTP or FTP.
 The interpreter can be HTML, Java, or JavaScript, depending on the type of document.
 Some commercial browsers include Internet Explorer, Netscape Navigator, and Firefox.

5
Application Layer Protocols

Web Server

 The web page is stored at the server.


 Each time a request arrives, the corresponding document is sent to the client.
 To improve efficiency, servers normally store requested files in a cache in memory;
memory is faster to access than a disk.
 A server can also become more efficient through multithreading or multiprocessing.
 Some popular web servers include Apache and Microsoft Internet Information Server.

6
Application Layer Protocols

Uniform Resource Locator (URL)

 A web page, as a file, needs to have a unique identifier to distinguish it from other web
pages.
 To define a web page, we need four identifiers: protocol, host, port, and path.
 However, before defining the web page, we need to tell the browser what client server
application we want to use, which is called the protocol.

7
Application Layer Protocols

Uniform Resource Locator (URL)

 To combine these four pieces together, the uniform resource locator (URL) has been
designed;
 It uses three different separators between the four pieces as shown below:

 protocol://host/path Used most of the time


 protocol://host:port/path Used when port number is needed

 https://msbte.org/rop/home.html
 https://172.22.34.114/chl/login.aspx
 https://msbte.org:8090/home.html
8
Application Layer Protocols

Uniform Resource Locator (URL)


 https://172.22.34.114:8090/chl/login.aspx
 Protocol
 It is abbreviated form of protocol that client and server process wish to use for
the communication.
 Most of the time the protocol is HTTP (Hypertext Transfer Protocol).
 Host
 The host identifier can be the IP address of the server or the unique name
given to the server.
 For Example, 10.0.0.100 or msbte.org

9
Application Layer Protocols

Uniform Resource Locator (URL)


 https://172.22.34.114:8090/chl/login.aspx
 Port
 The port, a 16-bit integer, is normally predefined for the client-server application.
 For example, if the HTTP protocol is used for accessing the web page, the well-
known port number is 80.
 Path

 The path identifies the location and the name of the file in the underlying
operating system.
 For example, /top/next/last/myfile is a path that uniquely defines a file named
myfile, stored in the directory last, which itself is part of the directory next,
which itself is under the directory top. 10
Application Layer Protocols

Web Documents

 The documents in the WWW can be grouped into three broad categories: static,
dynamic, and active.

1. Static Documents
 Static documents are fixed-content documents that are created and stored in a
server.
 The client can get a copy of the document only.
 In other words, the contents of the file are determined when the file is created, not
when it is used.
 The contents in the server can be changed, but the user cannot change them.
11
Application Layer Protocols

Web Documents
2. Dynamic Documents
 A dynamic document is created by a web server whenever a browser requests the
document.
 When a request arrives, the web server runs an application program or a script that
creates the dynamic document.
 The server returns the result of the program or script as a response to the browser
that requested the document.
 A very simple example of a dynamic document is the retrieval of the time and date
from a server.
 Time and date are kinds of information that are dynamic in that they change from
moment to moment 12
Application Layer Protocols

Web Documents

3. Active Documents

 We need a program or a script to be run at the client site. These are called active
documents.
 When a browser requests an active document, the server sends a copy of the document
or a script.
 The document is then run at the client (browser) site.
 One way to create an active document is to use Java applets, a program written in Java
on the server. It is compiled and ready to be run.

13
Application Layer Protocols

5.1.2 Hypertext Transfer Protocol (HTTP)

 The HyperText Transfer Protocol (HTTP) is used to define how the client server
programs can be written to retrieve web pages from the Web.
 An HTTP client sends a request; an HTTP server returns a response.
 The server uses the port number 80; the client uses a temporary port number.
 HTTP uses the services of TCP.
 The client and server never worry about errors in messages exchanged or loss of any
message, because the TCP is reliable and will take care of this matter.

14
Application Layer Protocols

Non-persistent versus Persistent Connections

 If the web pages, objects to be retrieved, are located on different servers, we do not
have any other choice than to create a new TCP connection for retrieving each object.

 However, if some of the objects are located on the same server, we have two choices:
to retrieve each object using a new TCP connection or to make a TCP connection and
retrieve them all.

 The first approach is called as non-persistent connection and second approach is called
persistent connection.

15
Application Layer Protocols

Non-persistent Connections
 In a non-persistent connection, one TCP connection is made for each
request/response.
 The following lists the steps in this strategy:

1. The client opens a TCP connection and sends a request.

2. The server sends the response and closes the connection.

3. The client reads the data until it encounters an end-of-file marker; it then closes the

connection.

16
Application Layer Protocols

Non-persistent Connections

17
Application Layer Protocols

Persistent Connections
 HTTP version 1.1 specifies a persistent connection by default.
 In a persistent connection, the server leaves the connection open for more requests
after sending a response.
 The server can close the connection at the request of a client or if a time-out has been
reached.

18
Application Layer Protocols

Persistent Connections

19
Application Layer Protocols
Message Formats

20
Application Layer Protocols

Message Formats

 The HTTP protocol defines the format of the request and response messages.

 Each message is made of four sections.

 The first section in the request message is called the request line; the first section in
the response message is called the status line.

 The other three sections have the same names in the request and response messages.

21
Application Layer Protocols

Format of Request Message

Part1: Request Line

 The first line in a request message is called a request line.

 There are three fields in this line separated by one space and terminated by two
characters (carriage return and line feed)

 Thesee fields are called method, URL, and version.

22
Application Layer Protocols

 The method field defines the request types.

 The second field, URL. It defines the address and name of the corresponding
web page.

 The third field, version, gives the version of the protocol; the most current
version of HTTP is 1.1
23
Application Layer Protocols

Part2: Header Line

 After the request line, we can have zero or more request header lines.
 Each header line sends additional information from the client to the server.
 For example, the client can request that the document be sent in a special format.
 Each header line has a header name, a colon, a space, and a header value.

24
Application Layer Protocols

Request Header Names

25
Application Layer Protocols

Header Values
 The value field defines the values associated with each header name.

Accept: text/html Cache-Control: no-cache

Accept-Charset: utf-8 Connection: keep-alive

Accept-Language: en-US

Part3: Body

 The body can be present in a request message.


 Usually, it contains the comment to be sent or the file to be published on the website
when the method is PUT or POST.
26
Application Layer Protocols

Format of Response Message

 A response message consists of a status line,


header lines, a blank line, and sometimes a
body.

 The first line in a response message is called the


status line.

 There are three fields in this line separated by


spaces and terminated by a carriage return and
line feed.
27
Application Layer Protocols

 The first field defines the version of HTTP protocol,


currently 1.1.

 The status code field defines the status of the


request.

 Status Code consists of three digits.

 Codes in the 100 range are only informational.

 The codes in the 200 range indicate a successful


request.

 The codes in the 300 range redirect the client to


another URL.

 The codes in the 400 range indicate an error at the client site.

 Finally, the codes in the 500 range indicate an error at the server site. 28
Application Layer Protocols

29
Application Layer Protocols
Application Layer Protocols

 The status phrase explains the status code in


text form.

 After the status line, we can have zero or


more response header lines.

 Each header line sends additional


information from the server to the client.

 Each header line has a header name, a colon,


a space, and a header value.
30
Application Layer Protocols

Response Message Header Names

31
Application Layer Protocols

Response Message Header Values

Date: Tue, 15 Nov 1994 08:12:31


GMT

Content-Length: 348

Content-Encoding: gzip

32
Application Layer Protocols

 The body contains the document to be sent


from the server to the client.

33
Application Layer Protocols

Cookies

 The World Wide Web was originally designed as a stateless entity. A client sends a
request; a server responds. Their relationship is over.
 Today the Web has other functions that need to remember some information about
the clients; some are listed below:

34
Application Layer Protocols

Cookies

1. Websites are being used as electronic stores that allow users to browse
through the store, select wanted items, put them in an electronic cart, and
pay at the end with a credit card.
2. Some websites need to allow access to registered clients only.
3. Some websites are just advertising agencies.
4. Some websites are used as portals: the user selects the web pages he wants
to see.

For these purposes, the cookie mechanism was devised.

35
Application Layer Protocols

Creating and Storing Cookies

1. When a server receives a request from a client, it stores information about the client in
a file or a string.
 The information may include the domain name of the client, registration number, and so
a timestamp etc.

2. The server includes the cookie in the response that it sends to the client.

3. When the client receives the response, the browser stores the cookie in the cookie
directory, which is sorted by the server domain name.

36
Application Layer Protocols

Using Cookies
1. When a client sends a request to a server, the browser looks in the cookie directory to
see if it can find a cookie sent by that server. If found, the cookie is included in the
request.
2. When the server receives the request, it knows that this is an old client, not a new one.
***Note that the contents of the cookie are never read by the browser or disclosed to
the user.
3. It is a cookie made by the server and eaten by the server.

37
Application Layer Protocols

Now let us see how a cookie is used for the four previously mentioned purposes,

 An electronic store (e-commerce) can use a cookie for its client shoppers.

 When a client selects an item and inserts it in a cart, a cookie that contains information
about the item, such as its number and unit price, is sent to the browser.

 If the client selects a second item, the cookie is updated with the new selection
information, and so on.

 When the client finishes shopping and wants to check out, the last cookie is retrieved
and the total charge is calculated.

Construct a diagram to show the application of cookies in a scenario in which


the server uses cookies for advertisement. W-19,S-22,W-22 4M
38
Application Layer Protocols

 Figure shows a scenario in which


an electronic store can benefit
from the use of cookies.

 Assume a shopper wants to buy a


toy from an electronic store
named BestToys.

 The shopper browser (client)


sends a request to the BestToys
server.

 The server creates an empty


shopping cart (a list) for the client
and assigns an ID to the cart (for
example, 12343).
39
Application Layer Protocols

 The server then sends a response


message, which contains the
images of all toys available, with
a link under each toy that selects
the toy if it is being clicked.

 This response message also


includes the Set-Cookie header
line whose value is 12343.

40
Application Layer Protocols

 The client displays the images


and stores the cookie value in a
file named BestToys.

 The cookie is not revealed to the


shopper.

 Now the shopper selects one of


the toys and clicks on it.

 The client sends a request, and


includes the ID 12343 in the
Cookie header line.

41
Application Layer Protocols

 When Sever receives the request


and checks the header, it finds
the value 12343 as the cookie.

 The server knows that the


customer is not new; it searches
for a shopping cart with ID
12343.

 The shopping cart (list) is opened


and the selected toy is inserted in
the list.

42
Application Layer Protocols

 The server now sends another


response to the shopper to tell her
the total price and ask him/her to
provide payment.

 The shopper provides information


about her credit card and sends a
new request with the ID 12343 as
the cookie value.

 When the request arrives at the


server, it again sees the ID 12343,
and accepts the order and the
payment and sends a confirmation
in a response.

43
Application Layer Protocols

5.1.3 File Transfer Protocol(FTP)


 File Transfer Protocol (FTP) is the standard protocol provided by TCP/IP for copying
a file from one host to another.

 Although transferring files from one system to another seems simple and
straightforward.

 Although there are some problems, we may face such as,

1. Two systems may have different ways to represent data.


2. Two systems may have different directory structures.

 All of these problems have been solved by FTP in a very simple and elegant approach.

 Although we can transfer files using HTTP, FTP is a better choice to transfer large files
or to transfer files using different formats.
44
Application Layer Protocols

5.1.3 File Transfer Protocol(FTP)

45
Application Layer Protocols

Two Connections

 The two connections in FTP have different lifetimes.


 The control connection remains connected during the entire interactive FTP session.
 The data connection is opened and then closed for each file transfer activity.
 It opens each time commands that involve transferring files are used, and it closes when
the file is transferred.
 The control connection is open, the data connection can be opened and closed multiple
times if several files are transferred.

 FTP uses two well-known TCP ports: port 21 is used for the control connection, and port
20 is used for the data connection.
46
Application Layer Protocols

FTP
Commands

47
Application Layer Protocols

FTP
Responses

48
Application Layer Protocols

Transmission Modes
 FTP can transfer a file across the data connection using one of the following three
transmission modes: stream mode, block mode, or compressed mode.

 The stream mode is the default mode; data are delivered from FTP to TCP as a
continuous stream of bytes.

 In the block mode, data can be delivered from FTP to TCP in blocks. In this case, each
block is preceded by a 3-byte header. The first byte is called the block descriptor; the
next two bytes define the size of the block in bytes.

 Compressed mode is often used when transferring large files. Data compression can
improve transfer times, especially when the network connection is slow and the CPU is
fast.

49
Application Layer Protocols

File Transfer

 File transfer occurs over the data connection under the control of the commands sent
over the control connection.

 However, we should remember that file transfer in FTP means one of three things:

1. retrieving a file (server to client)


2. storing a file (client to server)
3. directory listing (server to client)

50
Application Layer Protocols

TFTP (Trivial File Transfer Protocol)

 TFTP stands for Trivial File Transfer Protocol.

 TFTP is defined as a protocol that is used to transfer a file from a client to a server and
from a server to a client.

 TFTP is majorly used when no complex interactions are required by the client and server.

 The service of TFTP is provided by UDP (User Datagram Protocol) and works on port
number 69.

51
Working of TFTP

• TFTP makes use of port number 69 as it uses User Datagram Protocol (UDP).

• When the connection is established successfully between client and server, the client makes a
Read Request (RRQ) or Write Request( WRQ).

• If a client wants to only read the file it requests RRQ and if the client wants to write some data
into a server then it requests for WRQ.

• Once the connection is established and a request is made communication of files takes place in
the form of small packets. These packets are 512 bytes each.

• The server then communicates the packet back to the client and waits until it receives an
acknowledgment from the client that the packet has been received.

• When the acknowledgment is received from the client side, the server again sends the next
packet which is 512 bytes each.

• The same steps as mentioned above continue until the last packet is sent by the server to the
client. 52
Application Layer Protocols

53
Application Layer Protocols

Electronic Mail (Email)

• Electronic mail (or e-mail) allows users to exchange messages.

• In an application such as HTTP or FTP, the server program is running all the time,
waiting for a request from a client.

• When the request arrives, the server provides the service. There is a request and
there is a response.

• In the case of electronic mail, the situation is different. First, e-mail is considered a
one-way transaction.

54
Application Layer Protocols

Electronic Mail (Email)


 When Alice sends an email to Bob, she may expect a response, but this is not a
mandate.

 Bob may or may not respond. If he does respond, it is another one-way transaction.

 Second, it is neither feasible nor logical for Bob to run a server program and wait
until someone sends an e-mail to him.

 Bob may turn off his computer when he is not using it.

 This means that the idea of client/server programming should be implemented in


another way: using some intermediate computers (servers).

 The users run only client programs when they want and the intermediate servers
apply the client/server paradigm
55
Application Layer Protocols

Email Architecture

56
Application Layer Protocols

Email Architecture

• In the common scenario, the sender and the receiver of the e-mail, Alice and Bob
respectively, are connected via a LAN or a WAN to two mail servers.

• The administrator has created one mailbox for each user where the received
messages are stored.

• A mailbox is part of a server hard drive, a special file with permission restrictions.

• Only the owner of the mailbox has access to it. The administrator has also created a
queue (spool) to store messages waiting to be sent.

57
Application Layer Protocols

Email Architecture

• A simple e-mail from Alice to Bob takes nine different steps, as shown in the figure.

• Alice and Bob use three different agents: a user agent (UA), a message transfer
agent (MTA), and a message access agent (MAA).

58
Application Layer Protocols

Email Architecture

A user agent (UA)

• The first component of an electronic mail system is the user agent (UA).

• It provides service to the user to make the process of sending and receiving a
message easier.

• A user agent is a software package (program) that composes, reads, replies to, and
forwards messages.

• It also handles local mailboxes on the user computers.

59
Application Layer Protocols

Message Transfer Agent: SMTP

• The formal protocol that defines the MTA client and server in the Internet is called
Simple Mail Transfer Protocol (SMTP).

• SMTP is used two times, between the sender and the sender’s mail server and
between the two mail servers.
60
Application Layer Protocols

SMTP Commands and Responses

• SMTP uses commands and responses to transfer messages between an MTA client and
an MTA server.

• The command is from an MTA client to an MTA server; the response is from an MTA
server to the MTA client.

61
Application Layer Protocols

Responses

Commands
Application Layer Protocols

Mail Transfer Phases

1. Connection Establishment

 After a client has made a TCP connection to the well known port 25, the SMTP
server starts the connection phase.

2. Message Transfer

 After connection has been established between the SMTP client and server, a
single message between a sender and one or more recipients can be exchanged.

3. Connection Termination

 After the message is transferred successfully, the client terminates the


connection
63
Application Layer Protocols

Message Access Agent: POP and IMAP

• The first and second stages of mail delivery use SMTP.

• However, SMTP is not involved in the third stage because SMTP is a push protocol; it
pushes the message from the client to the server

• The third stage needs a pull protocol; the client must pull messages from the server.

• The direction of the bulk data is from the server to the client.

• The third stage uses a message access agent.

• Currently two message access protocols are available: Post Office Protocol, version 3
(POP3) and Internet Mail Access Protocol, version 4 (IMAP4).

64
Application Layer Protocols

POP3

• Post Office Protocol, version 3 (POP3) is simple but limited in functionality.

• The client POP3 software is installed on the recipient computer; the server POP3
software is installed on the mail server.

• Mail access starts with the client when the user needs to download its e-mail from
the mailbox on the mail server.

• The client opens a connection to the server on TCP port 110.

65
Application Layer Protocols

66
Application Layer Protocols

IMAP4
 Another mail access protocol is Internet Mail Access Protocol, version 4 (IMAP4).

 IMAP4 is similar to POP3, but it has more features; IMAP4 is more powerful and more
complex.

POP3 is deficient in several ways.

a. It does not allow the user to organize her mail on the server; the user
cannot have different folders on the server.

b. In addition, POP3 does not allow the user to partially check the contents
of the mail before downloading.

67
Application Layer Protocols

IMAP4 provides the following extra functions:

❑ A user can check the e-mail header prior to downloading.

❑ A user can search the contents of the e-mail for a specific string of characters prior
to downloading.

❑ A user can partially download e-mail. This is especially useful if bandwidth is limited
and the e-mail contains multimedia with high bandwidth requirements.

❑ A user can create, delete, or rename mailboxes on the mail server.

❑ A user can create a hierarchy of mailboxes in a folder for e-mail storage.

68
Application Layer Protocols

Remote Login:
1. TELNET (Terminal Network)

• If a student needs to use the Java compiler program at her university lab, there is
no need for separate Java compiler client and a Java compiler server.

• The student can use a client logging program to log into the university server and
use the compiler program at the university.

• We refer to these generic client/server pairs as remote logging applications.

69
Application Layer Protocols

1. TELNET (Terminal Network)

• One of the original remote logging protocols is TELNET, which is an abbreviation for
TErminaL NETwork.

• Although TELNET requires a logging name and password, it is vulnerable to hacking


because it sends all data including the password in plaintext (not encrypted).

• Because of this security issue, the use of TELNET has diminished in favor of another
protocol, Secure Shell (SSH).

70
Application Layer Protocols

Local versus Remote Logging

71
Application Layer Protocols

1. Remote login using TELNET (Terminal Network)

• TELNET is client application used to login on


remote machine and provides access to remote
system.

• The user here sends keystrokes to the terminal


driver, where the local OS accepts the
characters but does not interpret them.

• The character are then send TELNET client,


which transforms the characters into universal
character set called NVT and it is delivered to
local TCP/IP protocol suite.

72
Application Layer Protocols

1. Remote login using TELNET (Terminal Network)

• The NVT commands or text travel through the


internet and arrive at remote host TCP/IP
protocol suite.

• Here characters are delivered to TELNET server


which converts back to characters
understandable by remote computer.

• The TELNET Server delivers these characters to


Pseudo-terminal driver.

• The Pseudo-terminal drives delivers to OS, OS


interpret the commands and texts and finally
delivers it to appropriate application.
73
Application Layer Protocols

2. Secure Shell (SSH)

• Although Secure Shell (SSH) is a secure application program that can be used today
for several purposes such as remote logging and file transfer.

• It was originally designed to replace TELNET.

• It is a cryptographic network protocol that is used for transferring encrypted data over
the network. The port number of SSH is 22.

74
Application Layer Protocols

We briefly list the services provided by this protocol:

1. Privacy or confidentiality of the message exchanged.

2. Data integrity, which means that it is guaranteed that the messages exchanged
between the client and server are not changed/altered by an intruder.

3. Server authentication, which means that the client is now sure that the server is the
one that it claims to be .

4. Compression of the messages, which improves the efficiency of the system and
makes attack more difficult.

75
Application Layer Protocols

DOMAIN NAME SYSTEM (DNS)

• To identify an entity, TCP/IP protocols use the IP address, which uniquely identifies
the connection of a host to the Internet.

• However, people prefer to use names instead of numeric addresses.

• Therefore, the Internet needs to have a directory system that can map a name to an
address.

• This is analogous to the telephone network. A telephone network is designed to use


telephone numbers, not names.

76
Application Layer Protocols

DOMAIN NAME SYSTEM (DNS)

• Internet is so huge today, a central directory system cannot hold all the mapping.

• In addition, if the central computer fails, the whole communication network will
collapse.

• A better solution is to distribute the information among many computers in the world.

• In this method, the host that needs mapping can contact the closest computer holding
the needed information.

• This method is used by the Domain Name System (DNS).

77
Application Layer Protocols

1. The user passes the host name to the file transfer


client.

2. The file transfer client passes the host name to the


DNS client.

3. Each computer, after being booted, knows the


address of one DNS server. The DNS client sends a
message to a DNS server with a query that gives
the file transfer server name using the known IP
address of the DNS server.

4. The DNS server responds with the IP address of


the desired file transfer server.

5. The DNS server passes the IP address to the file


transfer client.

6. The file transfer client now uses the received IP


address to access the file transfer server. 78
Application Layer Protocols

Name Space
• The names must be unique because the addresses are unique.

• A 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; if they do, it has no
meaning.
• It can not be used with larger systems such as Internet and creates ambiguity
79
and duplication.
Application Layer Protocols
ceasar.first.com and ceasar.second.com
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.

• The responsibility for the rest of the name can be given to the organization itself.

• The organization can add suffixes (or prefixes) to the name to define its host or
resources. 80
Application Layer Protocols

Domain Name Space


• To have a hierarchical name space, a domain name space was designed.

• In this design the names are defined in an inverted-tree structure with the root at
the top.

• The tree can have only 128 levels: level 0 (root) to level 127
Application Layer Protocols

Label
 Each node in the tree has a label, which is a string with a maximum of 63
characters.
 The root label is a null string (empty string).
 DNS requires that children of a node have different labels, which guarantees the
uniqueness of the domain names.
Domain Name
• Each node in the tree has a domain name.
• A full domain name is a sequence of labels separated by dots (.).
• The domain names are always read from the node up to the root.
• The last label is the label of the root (null).
• This means that a full domain name always ends in a null label, which means
the last character is a dot because the null string is nothing.
Application Layer Protocols

Domain
• A domain is a subtree of the domain name space.
• The name of the domain is the name of the node at the top of the subtree.
• Figure shows some domains. Note that a domain may itself be divided into domains.
Application Layer Protocols
Application Layer Protocols
Application Layer Protocols

Dynamic Host Configuration Protocol (DHCP)

 A small organization can receive a block of addresses from an ISP.

 After a block of addresses are assigned to an organization, the network


administration can manually assign addresses to the individual hosts or routers.

 However, address assignment in a large organizations can be done automatically


using the Dynamic Host Configuration Protocol (DHCP).

 A network manager can configure DHCP to assign permanent IP addresses to the


host and routers. DHCP can also be configured to provide temporary, on demand, IP
addresses to hosts.
Application Layer Protocols

 DHCP (Dynamic Host Configuration Protocol) is a client-server protocol that uses DHCP servers and
DHCP clients.

 A DHCP server is a machine that runs a service that can lease out IP addresses and other TCP/IP
information to any client that requests them.

 The DHCP server typically has a pool of IP addresses that it is allowed to distribute to clients, and
these clients lease an IP address from the pool for a specific period of time, usually several days.

 Once the lease is ready to expire, the client contacts the server to arrange for renewal.

 DHCP clients are client machines that run special DHCP client software enabling them to
communicate with DHCP server.
Application Layer Protocols

DHCP clients obtain a DHCP lease for an IP address, a subnet mask, and various DHCP
options from DHCP servers in a four-step process:

1. DHCP DISCOVER: The client broadcasts a request for a DHCP server.

2. DHCPOFFER: DHCP servers on the network offer an address to the client.

3. DHCPREQUEST: The client broadcasts a request to lease an address from one of


the offering DHCP servers.

4. DHCPACK: The DHCP server that the client responds to acknowledges the client,
assigns it any configured DHCP options, and updates its DHCP database. The client
then initializes and binds its TCP/IP protocol stack and can begin network
communication.
Application Layer Protocols

You might also like