LAN9645x FRER Configuration

1. Stream Identification

Stream Identification configuration uses the vcap tool which is described on the VCAP Tool page.

The stream identification can match on every field that is supported by IS1 but in the following examples, we will identify a stream by DMAC and VLAN. This is what is called a Null Stream identification in 802.1CB.

We will also need to match on the ingress port because we need to hit a specific ingress flow for each ingress port.

The default port key configuration in IS1 uses different keysets for different frametypes. We can change the configuration to minimize the number of required VCAP rules to match all traffic. Moreover, this can ensure we use keys which are no larger than necessary. See page Classification (IS0/IS1) for more information.

As we only need to match on DMAC, VLAN, and port we can use a shorter key called 'S1_DMAC_VID' which is of type X1 and only occupies 1 subword. This saves space in the VCAP that can be used for other purposes.

To change the IS1 VCAP port keyset configuration for port 2 and lookup 1:

# symreg_lan9645x ANA_VCAP_S1_CFG[2,1].KEY_OTHER_CFG 3
# symreg_lan9645x ANA_VCAP_S1_CFG[2,1].KEY_IP4_CFG 4
# symreg_lan9645x ANA_VCAP_S1_CFG[2,1].KEY_IP6_CFG 6

It is also possible to give a range of ports. To change it for ports 0,1 and 2:

# symreg_lan9645x ANA_VCAP_S1_CFG[0-2,1].KEY_OTHER_CFG 3
# symreg_lan9645x ANA_VCAP_S1_CFG[0-2,1].KEY_IP4_CFG 4
# symreg_lan9645x ANA_VCAP_S1_CFG[0-2,1].KEY_IP6_CFG 6

The field KEY_OTHER_CFG uses S1_NORMAL by default and the encoding is:

0: Use key S1_NORMAL
1: Use key S1_7TUPLE
2: Use key S1_DBL_VID
3: Use key S1_DMAC_VID

The field KEY_IP4_CFG uses S1_5TUPLE_IP4 by default and the encoding is:

0: Use key S1_NORMAL
1: Use key S1_7TUPLE
2: Use key S1_5TUPLE_IP4
3: Use key S1_DBL_VID
4: Use key S1_DMAC_VID

The field KEY_IP6_CFG uses S1_5TUPLE_IP6 by default and the encoding is:

0: Use key S1_NORMAL
1: Use key S1_7TUPLE
2: Use key S1_5TUPLE_IP4
3: Use key S1_NORMAL_IP6
4: Use key S1_5TUPLE_IP6
5: Use key S1_DBL_VID
6: Use key S1_DMAC_VID


The stream identification configuration depends on where the FRER functionality is located in the network. The correct ports and lookups must be configured.


An example is switch S1 in the illustration above, where the stream transmitter, host A, has no FRER and VLAN functionality.

Switch S1 must identify the stream by the ingress port lan0 and DMAC 00:00:00:dd:dd:dd and classify the stream to VLAN 10 and to ISDX 1. We will want to match only on frames that do NOT contain R-tag and C-tag. To configure such a rule in lookup 1:

# vcap add 101 is1 10 1 VCAP_KFS_DMAC_VID\
    IF_IGR_PORT_MASK 0x1 0x3ff\
    R_TAGGED_IS 0x0 0x1\
    8021Q_VLAN_TAGGED_IS 0x0 0x1\
    L2_DMAC 00:00:00:dd:dd:dd ff:ff:ff:ff:ff:ff\
    VCAP_AFS_S1\
    VID_REPLACE_ENA 0x1\
    VID_VAL 0xa \
    ISDX_REPLACE_ENA 0x1\
    ISDX_ADD_VAL 0x1

ISDX is a number between 1 and 127 that identifies the stream for later use. The maximum number if stream identifications in a switch is therefore 127.


Another example is switch S2, where we will expect that the stream contains both R-tag and C-tag.

Switch S2 must identify the stream by the ingress port lan0, DMAC 00:00:00:dd:dd:dd and VLAN 10 and classify the stream to ISDX 1. We will want to match only on frames that contain R-tag and C-tag. To configure such a rule in lookup 1:

