Changeset 238

Show
Ignore:
Timestamp:
08/31/08 22:26:51 (4 months ago)
Author:
pwh
Message:
  • ipvpn.rb: Add documentation on Route Distinguishers.
  • 042_update_ipvpn_add_rd_integer.rb: Add a column for an RD in integer format.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • nethorus/app/models/ipvpn.rb

    r198 r238  
    2525differentiate routing table instances. 
    2626 
    27 [id] 
    28   A unique ID to represent this IP VPN. 
    29    
    30 [ipvpn_rd] 
    31   The Route Distinguisher for this IP VPN. 
    32      
    33 [ipvpn_name] 
    34   A human-readable name for this IP VPN. 
     27== Parameters 
     28 
     29* ((|id|)): A unique ID to represent this IP VPN. 
     30* ((|ipvpn_rd|)): The RD expressed in the format X:Y depending on the RD type (automatically determined from the integer representation). 
     31* ((|ipvpn_rd_integer|)): The RD expressed in integer format. 
     32* ((|ipvpn_name|)): Human-readable name. 
     33 
     34== Detail 
     35 
     36=== Route Distinguisher (ipvpn_rd) 
     37 
     38The Route Distinguisher (RD) is an 8-byte number, used to differentiate routes in one IP VPN from another.  The RD consists of three fields - a 2-byte type field, an administrator field and an assigned number field. 
     39 
     40 * Type 0 RDs use a 2-byte administrator subfield (an Autonomous System number, or ASN, from the public AS space) and a 4-byte assigned number subfield. 
     41 * Type 1 RDs use a 4-byte administrator subfield (an IPv4 address from the public IPv4 address space - use of RFC1918 address space is strongly discouraged) and a 2-byte assigned number subfield. 
     42 * Type 2 RDs use a 4-byte administrator subfield (an Autonomous System number, or ASN, from the BGP-AS4 space) and a 2-byte assigned number subfield. 
     43 
     44An RD specified in the 'ipvpn_rd' parameter of an Ipvpn object is automatically converted and stored as an 8-byte integer, and converted back to a Type 0, Type 1 or Type 2 RD when an object is retrieved. 
    3545 
    3646=end 
     
    4151  validates_presence_of :ipvpn_name 
    4252 
     53 
     54  # If the ((|ipvpn_rd||) value for this object has changed, we must 
     55  # re-calculate the ((|ipvpn_rd_integer|)) based on this new value.  
     56  # Changing the integer representation is currently unsupported. 
     57 
     58  def before_validation 
     59 
     60    if self.changed? 
     61 
     62      # TODO: Write code to convert a human-readable RD in to integer 
     63      # format. 
     64 
     65    end 
     66 
     67  end 
     68 
    4369end