Discussion:
TNSX socket IP designation
(too old to reply)
SRSeedBurners
2023-01-25 17:52:10 UTC
Permalink
We are transitioning to our new x-series systems. Probably using wrong terminology here but - our new tcpip topology is going to use a provider stack name (e.g. $ZTC10) which will have TWO tcpip numbers associated with it (e.g. 69.25.1.2 & 69.25.1.5). On our current TNSE systems we have one IP number per stack (i.e. $ZTC10 is 69.25.1.2). The new system is using a active-active failover so that if one CLIM goes down the other takes over without skipping a beat. I have no idea how that works but....

My question: is there a way to pick which IP address is used in our code? We currently get a socket using

socket_set_inet_name(STACK_NAME);
socket = socket_nw(AF_INET,SOCK_STREAM,ITPROTO_TCP,2D,2D);

I was told that it's going to round-robin now between the addresses. Can't have that.
Bill Honaker
2023-01-25 18:21:39 UTC
Permalink
Post by SRSeedBurners
We are transitioning to our new x-series systems. Probably using wrong terminology here but - our new tcpip topology is going to use a provider stack name (e.g. $ZTC10) which will have TWO tcpip numbers associated with it (e.g. 69.25.1.2 & 69.25.1.5). On our current TNSE systems we have one IP number per stack (i.e. $ZTC10 is 69.25.1.2). The new system is using a active-active failover so that if one CLIM goes down the other takes over without skipping a beat. I have no idea how that works but....
My question: is there a way to pick which IP address is used in our code? We currently get a socket using
socket_set_inet_name(STACK_NAME);
socket = socket_nw(AF_INET,SOCK_STREAM,ITPROTO_TCP,2D,2D);
I was told that it's going to round-robin now between the addresses. Can't have that.
Look into the call to 'bind(), placed after the socket_nw() completes'. This works for clients (connect_nw) or servers (listen).

Bill
Bill Honaker
2023-01-26 23:40:30 UTC
Permalink
Post by Bill Honaker
Post by SRSeedBurners
We are transitioning to our new x-series systems. Probably using wrong terminology here but - our new tcpip topology is going to use a provider stack name (e.g. $ZTC10) which will have TWO tcpip numbers associated with it (e.g. 69.25.1.2 & 69.25.1.5). On our current TNSE systems we have one IP number per stack (i.e. $ZTC10 is 69.25.1.2). The new system is using a active-active failover so that if one CLIM goes down the other takes over without skipping a beat. I have no idea how that works but....
My question: is there a way to pick which IP address is used in our code? We currently get a socket using
socket_set_inet_name(STACK_NAME);
socket = socket_nw(AF_INET,SOCK_STREAM,ITPROTO_TCP,2D,2D);
I was told that it's going to round-robin now between the addresses. Can't have that.
Look into the call to 'bind(), placed after the socket_nw() completes'. This works for clients (connect_nw) or servers (listen).
Bill
In C, the code would be something like this (there may need to be some casts):

#include <socket.h>
#include <in.h>
#include <netdb.h>
int error, socket;
struct sockaddr_in addr;
long tag;


addr.sa_family = AF_INET;
addr.sin_port = 2323;
addr.sin_addr = inet_addr("192.168.1.1");
error = bind (socket, &addr, sizeof(addr), address_len);
or
error = bind_nw (socket, &addr, sizeof(addr), tag);

Compile this with extensions on. Note that the address you put in must be one of the subnets that is defined to run in the stack (eg $ZTC0).

If you need an IPV6 addrses, usea sockaddr_in6 instead of a sockaddr_in and fill it in appropriately.

