Switch L3 Forwarding (routing)

1. L3 Introduction

Routing can be used for connectivity between IP nodes in different subnets.

The VelocitySP routing solution is based on VLANs as shown in the example below.

  • Host H1 is connected to VLAN 1.

  • Router R1 is connected to VLAN 1 and VLAN 2.

  • Router R2 is connected to VLAN 2 and has access to multiple remote networks.

+----+ 1.0.0.2/8  1.0.0.1/8 +----+ 2.0.0.1/8   2.0.0.2/8 +----+
|    |                      |    |                       |    |     4.4.0.0/16
| H1 +--------VID 1---------+ R1 +---------VID 2---------+ R2 |---> 3.3.0.0/16
|    |                      |    |                       |    |     0.0.0.0/0
+----+                      +----+                       +----+

Router R1 is described in the following examples.

2. L3 Interface Configuration

The L3 interfaces of R1 are configured as shown below:

  • VLAN 1: IP address 1.0.0.1/8.

  • VLAN 2: IP address 2.0.0.1/8.

IPATCH request message:

- ? "/ietf-interfaces:interfaces/interface"
  : name: L3V1
    type: iana-if-type:l3ipvlan


- ? "/ietf-interfaces:interfaces/interface[name='L3V1']/ietf-ip:ipv4/address"
  : ip: 1.0.0.1
    prefix-length: 8


- ? "/ietf-interfaces:interfaces/interface[name='L3V1']/ietf-ip:ipv4/\
     forwarding"
  : true


- ? "/ietf-interfaces:interfaces/interface"
  : name: L3V2
    type: iana-if-type:l3ipvlan


- ? "/ietf-interfaces:interfaces/interface[name='L3V2']/ietf-ip:ipv4/address"
  : ip: 2.0.0.1
    prefix-length: 8


- ? "/ietf-interfaces:interfaces/interface[name='L3V2']/ietf-ip:ipv4/\
     forwarding"
  : true

3. Static Route Configuration

Static routes live under a control-plane-protocol instance of type static. Per RFC 8349 (§5.3.1) this instance is user-managed configuration ("It MAY be configured in zero or multiple instances") and is not created implicitly by the system. The initial routing table is therefore set with a single request that creates the instance together with its routes — the same form used when the running configuration is applied at boot.

The static routes of R1 are configured as shown below:

  • Network 4.4.0.0/16 via 2.0.0.2.

  • Network 3.3.0.0/16 via 2.0.0.2.

  • Network 0.0.0.0/0 via 2.0.0.2 (default route).

IPATCH request message:

- ? "/ietf-routing:routing/control-plane-protocols/control-plane-protocol"
  : type: ietf-routing:static
    name: '0'
    static-routes:
      ietf-ipv4-unicast-routing:ipv4:
        route:
        - destination-prefix: 4.4.0.0/16
          next-hop:
            next-hop-address: 2.0.0.2
        - destination-prefix: 3.3.0.0/16
          next-hop:
            next-hop-address: 2.0.0.2
        - destination-prefix: 0.0.0.0/0
          next-hop:
            next-hop-address: 2.0.0.2

4. Adding a Static Route

Once the instance exists, an individual route can be added (or changed) by addressing the route list directly, without resending the whole table:

  • Network 5.5.0.0/16 via 2.0.0.2.

IPATCH request message:

- ? "/ietf-routing:routing/control-plane-protocols/\
     control-plane-protocol[type='ietf-routing:static'][name='0']/\
     static-routes/ietf-ipv4-unicast-routing:ipv4/route"
  : destination-prefix: 5.5.0.0/16
    next-hop:
      next-hop-address: 2.0.0.2

5. Routing Table

The routing table of R1 is retrieved as shown below.

It includes local routes based on L3 interface configuration and remote routes based on static route configuration:

  • Net 0.0.0.0/0, static/remote route via 2.0.0.2.

  • Net 1.0.0.0/8, direct/local route via VLAN 1.

  • Net 2.0.0.0/8, direct/local route via VLAN 2.

  • Net 3.3.0.0/16, static/remote route via 2.0.0.2.

  • Net 4.4.0.0/16, static/remote route via 2.0.0.2.