# vcap add 102 is1 10 1\
    VCAP_KFS_DMAC_VID\
    IF_IGR_PORT_MASK 0x1 0x3ff\
    R_TAGGED_IS 0x1 0x1\
    8021Q_VLAN_TAGGED_IS 0x1 0x1\
    8021Q_VID0 0xa 0xfff\
    L2_DMAC 00:00:00:dd:dd:dd ff:ff:ff:ff:ff:ff\
    VCAP_AFS_S1\
    ISDX_REPLACE_ENA 0x1\
    ISDX_ADD_VAL 0x1


To delete the stream identification above:

# vcap del 101
# vcap del 102

2. FRER tool

FRER is not yet supported via standard Linux user commands and therefore a proprietary tool called frer is provided:

$ frer --help
Usage: frer cs|msa|msf|ms|iflow|vlan [options]
options:
 --help                    Show this help text
commands:
cs:   cs cs_id [options]
 --enable:                 Enable recovery
 --alg:                    frerSeqRcvyAlgorithm (0: Vector, 1: Match)
 --hlen:                   frerSeqRcvyHistoryLength
 --reset_time:             frerSeqRcvyResetMSec
 --take_no_seq:            frerSeqRcvyTakeNoSequence
 --cnt:                    Show counters
 --clr:                    Clear counters
 --help:                   Show this help text

msa:   msa dev1 [dev2] [options]
 --help:                   Show this help text

msf:   msf ms_id [options]
 --help:                   Show this help text

ms:   ms dev ms_id [options]
 --enable:                 Enable recovery
 --alg:                    frerSeqRcvyAlgorithm (0: Vector, 1: Match)
 --hlen:                   frerSeqRcvyHistoryLength
 --reset_time:             frerSeqRcvyResetMSec
 --take_no_seq:            frerSeqRcvyTakeNoSequence
 --cs_id:                  Compound stream ID
 --cnt:                    Show counters
 --clr:                    Clear counters
 --help:                   Show this help text

iflow:   iflow id [options]
 --ms_enable:              Enable member stream
 --ms_id:                  Allocated member stream ID
 --generation:             Enable sequence generation
 --pop:                    Enable popping of R-tag
 --dev1:                   Split device 1 or '-'
 --dev2:                   Split device 2 or '-'
 --help:                   Show this help text

vlan:   vlan vid [options]
 --flood_disable:          Disable flooding in VLAN
 --learn_disable:          Disable learning in VLAN
 --help:                   Show this help text

All frerSeqRcvXXXX parameters are defined and explained in IEEE 802.1CB-2017.


2.1. Compound Stream

The frer cs command is used to configure a compound stream which is needed when you want to merge several member streams into one compound stream.

This is needed in switch S2, S3, and S4.

A compound stream is identified by a cs_id which is a number between 0 and 255.

See the FRER examples below on how to configure each switch.

To show compound stream 3 configuration:

# frer cs 3
enable:               1
alg:                  0
hlen:                 4
reset_time:        1000
take_no_seq:          0

Sequence recovery is enabled using Vector algorithm (alg = 0) with history length 4, ResetMSec is 1000 mS and TakeNoSequence is disabled.

To show compound stream 3 counters:

# frer cs 3 --cnt
OutOfOrderPackets :                0
RoguePackets      :                0
PassedPackets     :                0
DiscardedPackets  :                0
LostPackets       :                0
TaglessPackets    :                0
Resets            :                0

To clear compound stream 3 counters:

# frer cs 3 --clr


2.2. Member Stream

You will need a member stream if you want to enable individual recovery on a single stream and/or associate the stream with a compound stream in order to merge this stream with other streams.

A member stream is needed for each combination of ingress port/egress port. The ingress port is indirectly given via the ISDX.

This is needed in switch S2, S3, and S4.

See the FRER examples below on how to configure each switch.

A member stream is identified by a number returned by the 'frer msa' command (Member Stream Allocate). To allocate a member stream id for lan1:

$ frer msa lan1
0

This command returns the allocated member stream id associated with lan1.

In case you will want to split a single stream into two egress ports, you must allocate the two ports together as they will need to be associated with the same ISDX:

$ frer msa lan1 lan2
0

This command returns the allocated common member stream id associated with lan1 and lan2.

To show member stream 0 configuration associated with lan1:

