PIM Tool: pimnbr

# PIM tool: pimnbr (PIM Neighbor)

## Overview:

Pimnbr aims at testing PIM-DM/SM functionality. Pimnbr can exchange PIM packets as a PIM router, and emulate situation that test target communicate with multiple PIM router.
Behavior of pimnbr can be controlled by using command decribed below. It is possible to specify command interactively or from a configuration file that describing a stream of commands(like a script). Starting pimnbr is as follows:

## Running:

To run pimnbr, you must be a 'root'. Starting pimnbr is as follows:

  pimnbr [-f <config_file>]

  -f <config_file> : Specifies configuration file. By default, pimnbr run in interaction mode.

## Command:

### rpset-list

Specifies RP-Set information.

  rpset-list <list_id> group <group>/<masklen> rp <rp_addr> <holdtime> <priority>

  <list_id> : Specifies list ID.
  group <group_addr>/<mask> : Specifies group informations.
  rp <rp_addr> <holdtime> <priority>: Specifies RP's informations.

If same list ID is already specified beforehand, the content is appended the existing list.

### bsr-list

Specifies Bootstrap message.

  bsr-list <list_id> addr <addr> priority <priority>
  bsr-list <list_id> rpset <rpset-list>

  <list_id> : Specifies list ID.
  addr <addr>: Specifies BSR's address.
  priority <priority>: Specifies BSR's priority.
  rpset <rpset-list>: Specifies RP-Set information that is carried by Bootstrap message.

### crp-list

Specifies C-RP-Adv message.

  crp-list <list_id> addr <rp_addr> holdtime <holdtime> priority <priority>
  crp-list <list_id> group <group>/<masklen>

  <list_id>: Specifies list ID.
  addr <rp_addr>: Specifies C-RP's address.
  holdtime <holdtime>: Specifies C-RP's holdtime.
  priority <priority>: Specifies C-RP's priority.
  group <group>/<masklen>: Specifies group address.

### jp-list

Specifies Join-Prune message.

  jp-list <number> upnbr <nbr_addr> holdtime <holdtime>
  jp-list <number> group <group>/<masklen> join <src>/<masklen> [S] [RP] [WC]
  jp-list <number> group <group>/<masklen> prune <src>/<masklen> [S] [RP] [WC]

  <list_id>: Specifies list ID.
  upnbr <nbr_addr>: Specifies Upstream router's address.
  holdtime <holdtime>: Specifies holdtime.
  group <group>/<masklen>: Specifies group address.
  join <src>/<masklen>: Specifies join source address.
  prune <src>/<masklen>: Specifies prune source address.
  S RP WC: Set S-bit, RP-bit, W-bit.

### router-list

Configure PIM Router.

  router-list <list_id> addr <addr>
  router-list <list_id> bsr [priority <priority>] [period <period>]
  router-list <list_id> rpset-list <rpset-list>
  router-list <list_id> crp [priority <priority>] [holdtime <holdtime>]
  router-list <list_id> crp-group <crp-list>
  router-list <list_id> hello-option <type> <len> <val>
  router-list <list_id> hello-interval <time>
  router-list <list_id> tracefile <file>

  <list_id> : Specifies list ID
  addr <addr> : Specifies PIM Router's Address
  bsr [priority <priority>] [period <period>]: Specifies behavier as BSR. Default priority 1. period is interval of Bootstrap messages(Default 60s).
  rpset-list <bsr-list>: Specifies RP-set information included advertising Bootstrap messages.
  crp [priority <priority>] [period <period>]: Specifies behavior as CRP. Default priority xx. period is interval of C-RP-Adv messages(Default 60s).
  crp-group <crp-list>: Specifies group information included advertising C-RP-Adv messages.
  hello-option <type> <len> <val>: Specifies Hello option.
  hello-interval <time>: Specifies interval of Hello messages.
  tracefile <file> : Specifies the output file for trace information of the exchanged packets.

### config-file

Specifies a configuration file. You can write part of the configuration in a different file and include it by this command.

  config-file <file>

