Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

ICEE2007171-511

PSU­UNS International Conference on Engineering and
Environment ­ ICEE­2007, Phuket May10­11, 2007 
Prince of Songkla University, Faculty of Engineering
Hat Yai, Songkhla, Thailand 90112 

Automated IPv6 
Router Renumbering on Linux
Touchai Angchuan*, Parin Sornlertlamvanich
Centre for Network Research, Department of Computer Engineering, Faculty of Engineering, 
Prince of Songkla University, Thailand 
touch@coe.psu.ac.th, hirosue123@gmail.com

Abstract:  Almost   small   and   medium   organizations 


obtained their global network addresses from the ISP, in w 2. BACKGROUND
hich number assigned is subjected to changed from time to 
time as a result of changing ISP from one to the other.   2.1 Router Renumbering protocol
These   changes   required   an   administrator   to   do   some  The   Router   Renumbering   protocol   [1]   is 
configuration   changing   to   each   devices   within   the   developed by IETF. When a router receives commands 
network,   called Renumbering. There are two changing  from a Management System station, configuration values 
mechanism, manually or automatically changing. Router  will be automatically changed. In addition, IPv6 address 
Renumbering   is   one   of   the   automatically   mechanism.  makes renumbering  of end nodes much easier, in fact, 
However this mechanism is not yet supported by Linux  automatic,   as   they   obtain   their   addresses   from 
which is widely use as a server and PC­based router in  information   broadcast   from   routers.   The   Router 
PSU*. This paper proposed the additional function to the  Renumbering   allows   routers   to   be   provided   with   the 
radvd program on Linux  to  make it  possible  to do the  necessary information from a management system so that 
router renumbering which will help system administrator  they can automatically update their configurations.
to do less job when the time of address changing arrived. This   protocol   use   stateless   auto   configuration 
[2], hosts rely on Router Advertisement (RA) messages 
Key Words: IPv6 /Router Renumbering Protocol to obtain the information needed for auto configuration 
(used to automatically assign addresses to a host). 
The   Router   Renumbering   protocol   has   3 
1. INTRODUCTION operations:   1.   Add   operation:   to   add   the   new   prefix; 
Most of the small and medium organization obtain their  2.Change   operation:   to   change   remaining   time   of   old 
network   addresses   from   their   ISPs.   When   the  prefix; 3.Set­global operation: to replace all global­scope 
organization change their ISP, the addresses being used  prefixes or remove all global­scope prefixes. The Router 
have to return back to the former ISP and obtain the new  Renumbering   protocol   has   three   procedures:   1.   A 
address block from the new ISP. This changing required  management   stations   sends   RR­C   message   to   a   router 
all hosts and router in the organization to reconfigured  and  then the  router  process  each  PCO  (Prefix  Control 
their address by network administrator whether manual  Operation) in sequence; 2. The router checks each of its 
or automatically configuration.  interfaces for an address or prefixes which matches the 
Automated Renumbering is an approach that makes the  Match­Prefix in the PCO; 3. For every interface on which 
address changing a lot more easier. All changes can be  a match is found, the operation is applied.
controlled   from   centralized   system   and   all  servers   can  2.2 Router Advertisement Daemon
provide   there   services   seamlessly   during   the   change. 
However,   most   of   the   servers   we   have   are   Linux,   in  A   daemon   program   in   Linux   called   radvd 
which   they   do   not   yet   support   this   mechanism.   This  (Router   Advertisement   Daemon)   listens   to   Router 
paper proposed an additional function to Linux to make  Solicitations   (RS)   message   and   answers   back   to   the 
it possible do to a renumbering. The paper organized as  requester   with   Router   Advertisement   (RA)   message. 
follow: we start with background information of Router  Furthermore unsolicited RA messages are also send from 
Renumbering   protocol,   then   we   discuss   about   the  time to time, each of which contains information for any 
implementation in Linux and follow by the testing results  hosts   in   the   network   to   configured   their   network 
and conclusion.

*Prince of Songkla University, Hat Yai, THAILAND
ICEE2007171-512

interfaces. These information includes address prefixes,  number   of   seconds   for   the   New   Prefix   will   be   valid, 


