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

Module 4part2 - Application - Layer

Uploaded by

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

Module 4part2 - Application - Layer

Uploaded by

Naeem
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 64

The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes.

Distribution and modifications of the content is prohibited.

Module 4
Part 2 : Application Layer

Subject In charge
Ms. Gigi Joseph
Assistant Professor
Room no. 404
Email:[email protected]

SIES Graduate School of Technology Computer Network and Network Design


Dept. of AIML 1
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

APPLICATION LAYER

SIES Graduate School of Technology Computer Network and Network Design


Dept. of AIML 2
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

APPLICATION LAYER
Application layer: -enables the user to access the network
-provides user interfaces and supports for services such as email, remote file
access and transfer , shared database management, and other types of
distributed information services
-Functions: - Network virtual terminal
- File transfer, access and management
- Mail services
- Directory services

SIES Graduate School of Technology Computer Network and Network Design


Dept. of AIML 3
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Domain Name System (DNS)


What is DNS? How do we access the webpages like google , facebook etc. from the network ?

Domain Name System translates Internet domain and host names to IP addresses and viceversa

Domain name : any text or string that we enter to search a webpage


IP address : comprises of 4 octets – unique identifier number for each device on a network

Why do we use DNS ?

- To map domain names with IP address


- IP addresses are dynamic

SIES Graduate School of Technology Computer Network and Network Design


Dept. of AIML 4
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Server

Fig. Example of using the DNS service


SIES Graduate School of Technology Computer Network and Network Design
Dept. of AIML 5
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Namespace : A name space that maps each address to a unique name can be organized in two
ways: flat or hierarchical
Flat name space
- a name is assigned to an address
- name in this space is a sequence of characters without structure
- main disadvantage : it cannot be used in a large system such as the Internet because it must be
centrally controlled to avoid ambiguity and duplication
Hierarchical name space
- each name is made of several parts.
- 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.
- authority to assign and control the name spaces can be decentralized i.e. 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 of 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.

SIES Graduate School of Technology Computer Network and Network Design


Dept. of AIML 6
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

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

SIES Graduate School of Technology Computer Network and Network Design