### hello

Sending/receiving Hello message.

  hello send <interface> [ src <addr> ] [ dst <addr> ] [ hello-option <type> <len> <val>]
  hello recv <interface> timeout <time>

  <interface> : Specifies interface name to send/receive Hello.
  src <addr>: Specifies source address of PIM packet. By default, outgoing interface's address.
  dst <addr>: Specifies destination address of PIM packet.Defaultis 224.0.0.13.
  hello-option <type> <len> <val>: Specifies Hello option.
  timeout <time>: Specifies waiting time until receive Hello.

### register

Sending/receiving Register-Stop message.

  register send <interface> [ src <addr> ] dst <addr> [encapip <src> <dst>] [NB]
  register recv <interface> timeout <time>

  <interface> : Specifies interface name to send/receive Register.
  src <addr>: Specifies source address of PIM packet. By default, outgoing interface's address.
  dst <addr>: Specifies destination address of PIM packet.
  encapip <src> <dst>: Specifies encapsulation IP carried by Register message. If omit, send Null Register message.
  NB: Specifies N-bit, B-bit.
  timeout <time>: Specifies waiting time until receive Register.

### register-stop

Sending/receiving Register-stop message.

  register-stop send <interface> [ src <addr> ] dst <addr> entry <src>/<masklen> <group>/<masklen>
  register-stop recv <interface> timeout <time>

  <interface> : Specifies interface name to send/receive Register-Stop.
  src <addr>: Specifies source address of PIM packet. By default, outgoing interface's address.
  dst <addr>: Specifies destination address of PIM packet.
  entry <src>/<masklen> <group>/<masklen>: Specifies (S,G) entry .
  timeout <time>: Specifies waiting time until receive Register-stop.

### join-prune

Sending/receiving Join/Prune message.

  join-prune send <interface> [ src <addr> ] [dst <addr>] jp-list <jp-list>
  join-prune recv <interface> timeout <time>

  <interface> : Specifies interface name to send/receive Join/Prune.
  src <addr>: Specifies source address of PIM packet. By default, outgoing interface's address.
  dst <addr>: Specifies destination address of PIM packet. By default,224.0.0.13.
  jp-list <jp-list>: Specifies join-prune list.
  timeout <time>: Specifies waiting time until receive Join/Prune.

    	ex.
    	  jp-list 10 upnbr 192.168.20.3 holdtime 100
    	  jp-list 10 group 224.1.1.1/32 join 192.168.10.10 S RP
    	  jp-list 10 group 224.1.1.1/32 join 192.168.1.1 S RP
    	  join-prune send le0 jp-list 10

### bootstrap

Sending/receiving Bootstrap message.

  bootstrap send <interface> [ src <addr> ] dst <addr> bsr-list <bsr-list>
  bootstrap recv <interface> timeout <time>

  <interface> : Specifies interface name to send/receive Bootstrap.
  src <addr>: Specifies source address of PIM packet. By default, outgoing interface's address.
  dst <addr>: Specifies destination address of PIM packet.
  bsr-list <bsr-list>: Specifies bsr-list.
  timeout <time>: Specifies waiting time until receive Bootstrap.

    	ex.
    	  rpset-list 20 group 224.2.2.2/32 addr 192.168.100.1 100 10
    	  rpset-list 20 group 224.1.1.1/32 addr 192.168.100.1 100 10
    	  bsr-list 10 addr 192.168.50.5 priority 3
    	  bsr-list 10 rpset 20
    	  bootstrap send le0 bsr-list 10

### assert

Sending/receiving Assert message.

  assert send <interface> [ src <addr> ] [dst <addr>] [RP] pref <preference> metric <metric> entry <src>/<masklen> <group>/<masklen>
  assert recv <interface> timeout <time>

  <interface> : Specifies interface name to send/receive Assert.
  src <addr>: Specifies source address of PIM packet. By default, outgoing interface's address.
  dst <addr>: Specifies destination address of PIM packet. By default,224.0.0.13.
  RP: Set RPT-bit.
  preference <preference>: Specifies preference.
  metric <metric>: Specifies metric.
  entry <src>/<masklen> <group>/<masklen>: Specifies (S,G) entry.
  timeout <time>: Specifies waiting time until receive Assert.

