#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    4
    Rep Power
    0

    Multiple NICs, same subnet


    Hello,

    I am working on a Java web application deployed in Tomcat 7 in a Windows Server 2008 environment. One requirement we were recently given was to configure the server with multiple NICs, so as to support communication with some legacy applications that require my server to have specific IP addresses (all IPs on the same subnet).

    So, currently, my server is set up with NICs with the following addresses: 10.0.0.20, 10.0.0.21, 10.0.0.22. Tomcat is configured to listen on all interfaces, and any web service requests made to my application are handled and given a response. That's good.

    However, I am getting some reports that my app is not playing nicely with some of these legacy apps. Specifically, if legacy app A sends a web service request to 10.0.0.21, it expects to get a response from 10.0.0.21. However, according to reports, the responses actually come back over another interface, presumably determined by the Windows network stack. I'm guessing what happens is that since the client and all of the server's IPs are on the same subnet, Windows could use any of the three interfaces and just chooses one based on the routing tables.

    I am still in the process of setting up a test server and client to test this behavior. However, it seems to me (and maybe I'm naive) that this is part of the HTTP specification. The server shouldn't open up any new connections - it's supposed to just respond over the same connection initiated by the client. Is this behavior even possible?

    If it is possible, how can I configure my server (again, Windows Server 2008) to respond over the same interface on which a request was received?

    It doesn't appear to be any sort of Tomcat or Java configuration. I could create a static route in the routing table (not sure it works this way, though) to try to force the use of a specific interface when routing somewhere. However, all of the legacy apps are sitting on the same box, so any static route would only solve the problem for a specific app...

    Thanks!
  2. #2
  3. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,301
    Rep Power
    7170
    Well, from a physical perspective it's possible, but from a software perspective it doesn't seem very likely. It shouldn't really be very hard to test the theory, just install a packet sniffer like WireShark on the server and see what packets it's sending. I'd be interested to learn whether or not it's actually doing that.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    4
    Rep Power
    0
    Originally Posted by E-Oreo
    Well, from a physical perspective it's possible, but from a software perspective it doesn't seem very likely. It shouldn't really be very hard to test the theory, just install a packet sniffer like WireShark on the server and see what packets it's sending. I'd be interested to learn whether or not it's actually doing that.
    Agreed. That's what I'm trying to set up... Only my test machines are currently tied up with something else at the moment. Will be sure to let you know.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    4
    Rep Power
    0
    Ok, as an update, I tried to test this in my lab. Specifically, I set up the server with 3 NICs, and deployed the web application. Then, from a client, I made web service SOAP requests (via SoapUI) to each of the 3 IP addresses.

    Simultaneously, I had wireshark running, sniffing the packets going back and forth to and from the server. In every case, the SOAP responses were returned over the same interface to which the request was made.

    Next, I created a route in the server's routing table such that interface X should always be used when sending a packet to the client's IP address.

    Even with this route in place, I could not get the SOAP responses to arrive at the client from a different address than the one where I sent the requests.

    So... it looks like something altogether different must be going on.

    Thanks!
  8. #5
  9. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,301
    Rep Power
    7170
    Thanks for posting back.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around

IMN logo majestic logo threadwatch logo seochat tools logo