0% found this document useful (0 votes)
20 views25 pages

Overview of Application Layer Protocols

The document discusses the World Wide Web and its components like websites, browsers, servers and URLs. It explains how browsers communicate with servers to retrieve web pages using protocols like HTTP and how URLs are used to locate resources. It also provides details on non-persistent and persistent HTTP connections.

Uploaded by

cdhvvgybf
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views25 pages

Overview of Application Layer Protocols

The document discusses the World Wide Web and its components like websites, browsers, servers and URLs. It explains how browsers communicate with servers to retrieve web pages using protocols like HTTP and how URLs are used to locate resources. It also provides details on non-persistent and persistent HTTP connections.

Uploaded by

cdhvvgybf
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Chapter 5

Application Layer

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.

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.
Non-Persistent Connection
1. Without parallel connection
2. With parallel connection

Without parallel connection Non-Persistent


Each objection takes two RTT (assuming no window limit) one for TCP connection and
other for HTTP image/text file.
Persistent connection
1. Non-Pipelined
2. Pipelined
In Non-pipeline connection we first establish connection which takes two RTT then we
send all the objects images/text files which takes 1 RTT each (TCP for each object is
not required).

In Pipelined connection 2RTT for connection establishment and then 1RTT(assuming


no window limit) for all the objects i.e. images/text.

File Transfer Protocol (FTP) in Application Layer


File Transfer Protocol(FTP) is an application layer protocol which moves files between
local and remote file systems. It runs on the top of TCP, like HTTP. To transfer a file, 2
TCP connections are used by FTP in parallel: control connection and data connection.
What is control connection?
For sending control information like user identification, password, commands to change
the remote directory, commands to retrieve and store files, etc., FTP makes use of
control connection. The control connection is initiated on port number 21.

What is data connection?


For sending the actual file, FTP makes use of data connection. A data connection is
initiated on port number 20.
FTP sends the control information out-of-band as it uses a separate control connection.
Some protocols send their request and response header lines and the data in the same
TCP connection. For this reason, they are said to send their control information in-band.
HTTP and SMTP are such examples.

FTP Session :
When a FTP session is started between a client and a server, the client initiates a
control TCP connection with the server side. The client sends control information over
this. When the server receives this, it initiates a data connection to the client side. Only
one file can be sent over one data connection. But the control connection remains
active throughout the user session. As we know HTTP is stateless i.e. it does not have
to keep track of any user state. But FTP needs to maintain a state about its user
throughout the session.
Data Structures : FTP allows three types of data structures :
1. File Structure – In file-structure there is no internal structure and the file is
considered to be a continuous sequence of data bytes.
2. Record Structure – In record-structure the file is made up of sequential records.
3. Page Structure – In page-structure the file is made up of independent indexed
pages.

FTP Commands – Some of the FTP commands are :


USER – This command sends the user identification to the server.
PASS – This command sends the user password to the server.
CWD – This command allows the user to work with a different directory or dataset for
file storage or retrieval without altering his login or accounting information.
RMD – This command causes the directory specified in the path-name to be removed
as a directory.
MKD – This command causes the directory specified in the pathname to be created as
a directory.
PWD – This command causes the name of the current working directory to be returned
in the reply.
RETR – This command causes the remote host to initiate a data connection and to
send the requested file over the data connection.
STOR – This command causes to store a file into the current directory of the remote
host.
LIST – Sends a request to display the list of all the files present in the directory.
ABOR – This command tells the server to abort the previous FTP service command and
any associated transfer of data.
QUIT – This command terminates a USER and if file transfer is not in progress, the
server closes the control connection.

FTP Replies –

Some of the FTP replies are :


200 Command okay.
530 Not logged in.
331 User name okay, need a password.
225 Data connection open; no transfer in progress.
221 Service closing control connection.
551 Requested action aborted: page type unknown.
502 Command not implemented.
503 Bad sequence of commands.
504 Command not implemented for that parameter.
Trivial File Transfer Protocol (TFTP): It is also file transfer protocol without
sophisticated features of FTP.
 It is good for simple file transfers, such as during boot time.
 It uses UDP as transport layer protocols. Errors in the transmission (lost packets,
checksum errors) must be handled by the TFTP server.
 It uses only one connection through well-known port 69.
 TFTP uses a simple lock-step protocol (each data packet needs to be
acknowledged). Thus the throughput is limited

