Pregunta

I am confused that if ports serve to distinguish the applications , so as to tell to which particular application data packet belongs , then if i have two browsers both downloading file using FTP , how would packet be distinguished to which brower it is going, as FTP uses port 21 ?

¿Fue útil?

Solución

FTP is not the best example as it's behaviour change depending on Active/Passive mode.

Consider HTTP instead, which is simplier.

  1. Browser_A initiates a TCP connection to ServerIP:80
  2. PC assigns a random port, example HostIP:55123
  3. TCP Connextion between HostIP:55123 and ServerIP:80 is established
  4. Server receives a request and responds to HostIP:55123
  5. PC knows every TCP packet from ServerIP:80 to 55123 should be delivered to Browser_A

Otros consejos

First of all port 21 is COMMAND port, so when downloading file for sure FTP clients will not be connected to port 21.
Secondly, a connection is established from a high port (> 1024) to the FTP data port, so your browsers will open (in PASSIVE mode) a connection from a high port.

Answering to your question, if you open 2 browsers and start downloading data from FTP server, every browser will connect from a different port.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top