$ frer ms lan1 0
enable:               1
alg:                  1
hlen:                 2
reset_time:        1000
take_no_seq:          0
cs_id:                3

Individual recovery is enabled using Match algorithm (history length is N/A here), ResetMSec is 1000 mS and TakeNoSequence is disabled. This member stream is associated with compound stream 3.

To show member stream 0 counters associated with lan1:

$ frer ms lan1 0 --cnt
OutOfOrderPackets :                0
RoguePackets      :                0
PassedPackets     :                0
DiscardedPackets  :                0
LostPackets       :                0
TaglessPackets    :                0
Resets            :                0

To clear member stream 0 counters associated with lan1:

$ frer ms lan1 0 --clr

To free member stream 0:

$ frer msf 0 --clr


2.3. Ingress Flow

An ingress flow associates an ISDX with member stream(s), controls generation/removal of R-tag, and splitting of streams.

There are some restrictions on an ingress flow:

If sequence generation is enabled then member stream association and popping of R-tag is not allowed.

See the FRER examples below on how to configure each switch.

The ISDX’s are a shared resource, and must be properly managed. You can allocate and free an ISDX by:

$ frer iflowa
1
$ frer iflowf 1

To show ingress flow for ISDX 1:

$ frer iflow 1
ms_enable:            1
ms_id:                0
generation:           0
pop:                  0
dev1:              lan1
dev2:              lan2

ISDX 1 is associated with member stream id 0 and the stream is split into lan1 and lan2. Neither sequence generation nor popping of R-tag is enabled.


2.4. VLAN Configuration

The VLAN configuration allows you to control flooding and learning per VLAN, which is not possible with the current standard Linux bridge vlan API.

To show VLAN configuration for VLAN 10:

$ frer vlan 10
flood_disable:        1
learn_disable:        1

Both flooding and learning are disabled in VLAN 10.

3. FRER Examples

This section described how to configure switch S1, S2, and S4 in the illustration shown above. Switch S3 operates in a similar way as switch S2.

All examples require some common setup.

Create a VLAN-aware bridge with port lan0, lan1, and lan2:

# ip link add name br0 type bridge
# ip link set br0 type bridge vlan_filtering 1
# ip link set lan0 master br0
# ip link set lan1 master br0
# ip link set lan2 master br0
# ip link set lan0 up
# ip link set lan1 up
# ip link set lan2 up
# ip link set br0 up

Add VLAN 10 to all ports and disable flooding and learning:

# bridge vlan add dev lan0 vid 10
# bridge vlan add dev lan1 vid 10
# bridge vlan add dev lan2 vid 10
# frer vlan 10 --flood_disable 1 --learn_disable 1

Configure the IS1 VCAP to use 'S1_DMAC_VID' keysets in second lookup for ports 0, 1 and 2:

# symreg_lan9645x ANA_VCAP_S1_CFG[0-2,1].KEY_OTHER_CFG 3
# symreg_lan9645x ANA_VCAP_S1_CFG[0-2,1].KEY_IP4_CFG 4
# symreg_lan9645x ANA_VCAP_S1_CFG[0-2,1].KEY_IP6_CFG 6
# symreg_lan9645x ANA_VCAP_S1_CFG[0-2,1].KEY_RT_CFG 7

This is only necessary on ports where we use stream identification.

Now the different switches can be configured.


3.1. Switch S1

Switch S1 must:

  • Identify the untagged stream as stream 0 and associate it with ISDX 1 and VLAN 10

  • Generate a sequence number to insert in an R-tag

  • Split the traffic into two egress ports

  • Add C-tag and R-tag on egress

Note that individual and sequence recovery is not used in this setup.

lan0 is connected to host A.
lan1 is connected to switch S2.
lan2 is connected to switch S3.

Allocate an ISDX to use for the stream. Then create a VCAP rule in lookup 1 with ID=101 and priority 10 for stream identification and VLAN classification:

# ISDX=$(frer iflowa)
# vcap add 101 is1 10 1 VCAP_KFS_DMAC_VID\
    IF_IGR_PORT_MASK 0x1 0x3ff\
    R_TAGGED_IS 0x0 0x1\
    8021Q_VLAN_TAGGED_IS 0x0 0x1\
    L2_DMAC 00:00:00:dd:dd:dd ff:ff:ff:ff:ff:ff\
    VCAP_AFS_S1\
    VID_REPLACE_ENA 0x1\
    VID_VAL 0xa \
    ISDX_REPLACE_ENA 0x1\
    ISDX_ADD_VAL $ISDX

