Sockets question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Cowboy \(Gregory A. Beamer\)

    Sockets question

    This one is going to be hard to explain. First the question and then the
    background.

    If you have a box bound to two subnets through two NICs, can you code your
    socket listener to listen to a particular NIC? I see nothing in the class
    that provides this. It currently appears that the listener is, by default,
    bound to only one NIC, as it was working prior to moving the machine to be
    bound to the gateway on the other subnet.

    At this time, I have an alternative SOA solution (which requires a bit too
    much coding for my likes), so I am just wondering how to ensure the listener
    listens to both subnets (NICs) or how to ground it programmaticall y to one
    subnet (NIC). Other solutions are welcome, but that is the primary question.


    --------------------------------------------------------------
    You can stop reading here if you do not want the background:
    --------------------------------------------------------------

    On the old network, everything was on a single subnet. This is impossible
    now, as we have to set up both a hardware VPN and a software VPN. Due to set
    up of the VPNs, or VPN devices (one a Cisco ASA, the other a Linux box), I
    cannot set up the software VPN to listen through the hardware device, so we
    end up with two gateways. This is the reason for two subnets. It might be
    possible to figure out how to get the software VPN through the hardware
    device, but it is a vendor solution, which means I am not directly feeding
    the person who has to make that change.

    The solution worked on a single subnet. The box now sites with NIC one set
    up to talk on the subnet with the software VPN machine as its gateway. This
    is the "primary NIC" and "primary network". It has a second NIC that sits on
    another subnet, where the application server sits. I can move the app server
    (web apps only currently) to the other subnet, but this only delays having
    to solve this problem, as we will have to work with a VPN on the hardware
    device soon and the same applications will have to talk to it. That means
    moving the web server to the second subnet is a non-solution for long term.

    I can solve this with a SOA solution (web service of some sort: ASMX, WCF),
    but all of the web applications will have to change. I then have the web
    service talk to the service in the same manner the web applications
    currently do. Due to the way the vendor coded his libraries (there is an
    unintentional coupling through said libraries), there are a few gotchas in
    this approach, but they can be overcome with time.

    But if there is a way to tell a listener which network to listen to (which
    NIC to listen to), that solves the problem. I am not completely sure
    (scientifically ) the listener cannot listen to 2 NICs, but it appears to be
    the case. A few days back, when everything was on one subnet (talking to the
    hardware VPN), everything worked. It now fails. The only change was
    grounding the box with the listener on another subnet.

    --
    Gregory A. Beamer
    MVP, MCP: +I, SE, SD, DBA

    Subscribe to my blog


    or just read it:


    *************** *************** **************
    | Think outside the box! |
    *************** *************** **************

  • Ignacio Machin ( .NET/ C# MVP )

    #2
    Re: Sockets question

    On Oct 2, 9:10 am, "Cowboy \(Gregory A. Beamer\)"
    <NoSpamMgbwo... @comcast.netNoS pamMwrote:
    This one is going to be hard to explain. First the question and then the
    background.
    >
    If you have a box bound to two subnets through two NICs, can you code your
    socket listener to listen to a particular NIC? I see nothing in the class
    that provides this. It currently appears that the listener is, by default,
    bound to only one NIC, as it was working prior to moving the machine to be
    bound to the gateway on the other subnet.
    You can especify to which endpoint the connection will be attached too
    (or to all endpoints) as a matter of fact the version of the
    TcpListener that only accept a port is marked deprecaetd for a whie
    now.
    At this time, I have an alternative SOA solution (which requires a bit too
    much coding for my likes), so I am just wondering how to ensure the listener
    listens to both subnets (NICs) or how to ground it programmaticall y to one
    subnet (NIC). Other solutions are welcome, but that is the primary question.
    --------------------------------------------------------------
    You can stop reading here if you do not want the background:
    --------------------------------------------------------------
    Ok, I did :)

    Comment

    • Cowboy \(Gregory A. Beamer\)

      #3
      Re: Sockets question

      I caught that after firing off the question. Duh!

      --
      Gregory A. Beamer
      MVP, MCP: +I, SE, SD, DBA

      Subscribe to my blog


      or just read it:


      *************** *************** **************
      | Think outside the box! |
      *************** *************** **************
      "Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin @gmail.comwrote in
      message
      news:18ba1916-9bec-40b8-9e52-5541ee31c640@m4 5g2000hsb.googl egroups.com...
      On Oct 2, 9:10 am, "Cowboy \(Gregory A. Beamer\)"
      <NoSpamMgbwo... @comcast.netNoS pamMwrote:
      >This one is going to be hard to explain. First the question and then the
      >background.
      >>
      >If you have a box bound to two subnets through two NICs, can you code
      >your
      >socket listener to listen to a particular NIC? I see nothing in the class
      >that provides this. It currently appears that the listener is, by
      >default,
      >bound to only one NIC, as it was working prior to moving the machine to
      >be
      >bound to the gateway on the other subnet.
      >
      You can especify to which endpoint the connection will be attached too
      (or to all endpoints) as a matter of fact the version of the
      TcpListener that only accept a port is marked deprecaetd for a whie
      now.
      >
      >At this time, I have an alternative SOA solution (which requires a bit
      >too
      >much coding for my likes), so I am just wondering how to ensure the
      >listener
      >listens to both subnets (NICs) or how to ground it programmaticall y to
      >one
      >subnet (NIC). Other solutions are welcome, but that is the primary
      >question.
      >
      >--------------------------------------------------------------
      >You can stop reading here if you do not want the background:
      >--------------------------------------------------------------
      >
      Ok, I did :)

      Comment

      • Cowboy \(Gregory A. Beamer\)

        #4
        Re: Sockets question

        Oh, I forgot to say thank you. Thank you!

        --
        Gregory A. Beamer
        MVP, MCP: +I, SE, SD, DBA

        Subscribe to my blog


        or just read it:


        *************** *************** **************
        | Think outside the box! |
        *************** *************** **************
        "Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin @gmail.comwrote in
        message
        news:18ba1916-9bec-40b8-9e52-5541ee31c640@m4 5g2000hsb.googl egroups.com...
        On Oct 2, 9:10 am, "Cowboy \(Gregory A. Beamer\)"
        <NoSpamMgbwo... @comcast.netNoS pamMwrote:
        >This one is going to be hard to explain. First the question and then the
        >background.
        >>
        >If you have a box bound to two subnets through two NICs, can you code
        >your
        >socket listener to listen to a particular NIC? I see nothing in the class
        >that provides this. It currently appears that the listener is, by
        >default,
        >bound to only one NIC, as it was working prior to moving the machine to
        >be
        >bound to the gateway on the other subnet.
        >
        You can especify to which endpoint the connection will be attached too
        (or to all endpoints) as a matter of fact the version of the
        TcpListener that only accept a port is marked deprecaetd for a whie
        now.
        >
        >At this time, I have an alternative SOA solution (which requires a bit
        >too
        >much coding for my likes), so I am just wondering how to ensure the
        >listener
        >listens to both subnets (NICs) or how to ground it programmaticall y to
        >one
        >subnet (NIC). Other solutions are welcome, but that is the primary
        >question.
        >
        >--------------------------------------------------------------
        >You can stop reading here if you do not want the background:
        >--------------------------------------------------------------
        >
        Ok, I did :)

        Comment

        Working...