what are ports

I'm trying to understand the concept of port.

I know the standard port number for http is 80.

is a particular protocol, such as http , tied to a particular port and it doesn't work in any other port?
mikhaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

KimputerIT ManagerCommented:
Most of these ports are bound to standards, and that makes the internet work pretty well. Standard ports are for web browsing, email etc etc.
However, it's not tied to that port if you wish to implement it differently. For your intranet, if there are reasons to, you can have a web server server you on port 8080 (and the browser url bar would look like this: https://intranet:8080/login.aspx).
For every protocol, you can veer away any way you want, as long as the program allows it (most do) and if the communication is clear (both the server and the client knows about it).

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
JohnBusiness Consultant (Owner)Commented:
In simple conceptual terms, an application sends out a request via a port of its choosing (Port 80 is a convention) and gets the answer back on the same port. So an application can listen on its port and not have to scan through 65,000 ports for its information

I trusts this helps you.
JohnBusiness Consultant (Owner)Commented:
Here is a picture of Ports in and out.

C--General_Storage-Current-Software-.png
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

ste5anSenior DeveloperCommented:
Ports are part of the address of a service. The IP identifies the machine where a service is hosted. And the port is local part to identify the service.

The well-known ports (port < 1024) are to be used by convention. This means that at port 80 of a machine should listen a http service.

This should also answer you question: A service ("protocol" by your terms) can listen at any port. Cause the service itself doesn't need to know about the port, it's just offering service at what ever port it is tied to.
Don JohnstonInstructorCommented:
One of the things I've noticed over the years is a lot of people get stuck on this concept.  Personally, I think the term "port" throws them off.  Not sure why though.

Anyway, one of the things I've tried to get past this is explain that rather than use the term "port", use application interface number (AIN).   This "number" is how the application tracks data to and from the network stack.  So when your application (Firefox) wants to communicate with a web server (google), it will send the traffic to 80 (because 80 is the defined, standardized number for web servers). But your app also has to have a number for the return traffic. Because you can have multiple sessions (or tabs or windows) to google, you'll pick an unused number.  Let's say 9876.  If you have a second session to google, it would have a destination number of 80 also, but the source number would be different than 9876.

HTH
JohnBusiness Consultant (Owner)Commented:
Yes. You see above Dropbox using different ports (In and Out).
nociSoftware EngineerCommented:
Port <1024 used to be special because only privileged system accounts could create those.
As anyone can configure their own system it's own privileged accounts that became a useless concept outside of the mainframe & server arena.

Well known ports are mentioned in the /etc/service (or equivalent files).
Well known ports also include ports > 1024. 1433 (SQL Server),   9100 JetDirect, 6000 (X11), 9200 (Wap), (5222, 5223) XMPP (fe. Whatsapp).

(note that the same concept in software are called sockets.)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
port 25

From novice to tech pro — start learning today.