
- DCN Tutorial
- Data Comm & Networks Home
- DCN - Overview
- DCN - Computer Network Types
- DCN - Network LAN Technologies
- DCN - Computer Network Topologies
- DCN - Computer Network Models
- DCN - Computer Network Security
- Physical Layer
- DCN - Physical Layer Introduction
- DCN - Digital Transmission
- DCN - Analog Transmission
- DCN - Transmission media
- DCN - Wireless Transmission
- DCN - Multiplexing
- DCN - Network Switching
- Data Link Layer
- DCN - Data Link Layer Introduction
- DCN - Error detection and Correction
- DCN - Data Link Control & Protocols
- Network Layer
- DCN - Network Layer Introduction
- DCN - Network Addressing
- DCN - Routing
- DCN - Internetworking
- DCN - Network Layer Protocols
- Transport Layer
- DCN - Transport Layer Introduction
- DCN - Transmission Control Protocol
- DCN - User Datagram Protocol
- Application Layer
- DCN - Application Layer Introduction
- DCN - Client-Server Model
- DCN - Application Protocols
- DCN - Network Services
- DCN Useful Resources
- DCN - Quick Guide
- DCN - Useful Resources
File Transfer Protocol (FTP) in Application Layer
File Transfer Protocol (FTP) is an application layer protocol that is used to transfer the files between the local devices (PC, smartphone, etc.) to a server. It transfers both text and binary files over the Internet.
- FTP opens two connections between the computers − one for the commands and replies (control connection) and a second one for data transfers (data connection).
- FTP is built on a client-server model architecture using the control connection and data connection between the client and server.
Control Connection
A Contol Connectcion is established on Port number 21. It is the primary connection and is used to send commands back and forth between the client and the server. It is used for sending the control information like user identification, password, and remote directory, etc., once the control connection is established.
Data Connection
Data Connection is initiated on Port number 20. Using the established Control Connection, the client and server will create a separate Data Connection to transfer the requested data.
The Data Connection stays open until the transfer is complete, after that the Data Connection is closed.
Data Connections are closed by either the client or the server, depending on which party is sending the information. When a client is retrieving data from a server, the server will close the connection once all the data has been transferred. When the client is transferring data to the server, the client will terminate the connection after all the data has been transferred.
FTP transfers files in three different modes −
- Stream mode − Here, the FTP handles the data as a string of bytes without separating boundaries.
- Block mode − In the block mode, the FTP decomposes the entire data into different blocks of data.
- Compressed mode − In this mode, the FTP uses the Lempel-Ziv algorithm to compress the data.
- Related Articles
- Difference between File Transfer Protocol (FTP) and Secure File Transfer Protocol (SFTP)
- XMODEM File Transfer Protocol
- FTP protocol client in Python
- Extended Simple Mail Transfer Protocol (ESMTP)
- What is the application layer?
- The Application Layer in TCP/IP Model
- What is Wireless Application Protocol (WAP)?
- The Application Layer of OSI Model
- What is application layer protocols in TCP/IP?
- Dynamic Domain Name System (DDNS) in Application Layer
- What are the challenges faced by transport layer protocol?
- C program for file Transfer using UDP?
- PHP ftp://
- What is FTP?
- PHP FTP context options