Electronics Mail

Along with the Web, electronic mail is one of the most popular Internet applications. Just
like ordinary "snail mail," email is asynchronous – people send and read messages
when it is convenient for them, without having to coordinate with other peoples'
schedules.

In contrast with snail mail, electronic mail is fast, easy to distribute, and inexpensive.
Moreover, modern electronic mail messages can include hyperlinks, HTML formatted
text, images, sound and even video.

In this section we will examine the application-layer protocols that are at the heart of
Internet electronic mail. But before we jump into an in-depth discussion of these
protocols, let's take a bird's eye view of the Internet mail system and its key
components.
Fig. view of the Internet e-mail system.
Dynamic Host Configuration Protocol (DHCP) is an application layer protocol used to
distribute network configuration parameters, such as IP addresses, subnet masks,
default gateways, etc. to hosts on a TCP/IP network. Assigning network
parameters using DHCP reduces the amount of work of a network administrator, since
there is no need to statically configure parameters on each device.
DHCP employs a client-server architecture; a DHCP client is configured to request
network parameters from a DHCP server. A DHCP server is configured with a pool of
available IP addresses and assigns one of them to the DHCP client. Besides IP
addresses, a DHCP server can provide some additional network parameters, such as:
 subnet mask
 default gateway
 domain name
 DNS server

Here is an overview of the DHCP process:

As you can see from the picture above, a DHCP client goes through the four-step
process:
1. A DHCP client sends a broadcast packet (DHCPDiscover) to discover DHCP servers
on the network.
2. The DHCP server receives the DHCPDiscover packet and respond with
a DHCPOffer packet, offering IP addressing information to the DHCP client.
3. If there is more than one DHCP server on the network segment and the DHCP client
receives more than one DHCPOffer packets, the client will accept the first DHCPOffer
packet. The DHCP client responds by broadcasting a DHCPRequest packet,
requesting network parameters from the DHCP server.
4. The DHCP server approves the lease with a DHCPACK
(Acknowledgement) packet. The packet includes the lease duration and other
configuration information.
DHCP Allocation Methods:

o Manual Allocation: A particular IP address is pre-allocated to a single


device by an administrator. DHCP only communicates the IP address to
the device.

o Automatic Allocation: DHCP automatically assigns an IP address


permanently to a device, selecting it from a pool of available addresses.

o Dynamic Allocation: DHCP assigns an IP address from a pool of


addresses for a limited period of time chosen by the server, or until the
client tells the DHCP server that it no longer needs the address.
Dynamic Host Configuration Protocol (DHCP) Message Format
All Dynamic Host Configuration Protocol (DHCP) messages include a FIXED format section and a
VARIABLE format section. The fixed format section consists of several fields that are the same in every
Dynamic Host Configuration Protocol (DHCP) message. The variable format section in the Dynamic Host
Configuration Protocol (DHCP) contains "OPTIONS", which carry additional configuration parameters.

Dynamic Host Configuration Protocol (DHCP) Message Format

DHCP Message Description


Field

Specifies the type of the Dynamic Host Configuration Protocol (DHCP) message. Set to 1 in messages sent by a client
Operation Code
(requests) and 2 in messages sent by a server (response).

Hardware Type Specifies the network LAN architecture. For example, the ethernet type is specified when htype is set to 1.

Hardware Address Layer 2 (Data-link layer) address length (MAC address) (in bytes); defines the length of hardware address in the
Length chaddr field. For Ethernet (Most widely used LAN Standard), this value is 6.

Hops Number of relay agents that have forwarded this message.

Transaction
Used by clients to match responses from servers with previously transmitted requests.
identifier

seconds Elapsed time (in seconds) since the client began theDynamic Host Configuration Protocol (DHCP) process.

Flags Flags field is called the broadcast bit, can be set to 1 to indicate that messages to the client must be broadcast

ciaddr Client�s IP address; set by the client when the client has confirmed that its IP address is valid.

yiaddr Client�s IP address; set by the server to inform the client of the client�s IP address.

