I thought the ports were defined by the host server.

With different ports hosting different games. For example I recall seeing a server with port 27660 as a death match and port 27661 as tournament, etc.