When a RPC service starts, it can register its endpoints along with the interface identifier and version of the service. A special RPC service, the portmapper service, maintains a database, the endpoint map, that can be queried to find out endpoints that can be used to invoke a given RPC service.
When a RPC service listens on a TCP or UDP endpoint, it must register itself in the endpoint map because TCP and UDP ports are dynamically allocated to RPC services.
To query the portmapper RPC service, the rpcdump tool  can be used. In the output of that command, ncacn_ip_tcp and ncadg_ip_udp correspond to dynamically allocated ports.