the MTU of the link and default gateway. Preferred Lifetime is  the number of seconds for which 
The Router Advertisement Daemon is acting as  the New Prefix will be preferred.
IPv6   routers.  It  sends  Router  Advertisement  messages,  We   add   some   structure   to   do   the   Router 
specified by Neighbor Discovery Protocol­RFC 2461[3],  Renumbering on Linux as shown in Figure 2.
to a local Ethernet LAN periodically and when requested 
by a node sending a RS message. These messages are 
required   for   IPv6   stateless   auto­configuration   by   RFC 
2462[2].
 

3. IMPLEMENTATION PRINCIPLE
There   are   2   important   parts   in   Router 
Renumbering: 1.Management Station; 2.Router
3.1 Management Station
In the Management Station, we implemented it 
based   on   a   router   renumbering   daemon   (rrenumd) 
obtained from KAME SNAP kit (BSDs Platform)[4]. We 
improved   header   files   on   Linux   to   recognize   Router 
Renumbering   protocol   stack.   In   addition,   we   improve 
security between the Router and the Management Station  Figure 2 The relationship between RR­packet format and 
in order to ensure that the router renumbering command  stucture in program rrenumd
were sent to the router successfully. 
The   management   station   uses   router  In   the   rrenumd   program,  config()  function 
renumbering   daemon   (rrenumd)   to   transmit   Router  initials   some   field   in   RR   packet   for   sending   RR 
Renumbering  (RR)  request  packets to all router in  the  Command   message,   it   also   contains   the   Match­Prefix 
network, in order to perform  renumbering. The Router  and   Use­Prefix   from   the   configuration   file 
Renumbering   packet   format   has   three   type:   1.   RR  (rrenumd.conf). The rrenum_output() function sends RR 
Commands which are sent to routers; 2. RR Result which  Command message to the Router which is destination for 
are sent by routers; 3. SNR used to synchronize reset the  the renumbering.  
Recorded Sequence Number to zero which guards against 
message   replay.  These   messages   are   ICMPv6 
3.2 Router
distinguished   by   the   ICMPv6   “Code”   field   and   the 
“Message Body” field as shown in Figure 1. For   the   router   parts,   we   implemented   it   on 
Linux based on Automated IPv6 Site  Renumbering on 
NetBSD[6].   We   improved   the   Radvd   to   receive   router 
renumbering  command message from the Management 
Station, and it can use that message in order to renumber 
based on operation in Router Renumbering protocol. We 
improved a part of sending RA (Router Advertisement) 
message   from   the   router.   When   it   is   renumbered,   RA 
message should be changed address prefix instead of old 
address   prefix.   After   that,   this   RA   message   will   be 
advertised   to   hosts   to   configure   their   interfaces,   all 
functions for the Router Renumbering process in Radvd 
are show in the Figure 3.
We   improved   Router   Advertisement   Daemon 
Figure 1 Router Renumbering Message Format (Radvd)   to   accept   Router   Renumbering   message   from 
management   station.    In  process()  function   in   Radvd 
The body of an RR Command message contains  program, we add a part which can receives the RR packet 
sequence   of   zero   or   more   Prefix   Control   Operations,  (the icmp type equal to 138), if this RR packet is RR 
each of variable length. A Prefix Control Operation has  Command (the icmp code equal to 0), it will be sent to 
one Match­Prefix Part of 24 octets, followed by zero or  rr_command_input() function. 
more Use­Prefix Parts of 32 octets each. This is a Prefix  The  rr_command_check()  in  rr_command_ 
against which a router compares the address and prefixes  input()  function,  it   checks   integrity   of   RR   message, 
configured on its  interface. The Use­prefix which either  ICMP6_ROUTER_RENUMBERING type, length of RR 
becomes or is used in forming the new Prefix. The Use­ Command, sequence number and segment number, and 
Prefix   informs   specific   of  Valid   Liftime   that   is  the  then it sends data of packet to do Router Renumbering 
ICEE2007171-513

(do_rr()  function).   If   it’s   mistaken,   the   Router 


Renumbering is not happen.

Figure 4 The new IP address generation