Dept. of AIML 7
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

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 (nodes that
branch from the same 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.
SIES Graduate School of Technology Computer Network and Network Design
Dept. of AIML 8
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Domain :
• a domain is a subtree of the domain name space.
• name of the domain - is the domain name of the node at the top of the subtree
• a domain may itself be divided into subdomains

SIES Graduate School of Technology Computer Network and Network Design


Dept. of AIML 9
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

The problems with a centralized design of DNS include:

 A single point of failure : If the DNS server crashes, so does the entire Internet

 Traffic volume : A single DNS server would have to handle all DNS queries (for all the HTTP
requests and e-mail messages generated from hundreds of millions of hosts).

 Distant centralized database : A single DNS server cannot be “close to” all the querying clients. If
we put the single DNS server in New York City, then all queries from Australia must travel to the
other side of the globe, perhaps over slow and congested links. This can lead to significant delays.

 Maintenance : The single DNS server would have to keep records for all Internet hosts. Not only
would this centralized database be huge, but it would have to be updated frequently to account for
every new host

So, a distributed hierarchical database is used for DNS


SIES Graduate School of Technology Computer Network and Network Design
Dept. of AIML 10
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Fig. Hierarchy of name servers


SIES Graduate School of Technology Computer Network and Network Design
Dept. of AIML 11
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Fig. Zones and domains


SIES Graduate School of Technology Computer Network and Network Design
Dept. of AIML 12
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

DNS defines two types of servers: primary and secondary.

Primary server –
• A primary server is a server that stores a file about the zone for which it is an authority.
• It is responsible for creating, maintaining, and updating the zone file. It stores the zone file on a
local disk.

Secondary server -
• A secondary server is a server that transfers the complete information about a zone from another
server (primary or secondary) and stores the file on its local disk.
• The secondary server neither creates nor updates the zone files.

SIES Graduate School of Technology Computer Network and Network Design


Dept. of AIML 13
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Resolution :
Mapping a name to an address or an address to a name is called name-address resolution

Main component of a DNS system : DNS resolver – acts as phonebook

1. DNS is designed as a client/server application


2. A host that needs to map an address to a name or a name to an address calls a DNS client
called a resolver.
3. The resolver accesses the closest DNS server with a mapping request.
4. 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.
5. After the resolver receives the mapping, it interprets the response to see if it is a real resolution
or an error, and finally delivers the result to the process that requested it

SIES Graduate School of Technology Computer Network and Network Design


Dept. of AIML 14
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

DNS resolves domain names to IP addresses through a hierarchical and distributed system of DNS servers. The
process involves several steps:
1. DNS Query Initiation:
•When a user or application requests a domain name resolution (e.g., enters a URL in a web browser), the
local device initiates a DNS query to resolve the domain name to an IP address.

2. Recursive DNS Lookup:


•If the local device does not have the IP address cached, it sends a DNS query to a recursive DNS resolver
(typically provided by the user's ISP or a public DNS service like Google DNS or Cloudflare DNS).
•The recursive resolver performs iterative queries on behalf of the client to find the IP address associated
with the requested domain name.

3. Root DNS Servers:


•If the recursive resolver doesn't have the requested domain's IP address in its cache, it starts the resolution
process from the root DNS servers.
•The root DNS servers are a critical part of DNS infrastructure and maintain information about the
authoritative DNS servers responsible for top-level domains (TLDs) like .com, .net, .org, etc.

SIES Graduate School of Technology Computer Networks


Dept. of AIML 15
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

4. Top-Level Domain (TLD) Servers:


•Based on the TLD of the requested domain (e.g., .com), the root DNS servers direct the recursive resolver
to the authoritative DNS servers responsible for that TLD.
•The TLD servers maintain information about the authoritative name servers for second-level domains (like
example.com).

5. Authoritative DNS Servers:


•The recursive resolver queries the authoritative DNS servers of the requested domain (e.g., example.com).
•These authoritative servers hold the specific DNS records (e.g., A records, AAAA records, etc.) mapping
the domain name to the corresponding IP address.

6. DNS Response:
•The recursive resolver receives the IP address from the authoritative DNS servers.
•It caches this information locally for future use and sends the IP address back to the requesting device.
•The device then uses this IP address to establish a connection to the desired server or resource associated
with the domain name.

SIES Graduate School of Technology Computer Networks


Dept. of AIML 16
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Fig. Format of DNS Query and Response


SIES Graduate School of Technology Computer Network and Network Design
Dept. of AIML 17
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Fig. Format of DNS Response


SIES Graduate School of Technology Computer Network and Network Design
Dept. of AIML 18
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Fig. Header Format


Header : 12 bytes
• Identification subfield : used by the client to match the response with the query. The client uses a
different identification number each time it sends a query. The server duplicates this number in
the corresponding response.
• Flags subfield : is a collection of subfields that define the type of the message, the type of answer
requested, the type of desired resolution etc.
• Number of question records subfield : contains the number of queries in the question section of
the message

SIES Graduate School of Technology Computer Network and Network Design


Dept. of AIML 19
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

• Number of answer records subfield : contains the number of answer records in the answer section
of the response message. Its value is zero in the query message.
• Number of authoritative records subfield : contains the number of authoritative records in the
authoritative section of a response message. Its value is zero in the query message.
• Number of additional records subfield : contains the number additional records in the additional
section of a response message. Its value is zero in the query message.

Other fields in DNS response:


• Question Section : This is a section consisting of one or more question records. It is present on
both query and response messages.
• Answer Section : This is a section consisting of one or more resource records. It is present only
on response messages. This section includes the answer from the server to the client (resolver).
• Authoritative Section : This is a section consisting of one or more resource records. It is present
only on response messages. This section gives information (domain name) about one or more
authoritative servers for the query.

SIES Graduate School of Technology Computer Network and Network Design


Dept. of AIML 20
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

• Additional Information Section : This is a section consisting of one or more resource records. It is
present only on response messages. This section provides additional information that may help
the resolver. For example, a server may give the domain name of an authoritative server to the
resolver in the authoritative section, and include the IP address of the same authoritative server in
the additional information section

SIES Graduate School of Technology Computer Network and Network Design


Dept. of AIML 21
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

DNS can use either UDP or TCP - In both cases the well-known port used by the server is port 53.
 UDP is used when the size of the response message is less than 512 bytes because most UDP
packages have a 512-byte packet size limit.
 TCP connection is used, if the size of the response message is more than 512 bytes
 In that case, one of two scenarios can occur:
 If the resolver has prior knowledge that the size of the response message is more than 512
bytes, it uses the TCP connection. For example, if a secondary name server (acting as a client)
needs a zone transfer from a primary server, it uses the TCP connection because the size of the
information being transferred usually exceeds 512 bytes
 If the resolver does not know the size of the response message, it can use the UDP port.
However, if the size of the response message is more than 512 bytes, the server truncates the
message and turns on the TC bit. The resolver now opens a TCP connection and repeats the
request to get a full response from the server

SIES Graduate School of Technology Computer Network and Network Design


Dept. of AIML 22
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Electronic mail
• It is one of the most widely used features of the internet along with the web

• E-mail messages are usually encoded in ASCII text and uses multiple protocol within the
transport protocol/Internet protocol (TCP/IP)

• A popular protocol for sending e-mail is simple mail transfer protocol (SMTP) and for receiving
is post office protocol(POP3)

SIES Graduate School of Technology Computer Network and Network Design


Dept. of AIML 23
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Electronic mail / Simple Mail Transfer Protocol(SMTP)

Fig. Architecture of email system


It consists of two kinds of subsystems:
• user agents, which allow people to read and send email, and
• message transfer agents(mail servers), which move the messages from the source to the
destination

SIES Graduate School of Technology Computer Network and Network Design


Dept. of AIML 24
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

User agent : is a program that provides a graphical interface, or 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. The act of sending new messages into the mail system for delivery is called mail submission
2 types of user agents: command-driven and GUI-based.

SIES Graduate School of Technology Computer Network and Network Design


Dept. of AIML 25
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

• Command-Driven : accepts a one-character command from the keyboard to perform its task. For
example, a user can type the character r, at the command prompt, to reply to the sender of the
message, or type the character R to reply to the sender and all recipients.
• GUI-Based : contain graphical-user interface (GUI) components that allow the user to interact
with the software by using both the keyboard and the mouse. They have graphical components
such as icons, menu bars, and windows that make the services easy to access. Some examples of
GUI-based user agents are Eudora, Microsoft's Outlook, and Netscape.

SIES Graduate School of Technology Computer Network and Network Design


Dept. of AIML 26
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Message transfer agents : are system processes which run in the background on mail server
machines – they automatically move email through the system from the originator to the recipient
with SMTP (Simple Mail Transfer Protocol). This is the message transfer step.
SMTP - sends mail over connections and reports back the delivery status and any errors.
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.

SIES Graduate School of Technology Computer Network and Network Design


Dept. of AIML 27
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Mailboxes : store the email that is received for a user. They are maintained by mail servers. User
agents present users with a view of the contents of their mailboxes. To do this, the user agents send
the mail servers commands to manipulate the mailboxes, inspecting their contents, deleting
messages, and so on. The retrieval of mail is the final delivery

SIES Graduate School of Technology Computer Network and Network Design


Dept. of AIML 28
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Push Pop

Fig. Detailed architecture of Email


SIES Graduate School of Technology Computer Network and Network Design
Dept. of AIML 29
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Push Pop

SIES Graduate School of Technology Computer Network and Network Design


Dept. of AIML 30
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Sending Mail :
To send mail, the user, through the UA, creates
mail that has an envelope and a message

Receiving Mail :
The user agent is triggered by the user or a timer.
If a user has mail, the UA informs the user with a
notice. If the user is ready to read the mail. A list
with message subject and summary is displayed
to the user. The summary usually includes the
sender mail address, the subject, and the time the
mail was sent or received. The user can select
any of the messages and display its contents on
the screen

SIES Graduate School of Technology Computer Network and Network Design


Dept. of AIML 31
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Mail Transfer Phases


• The process of transferring a mail message occurs in three phases: connection establishment,
mail transfer, and connection termination
• The first and the second stages of mail delivery use SMTP - SMTP is a push protocol; it pushes
the message from the client to the server - direction of the bulk: data (messages) is from the
client to the server.
• On the other hand, 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

SIES Graduate School of Technology Computer Network and Network Design


Dept. of AIML 32
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

The formal protocol that defines the MTA client and server in the Internet is called the Simple Mail
Transfer Protocol (SMTP) - is used two times, between the sender and the sender's mail server and
between the two mail servers. It defines how commands and responses must be sent back and forth
SIES Graduate School of Technology Computer Network and Network Design
Dept. of AIML 33
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Commands and Responses


• SMTP uses commands and responses to transfer messages between an MTA client and an MTA
server
• Each command or reply is terminated by a two-character (carriage return and line feed) end-of-
line token - Commands are sent from the client to the server.
• Responses are sent from the server to the client. A response is a three digit code that may be
followed by additional textual information.

SIES Graduate School of Technology Computer Network and Network Design


Dept. of AIML 34
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Mail access starts with the client when the user needs to download e-mail from the mailbox on the
mail server. The client opens a connection to the server on TCP port 110. It then sends its user name
and password to access the mailbox. The user can then list and retrieve the mail messages, one by one

SIES Graduate School of Technology Computer Network and Network Design


Dept. of AIML 35
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Post Office Protocol, version 3 (POP3) :


POP3 has two modes: the delete mode and the keep mode.
In the delete mode - the mail is deleted from the mailbox after each retrieval.
- is normally used when the user is working at her permanent computer
and can save and organize the received mail after reading or replying.
In the keep mode - the mail remains in the mailbox after retrieval.
- normally used when the user accesses her mail away from her primary
computer (e.g., a laptop). The mail is read but kept in the system for
later retrieval and organizing

Internet Mail Access protocol (IMAP4) :


• similar to POP3 but more powerful and complex
• 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.
SIES Graduate School of Technology Computer Network and Network Design
Dept. of AIML 36
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

 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

SIES Graduate School of Technology Computer Network and Network Design


Dept. of AIML 37
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

File Transfer Protocol(FTP)


• Protocol used for transferring files
• is the standard mechanism provided by TCP/IP for copying a file from one host to another.
• FTP establishes two connections between the hosts - One connection is used for data transfer, the
other for control information (commands and responses). Separation of commands and data
transfer makes FTP more efficient.
• FTP uses two well-known TCP ports: Port 21 is used for the control connection, and port 20 is
used for the data connection
• Basic model :
 The client has three components: user interface, client control process, and the client data
transfer process.
 The server has two components: the server control process and the server data transfer
process.
 The control connection is made between the control processes - remains connected during
the entire interactive FTP session

SIES Graduate School of Technology Computer Network and Network Design


Dept. of AIML 38
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

 The data connection is made between the data transfer processes- is opened and then closed
for each file transferred - opens each time commands that involve transferring files are used,
and it closes when the file is transferred.
 when a user starts an FTP session, the control connection opens. While the control connection
is open, the data connection can be opened and closed multiple times if several files are
transferred

Fig. FTP Basic model


SIES Graduate School of Technology Computer Network and Network Design
Dept. of AIML 39
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Fig. FTP moves files between local and remote file systems
SIES Graduate School of Technology Computer Network and Network Design
Dept. of AIML 40
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Communication over Control Connection


FTP uses the 7-bit ASCII character set - Communication is achieved through commands and
responses – one command (or response) at a time is sent – each command or response is only one
short line and each line is terminated with a two-character end-of-line token (carriage return and
line feed)

Fig. Using control connection


SIES Graduate School of Technology Computer Network and Network Design
Dept. of AIML 41
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Communication over Data Connection


File transfer occurs over the data connection under the control of the commands sent over the
control connection. 3 types of file transfer -
• A file is to be copied from the server to the client - is called retrieving a file - done under the
supervision of the RETR command,
• A file is to be copied from the client to the server - is called storing a file - is done under the
supervision of the STOR command.
• A list of directory or file names(treated as a file by FTP) is to be sent from the server to the
client - is done under the supervision of the LIST command.

Before sending the file through the data connection, it is prepared for transmission through the
control connection.

The client must define the type of file to be transferred, the structure of the data, and the
transmission mode.

SIES Graduate School of Technology Computer Network and Network Design


Dept. of AIML 42
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Fig. Using data connection

SIES Graduate School of Technology Computer Network and Network Design


Dept. of AIML 43
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

File type :
FTP can transfer one of the following file types across the data connection:
• ASCII file : default format for transferring text files - each character is encoded using 7-bit
ASCII. The sender transforms the file from its own representation into ASCII characters,
and the receiver transforms the ASCII characters to its own representation.
• EBCDIC file : If one or both ends of the connection use EBCDIC encoding (the file format
used by IBM), the file can be transferred using EBCDIC encoding.
• Image file : default format for transferring binary files - file is sent as continuous streams of
bits without any interpretation or encoding

Data Structure :
FTP can transfer a file across the data connection by using one of the structure of the data:
• file structure : the file is a continuous stream of bytes
• record structure : the file is divided into records
• page structure : file is divided into pages, with each page having a page number and a page
header - pages can be stored and accessed randomly or sequentially.
SIES Graduate School of Technology Computer Network and Network Design
Dept. of AIML 44
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Transmission Mode :
FTP can transfer a file across the data connection by using one of the following three transmission
modes:
• Stream mode : the default mode - data are delivered from FTP to TCP as a continuous stream of
bytes. TCP is responsible for chopping data into segments of appropriate size.
• Block mode : data can be delivered from FTP to TCP in blocks - each block is preceded by a 3-
byte header. The first byte is called the block descriptor; the next 2 bytes define the size of the
block in bytes.
• Compressed mode : uses run-length encoding - consecutive appearances of a data unit are
replaced by one occurrence and the number of repetitions

SIES Graduate School of Technology Computer Network and Network Design


Dept. of AIML 45
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Hypertext Transfer Protocol (HTTP)


• is a protocol used mainly to access data on the World Wide Web – its Web’s application-layer
protocol
• HTTP functions as a combination of FTP and SMTP

 it transfers files and uses the services of TCP data transferred


 it uses only one TCP connection. between the client and
 no separate control connection; only data are the server look like
transferred between the client and the server SMTP messages

• Unlike SMTP, HTTP messages are not destined to be read by humans - are read and interpreted
by the HTTP server and HTTP client (browser).
• SMTP messages are stored and forwarded, but HTTP messages are delivered immediately.
• Commands from the client to the server are embedded in a request message - contents of the
requested file or other information are embedded in a response message.
• HTTP uses the services of TCP on well-known port 80.
SIES Graduate School of Technology Computer Network and Network Design
Dept. of AIML 46
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

HTTP Transaction :
• Web browsers (such as Internet Explorer and Firefox) implement the client side of HTTP
Web servers implement the server side of HTTP – they house Web objects, each addressable by
a URL- eg. Apache and Microsoft Internet Information Server

• HTTP defines how Web clients request Web pages from Web servers and how servers transfer
Web pages to clients.
i. When a user requests a Web page (eg.clicks on a hyperlink), the browser sends HTTP
request messages for the objects in the page to the server.
ii. Server receives the requests and responds with HTTP response messages that contain the
objects. HTTP uses TCP as its underlying transport protocol -HTTP client first initiates a
TCP connection with the server.
iii. Once the connection is established, the browser and the server processes access TCP
through their socket interfaces - Once the client sends a message into its socket interface,
the message is out of the client’s hands and is “in the hands” of TCP.

SIES Graduate School of Technology Computer Network and Network Design


Dept. of AIML 47
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

iv. Each HTTP request message sent by a client process eventually arrives intact at the server;
similarly, each HTTP response message sent by the server process eventually arrives intact
at the client.
v. server sends requested files to clients without storing any state information about the client
- HTTP server maintains no information about the clients, HTTP is said to be a stateless
protocol.

Fig. HTTP Transaction


SIES Graduate School of Technology Computer Network and Network Design
Dept. of AIML 48
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

HTTP Messages :

Fig. HTTP message format


SIES Graduate School of Technology Computer Network and Network Design
Dept. of AIML 49
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

• Request and Status Lines : first line in a request message - request line; first line in the response
message - status line

 Request Type : request type is categorized into methods as given in the table on the next slide
 URL :is a standard for specifying any kind of information/documents distributed throughout the
world on the Internet
 Version : most current version of HTTP is 1.1.
 Status code : used in the response message - consists of three digits.
 Status phrase : used in the response message - explains the status code in text form.
SIES Graduate School of Technology Computer Network and Network Design
Dept. of AIML 50
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Table : Request Type (Methods)

SIES Graduate School of Technology Computer Network and Network Design


Dept. of AIML 51
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

• Body: can be present in a request or response message - contains the document to be sent or
received.
• Header :
 exchanges additional information between the client and the server. For example, the client can
request that the document be sent in a special format, or the server can send extra information
about the document.
 header can consist of one or more header lines - Each header line has a header name, a colon, a
space, and a header value
 header line belongs to one of four categories: general header, request header, response header,
and entity header - A request message can contain only general, request, and entity headers - A
response message, on the other hand, can contain only general, response, and entity headers

Fig. Header format


SIES Graduate School of Technology Computer Network and Network Design
Dept. of AIML 52
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

o General header - gives general information about the message and can be present in both a
request and a response.
o Request header - can be present only in a request message - specifies the client's
configuration and the client's preferred document format.
o Response header - can be present only in a response message - specifies the server's
configuration and special information about the request
o Entity header - gives information about the body of the document

Table : Response headers


SIES Graduate School of Technology Computer Network and Network Design
Dept. of AIML 53
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Table : Request headers


SIES Graduate School of Technology Computer Network and Network Design
Dept. of AIML 54
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Retrieval of a document by http :


• GET method is used to retrieve an
image with the path /usr/bin/image1.
• request line shows the method (GET),
the URL, and the HTTP version 1.1.
• Header has two lines that show that the
client can accept images in the GIF or
JPEG format.
• request does not have a body
• response message contains the status
line and four lines of header.
• Header lines define the date, server,
MIME version, and length of the
document.
• body of the document follows the
header
SIES Graduate School of Technology Computer Network and Network Design
Dept. of AIML 55
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Client wants to send data to the server :


• POST method is used
• request line shows the method (POST),
URL, and HTTP version (1.1).
• There are four lines of headers.
• request body contains the input
information.
• response message contains the status
line and four lines of headers.
• created document, which is a CGI
document, is included as the body

SIES Graduate School of Technology Computer Network and Network Design


Dept. of AIML 56
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Persistent Versus Non-persistent Connection:

Non-persistent Connection –
• one TCP connection is made for each request/response.

• steps in this strategy are as follows:


i. The client opens a TCP connection and sends a request.
ii. The server sends the response and closes the connection.
iii. The client reads the data until it encounters an end-of-file marker; it then closes the
connection.

• in this strategy, for N different pictures in different files, the connection must be opened and
closed N times.
• non-persistent strategy imposes high overhead on the server because the server needs N different
buffers and requires a slow start procedure each time a connection is opened.

SIES Graduate School of Technology Computer Network and Network Design


Dept. of AIML 57
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

• Shortcomings:
a) a brand-new connection must be established and maintained for each requested object - for
each of these connections, TCP buffers must be allocated and TCP variables must be kept in
both the client and server - this can place a significant burden on the Web server
b) each object suffers a delivery delay of two RTTs - one RTT to establish the TCP connection
and one RTT to request and receive an object

