Port Forwarding using same Port

You are here: Home > Forum > General > General questions, comments, and issues > Port Forwarding using same Port

Page 1 of 1

Port Forwarding using same Port 13/03/2022 at 16:48 #145697
ajax103
Avatar
1103 posts
Can anyone explain how yesterday that Motherwell and Carlisle were able to be connected to as a client off a single PC using the exact same IP address and Port?

I was firmly under the impression that as a client connecting to a MP session that the host had to use different Ports even if chained and using the same IP off the same PC.

All I did was connect to Motherwell using one user tag so to speak and connected to Carlisle using a different one eg if I used Plan to identify myself when connecting to Motherwell and taking a panel while using Nalp to identify myself connecting to Carlisle and taking a panel, note they weren't what I used but I was surprised that it actually worked.

Is anyone able to offer a suggestion to how it's possible when it shouldn't be as far as I'm aware.

Log in to reply
Port Forwarding using same Port 13/03/2022 at 17:20 #145699
9pN1SEAp
Avatar
1100 posts
Game post shows CE was on 50507 with M on 50505.
Jamie S (JAMS)
Log in to reply
Port Forwarding using same Port 13/03/2022 at 18:52 #145700
ajax103
Avatar
1103 posts
9pN1SEAp in post 145699 said:
Game post shows CE was on 50507 with M on 50505.
Not at first it wasn't, I managed to connect to both using the same IP and the same Port for both of them until I raised it as a question THEN the host stepped in and changed the port on one of them but my question still remains, it shouldn't be possible but it is why?

Log in to reply
Port Forwarding using same Port 13/03/2022 at 19:01 #145701
i26
Avatar
306 posts
Guessing there's nothing to stop it but could cause issues down the line?

Log in to reply
Port Forwarding using same Port 13/03/2022 at 19:25 #145703
headshot119
Avatar
4869 posts
It's not possible to host two simulations on the same port at the same time. Each simulation will have been on a different port.
"Passengers for New Lane, should be seated in the rear coach of the train " - Opinions are my own and not those of my employer
Log in to reply
Port Forwarding using same Port 13/03/2022 at 19:26 #145704
ajax103
Avatar
1103 posts
headshot119 in post 145703 said:
It's not possible to host two simulations on the same port at the same time. Each simulation will have been on a different port.
Not true, I managed to do it so I know full well that it works, my question is HOW and WHY?

Log in to reply
Port Forwarding using same Port 13/03/2022 at 19:34 #145705
headshot119
Avatar
4869 posts
With the greatest respect, it's not possible to host two simulations on the same port, with the same external IP address.

Somewhere along the line you've either selected 50507 manually for the second simulation, or I have a feeling the loader defaults to 50507 when you're already connected to a different simulation on 50505.

"Passengers for New Lane, should be seated in the rear coach of the train " - Opinions are my own and not those of my employer
Log in to reply
The following user said thank you: jc92
Port Forwarding using same Port 13/03/2022 at 19:44 #145706
Tempest Malice
Avatar
122 posts
So a PC with any sensible operating system's networking stack can only allow one application to listen to a tcp port for connections (well unless the application claims to the OS to support multiuse, but sim sig doesn't so we don't need to consider that), so there isn't any way two sims share a port on the PC.
And given TCP doesn't do multicast this makes sense.

