Overview of File System Management
You can view, create, rename, or delete directories and copy, move, rename, or delete files through the console port or Telnet, STelnet, File Transfer Protocol (FTP), Trivial File Transfer Protocol (TFTP), or Secure File Transfer Protocol (SFTP).
Files, such as system software and configuration files, are saved on a device's storage component. You can use the file system to manage the files on the storage component.
File system operations include directory and file operations.
You can perform any of the following operations to manage directories and files:
Log in to a device through a console port or using Telnet or STelnet.
For details, see User Login Configuration.
- Log in to a device using FTP.
- Log in to a device using TFTP.
- Log in to a device using SFTP.
FTP
When two hosts run different operating systems and use
different file structures and character sets, you can use File Transfer
Protocol (FTP) to copy files from one host to the other.
FTP has two file transfer modes:
- Binary mode: is used to transfer program files, such as .app,
.bin, and .btm files.
- ASCII mode: is used to transfer text files, such as .txt, .bat,
and .cfg files.
FTP is a standard
application protocol based on the TCP/IP protocol suite. It is used
to transfer files between local clients and remote servers. FTP uses
two TCP connections to copy a file from one system to another. The
TCP connections are usually established in client-server mode, one
for control (the server port number is 21) and the other for data
transmission (the server port number is 20).
Control connection
A control connection is set up between
the FTP client and FTP server.
The control connection
always waits for communication between the client and server. Commands
are sent from the client to the server over this connection. The server
responds to the client after receiving the commands.
Data connection
The server uses port 20 to provide a
data connection. The server can either set up or terminate a data
connection. When the client sends files in streams to the server,
only the client can terminate the data connection.
FTP supports file transfer
in stream mode. The end of each file is indicated by end of file (EOF).
Therefore, new data connections must be set up for each file transfer
or directory list. When a file is transferred between the client and
server, a data connection is set up.
TFTP
TFTP is an application protocol based on User Datagram Protocol (UDP) connections. It uses the UDP port number 69 to transfer files between local hosts and remote servers. Unlike FTP, TFTP is simple and provides no authentication. TFTP applies when no complex interaction is required between clients and the server.
TFTP supports
the following transfer modes:
- Binary mode: used for program file transfers
- ASCII mode: used for text file transfers
HUAWEI NetEngine 8000 F Series can function only as a TFTP client and transmit files in binary
mode.
TFTP transfer requests are initiated by clients:
- When a TFTP client needs to download files from the TFTP server, the client sends a read request to the server. The server sends data packets to the client, and the client acknowledges the data packets.
- When a TFTP client needs to upload a file to the TFTP server, the client sends a write request and then data to the server, and receives acknowledgments from the server.
SFTP
SFTP uses SSH to ensure secure file transfer. On one hand, SFTP allows remote users to securely log in to a device to manage and transfer files. On the other hand, users can use a device functioning as a client to log in to a remote server and transfer files securely.
When the SFTP server or the connection between the server and the client fails, the client needs to promptly detect the fault and removes the connection proactively. To help the client promptly detect such a fault, configure an interval at which Keepalive packets are sent if no packet is received and the maximum number of times that the server does not respond to the client:
- If the client does not receive any packet within the specified period, the client sends a Keepalive packet to the server.
- If the maximum number of times that the server does not respond exceeds the specified value, the client proactively releases the connection.
Usage scenarios for file system management modes
Table 1 Usage scenarios for file system management modesFile System Management Mode
|
Advantage
|
Disadvantage
|
Usage Scenario
|
Console port, Telnet, or STelnet
|
You can log in to a device to manage directories and files.
For details, see User Login Configuration.
|
FTP
|
- Is based on TCP connections, having all TCP characteristics.
- Supports authentication and authorization.
- Supports file transfer between different file system hosts.
|
- FTP commands are complicated and various.
- FTP requires more memory resources than TFTP.
- Data and even user names and passwords are transmitted in plaintext, bringing security risks.
|
FTP can be used on networks that have delays, packet loss, and jitters.
FTP is used for version upgrade and file transfer.
|
TFTP
|
- Is based on UDP connections.
- Requires fewer memory resources than FTP.
|
- TFTP supports only file transfer.
- TFTP does not allow users to list directories or negotiate with the server to determine files that can be obtained.
- TFTP does not provide authentication or authorization. It transmits data in plaintext. This adds security risks and renders the device vulnerable to attacks and network viruses.
|
TFTP can be used to load and upgrade software on a local area network (LAN) in a laboratory where the network is in good conditions.
TFTP applies when no complex interaction is required between clients and the server.
For details, see Using TFTP to Access Other Devices.
|
SFTP
|
Provides strict encryption and integrity protection and has high security.
|
- Data transmission efficiency is low.
- Third-party software must be installed on terminals to support SFTP.
|
SFTP is applicable to networks that have high security requirements.
|