File Transfer
Download
Report
Transcript File Transfer
APPLICATION LAYER
Lecture 7
McGraw-Hill
©The McGraw-Hill Companies, Inc., 2000
Introduction
25.2
Having finished all the previous layers , we now come to the layer
where all the applications are found.
The layers below the application layer are there to provide
transport services, but they do not do real work for users.
However, even in the application layer there is a need for support
protocols, to allow the applications to function.
Accordingly, we will look at an important one of these protocols. The
item in question is DNS, which handles naming within the Internet.
Note that there is three real applications: electronic mail, the World
Wide Web, and multimedia.
3
Protocol
HTTP, FTP
TCP, UDP
ICMP, IP
PPP, Ethernet,
IEEE 802.11
Layer
Application layer
Transport layer
Network layer
Data link layer
PDU
message
segment
datagram
frame
Behrouz A. Forouzan” Data communications and Networking
25.4
1. Domain Name System
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Introduction
5
There are several applications in the application layer
of the Internet model that follow the client/server
paradigm.
The client/server programs can be divided into two
categories:
Application that directly used by the user, such as e-mail
Application that support other application programs.
The Domain Name System (DNS) is a supporting program
that is used by other programs such as e-mail.
Introduction
25.6
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, we need a system that can map a name to an
address or an address to a name, which is the DNS server
Figure Example of using the DNS service
DNS
server
• Figure shows an example of how a DNS client/server program can
support an e-mail program to find the IP address of an e-mail recipient
• A user of an e-mail program may know the e-mail address of the
recipient
• The DNS client program sends a request to a DNS server to map the email address to the corresponding IP address
• After that, DNS will response to the client with the IP address
25.7
Hierarchical Name Space
25.8
To be unambiguous, the names assigned to machines must be carefully
selected from a name space with complete control over the binding
between the names and IP addresses. Name space can be
Flat name space
A name is assigned to an address.
A name in this space is a sequence of characters without structure.
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.
DOMAIN NAME SPACE
25.9
To have a hierarchical name space, a domain name space was
designed. In this design the names are defined in an invertedtree structure with the root at the top. The tree can have only
128 levels: level 0 (root) to level 127.
DOMAIN NAME SPACE
25.10
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).
Domain Name:
Each node in the tree has a domain name. A full domain name is a
sequence of labels separated by dots
Fully Qualified Domain Name
Partially Qualified Domain Name
Figure 25.3 Domain names and labels
25.11
DOMAIN NAME SPACE
25.12
Domain :
A domain is a sub tree of the domain name space.
The name of the domain is the domain
name of the node at the top of the sub tree.
25.13
Hierarchy of Name Servers:
With
huge information, there is a need to distribute the
information among many computers called DNS servers.
One way to do this is to divide the whole space into many
domains based on the first level.
we let the root stand alone and create as many domains
(subtrees) as there are first-level nodes
DNS IN THE INTERNET
25.14
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.
Topics
Generic Domains
Country Domains
Inverse Domain
DNS IN THE INTERNET
25.15
1. Generic Domains
The generic domains define
registered hosts according to
their generic behavior. Each
node in the tree defines a
domain
Example : .com , .gov
2. Country Domains
The country domains
section uses twocharacter country
abbreviations (e.g., us
for United States).
Second labels can be
organizational, or they
can be more specific,
national designations.
The United States, for
example, uses state
abbreviations as a
subdivision of us (e.g.,
ca.us.).
25.17
3. Inverse domain
The inverse domain is used to map an address to a
name. This may happen, for example, when a server
has received a request from a client to do a task.
Although the server has a file that contains a list of
authorized clients, only the IP address of the client
(extracted from the received IP packet) is listed.
Mapping a name to an address or an address to a
name is called name-address resolution.
25.18
2. Remote logging & FTP
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Introduction
19
The main task of the Internet is to provide services
for users.
The most popular applications are:
remote logging
electronic mail
file transfer
1. REMOTE LOGGING
20
In the Internet, users may want to run application
programs at a remote site and create results that
can be transferred to their local site.
One way to satisfy that demand is to create a
client/server application program for each desired
service.
The better solution is a general-purpose
client/server program that lets a user access any
application program on a remote computer;
TELNET
21
TELNET is a general-purpose client/server
application program.
TELNET is an abbreviation for TErminaL NETwork.
It’s enable the establishment of a connection to a
remote .
Logging
22
users are part of the system with some right to
access resources.
Each authorized user has an identification and
password.
The user identification defines the user as part of
the system.
To access the system, the user logs into the system
with a user id or log-in name and password.
to prevent an unauthorized user from accessing the
resources.
Network Virtual Terminal
23
We are dealing with heterogeneous systems.
If we want to access any remote computer in the
world, we must first know what type of computer we
will be connected to.
we must also install the specific terminal emulator
used by that computer.
TELNET solves this problem by defining a universal
interface called the network virtual terminal (NVT)
character set.
Network Virtual Terminal
24
The client TELNET translates characters (data or
commands) into NVT form and delivers them to the
network.
The server TELNET, on the other hand, translates
data and commands from NVT form into the form
acceptable by the remote computer.
2. FILE TRANSFER
25
File Transfer Protocol (FTP) is the standard mechanism provided
by TCP/IP for copying a file from one host to another which is
not as it seems simple and straightforward.
Before transferring, some problems must be dealt with first,
such as:
Two systems may use different file name conventions.
Two systems may have different ways to represent text and data.
Two systems may have different directory structures.
All of these problems have been solved by FTP in a very
simple and elegant approach.
FILE TRANSFER
26
FTP differs from other client-server applications in that
it establishes two connections between the hosts.
One connection is used for data transfer, the other for
control information (commands and responses).
We need to transfer only a line of command or a line of
response at a time.
Separation of commands and data transfer makes FTP
more efficient.
FTP uses the control connection to establish a
communication between the client control process and
the server control process.
FTP
27
In details
File Type – (data transfer connection)
28
FTP can transfer one of the following file types across the data connection:
ASCII file.
EBCDIC file
Image file.
The ASCII file is the 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.
o The EBCDIC file used If one or both ends of the connection use EBCDIC encoding
(the file format used by IBM).
o
o
The image file is the default format for transferring binary files.
The file is sent as continuous streams of bits without any interpretation or
encoding.
This is mostly used to transfer binary files such as compiled programs.
Commands – (control connection)
29
Commands are divided into six groups:
access
commands
file management commands
data formatting commands
port defining commands
file transferring commands
miscellaneous commands
File Transfer
30
File transfer in FTP means one of three things:
Retrieving:
Storing:
A file is to be copied from the server to the client.
It is done under the supervision of the RETR command.
A file is to be copied from the client to the server.
It is done under the supervision of the STOR command.
List:
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.
FTP treats a list of directory or file names as a file.
File Transfer
31
Anonymous FTP
32
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.
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.
25.33
Another common protocol used by the
Internet
HTTP
HTTP: Hyper Transfer Protocol
34
What is HTTP?
Hypertext Transfer Protocol – the Web’s application layer
protocol
HTTP is an request-response client-server protocol . An HTTP client
sends a request message to an HTTP server. The server, in turn,
returns a response message
Prosperities:
Pipelined – requests sent as soon as it is encountered
Persistent – multiple objects can be sent over a single TCP
connection between the server and the client
25.35
Whenever you issue a URL from your browser to get a web resource
using HTTP, the browser turns the URL into a request message and sends it
to the HTTP server. The HTTP server interprets the request message, and
returns you an appropriate response message, which is either the
resource you requested or an error message
There are 4 parts in a URL (Uniform Resource Locator )
Protocol: The application-level protocol used by the client and server,
e.g., HTTP, FTP, and telnet.
Hostname: The DNS domain name or IP address of the server.
Port: The TCP port number that the server is listening for incoming
requests from the clients.
Path-and-file-name: The name and location of the requested resource,
under the server document base directory.
25.36