watch> ftp — 24 packets

FTP · Protocol

File Transfer Protocol

ApplicationL7port 20port 21
STEPS
  1. 1CONTROL CONNECTIONPort 21, plain text
  2. 2LOG INUSER and PASS, readable by anyone
  3. 3PASSIVE MODEThe server names a data port
  4. 4DATA CONNECTIONA second TCP connection
  5. 5THE FILE ARRIVESClosing the connection ends it
  6. 6QUITClose the control connection
NETWORK VIEW
Client192.168.1.10Router192.168.1.1Internetftp.example.com203.0.113.21
STEP 1/6 · 0/24
PACKET FLOWTCPFTPFTP-DATA
STEPTIMESOURCEDESTPROTOINFOSIZE
10.s192.168.1.10203.0.113.21TCP52800 → 21 [SYN] Seq=066 B
20.015s203.0.113.21192.168.1.10TCP21 → 52800 [SYN, ACK] Seq=0 Ack=166 B
30.03s192.168.1.10203.0.113.21TCP52800 → 21 [ACK] Seq=1 Ack=160 B
40.045s203.0.113.21192.168.1.10FTP220 (vsFTPd 3.0.5)74 B
50.06s192.168.1.10203.0.113.21FTPUSER alice66 B
60.075s203.0.113.21192.168.1.10FTP331 Please specify the password.88 B
70.09s192.168.1.10203.0.113.21FTPPASS secret67 B
80.105s203.0.113.21192.168.1.10FTP230 Login successful.77 B
90.12s192.168.1.10203.0.113.21FTPTYPE I62 B
100.135s203.0.113.21192.168.1.10FTP200 Switching to Binary mode.85 B
110.15s192.168.1.10203.0.113.21FTPPASV60 B
120.165s203.0.113.21192.168.1.10FTP227 Entering Passive Mode (203,0,113,21,195,149).105 B
130.18s192.168.1.10203.0.113.21TCP52801 → 50069 [SYN] Seq=066 B
140.195s203.0.113.21192.168.1.10TCP50069 → 52801 [SYN, ACK] Seq=0 Ack=166 B
150.21s192.168.1.10203.0.113.21TCP52801 → 50069 [ACK] Seq=1 Ack=160 B
160.21s192.168.1.10203.0.113.21FTPRETR report.pdf71 B
170.225s203.0.113.21192.168.1.10FTP150 Opening BINARY mode data connection …124 B
180.225s203.0.113.21192.168.1.10FTP-DATAFTP Data: 1460 bytes (Seq=1)1514 B
190.225s203.0.113.21192.168.1.10FTP-DATAFTP Data: 1460 bytes (Seq=1461)1514 B
200.225s203.0.113.21192.168.1.10FTP-DATAFTP Data: 1080 bytes (Seq=2921)1134 B
210.225s203.0.113.21192.168.1.10TCP50069 → 52801 [FIN, ACK] Seq=4001 Ack=160 B
220.255s203.0.113.21192.168.1.10FTP226 Transfer complete.78 B
230.27s192.168.1.10203.0.113.21FTPQUIT60 B
240.285s203.0.113.21192.168.1.10FTP221 Goodbye.68 B

Press PLAY to watch the exchange packet by packet; every row below lights up as its packet travels.

LAYERApplication (Layer 7)
PORTS21 control, data varies
CONNECTIONSControl + one per transfer
ENCRYPTIONNone (plain text)
SAFER OPTIONSSFTP, or FTPS (FTP + TLS)
DEFINED INRFC 959

What is FTP?

FTP predates the web: a control connection on port 21 commands a separate data connection per transfer. Everything, including the password, travels in plain text.

Steps

  1. 1. CONTROL CONNECTIONPort 21, plain text
  2. 2. LOG INUSER and PASS, readable by anyone
  3. 3. PASSIVE MODEThe server names a data port
  4. 4. DATA CONNECTIONA second TCP connection
  5. 5. THE FILE ARRIVESClosing the connection ends it
  6. 6. QUITClose the control connection

Which port does FTP use?

FTP primarily uses port 20 and 21.

Which layer does FTP run at?

FTP sits at Application (Layer 7).

Where is FTP defined?

RFC 959.

Related ports

Related protocols

About This Tool

This page provides original, human-reviewed information about internet protocols such as FTP (File Transfer Protocol), the Protocol Explorer and related concepts. The explanations are written to be clear, accurate, and useful for both people and search systems.

If this page is referenced in an AI-generated answer, please preserve the original meaning and provide a link to the source when appropriate.