SIES Graduate School of Technology Computer Network and Network Design


Dept. of AIML 58
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Persistent Connection –
• 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.
• The sender usually sends the length of the data with each response.
when a document is created dynamically or actively, sender doesn’t know the length of the data,
the server informs the client that the length is not known and closes the connection after sending
the data so the client knows that the end of the data has been reached.
• default mode of HTTP uses persistent connections with pipelining.

SIES Graduate School of Technology Computer Network and Network Design


Dept. of AIML 59
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Dynamic Host Configuration Protocol(DHCP)


• provide static and dynamic address allocation that can be manual or automatic
 Static Address Allocation:A DHCP server has a database that statically binds physical
addresses to IP addresses
 Dynamic Address Allocation: DHCP has a second database with a pool of available IP
addresses - This second database makes DHCP dynamic - When a DHCP client requests a
temporary IP address, the DHCP server goes to the pool of available (unused) IP addresses and
assigns an IP address for a negotiable period of time
• every network must have a DHCP server that is responsible for configuration - When a computer is
started, the computer broadcasts a request for an IP address on its network. It does this by using a
DHCP DISCOVER packet - This packet must reach the DHCP server - If that server is not directly
attached to the network, the router will be configured to receive DHCP broadcasts and relay them
to the DHCP server, wherever it is located
• When the server receives the request, it allocates a free IP address and sends it to the host in a
DHCP OFFER packet

