Viewing a single comment thread. View all comments

could_use_a_snack t1_j1zx19n wrote

Nicely explained. I have a follow up question.

Is the email service always on 25 and web service on 80? Basically are they standardized? Or at least mostly agreed on?

4

stevekeiretsu t1_j1zz71q wrote

See here:

https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers

In summary, the Internet Assigned Numbers Authority officially assigns certain ports for certain services, but in other cases it's just convention, and either way you are completely free to ignore it if you want. For example I'm a web developer and so I routinely run web servers on my laptop for local work, if you're running multiple for different projects you might stick them on 8080, 8081, whatever. Also sometimes people use non-standard ports as a form of security by obscurity. (To continue parent analogy somewhat, imagine if every apartment building was supposed to have a bank vault in apartment 762, it would make it kind of easy for thieves to find, so you might stick it in 638, and have an intermediary stationed at 762 to vet anybody who turns up and only forward known bank customers to the correct place)

11

wappledilly t1_j2113qg wrote

Many ports are reserved for common functions (22 and 53 are always ssh and dns), but many are used for different things altogether (8080 for instance can be used for many different services across many different vendors/developers).

IANA maintains the list of reserved ports when dealing with internet, and can be found at their website (along with other lists such as top level domains, IP address allocation, etc.) https://iana.org/

2

Brainfuck t1_j22x9ec wrote

Yes they are standardized and default ports. However many a times things aren't run on default ports.

Most of the standardized ports are below 1024. These are called privileged ports and only an Administrator can open them. This is additional security to make sure that a malicious user for example cannot run a webserver on port 80 to hack users.

1