IP address of the next server for the client to use in the configuration process (for example, the server to contact for
siaddr
TFTP download of an operating system kernel).

Relay agent (gateway) IP address; filled in by the relay agent with the address of the interface through which Dynamic
giaddr
Host Configuration Protocol (DHCP) message was received.

chaddr Client�s hardware address (Layer 2 address).

sname Name of the next server for client to use in the configuration process.

Name of the file for the client to request from the next server (for example the name of the file that contains the
file
operating system for this client).

Common questions

Powered by AI

URLs are critical in the web architecture as they provide a standard method for specifying the location of resources on the Internet. Each URL includes a protocol (e.g., HTTP, FTP), a host (server location), a port (optional), and a path to the resource. This structure enables browsers to locate and retrieve documents or files by directing requests to the appropriate server and path, facilitating user navigation and resource management .

In non-persistent HTTP, each element (like images and text files) requires a separate TCP connection with two RTTs per connection: one for establishing the connection and another for the data transfer. Each object is retrieved and disconnected before the next is requested. Conversely, persistent HTTP maintains a single TCP connection open for multiple elements. With pipelined persistent connections, multiple requests can be sent without waiting for prior responses, significantly reducing the number of RTTs and improving efficiency .

The World Wide Web enables information retrieval and browsing on the Internet through its structure of resources identified by URLs, interlinked by hypertext links, and accessed by browsers. Browsers act as clients that communicate with web servers using protocols like HTTP to request and display web pages. Each web page is retrieved from a server and rendered on the user's device, facilitating easy navigation between interlinked documents .

DHCP simplifies network administration by automating the assignment of IP addresses and other network configuration parameters like subnet masks, gateways, and DNS server addresses. It operates through a client-server model wherein DHCP servers manage a pool of IP addresses, reducing the need for manual configuration on each device. This minimizes errors and ensures efficient reuse and allocation of network resources through dynamic, automatic, and manual allocation methods .

FTP uses two parallel TCP connections: control and data. The control connection (port 21) is used for sending commands and control information, such as authentication and commands to retrieve or store files, and it remains open for the entire session. The data connection (port 20) is established separately for each file transfer, only existing while the file is being transferred. This out-of-band control stream results in robust session management but increases complexity due to dual-channel management .

DHCP messages consist of fixed and variable sections to balance protocol simplicity and flexibility. The fixed section includes fields like operation code, hardware type, and transaction identifier, ensuring consistent communication between clients and servers. The variable section includes 'OPTIONS,' providing additional parameters like lease duration and server identifiers. This format allows DHCP to dynamically adapt to diverse network needs, facilitating efficient IP address allocation and configuration, but any increase in options could introduce complexity and potential overhead in large network environments .

FTP supports three data structures: file, record, and page. The file structure treats the data as a continuous byte sequence, suitable for binary transfers. Record structure divides data into records, making it useful for transferring formatted text files that need reassembly. Page structure offers independent indexed pages, allowing random access to parts of a file, which can be beneficial for database management or files with complex formats requiring selective data reading .

The key components of Internet email include the email client, SMTP server for sending messages, and POP3/IMAP servers for receiving messages. The workflow begins with the user composing a message, which the email client sends to an SMTP server. This server forwards the message to the recipient's mail server, where it's stored until retrieved by the recipient's email client using POP3 or IMAP. This asynchronous process allows users to send and receive messages without needing their clients online simultaneously .

TFTP is a simpler protocol than FTP, designed for basic file transfers with minimal overhead. It operates over UDP, allowing faster transfers but lacking advanced features like authentication and control connections, which FTP provides using TCP. TFTP's stateless approach limits it to transferring files without secure authentication and error recovery features. These limitations make TFTP suitable for environments like initial bootstrapping where simplicity is key, but less appropriate for scenarios requiring security and reliability .

Non-persistent connections require a separate TCP connection for each request-response pair, which means each object needs two RTTs: one for the connection establishment and another for the actual data transmission. In contrast, persistent connections maintain the TCP connection for multiple requests, reducing the number of RTTs needed. Persistent connections can further be divided into non-pipelined, which handles requests sequentially, and pipelined, which sends multiple requests back-to-back without waiting for responses, thereby reducing latency .

You might also like