Good luck, let us know if you get it working (with maybe a simple example!
Bill
Randall
2023-01-27 19:11:26 UTC
Permalink
Post by Bill Honaker
We are transitioning to our new x-series systems. Probably using wrong terminology here but - our new tcpip topology is going to use a provider stack name (e.g. $ZTC10) which will have TWO tcpip numbers associated with it (e.g. 69.25.1.2 & 69.25.1.5). On our current TNSE systems we have one IP number per stack (i.e. $ZTC10 is 69.25.1.2). The new system is using a active-active failover so that if one CLIM goes down the other takes over without skipping a beat. I have no idea how that works but....
My question: is there a way to pick which IP address is used in our code? We currently get a socket using
socket_set_inet_name(STACK_NAME);
socket = socket_nw(AF_INET,SOCK_STREAM,ITPROTO_TCP,2D,2D);
I was told that it's going to round-robin now between the addresses. Can't have that.
Look into the call to 'bind(), placed after the socket_nw() completes'. This works for clients (connect_nw) or servers (listen).
Bill
#include <socket.h>
#include <in.h>
#include <netdb.h>
int error, socket;
struct sockaddr_in addr;
long tag;
addr.sa_family = AF_INET;
addr.sin_port = 2323;
addr.sin_addr = inet_addr("192.168.1.1");
error = bind (socket, &addr, sizeof(addr), address_len);
or
error = bind_nw (socket, &addr, sizeof(addr), tag);
Compile this with extensions on. Note that the address you put in must be one of the subnets that is defined to run in the stack (eg $ZTC0).
If you need an IPV6 addrses, usea sockaddr_in6 instead of a sockaddr_in and fill it in appropriately.
Good luck, let us know if you get it working (with maybe a simple example!
Bill
Depends on whether this is in Guardian or OSS. bind_nw, AFAIK, is no longer supported in OSS. You might have to use other defines also, like _XOPEN_SOURCE_EXTENDED 1, and _XOPEN_SOURCE, to make the right definitions available. I am not sure you can pick in IPv6 address. Whether this works also depends on whether your stack is multi-home or not. If it not, picking the appropriate =TCPIP^PROCESS^NAME define value may be sufficient without changing code.
Bill Honaker
2023-01-27 20:55:39 UTC
Permalink
Post by Randall
Post by Bill Honaker
We are transitioning to our new x-series systems. Probably using wrong terminology here but - our new tcpip topology is going to use a provider stack name (e.g. $ZTC10) which will have TWO tcpip numbers associated with it (e.g. 69.25.1.2 & 69.25.1.5). On our current TNSE systems we have one IP number per stack (i.e. $ZTC10 is 69.25.1.2). The new system is using a active-active failover so that if one CLIM goes down the other takes over without skipping a beat. I have no idea how that works but....
My question: is there a way to pick which IP address is used in our code? We currently get a socket using
socket_set_inet_name(STACK_NAME);
socket = socket_nw(AF_INET,SOCK_STREAM,ITPROTO_TCP,2D,2D);
I was told that it's going to round-robin now between the addresses. Can't have that.
Look into the call to 'bind(), placed after the socket_nw() completes'. This works for clients (connect_nw) or servers (listen).
Bill
#include <socket.h>
#include <in.h>
#include <netdb.h>
int error, socket;
struct sockaddr_in addr;
long tag;
addr.sa_family = AF_INET;
addr.sin_port = 2323;
addr.sin_addr = inet_addr("192.168.1.1");
error = bind (socket, &addr, sizeof(addr), address_len);
or
error = bind_nw (socket, &addr, sizeof(addr), tag);
Compile this with extensions on. Note that the address you put in must be one of the subnets that is defined to run in the stack (eg $ZTC0).
If you need an IPV6 addrses, usea sockaddr_in6 instead of a sockaddr_in and fill it in appropriately.
Good luck, let us know if you get it working (with maybe a simple example!
Bill
Depends on whether this is in Guardian or OSS. bind_nw, AFAIK, is no longer supported in OSS. You might have to use other defines also, like _XOPEN_SOURCE_EXTENDED 1, and _XOPEN_SOURCE, to make the right definitions available. I am not sure you can pick in IPv6 address. Whether this works also depends on whether your stack is multi-home or not. If it not, picking the appropriate =TCPIP^PROCESS^NAME define value may be sufficient without changing code.
Since the OP had socket_nw() in his example I assumed Guardian.
Randall
2023-01-28 22:16:48 UTC
Permalink
Post by Bill Honaker
Post by Randall
Post by Bill Honaker
We are transitioning to our new x-series systems. Probably using wrong terminology here but - our new tcpip topology is going to use a provider stack name (e.g. $ZTC10) which will have TWO tcpip numbers associated with it (e.g. 69.25.1.2 & 69.25.1.5). On our current TNSE systems we have one IP number per stack (i.e. $ZTC10 is 69.25.1.2). The new system is using a active-active failover so that if one CLIM goes down the other takes over without skipping a beat. I have no idea how that works but....
My question: is there a way to pick which IP address is used in our code? We currently get a socket using
socket_set_inet_name(STACK_NAME);
socket = socket_nw(AF_INET,SOCK_STREAM,ITPROTO_TCP,2D,2D);
I was told that it's going to round-robin now between the addresses. Can't have that.
Look into the call to 'bind(), placed after the socket_nw() completes'. This works for clients (connect_nw) or servers (listen).
Bill
#include <socket.h>
#include <in.h>
#include <netdb.h>
int error, socket;
struct sockaddr_in addr;
long tag;
addr.sa_family = AF_INET;
addr.sin_port = 2323;
addr.sin_addr = inet_addr("192.168.1.1");
error = bind (socket, &addr, sizeof(addr), address_len);
or
error = bind_nw (socket, &addr, sizeof(addr), tag);
Compile this with extensions on. Note that the address you put in must be one of the subnets that is defined to run in the stack (eg $ZTC0).
If you need an IPV6 addrses, usea sockaddr_in6 instead of a sockaddr_in and fill it in appropriately.
Good luck, let us know if you get it working (with maybe a simple example!
Bill
Depends on whether this is in Guardian or OSS. bind_nw, AFAIK, is no longer supported in OSS. You might have to use other defines also, like _XOPEN_SOURCE_EXTENDED 1, and _XOPEN_SOURCE, to make the right definitions available. I am not sure you can pick in IPv6 address. Whether this works also depends on whether your stack is multi-home or not. If it not, picking the appropriate =TCPIP^PROCESS^NAME define value may be sufficient without changing code.
Since the OP had socket_nw() in his example I assumed Guardian.
Me too, but at one point in time, socket_nw() was not excluded explicitly from OSS. No RVU was given by the OP.
Loading...