ONE/BI and VAT Guide

From fd.io
< ONE
Jump to: navigation, search

Introduction

The vpp contain a set of commands to set and debug LISP. One way to access the VAT (with proper permissions) is to use the vpp_api_test command:

sudo vpp_api_test

Binary API =

A Lisp API message is defined in the file .../vpp/vpp/api/vpp.api.

Lisp enable

The following is the VPP API message definition for enable/disable Lisp.

/** \brief enable or disable LISP feature
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param is_en - enable protocol if non-zero, else disable
*/
define lisp_enable_disable {
    u32 client_index;
    u32 context;
    u8  is_en;
};

/** \brief Reply for lisp enable/disable
    @param context - returned sender context, to match reply w/ request
    @param retval - return code
*/
define lisp_enable_disable_reply {
    u32 context;
    i32 retval;
};

The following is the VPP API message definition for show Lisp status.

/** \brief Request for lisp-gpe protocol status
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
*/
define show_lisp_status{
    u32 client_index;
    u32 context;
};

/** \brief Status of lisp, enable or disable
    @param context - sender context, to match reply w/ request
    @param feature_status - lisp enable if non-zero, else disable
    @param gpe_status - lisp enable if non-zero, else disable
*/
define show_lisp_status_reply{
    u32 context;
    i32 retval;
    u8 feature_status;
    u8 gpe_status;
};

Locator_set and Locator

The following is the VPP API message definition for creating and deleting Lisp locator_set and Lisp locator.

/** \brief add or delete locator_set
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param is_add - add address if non-zero, else delete
    @param locator_set_name - locator name
    @param locator_num - number of locators
    @param locators - Lisp locator data
*/
define lisp_add_del_locator_set {
    u32 client_index;
    u32 context;
    u8  is_add;
    u8  locator_set_name[64];
    u32 locator_num;
    u8  locators[locator_num];
};

/** \brief Reply for locator_set add/del
    @param context - returned sender context, to match reply w/ request
    @param retval - return code
*/
define lisp_add_del_locator_set_reply {
    u32 context;
    i32 retval;
};


/** \brief add or delete locator for locator_set
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param is_add - add address if non-zero, else delete
    @param locator_set_name - name of locator_set to add/del locator
    @param sw_if_index - index of the interface
    @param priority - priority of the lisp locator
    @param weight - weight of the lisp locator
*/
define lisp_add_del_locator {
    u32 client_index;
    u32 context;
    u8  is_add;
    u8  locator_set_name[64];
    u32 sw_if_index;
    u8  priority;
    u8  weight;
};

/** \brief Reply for locator add/del
    @param context - returned sender context, to match reply w/ request
    @param retval - return code
*/
define lisp_add_del_locator_reply {
    u32 context;
    i32 retval;
};

The following is the VPP API message definition for show locator_set and locator.


/** \brief Request for map lisp locator status
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param locator_set_index - index of locator_set
    @param filter - filter type;
      Support value:
        0: all locator
        1: local locator
        2: remote locator
 */
define lisp_locator_dump {
    u32 client_index;
    u32 context;
    u32 locator_set_index;
    u8  filter;
};

/** \brief LISP locator_set status
    @param local - if is set, then locator is local
    @param locator_set_name - name of the locator_set
    @param sw_if_index - sw_if_index of the locator
    @param priority - locator priority
    @param weight - locator weight
  */
define lisp_locator_details {
    u32 context;
    u8  local;
    u32 sw_if_index;
    u8  is_ipv6;
    u8  ip_address[16];
    u8  priority;
    u8  weight;
};

/** \brief LISP locator_set status
    @param locator_set_name - name of the locator_set
    @param local - if is set, then locator_set is local
    @param locator_count - number of locator this stats block includes
    @param locator - locator data
 */
define lisp_locator_set_details {
    u32 context;
    u8  local;
    u32 locator_set_index;
    u8  locator_set_name[64];
};

/** \brief Request for locator_set summary status
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param filter - filter type;
      Support value:
        0: all locator_set
        1: local locator_set
        2: remote locator_set
 */
define lisp_locator_set_dump {
    u32 client_index;
    u32 context;
    u8  filter;
};

Eid

The following is the VPP API message definition for creating and deleting Lisp eid address.

/** \brief add or delete lisp eid-table
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param is_add - add address if non-zero, else delete
    @param is_ipv6 - if non-zero the address is ipv6, else ipv4
    @param ip_address - array of address bytes
    @param prefix_len - prefix len
    @param locator_set_name - name of locator_set to add/del eid-table
    @param vni - virtual network instance
*/
define lisp_add_del_local_eid {
    u32 client_index;
    u32 context;
    u8  is_add;
    u8  is_ipv6;
    u8  ip_address[16];
    u8  prefix_len;
    u8  locator_set_name[64];
    u32 vni;
};