FETCH request message:

- "/ietf-routing:routing/ribs/rib[name='ipv4']/routes/route"

FETCH response message:

- ? "/ietf-routing:routing/ribs/rib/routes/route"
  : - next-hop:
        outgoing-interface: L3V2
        ietf-ipv4-unicast-routing:next-hop-address: 2.0.0.2
      source-protocol: ietf-routing:static
      active:
      -
      ietf-ipv4-unicast-routing:destination-prefix: 0.0.0.0/0
    - next-hop:
        outgoing-interface: L3V1
        ietf-ipv4-unicast-routing:next-hop-address: 0.0.0.0
      source-protocol: ietf-routing:direct
      active:
      -
      ietf-ipv4-unicast-routing:destination-prefix: 1.0.0.0/8
    - next-hop:
        outgoing-interface: L3V2
        ietf-ipv4-unicast-routing:next-hop-address: 0.0.0.0
      source-protocol: ietf-routing:direct
      active:
      -
      ietf-ipv4-unicast-routing:destination-prefix: 2.0.0.0/8
    - next-hop:
        outgoing-interface: L3V2
        ietf-ipv4-unicast-routing:next-hop-address: 2.0.0.2
      source-protocol: ietf-routing:static
      active:
      -
      ietf-ipv4-unicast-routing:destination-prefix: 3.3.0.0/16
    - next-hop:
        outgoing-interface: L3V2
        ietf-ipv4-unicast-routing:next-hop-address: 2.0.0.2
      source-protocol: ietf-routing:static
      active:
      -
      ietf-ipv4-unicast-routing:destination-prefix: 4.4.0.0/16

6. ARP Table

The ARP table of R1 is retrieved for each L3 interface as shown below:

  • VLAN1: IP address 1.0.0.2 via MAC address 00-00-00-00-00-12.

  • VLAN2: IP address 2.0.0.2 via MAC address 00-00-00-00-00-22.

FETCH request message:

- "/ietf-interfaces:interfaces/interface[name='L3V1']/ietf-ip:ipv4/neighbor"

- "/ietf-interfaces:interfaces/interface[name='L3V2']/ietf-ip:ipv4/neighbor"

FETCH response message:

- ? "/ietf-interfaces:interfaces/interface/ietf-ip:ipv4/neighbor"
  : - ip: 1.0.0.2
      link-layer-address: 00-00-00-00-00-12


- ? "/ietf-interfaces:interfaces/interface/ietf-ip:ipv4/neighbor"
  : - ip: 2.0.0.2
      link-layer-address: 00-00-00-00-00-22

7. L3 Interface Counters

The L3 interface counters of R1 are retrieved as shown below.

In this example, 10 frames have been routed from VLAN 1 to VLAN 2.

FETCH request message:

- "/ietf-interfaces:interfaces/interface[name='L3V1']/ietf-ip:ipv4/\
   mchp-velocitysp-ip:statistics"

- "/ietf-interfaces:interfaces/interface[name='L3V2']/ietf-ip:ipv4/\
   mchp-velocitysp-ip:statistics"

FETCH response message:

- ? "/ietf-interfaces:interfaces/interface/ietf-ip:ipv4/\
     mchp-velocitysp-ip:statistics"
  : rx-total: '10'
    rx-octets: '460'
    rx-hdr-errors: '0'
    rx-addr-errors: '0'
    rx-forwards: '10'
    rx-no-routes: '0'
    rx-unknown-protos: '0'
    rx-delivers: '0'
    tx-requests: '0'
    tx-forwards: '0'
    tx-total: '0'
    tx-octets: '0'


- ? "/ietf-interfaces:interfaces/interface/ietf-ip:ipv4/\
     mchp-velocitysp-ip:statistics"
  : rx-total: '0'
    rx-octets: '0'
    rx-hdr-errors: '0'
    rx-addr-errors: '0'
    rx-forwards: '0'
    rx-no-routes: '0'
    rx-unknown-protos: '0'
    rx-delivers: '0'
    tx-requests: '0'
    tx-forwards: '10'
    tx-total: '10'
    tx-octets: '460'