Parameters:

  • VCAP_KFS_DMAC_VID - IS1 key

    • LOOKUP 0x01 0xff - Second lookup

    • IF_IGR_PORT_MASK 0x001 0x3ff - Match on lan0 (port 0)

    • R_TAGGED 0 - Frame must be without an R-tag

    • 8021Q_VLAN_TAGGED_IS 0x0 0x1 - Frame must be without a C-tag

    • L2_DMAC 00:00:00:dd:dd:dd ff:ff:ff:ff:ff:ff - Match on all bits in host B MAC address

  • VCAP_AFS_S1 - IS1 action

    • VID_REPLACE_ENA 1 - Enable replace VID classification

    • VID_ADD_VAL 0XA - VID to classify to

    • ISDX_REPLACE_ENA 1 - Enable replace ISDX classification

    • ISDX_ADD_VAL $ISDX - ISDX to classify to..

Use allocated ISDX to setup the stream to generate R-tag (Sequence Generation) and transmit on lan1 and lan2 (Stream Split):

# frer iflow $ISDX --generation 1 --dev1 lan1 --dev2 lan2


3.2. Switch S2

Switch S2 must:

  • Identify the C-tagged and R-tagged stream from switch S1 as part of member stream 1 and associate it with ISDX 1

  • Identify the C-tagged and R-tagged stream from switch S3 as part of member stream 2 and associate it with ISDX 2

  • Apply individual recovery to both member streams 1 and 2

  • Split member stream 1 into two egress ports

  • Merge member streams 1 and 2 by mapping them to the same compound stream

  • Apply sequence recovery to the compound stream consisting of member streams 1 and 2 and discard one of the frames

lan0 is connected to switch S1.
lan1 is connected to switch S3.
lan2 is connected to switch S4.

Allocate ISDX for stream 1, and create a VCAP rule in lookup 1 with priority 10 and ID 101 for stream identification of stream (1):

# ISDX1=$(frer iflowa)
# vcap add 101 is1 10 1\
    VCAP_KFS_DMAC_VID\
    IF_IGR_PORT_MASK 0x1 0x3ff\
    R_TAGGED_IS 0x1 0x1\
    8021Q_VLAN_TAGGED_IS 0x1 0x1\
    8021Q_VID0 0xa 0xfff\
    L2_DMAC 00:00:00:dd:dd:dd ff:ff:ff:ff:ff:ff\
    VCAP_AFS_S1\
    ISDX_REPLACE_ENA 0x1\
    ISDX_ADD_VAL $ISDX1

Parameters:

  • VCAP_KFS_DMAC_VID - IS1 key

    • IF_IGR_PORT_MASK 0x001 0x3ff - Match on lan0 (port 0)

    • R_TAGGED 0x1 0x1 - Frame must be R-tagged

    • 8021Q_VLAN_TAGGED_IS 0x1 0x1 - Frame must be C-tagged

    • 8021Q_VID0 0xa 0xfff - VID must be 10

    • L2_DMAC 00:00:00:dd:dd:dd ff:ff:ff:ff:ff:ff - Match on all bits in host B MAC address

  • VCAP_AFS_S1 - IS1 action

    • ISDX_REPLACE_ENA 1 - Enable replace ISDX classification

    • ISDX_ADD_VAL $ISDX1 - ISDX to classify to..

Allocate an ISDX for stream 2, and create a VCAP rule in lookup 1 with priority 10 and ID 102 for stream identification of stream (2):

# ISDX2=$(frer iflowa)
# vcap add 102 is1 10 1 VCAP_KFS_DMAC_VID\
     IF_IGR_PORT_MASK 0x2 0x3ff\
     R_TAGGED_IS 0x1 0x1\
     8021Q_VLAN_TAGGED_IS 0x1 0x1\
     8021Q_VID0 0xa 0xfff\
     L2_DMAC 00:00:00:dd:dd:dd ff:ff:ff:ff:ff:ff\
     VCAP_AFS_S1\
     ISDX_REPLACE_ENA 0x1\
     ISDX_ADD_VAL $ISDX2

