PROTOCOL EXPLORERLearn how the internet works
Now learningFTP · File transferOverview · 5 steps
Learning progress0%
0 / 14 complete · 0 in progress
Web Server203.0.113.10InternetRouter192.168.1.1Client192.168.1.10

Protocol overview

FTP

Active

File Transfer Protocol

Separate a persistent command connection from a data connection. Follow a passive-mode file download and interpret FTP reply classes.

Layer
Application (Layer 7)
Default port
21 control; separate data connection
Transport
TCP
Data format
Text control + separate data channel
Defined in
RFC 959, RFC 2428
Read the complete guide ↗

Packet flow

DNSTCPRequestResponse
No.TimeSourceDestinationProtocolInfoSize
10.000s203.0.113.10192.168.1.10FTP220 FTP ready69 B
20.024s192.168.1.10203.0.113.10FTPUSER learner68 B
30.048s203.0.113.10192.168.1.10FTP331 Password required77 B
40.072s192.168.1.10203.0.113.10FTPPASS teaching-only74 B
50.096s203.0.113.10192.168.1.10FTP230 Logged in69 B
60.120s192.168.1.10203.0.113.10FTPTYPE I62 B
70.144s192.168.1.10203.0.113.10FTPEPSV60 B
80.168s203.0.113.10192.168.1.10FTP229 Entering Extended Passive Mode (|||50000|)102 B
90.192s192.168.1.10203.0.113.10TCP52344 → 50000 [SYN] Seq=066 B
100.216s203.0.113.10192.168.1.10TCP50000 → 52344 [SYN, ACK] Seq=0 Ack=166 B
110.240s192.168.1.10203.0.113.10TCP52344 → 50000 [ACK] Seq=1 Ack=160 B
120.264s192.168.1.10203.0.113.10FTPRETR demo.txt69 B
130.288s203.0.113.10192.168.1.10FTP150 Opening data connection83 B
140.312s203.0.113.10192.168.1.10FTP-DATAFile bytes on passive data connection76 B
150.336s203.0.113.10192.168.1.10FTP226 Transfer complete77 B
160.360s192.168.1.10203.0.113.10FTPQUIT60 B

FTP Control and Passive Data Connections

Follow FTP commands on the control connection and see how EPSV opens a separate passive data connection to transfer a file.

Understanding FTP

Separate a persistent command connection from a data connection. Follow a passive-mode file download and interpret FTP reply classes.

Default port
21 control; separate data connection
Transport / carrier
TCP
Category
application

What to look for in the lab

Find the port advertised by the EPSV reply and compare it with the control port in the packet inspector. Follow the new TCP handshake, then locate the file bytes on the separate data connection.

1. Open the control channel

The client connects to port 21 and receives 220. USER and PASS authorize the session; classic FTP exposes these commands in plaintext.

2. Choose a representation

TYPE I selects binary transfer. Text mode can transform line endings, so binary mode matters for arbitrary files.

3. Negotiate passive data

EPSV tells the client which server port to connect to for data. The control connection stays open while a second TCP connection carries file bytes.

4. Retrieve a file

RETR starts the transfer. A 150 reply precedes the data; 226 confirms transfer completion on the control channel.

5. Close the session

QUIT ends control communication. Passive FTP differs from active mode, in which the server opens the data connection toward the client.

Protocol relationships

Protocols cooperate across layers. Compare the neighboring lessons to distinguish addressing, delivery, application semantics and encryption.

Standards and editorial method

Written and implemented independently by NavSprout. Lessons summarize public protocol standards using synthetic documentation addresses and fictional credentials. Consult the standards for complete wire formats and normative behavior.

RFC 959 ↗ RFC 2428 ↗

Check your understanding

What carries file bytes in passive FTP?