[torquedev] IP version-agnostic Address Representation
knielson at adaptivecomputing.com
Fri Aug 26 09:41:46 MDT 2011
----- Original Message -----
> From: "Donald Neal" <dmneal at wand.net.nz>
> To: "Torque Developers mailing list" <torquedev at supercluster.org>
> Sent: Thursday, August 25, 2011 4:53:31 PM
> Subject: Re: [torquedev] IP version-agnostic Address Representation
> David Beer wrote:
> ----- Original Message -----
> Ken Nielson wrote:
> ----- Original Message -----
> From: "Donald Neal" <dmneal at wand.net.nz> To: "Torque Developers
> mailing list" <torquedev at supercluster.org> Sent: Thursday, August
> 11, 2011 6:05:59 PM
> Subject: [torquedev] IP version-agnostic Address Representation
> There are a range of cases in Torque where an IP address is
> by a 32-bit object. This is something of a problem where the IP
> may actually be 128 bits long.
> I see two distinct cases here. In one the 32-bit object is being
> a key (as with AvlNode). In this case I propose initially to take
> lower-order 32 bits of an IPv6 address and keep going as now. This
> simple and effiicient, but would definitely give rise to
> which will confuse people in future.
> So the key does in future need to change. My inclination is to use
> struct created for the purpose containing two uint64_t's. But
> definitely other ways of doing this.
> In the other case, the address is not used as a key (as in struct
> pbsnode, say). That makes it viable to use either a struct
> the minimum fields necessary or a sockaddr*. I'm inclined towards
> latter on the grounds that keeping down the number of struct types
> use makes life simpler, But again there are clearly other ways of
> Does anyone have a view on this? Does anyone have any other reason
> use a package like gmp, which I don't see as needed for this
> - Donald Neal The current scheme TORQUE uses to identify trusted
> hosts is to use
> the host name and IPv4 ip address. The 32-bit IP address is used
> as a key to store trusted addresses in an AVL tree. The convenient
> thing about using this scheme is that connections are verified
> without the need to read any data from the stream. With the
> 128-bit IPv6 address the AVL tree is broken. We could change the
> AVL-tree to take a 128 bit key and then pad the IPv4 addresses. (I
> am just brain-storming).
> Another thought is to have the server assign a random number to
> each MOM and then distribute those numbers across the cluster.
> This would require a change in the protocol. It also requires a
> reading of the incoming stream to get the number.
> Just some thoughts.
> Ken From the (limited) discussion, I'm inclined to conclude
> i) Noone has another use for gmp, so general-purpose large objects
> not the answer.
> ii)) Replacing the 32-bit key in AvlNode with a struct of two
> is as good an idea as anything else.
> So life looks to be simpler if all AvlNodes have a 128-bit key in
> of a 32-bit one. This becomes more complex if the same node
> is used both with an AvlNode and with a resizable_array.
> Is there a simple explanation anywhere of what the resizable_array
> struct is intended to be used for? This is a question about design
> philosophy rather than existing code. The resizable_array struct is
> being used in many places to replace linked lists. This struct
> actually has the capability of maintaining a fixed order, so in a
> way it is still a linked list that resides in an array.
> The struct is used (in 4.0) to store jobs, nodes, queues, and tasks.
> As far as my intention for its use, I wanted to use it as an easy
> way for storing objects in arrays where the number of objects could
> change. I have tried to make it into a flexible and widely usable
> struct. Is there anything more specific you'd like to know about it?
> David Well, a general-purpose representation of a node's address
> can't be smaller than the address, which may be 128 bits. As it
> stands resizable_array is indexed by int. So the options look to me
> to be
> i) Replace the existing resizable_array with one indexed by an object
> which can hold up to 128 bits.
> ii) Create a second kind of resizable_array which is indexed by a
> 128-bit object, leaving the existing resizable_array unchanged.
> iii) Maintain a structure holding a 1:1 mapping between a
> general-purpose network address representation and the value used to
> index resizable_arrays.
> I don't like any of these much. I suspect option ii may result in
> less complexity of thinking if not less code than the others, but I
> welcome more informed opinions.
> - Donald Neal
> Donald Neal |"We're not going to have any riots around
> | here. It doesn't matter if you're
> | Turkish,
> High Performance Computing | if you live round here we'll defend
> The University of Waikato | - Aykut Boyraz
If you are going to create a resizable array to hold the values then I don't think it much matters if you use an address for the value or some other value which securely and uniquely identifies the node. Currently, the AVL tree actually identifies nodes by address and port in the trunk.
My point is that as you design the structure I would just think of unique 128 bit values and not think in terms of IP addresses. IP addresses are just a value in the end.
More information about the torquedev