Difference between FTP and TFTP

FTP (FileTransfer Protocol) is used to transfer files between a remote server and a local host, and is a general protocol for transferring files on an IP network. Before the advent of the World Wide Web (WWW, World Wide Web), users used the command line to transfer files, and the most common application was FTP.

Although most users currently choose to use Email and Web to transfer files under normal circumstances, FTP still has a relatively wide range of applications.
The FTP protocol belongs to the application layer protocol in the TCP/IP protocol family. It is used to transfer files between a remote server and a local client, and uses TCP ports 20 and 21 for transmission. Port 20 is used to transmit data, and port 21 is used to transmit control messages. The basic operation of the FTP protocol is described in RFC959.
FTP supports two modes, one is called Standard (that is, PORT mode, active mode), and the other is Passive (that is, PASV, passive mode). Standard mode FTP client sends PORT command to FTP server. Passive mode FTP client sends PASV command to FTP Server.
The following describes the working principle of these two methods:
Port
The FTP client first establishes a connection with the FTP server's TCP 21 port, and sends commands through this channel. When the client needs to receive data, it sends a PORT command on this channel. The PORT command contains what port the client uses to receive data. When transmitting data, the server side connects to the client's designated port through its own TCP 20 port to send data. The FTP server must establish a new connection with the client to transfer data.
Passive
When establishing the control channel, it is similar to the Standard mode, but instead of the Port command, the Pasv command is sent after the connection is established. After receiving the Pasv command, the FTP server randomly opens a high-end port (port number greater than 1024) and notifies the client of the request to transmit data on this port. The client connects to this port on the FTP server and establishes a channel through a three-way handshake. Then the FTP server will Data transmission is performed through this port.
Many firewalls are not allowed to accept externally initiated connections when they are set up, so many FTP servers located behind the firewall or the internal network do not support PASV mode because the client cannot open the high-end port of the FTP server through the firewall; Clients on the network cannot log in to the FTP server in PORT mode, because the TCP 20 from the server cannot establish a new connection with the client on the internal network, causing it to fail to work.
The method of establishing the control link in the active mode and the passive mode is the same, but the method of establishing the data link is completely different, so the two methods have their own advantages and disadvantages in actual use. Please choose according to the actual networking environment.
TFTP (Trivial File Transfer Protocol) is also used to transfer files between the remote server and the local host. Compared with FTP, TFTP does not have a complex interactive access interface and authentication control, which is suitable for the client and server without complex interaction environment of. The operation of the TFTP protocol is based on the UDP protocol and uses UDP port 69 for data transmission. The basic operation of the TFTP protocol is described in RFC1986.
Currently, the device can only be used as a TFTP client, not as a TFTP server.
The TFTP transfer request is initiated by the client:
When the TFTP client needs to download files from the server, the client sends a read request packet to the TFTP server, then receives data from the server, and sends a confirmation to the server;
When a TFTP client needs to upload a file to the server, the client sends a write request packet to the TFTP server, then sends data to the server, and receives confirmation from the server.
The difference between FTP and TFTP:
1. FTP supports login security, has proper authentication and encryption protocols, and needs to communicate with FTP authentication during connection establishment. TFTP is an open protocol that lacks security and encryption mechanisms in place. No authentication is required when communicating with TFTP, which means that transferring files on an open server via the Internet is very dangerous and data packets may be lost.
2. FTP uses TCP as the transport layer protocol to send data from control commands through a separate TCP connection. TFTP uses UDP as the transport layer protocol. Because UDP is a connectionless protocol, TFTP does not use connections.
3. FTP uses 2 ports: TCP port 21 is a listening port; TCP port 20 or higher TCP port 1024 or more is used for source connection. TFTP uses only one port with stop and wait mode: port 69.
The above is the news sharing from the PASSHOT. I hope it can be inspired you. If you think today' s content is not too bad, you are welcome to share it with other friends. There are more latest Linux dumps, CCNA 200-301 dumpsCCNP Written dumps and CCIE Written dumps waiting for you.

Comments

Popular posts from this blog

How to choose Cisco dumps?

What is proxy communication?

What are CCNP Data Center jobs in Dubai?