TransWikia.com

How a software is assigned a designated port by the community?

Unix & Linux Asked on November 9, 2021

This is a question on Unix software development.
I have seen the following questions, which gave rise to my question:

Suppose you are building a service which you later want to package and publish for the Linux distro, and it involves networking. You are making everything by scratch (like not using ssh or HTTP etc.), so you will need some default ports for communication.
How does the community (or whoever is responsible) decide which port is to be used and make it reserved?

One Answer

Read the content of /etc/services. There are a few comments that will shed some light on this.

E.g.

# Network services, Internet style
#
# Note that it is presently the policy of IANA to assign a single well-known
# port number for both TCP and UDP; hence, officially ports have two entries
# even if the protocol doesn't support UDP operations.
#
# Updated from https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml .
#
# New ports will be added on request if they have been officially assigned
# by IANA and used in the real-world or are needed by a debian package.
# If you need a huge list of used numbers please install the nmap package.

.
.
.

#=========================================================================
# The remaining port numbers are not as allocated by IANA.
#=========================================================================
.
.
.
# Services added for the Debian GNU/Linux distribution
.
.
.
# Local services

These are not the only comments in the file.

From this I see a section of ports assigned by IANA. A section that are documented by IANA (but not assigned by), a section assigned by Debian (I am running Debian Gnu/Linux), and a section for me to add locally used ports.

See these pages for more information

The second link above has information on how to register a port. You can also register just a name (ports can be looked up for a particular end-point using DNS).

How would you go about getting a port registered for your software

Step one

Get popular: You won't convince anyone until your software is popular.

What to do now.

Choose a port that is not in use. Chose a default, but make it configurable.

Low numbered ports (reserved for root, or capability CAP_NET_BIND_SERVICE)

You can use these if you have control over the machine. The advantage on a multi user machine, is other users can not use the port: steal the port (DOS), use the port (fake site), etc.

Answered by ctrl-alt-delor on November 9, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP