{"id":974,"date":"2026-04-12T07:52:22","date_gmt":"2026-04-12T07:52:22","guid":{"rendered":"https:\/\/networkingnotebook.com\/?p=974"},"modified":"2026-04-12T08:03:19","modified_gmt":"2026-04-12T08:03:19","slug":"ftp-vs-tftp","status":"publish","type":"post","link":"https:\/\/networkingnotebook.com\/?p=974","title":{"rendered":"FTP vs TFTP"},"content":{"rendered":"\n<p>Today I am going to talk about FTP (File Transfer Protocol) and TFTP (Trivial File Transfer Protocol.) FTP is a TCP protocol on port 20 and 21, while TFTP operates on UDP port 69. TFTP and FTP are both used to transfer files over an IP network. They both use a client-server model where a client has the choice to copy files from a server or copy files to a server. FTP is known for having more features than TFTP, as TFTP is a more lightweight protocol compared to FTP.<\/p>\n\n\n\n<p><strong>TFTP-<\/strong> TFTP is a UDP protocol used to transfer files to a server or from a server. The typical use cases for TFTP is for booting diskless PCs (booting from an OS file on the server), transferring configuration files to routers or switches, and updating the firmware on network devices. TFTP is a very simple protocol because the only features that it provides the client is to send a read request or a write request. Read means to download a file and write means to upload a file. This read or write request is sent in a request packet to the server on UDP port 69. The server does not continue the file transfer on port 69 though, instead whenever the server receives a request from a client it opens up an ephemeral port (49152 &#8211; 65,535). From this ephemeral port number, the server will respond to the client with an ACK for a write operation or the data for a read operation. The remaining data transfer will take place on this ephemeral port instead of port 69, while keeping port 69 free and open for other users.\u00a0<\/p>\n\n\n\n<p><strong>Lock-Step- <\/strong>Although TFTP runs on UDP which sacrifices reliability for higher throughput and speeds, TFTP has a mechanism to ensure reliability even over UDP. TFTP provides reliability using a \u201clock-step ACK\u201d mechanism. TFTP transfers data in fixed-size blocks which are 512 bytes long. When the sender sends a data block with a block\/sequence number, the sender must wait to receive an ACK from the receiver with the same block\/sequence number before sending the next data block. If an ACK is not received within a certain time interval then the data block will be retransmitted until it is explicitly acknowledged.<\/p>\n\n\n\n<p><strong>Data vs Control FTP-<\/strong> FTP is another file transfer protocol, but it works differently from TFTP. The first difference is that it&#8217;s a TCP protocol compared to UDP. The main differentiator is that it has two connections called \u201cdata\u201d and \u201ccontrol.\u201d The data connection runs on TCP port 20(only on active mode) and is used to transfer the actual file content or directory listings. The control connection runs on TCP port 21 and is used to exchange credentials, commands, and responses to manage the FTP connection. In a FTP session, there will be many commands made by clients such as PORT, PASV, LS, close, etc\u2026These commands instruct the server on what wants to be done. So if I want to get the name of files in a directory, I would send a \u2018ls\u2019 command. If I want to download a file, I can send a \u2018get [filename]\u2019 command. All of these commands are sent over the control connection. The server is responsible for sending a reply for each command. The server responds with a 3 digit code that represents the result of the specific command such as \u2018success,\u2019 \u2018failure,\u2019 or \u2018need more information.\u2019 The control connection is persistent throughout the whole duration of the session so that commands and responses can flow between the client and server. The data connection is only temporary, it opens to send file contents and after they are sent it is immediately closed. In a busy session the control connection is opened once and closed once, while a data connection for that same session may be opened and closed multiple times.\u00a0<\/p>\n\n\n\n<p><strong>FTP Features- <\/strong>FTP is a more stacked protocol than FTP because it provides a lot more features. The first being is that it provides user authentication. It allows a user to verify its identity using a simple username and password. Although it provides authentication, it does not provide encryption so everything including the username and password are sent in plain-text. FTP also provides the ability to manage files. Unlike TFTP, FTP users are able to rename and delete files as they wish, allowing them full control over the files accessed via TCP\/IP. FTP users are also able to browse or navigate through directories, allowing users to change folders and see the names of the files in those folders.\u00a0<\/p>\n\n\n\n<p><strong>Active vs Passive Mode-<\/strong> FTP also has two distinct modes called \u201cactive\u201d and \u201cpassive.\u201d For active mode, the server initiates the data connection. The process goes like\u2026<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Client wants to download or upload a file<\/li>\n\n\n\n<li>Client opens the control connection<\/li>\n\n\n\n<li>Client opens an ephemeral port (49152 &#8211; 65,535)\u00a0<\/li>\n\n\n\n<li>Client informs the server of the IP and port number via \u201cPORT\u201d command over the control connection.\u00a0<\/li>\n\n\n\n<li>The server then initiates the data connection.\u00a0<\/li>\n<\/ol>\n\n\n\n<p>This is the process of an active connection, but a major problem arises for active connections. Due to the fact that the server is initiating on a completely different port from the control connection (port 21), it is common for client-side firewalls and NAT to block incoming connections from the FTP server. In order to solve this issue, \u201cpassive mode\u201d was created. In passive mode the client both initiates the control connection and the data connection. It opens the control connection, sends a PASV command, the server then opens an ephemeral port, and the client finally initiates the data connection. This allows the FTP session to run very smoothly, without any firewall or NAT issues.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"544\" src=\"https:\/\/networkingnotebook.com\/wp-content\/uploads\/2026\/04\/image-1024x544.png\" alt=\"\" class=\"wp-image-977\" srcset=\"https:\/\/networkingnotebook.com\/wp-content\/uploads\/2026\/04\/image-1024x544.png 1024w, https:\/\/networkingnotebook.com\/wp-content\/uploads\/2026\/04\/image-300x159.png 300w, https:\/\/networkingnotebook.com\/wp-content\/uploads\/2026\/04\/image-768x408.png 768w, https:\/\/networkingnotebook.com\/wp-content\/uploads\/2026\/04\/image-1536x816.png 1536w, https:\/\/networkingnotebook.com\/wp-content\/uploads\/2026\/04\/image.png 1964w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Today I am going to talk about FTP (File Transfer Protocol) and TFTP (Trivial File Transfer Protocol.) FTP is a TCP protocol on port 20 and 21, while TFTP operates on UDP port 69. TFTP and FTP are both used to transfer files over an IP network. They both use a client-server model where a&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-974","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/networkingnotebook.com\/index.php?rest_route=\/wp\/v2\/posts\/974","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/networkingnotebook.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/networkingnotebook.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/networkingnotebook.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/networkingnotebook.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=974"}],"version-history":[{"count":3,"href":"https:\/\/networkingnotebook.com\/index.php?rest_route=\/wp\/v2\/posts\/974\/revisions"}],"predecessor-version":[{"id":978,"href":"https:\/\/networkingnotebook.com\/index.php?rest_route=\/wp\/v2\/posts\/974\/revisions\/978"}],"wp:attachment":[{"href":"https:\/\/networkingnotebook.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=974"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/networkingnotebook.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=974"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/networkingnotebook.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=974"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}