Hi Are ports only a convention or they define the protocol... I mean that for example when I connect to port 22(ssh) am I passing data in a special way (protocol) or is only that because it is port 22 there is going to be a sshd waiting there and not for example a httpd... Could somebody throw a little more light in this port stuff? :-) Thanks!! Raul
On Monday 17 December 2001 11.38, Raúl Gutiérrez Segalés wrote:
Hi
Are ports only a convention or they define the protocol... I mean that for example when I connect to port 22(ssh) am I passing data in a special way (protocol) or is only that because it is port 22 there is going to be a sshd waiting there and not for example a httpd... Could somebody throw a little more light in this port stuff? :-)
It is a convention. A port is just a number in the TCP header. A program on one machine registers with the TCP stack that when packets come with number X in the port field, it wants them. It is quite possible to start a web server on port 22. It's quite common to start them on high ports to get around firewalls, or if you're on a machine that isn't root. There is a document at http://www.iana.org/assignments/port-numbers that define the standard way to use ports, e.g. ftp on 21, http on 80 etc. You're free to use whatever you want, but if people are to use it you have to tell them what port delivers what service. If you go by the standard, programs can generally handle it automatically. Of course, the program that listens on the port (say sshd for example) will require data to be transmitted according to their own protocol, but that's another matter regards Anders
--- Ra�l_Guti�rrez_Segal�s
Hi
Are ports only a convention or they define the protocol...
I could be so wrong, but my understanding is that daemon servers (ssh, apache, ftp) listen to specific ports, mostly as a matter of standardization/convienence. Example, apache listens to :80, but you could make it listen to another port if you wanted. You would need a reason as web browsers make requests on port :80, so if you made apache listen to :81, then web browsers would not hit your apache port without be redirected by a masq/firewall/router type thing. I'm guessing it make no sense to randomly hide your ports since someone could sniff your traffic and figure out where it's going. Again, that's off the top of my head, and is more a gut feeling based on my feeble understanding than anything. ===== Daniel Woodard __________________________________________________ Do You Yahoo!? Check out Yahoo! Shopping and Yahoo! Auctions for all of your unique holiday gifts! Buy at http://shopping.yahoo.com or bid at http://auctions.yahoo.com
participants (3)
-
Anders Johansson
-
Raúl Gutiérrez Segalés
-
Scheme Loh