•Unit6
•Application
Layer
• Application layer
• Note
The application layer is responsible for providing services
to the user.
• Fig. Summary of layers
• Fig. TCP/IP and OSI model
• Fig. Addresses in TCP/IP
• Fig. Relationship of layers and addresses in TCP/IP
Network Architecture:
-Computer Network Architecture is defined as the
physical and logical design of the software, hardware,
protocols, and media of the transmission of data.
-Simply we can say that how computers are organized
and how tasks are allocated to the computer.
-Two of the most widely used types of network
architecture are:
1. Peer-to-Peer architecture
2. Client/Server architecture
1. Peer-to-Peer architecture (P2P architecture):
-It is a commonly used computer networking architecture in which
each workstation, or node, has the same capabilities and
responsibilities.
-PeerToPeer network is useful for small environments, usually up
to 10 computers.
- PeerToPeer network has no dedicated server.
-Special permissions are assigned to each computer for sharing the
resources, but this can lead to a problem if the computer with the
resource is down.
Advantages Of Peer-To-Peer Network:
-It is less costly as it does not
contain any dedicated server.
-If one computer stops working but,
other computers will not stop
working.
-It is easy to set up and maintain as
each computer manages itself.
Disadvantages Of Peer-To-Peer Network:
-In the case of Peer-To-Peer network, it does not contain the centralized
system . Therefore, it cannot back up the data as the data is different in
different locations.
- It has a security issue as the device is managed itself.
2. Client/Server Architecture:
-It is a network model designed for the end users i.e clients, to access the
resources such as songs, video, etc. from a central computer i.e. Server.
-The central controller is known as a server while all other computers in
the network are called clients.
-A server performs all the major operations such as security and network
management.
-A server is responsible for managing all the resources such as files,
directories, printer, etc.
- All the clients communicate with each other through a server.
-Eg., if client 1 wants to send some data to client 2, then it first sends the
request to the server for the permission. The server sends the response
to the client 1 to initiate its communication with the client 2.
Advantages Of Client/Server network:
-It contains the centralized system.
Therefore we can back up the data easily.
-It has a dedicated server that improves the
overall performance of the whole system.
-Security is better in Client/Server network
as a single server administers the shared
resources.
-It also increases the speed of the sharing
resources.
Disadvantages Of Client/Server network:
- It is expensive as it requires the server with large memory.
-A server has a Network Operating System(NOS) to provide the resources
to the clients, but the cost of NOS is very high.
- It requires a dedicated network administrator to manage all the resources.
• Domain Name System
• Figure Example of using the DNS service
server
• NAME SPACE
• To be unambiguous, the names assigned to machines
must be carefully selected from a namespace with
complete control over the binding between the names
and IP addresses.
It is organized into 2 ways:
l
Flat Name Space:
• - Name is assigned to an address.
The name in this space is a sequence of characters without
•• structure.
-
Disadvantage:
• - It cannot be used in a Internet because it must be centrally
• controlled to avoid ambiguity and duplication.
• Hierarchical Name Space
l
- Name is made of several parts.
- 1st part define nature of organization.
- 2nd part define name of organization.
- 3rd part define department of organization
and so on.
-Central authority assign the part of the name
that nature of organization and the name of
the organization.
• 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.
Label
Domain Name
Domain
• Figure Domain name space
• Figure Domain names and labels
• Figure FQDN and PQDN
• Figure Domains
• DISTRIBUTION OF NAME SPACE
• The information contained in the domain name space
must be stored. However, it is very inefficient and also
unreliable to have just one computer store such a huge
amount of information.
• Hierarchy of Name Servers
• Zone
• Root Server
• Primary and Secondary Servers
• Figure. Hierarchy of name servers
• Figure. Zones and domains
• Note
• A primary server loads all information from the disk
file, it is responsible for creating, maintaining and
updating the zone file.
•
• The secondary server loads all information from the
primary server.
• When the secondary downloads information
from the primary, it is called zone transfer.
• DNS IN THE INTERNET
• DNS is a protocol that can be used in different
platforms. In the Internet, the domain name space
(tree) is divided into three different sections: generic
domains, country domains, and the inverse domain.
• Generic Domain:
• It defines registered host according to their behavior.
• Country Domain:
• It section uses 2 character country abbreviations and
second labels Can bé organizational or national désignations.
• Inverse Domain:
• It is used to map an address to a name.
• Servers has list of client with IP address.
• Server ask to its Resolver to send a query to the DNS
server
maptoan address to a name in its list.
• DNS IN THE INTERNET
• Generic domains
• Generic domain labels
• Country domains
• Inverse domain
• RESOLUTION
• Mapping a name to an address or
an address to a name is called
name-address resolution.
• Resolver:
• A host that needs to map an address to a name or a name
to an address calls a DNS client called a resolver.
• Mapping Names to Addresses:
• Resolver gives a domain name to the server and ask for the
corresponding address. Server checks Country and Generic domain for
mapping.
• Mapping Addresses to Names:
• Client send IP address for mapping a domain name.
•• It labels
use thebefore
Inverse domain.
sending.
•• Eg.:
The Resolver
resolver first invers
recieves IPIP address and then adds the two
[Link]
• After inversion and adding labels [Link].[Link]
• Recursive Resolution
• Client (Resolver) send query to server, it checks
• Database and respond. If he do not have that domain
name then he forward query to another server and so on.
• Iterative Resolution
• Client repeats the same query to multiple server.
• If server do not have Domain name, it returns
• the IP address of the server that it thinks can
• resolve the query.
• Caching
• When a server ask for a mapping from another
server and receives the response, it stores this
information in its cache memory before sending it to
• the client.
Caching speed up resolution.
• Disadvantage:
l
Long term cache send outdated mapping to the client.
l
Time To Live (TTL) is used to overcome
this problem.
• DNS MESSAGES
• DNS has two types of messages: query and response.
Both types have the same format.
• The query message consists of a header and question
records
• the response message consists of a header, question
records, answer records, authoritative records, and
additional records.
• Figure. Query and response messages
•
Header:
• Both Query and Response messages have the
• same header format of size 12 bytes.
• TYPES OF RECORDS
• Two types of records are used in DNS. • Question Record
• Resource Record
• The question records are used in the question section
of the query and response messages.
• The resource records are used in the answer,
authoritative, and additional information sections of
the response message.
• REGISTRARS
• How are new domains added to DNS?
This is done through a registrar, a commercial entity
accredited by ICANN (Internet Corporation for Assign
Names and Numbers). A registrar first verifies that the
requested domain name is unique and then enters it into
the DNS database. A fee is charged.
• [Link]
• ENCAPSULATION
• 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.
• If the size of the response message is more than 512
bytes, a TCP connection is used.
• Note
• DNS can use the services of UDP or TCP
using the well-known port 53.
• HTTP
The Hypertext Transfer Protocol (HTTP)
l
is a protocol used mainly to access data
on the World Wide Web.
HTTP functions as a combination of FTP and SMTP.
RTT (Round Trip Time) contains different delays.
HTTP uses the services of TCP on well-known port 80.
Non-Persistent Connections:
Client Server configuration required.
Disadvantages:
New connection required for each request.
Each object suffers a delivery delay of 2 RTT’s, 1
RTT to TCP connection and 1 RTT to request and
receive an object.
Persistent Connections:
It is a default mode for HTTP
TCP connection is open after a response.
2 versions of Persistence Connections:
Without Pipelining:
Client issues new request only when the previous response
has been received.
Disadvantage:
Server become idle after response object.
2) With Pipelining:
Default mode of HTTP.
Client make back-to-back request for objects.
Server sends objects back-to-back.
• Fig. HTTP transaction
HTTP is a stateless protocol, because the connection between the
browser and the server is lost once the transaction ends.
• HTTPRequest and response messages
• Fig. Request and status lines
• Table. Request Type
(Methods)
• Table. Status codes
• Table. Status codes
(continued)
• Fig. Header format
• Table. General headers
ELECTRONIC MAIL
One of the most popular Internet services is
electronic mail (e-mail). The designers of the
Internet probably never imagined the
popularity of this application program. Its
architecture consists of several components
that we discuss in this chapter.
Topics discussed in this section:
Architecture
User Agent
Message Transfer Agent: SMTP
Message Access Agent: POP and IMAP
Web-Based Mail
Figure 26.6 First scenario in electronic mail
Note
When the sender and the receiver of an
e-mail are on the same system,
we need only two user agents.
Second scenario in electronic mail
Note
When the sender and the receiver of an
e-mail are on different systems, we
need two UAs and a pair of
MTAs (client and server).
Third scenario in electronic mail
Note
When the sender is connected to the
mail server via a LAN or a WAN,
we need two UAs and two pairs
of MTAs (client and server).
Fourth scenario in electronic mail
Push versus pull in electronic email
Note
When both sender and receiver are
connected to the mail server via
a LAN or a WAN, we need two UAs,
two pairs of MTAs
and a pair of MAAs.
This is the most common situation today.
Services of user agent
Note
Some examples of command-driven
user agents are mail, pine, and
elm.
Note
Some examples of GUI-based user
agents are Eudora, Outlook, and
Netscape.
Format of an e-mail
E-mail address
Multipurpose Internet Mail Extensions (MIME):
- Electronic mail has a simple structure. Its simplicity, comes at a price.
- It can send messages only in NVT 7-bit ASCII format.
- In other words, it has some limitations.
-For example, it cannot be used for languages that are not supported by 7-bit
ASCII characters (such as French, German, Hebrew, Russian, Chinese, and
Japanese).
- Also, it cannot be used to send binary files or video or audio data.
-Multipurpose Internet Mail Extensions (MIME) is a supplementary protocol
that allows non-ASCII data to be sent through e-mail.
-MIME transforms non-ASCII data at the sender site to NVT ASCII data and
delivers them to the client MTA to be sent through the Internet.
- The message at the receiving side is transformed back to the original data.
-We can think of MIME as a set of software functions that transforms non-
ASCII data (stream of bits) to ASCII data and vice versa.
MIME
MIME header
Data types and subtypes in MIME
Content-transfer-encoding
• SMTP
• Commands and responses
• Figure . Command format
• Table
Commands
• Table Responses
• Table Responses(continued)
• POP3 and IMAP4
Comparison between IMAP4 & POP3
-IMAP4 is used to download, read and manage emails, while POP3 is used only
for downloading emails.
-IMAP4 is newer and more popular than POP3, especially when mailboxes are
huge, or multiple clients access the same account.
-With IMAP4, the server retains the master copy and all devices and apps that are
configured for the email account sync with the server. With POP3, there is
no such synchronization.
-With IMAP4, any changes (such as deleting mail) made on one device are
automatically reflected in any other app or device syncing to the same account.
- With POP3, you can download all email from the server on to your device and
choose to either delete the copy on the server or retain it.
IMAP4 POP3
Speed Slow Fast
Storage of Always on server Downloaded onto local
device, unless ‘keep a
content
copy on the server’
selected.
Mail Syncing Yes No
Direction Bi-directional - Whatever One-direction - Changes
changes you make on made on device have
server or device, the no effect on server
other side shows the content.
changes too.
Port used by PORT 143 PORT 110
server
Required Possible
Keep messages
on the server
Web-Based Mail
-Eg. Gmail, Hotmail and Yahoo.
-Mail transfer from Sender's browser to sender's mail server is done through
HTTP.
-The transfer of the message from the sending mail server to the receiving
mail server is still through SMTP.
-Finally, the message from the receiving server (the Webserver) to receiver's
browser is done through HTTP.
-The last phase is very interesting. Instead of POP3 or IMAP4, HTTP is
normally used.
-The website sends a form to be filled in by user, which includes the log-in
name and the password.
-If the log-in name and password match, the e-mail is transferred from the
Web server to user's browser in HTML format.
IMAP and POP3
IMAP is generally better than POP3 for modern users due to the
following reasons:
1. Synchronization Across Devices
IMAP: Keeps emails on the server, allowing users to access the
same mailbox from multiple devices (e.g., phone, laptop, and
tablet).
POP3: Downloads and often deletes emails from the server,
limiting access to a single device.
2. Server-Side Management
IMAP: Emails, folders, and read/unread status are managed on the
server, ensuring consistent experience across devices.
POP3: Emails are only available locally after download, and
changes (e.g., read status) are not reflected on other devices.
IMAP and POP3
IMAP is generally better than POP3 for modern users due
to the following reasons:
ge
IMAP: Requires a stable internet connection for full
functionality but allows selective offline access by
syncing important emails.
POP3: Works better offline as emails are stored locally,
but this can be risky if the device is lost or damaged.
4. Storage and Server Load
IMAP: Requires more server storage, which could
increase costs for ISPs, but aligns with modern cloud
storage trends.
POP3: Reduces server load since emails are downloaded
and deleted, but this model is becoming outdated.
• FILE TRANSFER
• Transferring files from one computer to another is one
of the most common tasks expected from a networking
or internetworking environment. As a matter of fact,
the greatest volume of data exchange in the Internet
today is due to file transfer.
• File Transfer Protocol (FTP)
• Use to transfer différent file formats.
• Note
• FTP uses the services of TCP. It needs
two TCP connections.
• The well-known port 21 is used for the
control connection and the well-
known
port 20 for the data connection.
• Figure. FTP
• The control connection remains connected during the entire
interactive.
• The Data connection is opened and then closed for each file
transferred.
• Figure. Using the control connection
Communication over Data Connection
-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.A file is to be copied from the server to the client. This is called retrieving
a file. It is done under the supervision of the RETR command.
2.A file is to be copied from the client to the server. This is called storing a
file. It is done under the supervision of the STOR command.
3.A list of directory or file names is to be sent from the server to the client.
This is done under the supervision of the LIST command.
Note that FTP treats a list of directory or file names as a file. It is sent
over the data connection.
• Figure. Using the data connection
File Type: ASCII file, EBCDIC file, image file etc.
Data Structure : File structure, record structure & page structure.
Transmission mode : Stream mode, block mode, compressed mode.
Anonymous FTP :
-To use FTP, a user needs an account (user name) and a password on the
remote server.
-Some sites have a set of files available for public access, to enable
anonymous FTP.
-To access these files, a user does not need to have an account or
password.
-Instead, the user can use anonymous as the user name and guest as the
password.
-User access to the system is very limited. Some sites allow anonymous
users only a subset of commands.
-For example, most sites allow the user to copy some files, but do not allow
navigation through the directories.
• REMOTE LOGGING
• It would be impossible to write a specific client/server
program for each demand. The better solution is a
general-purpose client/server program that lets a user
access any application program on a remote computer.
• TELNET (TErminaL NETwork)
•TELNET is a general-purpose
client/server application
program.
• Timesharing Environment.
• Logging:
l
Local log-in: (No use of
TELNET). Remote log-in: (Use of
TELNET).
• Local and remote log-in
• Concept of NVT
DHCP (Dynamic Host Configuration Protocol)
-DHCP is a Client-Server protocol provides static and
dynamic address allocation that can be manual or
automatic.
- DHCP provides temporary IP addresses for a
limited time (Lease time).
- If lease expire, client must either stop use
of IP or renew the lease.
It is a 4 step
process:
[Link] discover
[Link] offer
[Link] request
[Link] ACK
• DHCP Header
• (There are >100 different options)
OpCode: 1 (Request), 2(Reply)
Hardware Type: 1 (for Ethernet)
Hardware address length: 6 (for Ethernet)
Hop count: set to 0 by client
Transaction ID: Integer (used to match reply to response)
Seconds: number of seconds since the client started to
boot. Flags : 2 bytes- 1 bit is Broadcast bit=1- used to
braodcast request, remaining 15 bits = 0, unused
Client IP address, Your IP address, server IP address,
Gateway IP address, client hardware address,
server host name, boot file name: client fills in the
information that it has, leaves rest blank.
FTP (File Transfer Protocol): Defined and
Explained
FTP (File Transfer Protocol) is a standard network
protocol used for the transfer of files from one host
to another over a TCP-based network, such as the
Internet.
FTP works by opening two connections that link the
computers trying to communicate with each other.
One connection is designated for the commands
and replies that get sent between the two clients,
and the other channel handles the transfer of data.
FTP (File Transfer Protocol): Defined and
Explained
During an FTP transmission, there are four
commands used by the computers, servers, or
proxy servers that are communicating. These are
“send,” “get,” “change directory,” and “transfer.”
While transferring files, FTP uses three different
modes: block, stream, and compressed.
The stream mode enables FTP to manage
information in a string of data without any
boundaries between them. The block mode
separates the data into blocks, and in the
compress mode, FTP uses an algorithm called
the Lempel-Ziv to compress the data.
What is FTP useful
for?
One of the main reasons why modern businesses and
individuals need FTP is its ability to perform large file size
transfers. When sending a relatively small file, like a Word
document, most methods will do, but with FTP, you can
send hundreds of gigabytes at once and still get a smooth
transmission.
The ability to send larger amounts of data, in turn, improves
workflow. Because FTP allows you to send multiple files at
once, you can select several and then send them all at the
same time. Without FTP services, you may have to send
them one by one, when you could be accomplishing other
work.
What is FTP useful
for?
One of the main reasons why modern businesses and
individuals need FTP is its ability to perform large file size
transfers. When sending a relatively small file, like a Word
document, most methods will do, but with FTP, you can
send hundreds of gigabytes at once and still get a smooth
transmission.
The ability to send larger amounts of data, in turn, improves
workflow. Because FTP allows you to send multiple files at
once, you can select several and then send them all at the
same time. Without FTP services, you may have to send
them one by one, when you could be accomplishing other
work.
What is FTP useful
for?
For example, if you have to transfer a large collection of
important documents from headquarters to a satellite
office but have a meeting to attend in five minutes, you
can use FTP to send them all at once. Even if it takes 15
minutes for the transfer to complete, FTP can handle it,
freeing you up to attend the meeting.
Types of FTP
FTP Plain
FTP Plain refers to normal FTP without encryption.
By default, it uses port 21, and it is supported by
the majority of web browsers.
FTPS
FTPS refers to FTP Secure or FTP secure sockets
layer (SSL) because this kind of FTP server uses
SSL encryption, which is slightly different than
traditional FTP. The primary difference is the
security that comes with FTPS, which was the first
type of encrypted FTP invented.
Types of FTP
FTPES
The “E” in FTPES means “explicit,” making the
acronym stand for File Transfer Protocol over
explicit transport layer security (TLS)/SSL. This
type of FTP begins like regular FTP, using port 21,
but then special commands upgrade it to a
TLS/SSL-encrypted transmission. Because it
tends to work well with firewalls, some prefer to
use FTPES over FTPS.
How to Use FTP
The three most common ways of using FTP include:
Via a web browser: With a web browser, you do
not need any special software or a client to
download files from servers that provide for FTP
sites.
A general user interface (GUI) FTP client: These
third-party applications enable users to connect
and then send files over FTP.
Command-line FTP: Major operating systems
come equipped with FTP client capabilities as a
command line.
What is an FTP Port?
An FTP port is a communication endpoint and
allows data transfer between a computer and a
server. A computer's operating system only uses a
specific number of ports, which are necessary for
software to connect through a network. An FTP
port is required for the client and server to quickly
exchange files.