After that, the router will send new RA to all 
hosts in its subnet. We use  send_ra()  function in Radvd 
program, it sends new Router Advertisement (RA) which 
contains new prefix, valid lifetime and preferred lifetime 
to   all   hosts.   We   improve   Radvd   to   send   new   RA   on 
interface   which   was   matched   with   Match_Prefix.   The 
Radvd   program   was   edited   to   send   new   RA   when   it 
receives the RR Command from the management station.
In the real world, Router Renumbering system 
may crashes or reboot, the management station does not 
know for this problem, if it does not receive the report 
from   the   router.   The   router   should   send   a   report   to 
Figure 3 Functions for the Router Renumbering process. management to solve this problem and save date which 
it’s necessary. If the system crashes and reboot while the 
The  do_rr()  function   calls  do_pco()  for   each  renumbering   is   not   finish.   So,   the   stable   sequence 
Prefix   Control   Operations   (PCOs)   in   a   received   RR  number   and   report   procedure   can   help   for   the 
Command   message.   The  rr_pco_check()  in  do_pco()  renumbering to be successful. 
function, it checks validity of the PCOs: 1. Check length  For the stable sequence numbers, we add some 
of Match­Prefix (rpm­>rpm_matchlen) must be 0 to 128  code in the file “rrenum.c” of router (radvd) that code 
inclusive, 2. Check sum of Use­Prefix length and keeplen  keeps   value   of   sequence   number,   segment   number, 
(uselen + keeplen) must be between 0 and 128 inclusive.  match­prefix,   matchlen,   interface   number,   use­prefix, 
After   that,   the  do_use_prefix()  function   can   get   IP  vltime,   pltime   in   sequence   configuration   file 
addresses (in  get_alladdr()  function) from all interfaces,  “(/etc/rrseq.log)”.   We   always   update   to   “/etc/rrseq.log” 
it will check interface which matches with Match­Prefix  file when the Router Renumbering sequence is finished 
(in  prefix_match()  function),   and   it   can   the   matched  in each sequence. The report message consists of IPv6 
interface to do Router Renumbering. header, RR header and RR Result which reads value in 
The  do_use_prefix()  function  checks   the  sequence configuration file (“/etc/rrseq.log”). The detail 
Operation (Add, Change) to do following the Operation  of   report   and   stable   sequence   procedure   is   shown   in 
which gets from RR message, and it creates new address.  Figure 5.
If Add Operation, it will add new address, valid lifetime 
and preferred lifetime on interface which matches Match­
Prefix. If Change Operation, it will change valid lifetime 
and  preferred  lifetime  with address on interface which 
matches   Match­Prefix.  The  newaddress()  in 
do_use_prefix()  function  creates   new   address   via 
calculate   prefix   length   of   new   prefix   from   uselen   + 
keeplen   (from   the   address   of   interface   of   the   router 
which matches the Match­Prefix) as show in the Figure 
4. The new address is combined between new prefix and 
interface identifiers (based on EUI64). If Add Operation, 
new address is created from the  newaddress()  function, 
and then it adds on that interface.  If Change Operation, 
that   address   is   changed   preferred   lifetime   and   valid  Figure 5 Report and Stable sequence procedure
lifetime following the RR Command from management 
station. In   security   consideration,   the   connection 
between the Router and the Management Station should 
be protected from IPsec [5] which can encrypt data, and 
all   information   transmitted   during   the   authentication 
process.
ICEE2007171-514

4. TESTING AND RESULT IP address on the interface of router which has 
the   address   matched   with   match­prefix   part   that   is 
When the management station send the router 
renumbering   request   packet   that   have   the   important  3ffe:5001:0::/48   from   the   router   renumbering   packet. 
After renumbering occurred, the interface of router has 
information so that:
the   new   IP   address.   It   uses   use­prefix   part   that   is 
1. Operation is specifies the operation of the router 
2001:200:bbbb::/48 for new IP address.
renumbering protocol.
2. Match­prefix is specifies the match address to 
check matching.
3. Use­prefix use for some part of makes the new 
address.
4. Keeplen is specifies the number of bit of prefix 
or address which matched, it take to make the 
new addresses. Figure 8 Show the address on the interface “eth0” before 
5. Pltime  is specifies how long the prefix generated  renumbering.
by stateless auto configuration.  
6. Vltime  is specifies how long the prefix are still 
on the interface.