Parameters:

  • VCAP_KFS_DMAC_VID - IS1 key

    • IF_IGR_PORT_MASK 0x002 0x3ff - Match on lan1 (port 1)

    • R_TAGGED 0x1 0x1 - Frame must be R-tagged

    • 8021Q_VLAN_TAGGED_IS 0x1 0x1 - Frame must be C-taggged

    • 8021Q_VID0 0xa 0xfff - VID must be 10

    • L2_DMAC 00:00:00:dd:dd:dd ff:ff:ff:ff:ff:ff - Match on all bits in host B MAC address

  • VCAP_AFS_S1 - IS1 action

    • ISDX_REPLACE_ENA 1 - Enable replace ISDX classification

    • ISDX_ADD_VAL $ISDX1 - ISDX to classify to..

Configure compound stream 3 with vector algorithm, maximum history length 32, and reset_time 4000 milliseconds

# frer cs 3 --enable 1 --alg 0 --hlen 32 --reset_time 4000

Allocate member stream id for egress on lan1 and lan2:

# MS_ID1=$(frer msa lan1 lan2)

The number returned will later be used as ms_id for member stream 1

Allocate member stream id for egress on lan2 only:

# MS_ID2=$(frer msa lan2)

The number returned will later be used as ms_id for member stream 2

Setup member stream 1 on lan1 with match algorithm, reset_time 4000 milliseconds:

# frer ms lan1 $MS_ID1 --enable 1 --alg 1 --reset_time 4000

Setup member stream 1 on lan2 with match algorithm, reset_time 4000 milliseconds, and compound stream 3:

# frer ms lan2 $MS_ID1 --enable 1 --alg 1 --reset_time 4000 --cs_id 3

Setup member stream 2 on lan2 with match algorithm, reset_time 4000 milliseconds, and compound stream 3:

# frer ms lan2 $MS_ID2 --enable 1 --alg 1 --reset_time 4000 --cs_id 3

Associate $ISDX1 with member stream 1 ($MS_ID1) and split the stream into lan1 and lan2:

# frer iflow $ISDX1 --ms_enable 1 --ms_id $MS_ID1 --dev1 lan1 --dev2 lan2

Associate $ISDX2 with member stream 2 ($MS_ID2) and lan2 only:

# frer iflow $ISDX2 --ms_enable 1 --ms_id $MS_ID2 --dev1 lan2


3.3. Switch S4

Switch S4 must:

  • Identify the C-tagged and R-tagged stream from switch S2 as part of member stream 3 and associate it with $ISDX3

  • Identify the C-tagged and R-tagged stream from switch S3 as part of member stream 4 and associate it with $ISDX4

  • Apply individual recovery to both member stream 3 and 4

  • Merge member stream 3 and 4 by mapping them to the same compound stream

  • Apply sequence recovery to the compound stream consisting of member stream 3 and 4 and discard one of the frames

  • Remove C-tag and R-tag

lan0 is connected to switch S2.
lan1 is connected to switch S3.
lan2 is connected to host B.

Allocate an ISDX for stream 3, and create a VCAP rule in lookup 1 with priority 10 and ID 103 for stream identification of stream (3):

# ISDX3=$(frer iflowa)
# vcap add 103 is1 10 1\
    VCAP_KFS_DMAC_VID\
    IF_IGR_PORT_MASK 0x1 0x3ff\
    R_TAGGED_IS 0x1 0x1\
    8021Q_VLAN_TAGGED_IS 0x1 0x1\
    8021Q_VID0 0xa 0xfff\
    L2_DMAC 00:00:00:dd:dd:dd ff:ff:ff:ff:ff:ff\
    VCAP_AFS_S1\
    ISDX_REPLACE_ENA 0x1\
    ISDX_ADD_VAL $ISDX3

Parameters:

  • VCAP_KFS_DMAC_VID - IS1 key

    • IF_IGR_PORT_MASK 0x001 0x3ff - Match on lan0 (port 0)

    • R_TAGGED 0x1 0x1 - Frame must be R-tagged

    • 8021Q_VLAN_TAGGED_IS 0x1 0x1 - Frame must be C-taggged

    • 8021Q_VID0 0xa 0xfff - VID must be 10

    • L2_DMAC 00:00:00:dd:dd:dd ff:ff:ff:ff:ff:ff - Match on all bits in host B MAC address

  • VCAP_AFS_S1 - IS1 action

    • ISDX_REPLACE_ENA 1 - Enable replace ISDX classification

    • ISDX_ADD_VAL $ISDX3 - ISDX to classify to.