/** \brief Reply for local_eid add/del
    @param context - returned sender context, to match reply w/ request
    @param retval - return code
*/
define lisp_add_del_local_eid_reply {
    u32 context;
    i32 retval;
};

The following is the VPP API message definition for show eid table.

/** \brief Dump lisp eid-table
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param locator_set_index - index of locator_set
    @param is_local - local if non-zero, else remote
    @param eid_type:
      0 : ipv4
      1 : ipv6
      2 : mac
    @param eid - EID can be ip4, ip6 or mac
    @param prefix_len - prefix len
    @param vni - virtual network instance
    @param ttl - time to live
    @param authoritative - authoritative
 */
define lisp_eid_table_details {
    u32 context;
    u32 locator_set_index;
    u8  is_local;
    u8  eid_type;
    u32 vni;
    u8  eid[16];
    u8  eid_prefix_len;
    u32 ttl;
    u8  authoritative;
};

/** \brief Request for local eid table summary status
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param eid_set - if non-zero request info about specific mapping
    @param vni - virtual network instance; valid only if eid_set != 0
    @param prefix_length - prefix length if EID is IP address;
      valid only if eid_set != 0
    @param eid_type - EID type; valid only if eid_set != 0
      Supported values:
        0: EID is IPv4
        1: EID is IPv6
        2: EID is ethernet address
    @param eid - endpoint identifier
    @param filter - filter type;
      Support values:
        0: all eid
        1: local eid
        2: remote eid
 */
define lisp_eid_table_dump {
    u32 client_index;
    u32 context;
    u8  eid_set;
    u8  prefix_length;
    u32 vni;
    u8  eid_type;
    u8  eid[16];
    u8  filter;
};

Map resolver

The following is the VPP API message definition for creating and deleting map resolver ip address.

/** \brief add or delete map-resolver
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param is_add - add address if non-zero, else delete
    @param is_ipv6 - if non-zero the address is ipv6, else ipv4
    @param ip_address - array of address bytes
*/
define lisp_add_del_map_resolver {
    u32 client_index;
    u32 context;
    u8  is_add;
    u8  is_ipv6;
    u8  ip_address[16];
};

/** \brief Reply for map_resolver add/del
    @param context - returned sender context, to match reply w/ request
    @param retval - return code
*/
define lisp_add_del_map_resolver_reply {
    u32 context;
    i32 retval;
};

The following is the VPP API message definition for show map resolver ip address.

/** \brief LISP map resolver status
    @param locator_set_name - name of the locator_set
    @param is_ipv6 - if non-zero the address is ipv6, else ipv4
    @param ip_address - array of address bytes
 */
define lisp_map_resolver_details {
    u32 context;
    u8  is_ipv6;
    u8  ip_address[16];
};

/** \brief Request for map resolver summary status
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
 */
define lisp_map_resolver_dump {
    u32 client_index;
    u32 context;
};

Remote Mapping

The following is the VPP API message definition for creating and deleting remote mapping.

/** \brief add or delete remote static mapping
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param is_add - add address if non-zero, else delete
    @param vni - virtual network instance
    @param action - negative map-reply action
    @param eid_is_ip4 - ipv4/6 of source and destination EIDs
    @param deid - destination EID
    @param seid - source EID
    @param rloc_num - number of remote locators
    @param rlocs - remote locator data
*/
define lisp_add_del_remote_mapping {
    u32 client_index;
    u32 context;
    u8  is_add;
    u32 vni;
    u8 action;
    u8 eid_is_ip4;
    u8 deid[16];
    u8 seid[16];
    u8 deid_len;
    u8 seid_len;
    u32 rloc_num;
    u8 rlocs[0];
};

/** \brief Reply for lisp_add_del_remote_mapping
    @param context - returned sender context, to match reply w/ request
    @param retval - return code
*/

define lisp_add_del_remote_mapping_reply {
    u32 context;
    i32 retval;
};

Pitr

The following is the VPP API message definition for enable/disable pitr.

/** \brief configure or disable LISP PITR node
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param ls_name - locator set name
    @param is_add - add locator set if non-zero, else disable pitr
*/
define lisp_pitr_set_locator_set {
    u32 client_index;
    u32 context;
    u8 is_add;
    u8 ls_name[64];
};

