?
Solved

Please Critique my FTP port assignment Homework solution

Posted on 2010-11-27
1
Medium Priority
?
882 Views
Last Modified: 2012-05-10
Hey community. I'm doing a networking course at university level and I need a little help with a question. I attempted the question below with that I know thus far, in addition to my research. Please critique my solution so that I can gain a better understanding of how FTP and port assignment works. Many thanks for your responses in advance!

Here's the question:

Q) Suppose client A initiates an FTP session with server S. At about the same time, client B also initiates an FTP session with Server S. Provide possible source and destination port numbers for:
a) the segments sent from A to S?
b) the segments sent from B to S?
c) the segments sent from S to A?
d) the segments sent from S to B?
e) If A and B are different hosts, is it possible that the source port numbers in the segments from A to S are the same from B to S? How about if they are the same host?

From my research(at least my understanding of it), the server listens on port 21 for incoming FTP sessions. After handshaking is complete, the client begins to listen on it's  it’s ephemeral port + 1 and sends the  PORT  N+1 command to the server on its port 21 i.e. if the ephemeral port in use by the client is 1026, then it would listen on port 1027. Once this is done the data transfer port (port 20) on the FTP server would initiate a connection to the FTP client’s ephemeral port plus 1, as indicated. I have also learnt that each port can have numerous sockets. I do not know if sockets apply to FTP ports however.

Using this information, ( and assuming that the N+1 concept also applies on the server side) here are my attempted answers:

a)src: 1027  dest: 20
b)src: 1028  dest:21
c)src: 20  dest: 1027
d)src: 21  dest: 1028
e) If A and B are different hosts: Yes, they just use different sockets on the same port for connections.
 If A and B are the same hosts: Yes, like before, different sockets are used on the same connection.
0
Comment
Question by:kajun989
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 7

Accepted Solution

by:
John Jennings earned 2000 total points
ID: 34235337
Your understand is pretty much spot on, the only thing I'd make note of is the port assignments.

If your connection is an 'Active mode' connection, and there is no firewall issues, then port assignment will look like this:

SRC(command):1025 >> DST(command):21. Once this is done, the data channel is established.
SRC(data):1026 >> DST(data):20

If the connection is passive, it might look more like this:
SRC(command):1025 >> DST(command):21
SIMULTANOUSLY, DURING PASSIVE MODE A PASV command is sent to the server which creates this response:
SRC(data):1026 >> PASV command, DST(data):20 >> DST(data):1027

so, to fit into your abcd format above....
ACTIVE
a)src(command):1025 >> DST(command):21 // src(data):1026 >> dst(data):20
b)src(command):1025 >> DST(command):21 // src(data):1026 >> dst(data):20
c + d) 20/21 >> 1025/1026

PASSIVE
a)src(command):1025 >> DST(command):21 // src(data):1026 >> dst(data):1027
b)src(command):1025 >> dst(command):21 // src(data):1026 >> dst(data):1027

Passive Mode is designed to overcome firewall issues, mainly on the client side.

Any questions?
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Configuring network clients can be a chore, especially if there are a large number of them or a lot of itinerant users.  DHCP dynamically manages this process, much to the relief of users and administrators alike!
David Varnum recently wrote up his impressions of PRTG, based on a presentation by my colleague Christian at Tech Field Day at VMworld in Barcelona. Thanks David, for your detailed and honest evaluation!
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question