nest-simulator icon indicating copy to clipboard operation
nest-simulator copied to clipboard

Change default port for NEST Server to avoid conflicts on MacOS

Open heplesser opened this issue 2 years ago • 6 comments

On MacOS, port 5000 is used by the system for the AirTunes service. Since localhost is mapped to 127.0.0.1 (IPv4) and ::1 (IPv6) and AirTunes is running on both, starting NEST Server with the current default port 5000 leads to the situation that that port offers NEST if accessed via IPv4 and AirTunes via IPv6. In particular, http://localhost:5000 will resolve to AirTunes, as IPv6 takes precedence. Any attempt to use NEST Server via localhost thus fail silently, while access via http://127.0.0.1:5000 works.

To avoid this problem, I suggest to choose a different default port for NEST Server, e.g., 5001.

heplesser avatar Mar 01 '22 22:03 heplesser

Issue automatically marked stale!

github-actions[bot] avatar May 01 '22 08:05 github-actions[bot]

@babsey Have you had a chance to take a look at this issue?

heplesser avatar May 02 '22 07:05 heplesser

No, I did not look at this issue. But I think it is not a big deal to change it. A new default port would be very uncommon one like 5813 (Fibonacci) or do you have a better number?

When the default port changed in next release, we need to inform associated projects which use NEST Server. Here, I list projects using NEST Server:

babsey avatar May 02 '22 08:05 babsey

I have no previous experience in assigning port numbers, but after a quick search its seems that there is an official IANA table mapping ports to services and a protocol for assigning ports to services. It seems to me that we should not use a port (below 41952) without IANA approval. This is especially important, I believe, when offering NEST server remotely. We might need to discuss with more knowledgable colleagues.

heplesser avatar May 02 '22 12:05 heplesser

See https://stackoverflow.com/questions/2200199/how-do-you-decide-what-port-to-use

babsey avatar May 05 '22 16:05 babsey

Issue automatically marked stale!

github-actions[bot] avatar Jul 05 '22 08:07 github-actions[bot]

Ping to remind this issue.

babsey avatar Oct 10 '22 10:10 babsey

My suggestions for NEST Server would be:

  • [ ] 17969 - amount of Ås inhabitants
  • [x] 52425 - postal code of Research Center Jülich (palindromic)
  • [ ] 52428 - postal code of Jülich
  • [ ] 59862 - 5=Server of Nine Eight Six Two
  • [ ] 59863 - 5=Server of Nine Eight Six Three
  • [ ] 59872 - 5=Server of Nine Eight Seven Two
  • [ ] 59873 - 5=Server of Nine Eight Seven Three

babsey avatar Oct 10 '22 10:10 babsey

I suppose we are limited to 16 bits for port numbers, so 79104 will not work, even though it would be yet more fitting. Given those limitations, I'd suggest 52428.

@jougs @terhorstd @gtrensch Any comments or objections?

heplesser avatar Oct 10 '22 20:10 heplesser

52425 is the postal code of Forschungszentrum Jülich for mail delivery and nicely symmetric.

jougs avatar Oct 11 '22 07:10 jougs

@jougs: You are right! The postal code of FZJ is palindromic. I also like the number 52425. I am waiting for opinion of others, then I will work on changing the default port.

babsey avatar Oct 11 '22 08:10 babsey

@jougs: You are right! The postal code of FZJ is palindromic. I also like the number 52425. I am waiting for opinion of others, then I will work on changing the default port.

Go 52425, go!

heplesser avatar Oct 11 '22 09:10 heplesser