In basic networking services, (e.g ssh) why we use statically assigned port number? What are potential problems with allowing services to select their own port in the applications provided by us?
Imagine the World Wide Web (www) without standardization of port [tcp] 80 for HTTP or 443 for HTTPS. Or email if SMTP wasn't typically found on port 25. How would browsers or mail servers know which port to use to reach the multitudes of servers littered all over the internet?
As @smithy2k3 noted, you can configure whatever port you want, assuming that port is communicated to the client somehow -- sneakernet or email come to mind -- and you're able to traverse your protocol through firewalls that may be inspecting the traffic on certain ports for rewrite -- FTP on tcp/21 and SIP on udp/5060, for example.