4.1 Router Renumbering testing: first Scenario
Connect   the   Management   Station   (Linux), 
Router   (Linux)   and   Host   together.   The   configuration 
information   for   the   Router   Renumbering   are   in 
Management   Station,   in   the   file   called  Figure 9 Show the address on the interface “eth0” after 
rrenumd_linux.conf   which   has   2   sequences,   sequence  renumbering.
number 1 is CHANGE Operation, and sequence number 
2 is ADD Operation. 4.2 Second Scenario: test Report and Stable sequence 
When the management station transmits the RR  number 
message to the router. And then, the router receives and 
processes   the   router   renumbering   request   packets.   The 
router will mask the matched address to delete then will 
be   adding   the   new   address   and   then   delete   the   old 
address which is marked.
CHANGE Operation
IP address on the interface matches with Match­
Prefix   part   that   is   3ffe:5001:0::/48   from   the   router 
Figure 10 Show testing for sequence number and report
renumbering   packet.   After   renumbering   occurred,   the 
interface   of   router   has   the   new   valid   and   preferred 
Packet was sent by the management station on 
lifetime. The old IP address has gone the interface when 
Linux   for   CHANGE   Operation   which   is   Sequence 
preferred and valid lifetime value is equal to zero.
number 1, and it sets R flags to request result from the 
router.   The   Router   does   Router   Renumbering   process 
which   receives   RR   Command   message   from 
management   station   that   is   used   to   request   report 
message. The step of router checks sequence, do router 
renumbering, write file /etc/rrseq.log to update data and 
send report message to management station.

Figure 6 Show the address on the interface “eth0” before 
renumbering.

Figure 7 Show the address on the interface “eth0” after 
renumbering.
ADD Operation
ICEE2007171-515

Figure10 Show The router process of renumbering and  [2]  S. Thomson and T. Narten, “IPv6 Stateless Address 


send report message. Autoconfiguration”, RFC2462, December 1998.

The Management Station sends RR Command  [3] T. Narten, E. Nodmark and W. simpson, “Neighbor 
message   with   a   new   sequence   number   to   Router.   If  Discovery for IP Version 6”, RFC 2461, December 1998.
Router   do   renumbering   success,   then   router   save   new 
data. After that, the router send report  message to the  [4] KAME, “KAME SNAP kit”, www.kame.net.
Management Station, as show in Figure 11. [5] S. Kent and R. Atkinson, “Security Architecture for 
the Internet Protocol”, RFC 2401, November 1998.

 Figure 11 Show Management receive report message 
from router

6. CONCLUSION
Automated IPv6 site renumbering on Linux for 
the administrator to have alternative choices which need 
used   operating   system   on   Linux.   This   project   is 
developed to change addresses automatically. Changing 
of   IP   address   information   associated   with   hosts   and 
subnet is called Renumbering.
Automated   IPv6   site   renumbering   on   Linux 
ports   Router   Renumbering   Daemon   (rrenumd)   from 
NetBSD in a part of Management Station. In Router site, 
implement   Radvd   (Router   Advertisement   Daemon   on 
Linux) to support Router Renumbering protocol. In part 
of  Management, we  port   rrenumd  to  startup  on  Linux 
already and we edit rrenumd that can retransmit and wait 
for the report message from router. In part of Router, we 
edit the Radvd to do Router Renumbering and making 
sure that all of the router renumbering is completed. We 
add part  of update configuration file in Radvd for the 
router   remembers   having   completed   that   renumbering. 
So, it’s not attempted again, and we add part of check 
sequence   number,   this   case   solves   problem   of   old 
sequence   number   in   management   station.   Sending   a 
report message to the management station, it can know 
the router that could receive RR command and do Router 
Renumbering   completely.   In   another   case,   if   Router 
reboots while do Change Operation not completed (valid 
time and preferred time not time is up). We add a part of 
check   and   save   time   algotrithm   to  solve   this   problem. 
Later,   we   use   AH   protocol   for   makes   sure   that   the 
delivered data is authentic, and it’s arrived at the router 
without modification.
This project intends to implement Management 
Station and Router for benefit of Administrator that uses 
operating   system   on   Linux.   Present   day,   Linux   can’t 
support Router Renumbering protocol. We would like to 
support   it,   because   of   many   administrators   work   with 
operating system on Linux.

5. REFERENCES
[1]  M. Crawford, “Router Renumbering for IPv6”, RFC 
2894, August 2000.

You might also like