Home Help Center

Client local ip address bind

Hello,

I'm testing Ice, and for now I realize that is a great middleware (currently I'm using TAO). Congratulations! :-)

One question, Can I bind a TCP/UDP outgoing connection of one client to a concrete LOCAL ip address in a multihomed machine? I need to connect to a server from one concrete local available ip address in the client machine.

OS: Windows (2k & xp)
Ice: 2.0.0

Thanks and sorry about my English.

Best regards,
Mario

Comments

  • marcmarc FloridaAdministrators, ZeroC Staff Marc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications Engine ZeroC Staff
    Sure, just specify the local IP address in the endpoint.
  • mariomario Member
    Hello marc,

    sorry but I don't know how to configure the local IP address in the endpoint.

    In page 1429 (D.2 - Endpoints) of the Ice Manual, the format of the endpoint is described but, after reading all chapter, I don't know the answer to my question.

    Sintax: tcp -h host -p port -t timeout -z
    Client semantics for host parameter (-h): Determines the hostname or IP address to which a connection attempt is made.

    With this parameter I can configure the server ip address but, the client ip address?

    Thanks,
    Mario
  • marcmarc FloridaAdministrators, ZeroC Staff Marc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications Engine ZeroC Staff
    I'm not sure I understand the question. The client IP address is automatically chosen depending on which of the available local IP addresses allows you to send a request to the server.

    For example, if you have a server that listens to both 192.168.1.10 and 192.168.2.10, and if you have two local interfaces 192.168.1.1 and 192.168.2.1, then any request to 192.168.1.10 will automatically be sent using 192.168.1.1 and any request to 192.168.2.10 will be sent using 192.168.2.1. (All assuming your netmask is 255.255.255.0.) This is nothing Ice specific, this is simply how IP connections work.
  • mariomario Member
    Hello marc,

    yes, you are correct. But I need to configure the client IP address because I have two local NIC adapters, each with one IP address in the same IP subnet (192.168.1.x / 255.255.255.0) so routing tables don't work for me.

    Thanks,
    Mario
  • marcmarc FloridaAdministrators, ZeroC Staff Marc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications Engine ZeroC Staff
    I'm afraid selecting between these is not possible. May I ask why you want to explicitly select between two equivalent IP interfaces?
  • mariomario Member
    Hello marc,

    After running some tests with two machines (two NIC adapter each) I realize that finally I don't need that. Sorry for the time you spend with that question. I'll explain you the situation...

    What I need is NIC redundancy in client and server side and total control of the flow of communications.
    All my problems are related to the Windows Media Sensing "feature". From where I came from, I needed to disable this feature for a certain software service to operate well and configure only one IP subnet.

    With "Media Sensing" disabled, Windows can't route my packets correctly so I needed to select from local available client IP addresses manually and code the apropiate logic inside my program. Now, I can activate "Media Sense" so I don't need nothing to do manually :-)

    I configure an endpoint like that: "tcp -h 192.168.1.1 -p 50000:tcp -h 192.168.1.2 -p 50000" and I ran my tests. Pluging and unpluging the cables in the client machines and in the server machine all worked ok :-) :-)

    Now I'm going read the manual to learn how to configure tries and timeouts.

    Thanks,
    Mario
Sign In or Register to comment.