However a router which supports remapping with the port forwarding could quite reasonably forward one port on it's outside interface to multiple internal ones (I.E. to both sims on different internal ports from the same external one), under an assumption that only one should reply I guess.
Though given that the incorrect sim will be trying to close the connection whilst the correct one is accepting it I am somewhat surprised that you can reliably actually connect to both unless the router was doing something far cleverer than it should be doing. (I suppose it depends on how sim sig connection rejects are actually implemented, and if the host program actually closes the connection at the TCP level, or the client does that once the host tells it it is the wrong sim, though even then the client would get replies from both hosts, so it would have to be luck that the connection works (tcp packet numbering probably mean it only sees one reply, but doesn't in any way make it the right one))
But as both your connections come from different temporary ports I can completely follow how once established, both connections could run in parallel.

Log in to reply
Port Forwarding using same Port 13/03/2022 at 19:51 #145707
Steamer
Avatar
3913 posts
Online
I've just attempted to start Aston and Derby both using port 50505. On starting the second simulation, the error "cannot open TCP port for hosting the simulation" is displayed. The simulation still loads, but not as a server.
"Don't stress/ relax/ let life roll off your backs./ Except for death and paying taxes/ everything in life.../ is only for now." (Avenue Q)
Log in to reply
Port Forwarding using same Port 13/03/2022 at 20:14 #145708
ajax103
Avatar
1103 posts
Steamer in post 145707 said:
I've just attempted to start Aston and Derby both using port 50505. On starting the second simulation, the error "cannot open TCP port for hosting the simulation" is displayed. The simulation still loads, but not as a server.
Much be a fluke then as the host most certainly managed to start Motherwell and Carlisle on Port 50505 on the same PC hence same IP, the only difference was I connected to one as ajax and the the other as xaja WHICH worked.

Try that and you should be able to recreate it

headshot119 in post 145705 said:
With the greatest respect, it's not possible to host two simulations on the same port, with the same external IP address.

Somewhere along the line you've either selected 50507 manually for the second simulation, or I have a feeling the loader defaults to 50507 when you're already connected to a different simulation on 50505.
Nope certainly used the same port, as it was advertised with the same port to start with as I was asked to test their port forwarding.

Last edited: 13/03/2022 at 20:15 by ajax103
Reason: None given

Log in to reply
Port Forwarding using same Port 13/03/2022 at 23:24 #145711
GeoffM
Avatar
6274 posts
I think I might know a little about port basics, maybe I'm qualified?

Two simulations were not hosted on the same port. That's it.

SimSig Boss
Log in to reply
The following users said thank you: Meld, Tempest Malice, elltrain3
Port Forwarding using same Port 14/03/2022 at 00:20 #145712
ajax103
Avatar
1103 posts
GeoffM in post 145711 said:
I think I might know a little about port basics, maybe I'm qualified?

Two simulations were not hosted on the same port. That's it.
We just have to disagree as I managed it as I know that I didn't connect to two different ports until I reconnected later.

Log in to reply
Port Forwarding using same Port 14/03/2022 at 01:03 #145713
postal
Avatar
5189 posts
Could Karl's post #145705 earlier possibly provide an answer?

What about a possible scenario where the host had originally mis-typed both ports as 50505 even though 50505 and 50507 were actually being used? If Karl's feeling that the loader defaults from 50505 to 50507 when there is a conflict is the reality of the situation, then when you manually entered 50505 for both sims the loader actually connected you to one of them on 50507?

If that is a plausible scenario then everyone in this topic has been reporting accurately and there is no underlying conflict even though the reports appear to be contradictory.

“In life, there is always someone out there, who won’t like you, for whatever reason, don’t let the insecurities in their lives affect yours.” – Rashida Rowe
Log in to reply
The following user said thank you: Dionysusnu
Port Forwarding using same Port 14/03/2022 at 18:24 #145726
GeoffM
Avatar
6274 posts
ajax103 in post 145712 said:
GeoffM in post 145711 said:
I think I might know a little about port basics, maybe I'm qualified?

Two simulations were not hosted on the same port. That's it.
We just have to disagree as I managed it as I know that I didn't connect to two different ports until I reconnected later.
The fact you asked the question shows that you think it shouldn't be possible, and you are right: it is not possible. Windows only supports one listener per port. SimSig is not programmed to handle more than one simulation per port.

SimSig Boss
Log in to reply
Port Forwarding using same Port 14/03/2022 at 18:28 #145727
GeoffM
Avatar
6274 posts
postal in post 145713 said:
If Karl's feeling that the loader defaults from 50505 to 50507 when there is a conflict is the reality of the situation, then when you manually entered 50505 for both sims the loader actually connected you to one of them on 50507?
The Loader, as a server used to automatically select 50507 if another instance of SimSig was running but it was unreliable so it was removed a few months ago. Clients, in AJAX's case, never did this.

SimSig Boss
Log in to reply
The following user said thank you: postal