/** \brief Reply for lisp_pitr_set_locator_set
    @param context - returned sender context, to match reply w/ request
    @param retval - return code
*/
define lisp_pitr_set_locator_set_reply {
    u32 context;
    i32 retval;
};

Adjacency

The following is the VPP API message definition for creating and deleting adjacency.


/** \brief add or delete LISP adjacency adjacency
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param is_add - add address if non-zero, else delete
    @param vni - virtual network instance
    @param eid_type -
      0 : ipv4
      1 : ipv6
      2 : mac
    @param deid - destination EID
    @param seid - source EID
*/
define lisp_add_del_adjacency {
    u32 client_index;
    u32 context;
    u8  is_add;
    u32 vni;
    u8 eid_type;
    u8 deid[16];
    u8 seid[16];
    u8 deid_len;
    u8 seid_len;
};

/** \brief Reply for lisp_add_del_adjacency
    @param context - returned sender context, to match reply w/ request
    @param retval - return code
*/
define lisp_add_del_adjacency_reply {
    u32 context;
    i32 retval;
};

LISP commands

Lisp enable

To enable lisp, use "lisp_enable_disable":

vat# lisp_enable_disable enable

To disable lisp.

vat# lisp_enable_disable disable

To display lisp status

vat# show_lisp_status
lisp status         locator-set     
feature: enabled
gpe: enabled

Locator_set

To add new locator_set, use "lisp_add_del_locator_set". This command also "reset" exist locator_set in vpp:

vat# lisp_add_del_locator_set locator-set ls1

To delete a specific locator_set, use "lisp_add_del_locator_set locator-set <name> del":

vat# lisp_add_del_locator_set locator-set ls1 del

When delete locator_set, then also delete all locator which are assigned to locator_set

To add new locator to locator_set, use "lisp_add_del_locator":

vat# lisp_add_del_locator locator-set  ls1 iface GigabitEthernet0/a/0 p 1 w 2

Where p is priority and w is weight.

Locator API also support sw_if_index instead of interface name:

lisp_add_del_locator locator-set  ls1 sw_if_index 6 p 1 w 2

To delete specific locator, use "lisp_add_del_locator locator-set <name> iface <interface> p <priority> w <weight> del"

vat# lisp_add_del_locator locator-set  ls1 iface GigabitEthernet0/a/0 p 1 w 2 del

To display locator_set and locator:

vat# lisp_locator_set_dump
     locator-set    locator-set-inde     locator        priority         weight     
         ls1                0               2               1               2       
       remote-1             1           6.0.3.20            1               1  


Eid

To add new Eid address, use "lisp_add_del_local_eid"

vat# lisp_add_del_local_eid eid 6:0:1::0/64 locator-set ls1

There must exist locator_set, before add new eid address.

To delete specific eid address, use "isp_add_del_local_eid eid <address>/<prefix> locator-set <name>"

vat# lisp_add_del_local_eid eid 6:0:1::0/64 locator-set ls1 del

To display Eid table:

vat# lisp_eid_table_dump
EID                                type                locators                      ttl                 authoritative
[0] 6.0.1.0/24                     local(ls1)          2                             0                   0
[0] 6.0.2.0/24                     remote              6.0.3.20                      1440                1

Map resolver

To add new map resolver, use "lisp_add_del_map_resolver"

vat# lisp_add_del_map_resolver 6:0:3::100

To delete specific map resolver, use "lisp_add_del_map_resolver <ip address> del"

vat# lisp_add_del_map_resolver 6:0:3::100 del

To display map resolver:

vat# lisp_map_resolver_dump
    Map resolver    
     6:0:3::100

Remote Mapping

To add new remote mapping, use "lisp_add_del_remote_mapping"

vat# lisp_add_del_remote_mapping add vni 0 deid 6.0.2.0/24 seid 6.0.1.0/24 rloc 6.0.3.2

To delete specific remote mapping, use "lisp_add_del_remote_mapping del vni <vni> deid <ip prefix> seid <ip prefix> rloc <ip address>"

lisp_add_del_remote_mapping del vni 0 deid 6.0.2.0/24 seid 6.0.1.0/24 rloc 6.0.3.2

To display remote mapping use:

vat# lisp_locator_set_dump
     locator-set    locator-set-inde     locator        priority         weight     
         ls1                0               2               1               2       
       remote-1             1           6.0.3.20            1               1  

Proxy-ITR

To add new proxy-itr, use "lisp_pitr_set_locator_set"

vat# lisp_pitr_set_locator_set 6:0:3::100