Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

While downloading a tar ball from gnu's FTP server, I found that other than standard 21 TCP port connection, I also seeing an extra connection:

tcp        0      0 192.168.1.109:45056     208.118.235.20:21       ESTABLISHED 10956/wget          
tcp        0      0 192.168.1.109:56724     208.118.235.20:22259    ESTABLISHED 10956/wget 

What that port is used for? I checked /etc/services, only 20 and 21 should be in use, am I wrong?

The command in use was wget 'ftp://ftp.gnu.org/gnu/tar/tar-1.26.tar.xz'

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Port 20 and 21 are the control ports. A new (semi-random) port is opened to actually transfer data.

Edit: A bit longer explanation.

Client (wget)                                Server with FTPd
                                             FTPd listening at port 21
Open connection to port 21
                                             220 Hello, who are you?
send username
send plain text password
                                             230 Ok. Access granted.
cd gnu/tar/
                                             250 Ok.  (new dir is gnu/tar/)
PORT 192,168,1,109,1234
(aka, please send answers to 192.168.1.109 on PORT 1234.
 Usually this is a random port in the range <1024-65536>
 Ports below 1024 are priveledge ports, and thus excluded.
 Max port number is 65535 (16 bit value) 
)

List                                         SERVER connects from port 20
                                             to 192.168.1.109 port 1234
                                             Server sends data

rfc959

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.