### graft/gack

Sending/receiving Graft/Graft-Ack message.

  graft|gack send <interface> [ src <addr> ] [dst <addr>] jp-list <jp-list>
  graft|gack recv <interface> timeout <time>

  <interface> : Specifies interface name to send/receive Graft/Graft Ack.
  src <src>: Specifies source address of PIM packet. By default, sending interface's address.
  dst <dst>: Specifies destination address of PIM packet. By default,224.0.0.13.
  jp-list <jp-list>: join-prune list.
  timeout <time>: Specifies waiting time until receive Graft/Graft Ack.

### crpadv

Sending/receiving C-RP Adv message.

  crpadv send <interface> [ src <addr> ] dst <addr> crp-list <crp-list>
  crpadv recv <interface> timeout <time>

  <interface> : Specifies interface name to send/receive C-RP Adv.
  src <addr>: Specifies source address of PIM packet. By default, outgoing interface's address.
  dst <addr>: Specifies destination address of PIM packet.
  crp-list <crp-list>: Specifies crp-list.
  timeout <time>: Specifies waiting time until receive Bootstrap.

    	ex.
    	  crp-list 1 addr 192.168.30.3 holdtime 100 priority 10
    	  crp-list 1 addr group 224.10.10.10/32
    	  crp-list 1 addr group 224.10.1.1/32
    	  crpadv send le0 dst 192.168.10.1 crp-list 1

### router

Specifies behavior of PIM Router.

  router up | down <router-list>
  router adv | no-adv <router-list> bootstrap <bsr-list> [period <period> ]
  router adv | no-adv <router-list> crpadv <crp-list> [period <period> ]
  router adv | no-adv <router-list> join-prune <jp-list> [period <period> ]

  <router-list> : Specifies the router-list ID.
  up | down: bring up/down.
  adv | no-adv: start advertising or stop advertising.
  bootstrap <bsr-list>: Specifies advertised Bootstrap message
  crpadv <crpadv-list>: Specifies advertised C-RP-Adv message.
  join-prune <jp-list>: Specifies advertised Join/Prune message.
  period <period>: Specifies interval of each messages. If not specify, each messages only sent once.

### dump

Dump specified router's information.

  dump <router-list> <file-name>

### debug/nodebug

Control output trace information to terminal.

  debug [detail] [tty <tty_name>]
  nodebug

  debug : Enable output trace information(src/dest address and type of sending or receiving PIM packet).
  nodebug: Disable output trace information.
  detail : If specifies, output content of each packet.
  tty <tty_name>: Specifies output terminal. Default is current terminal.

### wait

Specifies wait time(sec) until execute next command.

  wait <time>

### quit

Stop the evaluation of this script.

  quit

## Example

             D           C           B
             |  +----+   |           |   +----+  |
             +--+ R2 +---+           +---+*R3*+--+ A
             |  +----+   |   +----+  |   +----+  |
                         +---+ R1 +--+
                         |   +----+  |

              B: 192.168.3.0/24
              C: 192.168.11.0/24

              BSR,RP: R2 (192.168.11.1)
              Test Target: R3

     # PIM-SM Test
     #
     # Definition of RP-set information
     rpset-list 20 group 224.0.0.0/8 rp 192.168.11.1 2
     # Definition of Bootstrap message
     bsr-list 5 addr 192.168.11.1 priority 10
     bsr-list 5 addr rpset 20
     # Definition of PIM Neighbor (as R1)
     router-list 1 addr 192.168.3.3
     #
     # Start of Test
     #
     router up 1
     wait 30
     # Advertising Bootsrap message
     router adv 1 bootstrap 5 period 60
     wait 180
     router down 1
     quit