> I recently changed rhnServerNetwork due IPv6 and it was quite straight.
> 
> Now I focused on rhnServerInterface and I want to give you chance to
> argue with me, before I do the change. :)
> 
> Today the table looks like:
> http://spacewalk.redhat.com/documentation/schema-doc/table-RHNSERVERNETINTE
> RFACE.html
> 
> It has columns:
> * SERVER_ID   NUMBER(38)
> * NAME                VARCHAR2(32)
> IP_ADDR               VARCHAR2(64)
> NETMASK               VARCHAR2(64)
> BROADCAST     VARCHAR2(64)
> HW_ADDR               VARCHAR2(18)
> MODULE                VARCHAR2(128)
> CREATED               DATE
> MODIFIED      DATE
> 
> "*" marks primary key
> 
> Previusly clients send over XMLRPC this data:
> 
> intDict[interface] = {'hwaddr':hwaddr,
>                               'ipaddr':ipaddr,
>                               'netmask':netmask,
>                               'broadcast':broadcast,
>                               'module': module
>                               }
> 
> for some time (since 2010-11-20) it send:
> 
> intDict[interface] = {'hwaddr':hwaddr,
>                               'ipaddr':ipaddr,
>                               'netmask':netmask,
>                               'broadcast':broadcast,
>                               'module': module,
>                               'ipv6': ip6_list}
> 
> where ip6_list is:
> 
> ip6_list.append({
>                     'scope':   ip6.scope,
>                     'addr':    ip6.address,
>                     'netmask': ip6.netmask
>                 })
> 
> The ipv6 key/value pair is ignored by server for now.
> The IPv6 stuff will not fit into current table so I come with following
> solution:
> 
> Simplify table rhnServerInterface to columns:
> * SERVER_ID   NUMBER(38)
> * NAME                VARCHAR2(32)
> HW_ADDR               VARCHAR2(18)
> MODULE                VARCHAR2(128)
> CREATED               DATE
> MODIFIED      DATE
> 
> Create new table rhnServerInterfaceIPv4 with columns:
> * SERVER_ID   NUMBER(38)
> * NAME                VARCHAR2(32)
> IP_ADDR               VARCHAR2(64)
> NETMASK               VARCHAR2(64)
> BROADCAST     VARCHAR2(64)
> CREATED               DATE
> MODIFIED      DATE
> Migration of existing data from rhnServerInterface to this new table is
> easy and should not be problem.
> 
> Create new table rhnServerInterfaceIPv6 with columns:
> * SERVER_ID   NUMBER(38)
> * NAME                VARCHAR2(32)
> SCOPE         VARCHAR2(19)
> ADDR          VARCHAR2(45)
> NETMASK               VARCHAR2(49)
> CREATED               DATE
> MODIFIED      DATE
> 
> SCOPE can be (according rfc2373):
> scop is a 4-bit multicast scope value used to limit the scope of
>       the multicast group.  The values are:
> 
>          0  reserved
>          1  node-local scope
>          2  link-local scope
>          3  (unassigned)
>          4  (unassigned)
>          5  site-local scope
>          6  (unassigned)
>          7  (unassigned)
>          8  organization-local scope
>          9  (unassigned)
>          A  (unassigned)
>          B  (unassigned)
>          C  (unassigned)
> 
> longest is organization-local with 19 chars, but I seen more different
> strings already ("local", "universe" etc.).
> So I tend to think that more general VARCHAR(128) would be better here.
> 
> ADDR - longest IPv6 address can be 45 character wide. While we may
> normalize the address and make it shorter. Question is whether we want
> it normalize here or exactly as we get it over wire.
> 
> NETMASK - it is addr plus "/128" as longest prefix.

Today, we discussed another approach with Miroslav:

rhnServerNetInterface:
    ID                 <-- this will be table's primary key
    SERVER_ID
    NAME
    HW_ADDR
    MODULE
    CREATED
    MODIFIED

rhnServerNetAddress4 (or some other / better name):
    INTERFACE_ID <-- this will reference rhnServerNetInterface(id)
    ADDRESS
    NETMASK
    BROADCAST

rhnServerNetAddress6 (or some other / better name):
    INTERFACE_ID <-- this will reference rhnServerNetInterface(id)
    ADDRESS
    SCOPE
    NETMASK

Plus we may have several other constraints in place, such as:

unique rhnServerNetAddress4(interface_id, address)
unique rhnServerNetAddress6(interface_id, address, scope)

Thoughts, concerns, suggestions?

-Milan Zázrivec

_______________________________________________
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to