Allocate an ISDX for stream 4, and create a VCAP rule in lookup 1 with priority 10 and ID 104 for stream identification of stream (4):

# ISDX4=$(frer iflowa)
# vcap add 104 is1 10 1\
    VCAP_KFS_DMAC_VID\
    IF_IGR_PORT_MASK 0x2 0x3ff\
    R_TAGGED_IS 0x1 0x1\
    8021Q_VLAN_TAGGED_IS 0x1 0x1\
    8021Q_VID0 0xa 0xfff\
    L2_DMAC 00:00:00:dd:dd:dd ff:ff:ff:ff:ff:ff\
    VCAP_AFS_S1\
    ISDX_REPLACE_ENA 0x1\
    ISDX_ADD_VAL $ISDX4

Parameters:

  • VCAP_KFS_DMAC_VID - IS1 key

    • IF_IGR_PORT_MASK 0x002 0x3ff - Match on lan1 (port 1)

    • R_TAGGED 0x1 0x1 - Frame must be R-tagged

    • 8021Q_VLAN_TAGGED_IS 0x1 0x1 - Frame must be C-taggged

    • 8021Q_VID0 0xa 0xfff - VID must be 10

    • L2_DMAC 00:00:00:dd:dd:dd ff:ff:ff:ff:ff:ff - Match on all bits in host B MAC address

  • VCAP_AFS_S1 - IS1 action

    • ISDX_REPLACE_ENA 1 - Enable replace ISDX classification

    • ISDX_ADD_VAL $ISDX4 - ISDX to classify to.

Add static MAC address in VLAN 10 on lan2. This is needed if no splitting is involved:

# bridge fdb add 00:00:00:dd:dd:dd dev lan2 static master vlan 10

Configure compound stream 4 with vector algorithm, history length 32, and reset_time 4000 milliseconds

# frer cs 4 --enable 1 --alg 0 --hlen 32 --reset_time 4000

Allocate member stream id for egress on lan2:

# MS_ID3=$(frer msa lan2)

The number returned will later be used as ms_id for member stream 3

Allocate member stream id for egress on lan2:

# MS_ID4=$(frer msa lan2)

The number returned will later be used as ms_id for member stream 4

Setup member stream 3 on lan2 (ms_id 0) with match algorithm, reset_time 4000 milliseconds, and compound stream 0:

# frer ms lan2 $MS_ID3 --enable 1 --alg 1 --reset_time 4000 --cs_id 4

Setup member stream 4 on lan2 (ms_id 2) with match algorithm, reset_time 4000 milliseconds, and compound stream 0:

# frer ms lan2 $MS_ID4 --enable 1 --alg 1 --reset_time 4000 --cs_id 4

Associate $ISDX3 with member stream 3 ($MS_ID3), pop R-tag and set egress to lan2:

# frer iflow $ISDX3 --ms_enable 1 --ms_id $MS_ID3 --pop 1 --dev1 lan2

Associate $ISDX4 with member stream 4 ($MS_ID4), pop R-tag and set egress to lan2:

# frer iflow $ISDX4 --ms_enable 1 --ms_id $MS_ID4 --pop 1 --dev1 lan2

Create a VCAP rule with priority 10 and handle 0 to remove the VLAN tag:

# vcap add 301 es0 10 0\
    VCAP_KFS_VID\
    IF_EGR_PORT 0x2 0xfff\
    8021Q_VID_CLS 0xa 0xfff\
    VCAP_AFS_VID\
    PUSH_OUTER_TAG 3

Parameters:

  • VCAP_KFS_VID - ES0 key

    • IF_EGR_PORT_NO 2 0xf - Match on egress on lan2 (port 2)

    • 8021Q_VID_CLS 0xa 0xfff - VID must be 10

  • VCAP_AFS_VID - ES0 action

    • PUSH_OUTER_TAG 3 - Force untag