SCOUG-Programming Mailing List Archives
Return to [ 02 |
October |
1998 ]
>> Next Message >>
Content Type: text/plain
Hi Greg,
Gregory W. Smith wrote:
>
> If the FTP server gets a request from joe@abc.net on port 20, it
> spawns child process "A" that has the established connection on port
> 20. The child process then opens a data connection with joe@abc.net on
> port 21 and then does all of the file transfers. The parent process
> then closes its connection on port 20 and then re-opens port 20 to
> listen for the next user.
So the Port 20 "handle" (or whatever) is passed to A-joe@abc.net?
Doesn't that jeopardize the integrity of the system? Couldn't Joe,
being a malevolent sort of person, try to read some Port 20 packets and
totally flummox the FTP server?
Or are the ports irrelevant because the processes are using sockets? A
socket is basically a handle for a specific IP address and port number.
Is it the handle (the socket) that's passed from the server to the child
process?
> If fred@def.com then connects on port 20,
> the server spawns another child process "B". It is up to the tcp stack
> to keep track of who gets which data. When a packet comes in for port
> 20 from joe@abc.net, the OS gives it to child process "A". A packet
> for port 20 from fred@def.net goes to process "B".
I'm really confused now. I thought the FTP server (the parent process)
was listening on port 20. How does the TCP stack know to give the
packet that comes in on port 20 to the child process? In the header,
the IP address is the same and both carry the same port number, 20.
There's no other identification in the header that the TCP stack can use
to properly steer the packet.
I thought that the child process was given a new, unique port number by
the TCP stack, and a socket (a handle) was passed to the child process
so that it could use that port number. I thought the child process
never really knew what port number it was using and only used the socket
for its communications. I thought the TCP stack kept a table so it
could look up a port if given a socket (for transmitted data), and look
up a socket if given a port (for received packets). I thought that only
one process at a time could use a port, and that a parent and a child
could not use the same port.
I thought this was all really simple and now I'm going to get an F (sob)
in FTP Servers 101.
Where am I getting mixed up?
Thanks.
- Peter Skye
=====================================================
To unsubscribe from this list, send an email message
to "steward@scoug.com". In the body of the message,
put the command "unsubscribe scoug-programming".
For problems, contact the list owner at
"rollin@scoug.com".
=====================================================
>> Next Message >>
Return to [ 02 |
October |
1998 ]
The Southern California OS/2 User Group
P.O. Box 26904
Santa Ana, CA 92799-6904, USA
Copyright 2001 the Southern California OS/2 User Group. ALL RIGHTS
RESERVED.
SCOUG, Warp Expo West, and Warpfest are trademarks of the Southern California OS/2 User Group.
OS/2, Workplace Shell, and IBM are registered trademarks of International
Business Machines Corporation.
All other trademarks remain the property of their respective owners.
|