1

I have a problem with multiple processes needing to bind a TCP socket to the same port in Windows Server 2008.

At the moment I believe this is causing some unexpected erratic behavior as a race condition between processes exists, where you can't know which packet will be delivered to which process.

Separating the processes to different machines is apparently out of the question, so one solution I would like to try is binding on this port through different IP addresses.

Now, I know I can use netsh interface ipv4 add address to add static IPs in Windows. However, is it possible to add addresses and allow the DHCP to assign IPs to each of these virtual interfaces?

Luke
  • 557
  • 1
  • 5
  • 11
  • What virtual interfaces? You've mentioned processes and sockets but nothing about virtual interfaces. A DHCP server will assign an ip address to each unique MAC address/interface. – joeqwerty Oct 02 '15 at 15:37
  • Sorry, that was just what I was calling it when you add multiple IPs to one physical interface... I don't know what the usual terminology is. – Luke Oct 02 '15 at 15:47
  • What exactly could you be hosting that you don't want to have static addresses? – Jacob Evans Oct 02 '15 at 20:29
  • @JacobEvans It's not that I don't want to have static addresses, it's that I'd prefer not to have to mess around with that stuff when I am not the Network administrator. – Luke Oct 05 '15 at 08:37

1 Answers1

1

If this is a virtual machine, one way of doing it would be to simply add virtual network interfaces, each of them running DHCP.

But really, I think wanting to request the IP addresses here by DHCP doesn't make much sense, because you're going to have to configure the server processes themselves to bind to specific IP addresses, which would be subject to change if you're assignign by DHCP. Maybe if you can bind to an interface rather than an IP address, it would still kind of make sense. That'd depend on the application in question.

Assigning multiple static IP addresses probably makes much more sense though.

FYI you don't need to use netsh to do this, this can be done in the IPv4 properties of the interface under the Advanced button. You'll be able to add multiple addresses there.

Per von Zweigbergk
  • 2,625
  • 2
  • 19
  • 28
  • 1
    If it's a physical machine, you may be able to enable the Hyper-V role on the machine, and then add multiple management interfaces using PowerShell to accomplish the same thing. That's a total hack though, and you shouldn't do it. – Per von Zweigbergk Oct 02 '15 at 17:57