WL#14327: change default xproto port

Affects: Server-8.0   —   Status: Complete

Motivation

MySQL Router uses 64460 and 64461 as default port for the xprotocol routes when it bootstraps.

TCP port 64460 and 64461 are in the "dynamic port range" as defined by https://tools.ietf.org/html/rfc6335:

the Dynamic Ports, also known as the Private or Ephemeral Ports, from 49152-65535 (never assigned)

and is likely fail to bind on a high-connection server as ephemeral ports are used to as src-ports for connections and may already be in use.

the User Ports, also known as the Registered Ports, from 1024- 49151 (assigned by IANA)

IANA assigned ports

As of 2020-09-23 the ports following the router's default port 6446 are unassigned:

https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=6447

6447-6454 Unassigned

Goal

  • change the default port for the xprotocol routes to ports in the User Ports range.

Requirements

R1
when bootstrapping and --conf-base-port is not set, router MUST use TCP port 6446 as base-port.
R2
when bootstrapping and --conf-base-port is set to 0, router MUST use the old default ports (6446, 6447, 64460, 64470).
R3
when bootstraping with a configuration which already contains a xprotocol routing section, its bind-ports MUST be unchanged if the --conf-base-port param is not used and the xprotocol ports are old defaults (64460, 64470)

Bootstrap

--conf-base-port=0

If --conf-base-port set to 0,

name port
ClassicRWPort 6446
ClassicROPort 6447
XProtoRWPort 64460
XProtoROPort 64470

Currently, this is the default.

--conf-base-port unset

Old Behaviour

If --conf-base-port is not set, it defaults to 0 and triggers the default ports.

New behaviour

If --conf-base-port is not set, it defaults to 6446 which results in:

name port
ClassicRWPort 6446
ClassicROPort 6447
XProtoRWPort 6448
XProtoROPort 6449