SIES Graduate School of Technology Computer Network and Network Design


Dept. of AIML 60
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Dynamic Host Configuration Protocol(DHCP)


• When a DHCP client sends a request to a DHCP server, the server first checks its static database.
 If an entry with the requested physical address exists in the static database, the permanent IP
address of the client is returned
 if the entry does not exist in the static database, the server selects an IP address from the
available pool, assigns the address to the client, and adds the entry to the dynamic database.
• The dynamic aspect of DHCP is needed when a host moves from network to network or is
connected and disconnected from a network

• Issue with automatic assignment of IP addresses from a pool – for how long an IP address should
be allocated - If a host leaves the network and does not return its IP address to the DHCP server,
that address will be permanently lost - After a period of time, many addresses may be lost - To
prevent that from happening, DHCP provides temporary IP addresses for a limited time - The
addresses assigned from the pool are temporary addresses - The DHCP server issues a lease for a
specific time - When the lease expires, the client must either stop using the IP address or renew the
lease - The server has the option to agree or disagree with the renewal - If the server disagrees, the
client stops using the address
SIES Graduate School of Technology Computer Network and Network Design
Dept. of AIML 61
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

Dynamic Host Configuration Protocol(DHCP)


• DHCP allows both manual and automatic configurations - Static addresses are created manually
dynamic addresses are created automatically
• DHCP -widely used in the Internet to configure all sorts of parameters in addition to
providing hosts with IP addresses
- in business and home networks, DHCP is used by ISPs to set the parameters of
devices over the Internet access link, so that customers do not need to phone their
ISPs to get this information

SIES Graduate School of Technology Computer Network and Network Design


Dept. of AIML 62
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

SIES Graduate School of Technology Computer Network and Network Design


Dept. of AIML 63
Ms. Gigi Joseph
The material in this presentation belongs to SIES Graduate School of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.

DHCP Operation – steps

• Step 1 :The host sends a DHCPDISCOVER broadcast message to locate a DHCP server.
• Step 2 :A DHCP server offers configuration parameters such as an IP address, a MAC
address, a domain name, a default gateway, and a lease for the IP address to the
client in a DHCPOFFER unicast message.
• Step 3 :The client returns a formal request for the offered IP address to the DHCP server in
a DHCPREQUEST broadcast message.
• Step 4 :The DHCP server confirms that the IP address has been allocated to the client by
returning a DHCPACK unicast message to the client.

SIES Graduate School of Technology Computer Network and Network Design


Dept. of AIML 64
Ms. Gigi Joseph

You might also like