not sure I quite understand your problem. It should be no problem to establish 100k (or even a million) connections to one port. I will try to explain the problem you are currently have in detail (the solution for that I already wrote in the last response).
As I wrote before each TCP connection is made up of this tuple:
(local ip, local port, peer ip, peer port)
Lets say peerIp is 184.108.40.206 and peerPort is 1883 for HiveMQ (or any server). This mean peerIp and peerPort are static as you always have connect via this address:
(local ip, local port, 220.127.116.11, 1883)
Now we have only “local ip” and “local port” that can be varied to make connections to the server. Now lets further say JMeter (or any tool for making connection) uses the ip “18.104.22.168” you get this template:
(22.214.171.124, local port, 126.96.36.199, 1883)
The last variable part is local port and here we are limited by the fact that you can only have max 65536* (2^16) ports that you could put into “local port”, therefore as I wrote before with only one local ip you can at max establish 65536 connections:
(188.8.131.52, 0, 184.108.40.206, 1883) (connection tuple for client1)
(220.127.116.11, 1, 18.104.22.168, 1883) (connection tuple for client2)
(22.214.171.124, 65534, 126.96.36.199, 1883) (connection tuple for client65535)
(188.8.131.52, 65535, 184.108.40.206, 1883) (connection tuple for client65536)
*theoretically, not sure if all port can be used
As peerIp and peerPort are fix and localPort can only have max 65536 values you need to introduce variation into local ip (and that are my two points in the last response) two achieve 100k connections.
I / We are using an internal tool that I’m regrettably not allowed to hand out. But I can tell you this much, we scale the instances where the tool is running on to achieve millions of connections similar to the distributed approach of JMeter.