Ports in FTP or other linked computer connections

627 views

What are the ‘ports’ in FTP or other linked computer connections representing/how do they work? What is their purpose and how do you determine which port number you need?

In: Technology

3 Answers

Anonymous 0 Comments

They’re a way of differentiating traffic to different applications.

So, the bytes of data coming out of the ethernet adapter/device are read by the device driver and then a low level networking protocol that does only one thing very well and very fast: it receives and buffers incoming and outgoing network traffic. Its like the mailroom in a big office building or the shipping/receiving department of a factory. It doesn’t care what comes in or why, it just deals with the delivery drivers and such and finds a spot to put the stuff. Then higher level protocols will look at where it came from and what port (department in our analogy) its destined to. These higher level protocols will slot the incoming packets into special buffers or bins or spools or memory addresses that will be read by each specific program. Like this mail is for “finance” or “accounts payable” or “engineering”. Then, those specific programs get sent a signal or some kind of communication saying “you’ve got mail!” and then those programs can read the incoming stuff at their leisure. Or not.

So lets say an incoming game packet comes in. The network protocols shove the packets addressed to that port into some reserved memory or storage and flags the game that it has new packets, then the networking code in the game comes and gets it. Actually in the case of game networking its more like the game department sent one of their interns to go hang out in the mail room and they grab the message for the game as soon as it arrives and takes up to Game Department immediately and comes back to wait for the next one. But lets say email. Outlook will say “just dump incoming mail into this file over here network stack and I’lkl check it every 10 minutes.

So your computers IP address is like a building street address, ports are like the specific mailbox or department or even person (some programs can “listen” on multiple ports) within that building.

Anonymous 0 Comments

The port number is used by by the system to identify what application the data came from or destined to. In the case of FTP, the ftp server is going to expect communication on top port 21. When network traffic is processed, it will look at the port number in the tcp header and hand it off to the ftp service.

Commonly used applications will have ports registered with IANA and can be searched for. Generally these ports are between 1 and 2000.

That said, the port numbers are mostly arbitrary. You don’t have to run ftp on port 21, you can run it on any port not in use by the system. If you do you might run into issues with programs expecting a common service to be running on a known port if it’s hard coded, and there potential security issues to take into consideration.

Anonymous 0 Comments

Your IP Address is the address of your computer, just like a building has a street address. The port is like the apartment number inside the building.

You have Chrome open to browse Reddit and you are playing an online game. Each of those two uses a different port number, so that data sent over the internet to your computer gets to the correct apartment, or program.

So a port number is literally just an extra number in the data being sent so the computer will know which program that data is for.