Post Go back to editing

ADIN6310 over SPI: FRER Stream Identification Failing (No R-TAGs, Listener Stats Zero)

Category: Software
Product Number: ADIN6310
Software Version: ADIN6310 TSN Driver Library Rev. 5.1.0-GA 5.1.0-GA

Hello!Raised hands

I am trying to implement IEEE 802.1CB (FRER) using two ADIN6310 evaluation kits connected to Texas Instruments AM62P MPUs over SPI in Linux.

Standard switching and ping work perfectly with my general configuration, but I am struggling to get the FRER Talker and Listener proxies to actually encapsulate/decapsulate the traffic. Normal TCP data is successfully received, but the FRER mechanisms appear to be bypassed.

Hardware & Topology Setup:

  • Host A (Talker Node): TI AM62P MPU connected via SPI to ADIN6310 Eval Kit 1.

  • Host B (Listener Node): TI AM62P MPU connected via SPI to ADIN6310 Eval Kit 2.

  • Topology:

    • Host 1 (AM62p - 1) Eth0 <---> [Port 1] Talker ADIN6310 -1

    • Talker ADIN6310 -1 [Port 4] <---> [Port 4] Listener ADIN6310 - 2 (Path A)

    • Talker ADIN6310 -1 [Port 5] <---> [Port 5] Listener ADIN6310 - 2 (Path B)

    • Listener ADIN6310 - 2 [Port 1] <---> Host 2 (AM62p - 2) Eth0

Software & Configuration Context:

  • VLAN: VLAN 100 allowed on all ports (SES_SetVlanMode(100, 0xFFF)).

  • MSTP is disabled. Using Unicast/Multicast miss return for basic loop protection between ports 4 and 5.

  • I am utilizing the sample code logic provided in the driver user guide for Talker/Listener stream configuration but I changed the redundant ports.

  • Config the VLAN 100 in both AM62p 

The Talker Script VLAN 

#!/bin/sh

echo "Configuring FRER Talker Network Interfaces..."

# 1. Bring up the physical interface
ip link set eth0 up

# 2. Create a VLAN 100 interface and assign an IP
ip link add link eth0 name eth0.100 type vlan id 100
ip addr add 192.168.100.1/24 dev eth0.100
ip link set eth0.100 up

# 3. Force the ARP table to map the Listener's IP to the hardcoded FRER Dest MAC
arp -s 192.168.100.2 C0:D6:0A:F9:6A:D8

echo "Talker setup complete! Ping traffic to 192.168.100.2 will now trigger FRER."

The Listener Script VLAN 

#!/bin/sh

echo "Configuring FRER Listener Network Interfaces..."

# 1. Bring up the physical interface
ip link set eth0 up

# 2. Create a VLAN 100 interface and assign an IP
ip link add link eth0 name eth0.100 type vlan id 100
ip addr add 192.168.100.2/24 dev eth0.100
ip link set eth0.100 up

echo "Listener setup complete! Ready to receive FRER traffic on 192.168.100.2."

The Issue: To test the FRER redundancy, I am running a simple unidirectional TCP client/server counter program from Host A to Host B. by VLAN's IP 192.168.100.2

  1. Data Arrives: The server on Host B successfully receives the counter data.

  2. No FRER Tags:  I connected talker end to AM62P's to 2 ethernet eth0 and etn1 for capture RTAG,  I perform a packet capture (pcap format) on the AM62P monitoring the FRER ports (Ports 4 & 5), there is no FRER ID / R-TAG sequence number injected into the packets.

  3. Zero Statistics: Polling SES_FrerGetSequenceRecoveryStatistics() continuously returns 0 for rxPassedPkts, rxDiscardedPkts, etc., despite data flowing.

Stream Identification Configuration code:

/*
 * Copyright (c) 2024 - 2026 Analog Devices, Inc. All Rights Reserved.
 */

#include <stdlib.h>
#include <stdio.h>
#include <getopt.h>
#include <string.h>
#include <unistd.h>
#include <signal.h>
#include <inttypes.h>
#include <sys/types.h>
#include <sys/wait.h>

#include "SES_PORT_interface.h"
#include "SES_interface_management.h"
#include "SES_codes.h"
#include "SES_switch.h"
#include "SES_port_api.h"
#include "EX_ses_example_app.h"
#include "EX_util.h"
#include "SES_app_debug.h"
#include "SES_frer.h" // Essential for FRER configurations

#define PORT_COUNT 6
#define SPI_SPEED 16000000

// Port Map Definitions
#define SES_PORT_0 0
#define SES_PORT_1 1
#define SES_PORT_2 2
#define SES_PORT_3 3
#define SES_PORTMAP_PORT_0 1
#define SES_PORTMAP_PORT_1 2
#define SES_PORTMAP_PORT_2 4
#define SES_PORTMAP_PORT_3 8
#define SES_PORTMAP_PORT_4 16
#define SES_PORTMAP_PORT_5 32

// Global Variables
uint8_t AppRunningStatus = 1;
struct sigaction sa;

// Function Prototypes
static bool EX_IsSpiModeValid(int spiMode);
static int EX_HardcodeBoardSettings(uint8_t * primaryMac, uint8_t * portCount, SES_portInit_t * initializePorts_p);
void handle_sigint(int sig);

// FRER & Loop Protection Prototypes
int32_t EX_ConfigureLoopPreventionMissReturn(void);
int32_t configure_adin6310_talker(int32_t * frerTableIndex);
int32_t configure_adin6310_listener(int32_t * listenerFrerTableIndex);
int32_t sesGetFrerListenerStatistics(int32_t listenerFrerTableIndex);

int main(int argc, char ** argv)
{
    int opt;
    int interfaceId = -1;
    int rv = SES_OK;
    char * interface_p = NULL;
    printf("Version :- FRER(Embedded AM62p)\n");
   
#if SPIDEV
    const char * readyPin_p = NULL;
#endif

    uint8_t primaryMac[6] = {0};
    uint8_t hostMac[6] = {0};
    uint8_t portCount;
    SES_portInit_t initializePorts_p[SES_MAX_PORTS] = {0};
    sesID_t deviceId = -1;
    SES_driverFunctions_t driverFunctions = {0};

#if SPIDEV
    SES_PORT_SpidevInitParams_t spiInitParams = {0};
    while ((opt = getopt(argc, argv, "p:g:s:lh")) != -1)
#else
    SES_PORT_ft4222InitParams_t spiInitParams = {{0}, 0, SES_PORT_SPI_notUsed};
    while ((opt = getopt(argc, argv, "p:s:lh")) != -1)
#endif
    {
        switch (opt)
        {
        case 'p':
            interface_p = optarg;
            break;
#if SPIDEV
        case 'g':
            readyPin_p = optarg;
            break;
#endif
        case 's':
            spiInitParams.spiMode = strtol(optarg, NULL, 10);
            break;
        case 'h':
        default:
            printf("Usage: %s -p <interface> [-s <mode>]\n", argv[0]);
            exit(EXIT_FAILURE);
        }
    }

    // 1. Initialize Board Settings
    rv = EX_HardcodeBoardSettings(primaryMac, & portCount, initializePorts_p);
    if (rv != SES_OK)
        exit(EXIT_FAILURE);

    // 2. Initialize SES Library
    if (SES_Init() != SES_OK)
        return -1;

    // 3. YOUR SPI/Ethernet Selection Logic
    if (spiInitParams.spiMode == SES_PORT_SPI_notUsed)
    {
        if (EX_StringToMacAddress(interface_p, hostMac, ":") != SES_OK)
            exit(EXIT_FAILURE);

        driverFunctions.init_p = SES_PORT_ETH_Init;
        driverFunctions.release_p = SES_PORT_ETH_Release;
        driverFunctions.sendMessage_p = SES_PORT_ETH_SendMessage;
        driverFunctions.updateFilter_p = SES_PORT_ETH_UpdateFilter;
        rv = SES_AddHwInterface(hostMac, & driverFunctions, & interfaceId);
    } else
    {
#if SPIDEV
        if (interface_p)
            spiInitParams.spiDevice = interface_p;
        if (readyPin_p)
            spiInitParams.gpioPin = readyPin_p;
        spiInitParams.speed = SPI_SPEED;
#else
        if (interface_p)
            spiInitParams.deviceIndex = strtol(interface_p, NULL, 10);
#endif
        driverFunctions.init_p = SES_PORT_SPI_Init;
        driverFunctions.release_p = SES_PORT_SPI_Release;
        driverFunctions.sendMessage_p = SES_PORT_SPI_SendMessage;
        rv = SES_AddHwInterface( & spiInitParams, & driverFunctions, & interfaceId);
    }

    if (rv != SES_OK)
        return rv;

    // 4. Add Device and Initialize ALL Ports
    rv = SES_AddDevice((uint32_t) interfaceId, primaryMac, & deviceId);
    if (rv == SES_OK)
    {
        rv = SES_InitializePorts(portCount, initializePorts_p);
        if (rv == SES_OK) {
            EX_ConfigureLoopPreventionMissReturn();
        }
    }

    // Print the Firmware Version
    sesGetAppInfo();

    // 6. Apply FRER Configuration
    int32_t talkerFrerTableIndex = -1;
    int32_t listenerFrerTableIndex = -1;

    switch (Frer_Config_opt) {
    case 1: // Talker
        configure_adin6310_talker( & talkerFrerTableIndex);
        printf("SES Application Running: FRER Talker Proxy\n");
        break;
    case 2: // Listener
        configure_adin6310_listener( & listenerFrerTableIndex);
        printf("SES Application Running: FRER Listener Proxy\n");
        break;
    default:
        printf("No FRER Config\n");
    }

    // Setup ISR and Loop
    sa.sa_handler = & handle_sigint;
    sigaction(SIGINT, & sa, NULL);
    printf("Setup Finish\n");

    while (AppRunningStatus)
    {
        switch (Frer_Config_opt) {
        case 1: // Talker
            //printf(".\n"); // Keepalive marker for Talker
            break;
        case 2: // Listener
            sesGetStatisticsPortStatistics(6);
            sesGetFrerListenerStatistics(listenerFrerTableIndex);
            break;
        default: // No Frer config
            printf("No FRER Config");
        }
        sleep(2); // Wait 2 seconds before repolling stats
    }

    SES_RemoveHwInterface(interfaceId);
    return 0;
}

// ---------------------------------------------------------------------
// Loop Protection (Approach 2 - Miss Return)
// ---------------------------------------------------------------------
int32_t EX_ConfigureLoopPreventionMissReturn(void)
{
    int32_t rv = 0;
    uint8_t portMap;
    bool cutThrough;
    uint8_t lookupDone;
    uint8_t txFilter;
    bool txFilterValid;
    uint8_t rxFilter;
    bool rxFilterValid;

    rv = SES_GetUnicastMissReturn(SES_macPort4, & portMap, & cutThrough, & lookupDone, & txFilter, & txFilterValid, & rxFilter, & rxFilterValid);
    if (rv == SES_PORT_OK) {
        portMap = portMap & ~(1 << 5); // 1 << 5 represents Port 5
        SES_SetUnicastMissReturn(SES_macPort4, portMap, cutThrough, lookupDone, txFilter, txFilterValid, rxFilter, rxFilterValid);
    }
    rv = SES_GetMulticastMissReturn(SES_macPort4, & portMap, & cutThrough, & lookupDone, & txFilter, & txFilterValid, & rxFilter, & rxFilterValid);
    if (rv == SES_PORT_OK) {
        portMap = portMap & ~(1 << 5);
        SES_SetMulticastMissReturn(SES_macPort4, portMap, cutThrough, lookupDone, txFilter, txFilterValid, rxFilter, rxFilterValid);
    }

    rv = SES_GetUnicastMissReturn(SES_macPort5, & portMap, & cutThrough, & lookupDone, & txFilter, & txFilterValid, & rxFilter, & rxFilterValid);
    if (rv == SES_PORT_OK) {
        portMap = portMap & ~(1 << 4); // 1 << 4 represents Port 4
        SES_SetUnicastMissReturn(SES_macPort5, portMap, cutThrough, lookupDone, txFilter, txFilterValid, rxFilter, rxFilterValid);
    }
    rv = SES_GetMulticastMissReturn(SES_macPort5, & portMap, & cutThrough, & lookupDone, & txFilter, & txFilterValid, & rxFilter, & rxFilterValid);
    if (rv == SES_PORT_OK) {
        portMap = portMap & ~(1 << 4);
        SES_SetMulticastMissReturn(SES_macPort5, portMap, cutThrough, lookupDone, txFilter, txFilterValid, rxFilter, rxFilterValid);
    }

    printf("Loop Protection (Miss Return Approach) Applied between Ports 4 & 5.\n");
    return SES_PORT_OK;
}

// ---------------------------------------------------------------------
// FRER Talker Configuration
// ---------------------------------------------------------------------
int32_t configure_adin6310_talker(int32_t * frerTableIndex)
{
    int32_t rv = 0;
    uint8_t destinationMAC[6] = {0xC0, 0xD6, 0x0A, 0xF9, 0x6A, 0xD8};
    TSN_ieee802Dot1cbFrer_t frerParameters;
    TSN_ieee802Dot1cbStream_t streamParameters;
    TSN_ieee802Dot1cbMaskAndMatch_t maskAndMatchParameters;

    memset( & frerParameters, 0, sizeof(TSN_ieee802Dot1cbFrer_t));
    memset( & streamParameters, 0, sizeof(TSN_ieee802Dot1cbStream_t));
    memset( & maskAndMatchParameters, 0, sizeof(TSN_ieee802Dot1cbMaskAndMatch_t));

    rv = SES_SetVlanMode(100, 0xFFF); // Allow VLAN 100 on all switch ports
    if (rv < SES_PORT_OK) printf("SES_SetVlanMode Error :: %d\n", rv);

    // Stream table Parameters
    streamParameters.TSN_streamIdentity.identificationType = TSN_nullStream;
    for (int i = 0; i < 6; i++) {
        streamParameters.TSN_streamIdentity.TSN_parameters.TSN_nullStreamIdentification.destinationMac[i] = destinationMAC[i];
    }
    streamParameters.TSN_streamIdentity.TSN_parameters.TSN_nullStreamIdentification.vlan = 100;

    streamParameters.portMap = SES_PORTMAP_PORT_4 | SES_PORTMAP_PORT_5;
    streamParameters.TSN_HardwareTableIndices.dynTblIdx[0] = -1;
    streamParameters.TSN_HardwareTableIndices.dynTblIdx[1] = -1;
    streamParameters.TSN_HardwareTableIndices.exTblruleId = -1;
    streamParameters.useStreamtable = false;

    frerParameters.TSN_sequenceGeneration.reset = false;
    frerParameters.TSN_sequenceRecovery.individualRecovery = false;

    frerParameters.TSN_streamSplit.port = SES_PORT_1;
    frerParameters.TSN_HardwareTableIndices.individualRecoveryTblIdx = -1;
    frerParameters.TSN_HardwareTableIndices.sequenceGenerationTblIdx = -1;
    frerParameters.TSN_HardwareTableIndices.sequenceRecoveryTblIdx = -1;
    frerParameters.TSN_HardwareTableIndices.txTransformTblIdx = -1;

    rv = SES_FrerConfigureTalkerProxyForStream( & frerParameters, & streamParameters, & maskAndMatchParameters);
    if (rv == SES_PORT_OK) {
        * frerTableIndex = frerParameters.TSN_HardwareTableIndices.sequenceGenerationTblIdx;
    }
    return rv;
}

// ---------------------------------------------------------------------
// FRER Listener Configuration & Statistics
// ---------------------------------------------------------------------
int32_t configure_adin6310_listener(int32_t * listenerFrerTableIndex)
{
    int32_t rv = 0;
    uint8_t destinationMAC[6] = {0xC0, 0xD6, 0x0A, 0xF9, 0x6A, 0xD8};
    TSN_ieee802Dot1cbFrer_t frerParameters;
    TSN_ieee802Dot1cbStream_t streamParameters;
    TSN_ieee802Dot1cbMaskAndMatch_t maskAndMatchParameters;

    memset( & frerParameters, 0, sizeof(TSN_ieee802Dot1cbFrer_t));
    memset( & streamParameters, 0, sizeof(TSN_ieee802Dot1cbStream_t));
    memset( & maskAndMatchParameters, 0, sizeof(TSN_ieee802Dot1cbMaskAndMatch_t));

    rv = SES_SetVlanMode(100, 0xFFF);
    streamParameters.TSN_streamIdentity.identificationType = TSN_nullStream;
    for (int i = 0; i < 6; i++) {
        streamParameters.TSN_streamIdentity.TSN_parameters.TSN_nullStreamIdentification.destinationMac[i] = destinationMAC[i];
    }
    streamParameters.TSN_streamIdentity.TSN_parameters.TSN_nullStreamIdentification.vlan = 100;

    // Output reconstructed data strictly out of Port 1
    streamParameters.portMap = SES_PORTMAP_PORT_1;
    streamParameters.TSN_HardwareTableIndices.dynTblIdx[0] = -1;
    streamParameters.TSN_HardwareTableIndices.dynTblIdx[1] = -1;
    streamParameters.TSN_HardwareTableIndices.exTblruleId = -1;
    streamParameters.useStreamtable = false;

    frerParameters.TSN_sequenceRecovery.algorithm = TSN_vector; // Or TSN_match
    frerParameters.TSN_sequenceRecovery.historyLength = 5;
    frerParameters.TSN_sequenceRecovery.resetTimeout = 0xffff;
    frerParameters.TSN_sequenceRecovery.takeNoSequence = false;
    frerParameters.TSN_sequenceRecovery.individualRecovery = false;

    frerParameters.TSN_HardwareTableIndices.individualRecoveryTblIdx = -1;
    frerParameters.TSN_HardwareTableIndices.sequenceGenerationTblIdx = -1;
    frerParameters.TSN_HardwareTableIndices.sequenceRecoveryTblIdx = -1;
    frerParameters.TSN_HardwareTableIndices.txTransformTblIdx = -1;

    rv = SES_FrerConfigureListenerProxyForStream( & frerParameters, & streamParameters, & maskAndMatchParameters);
    if (rv == SES_PORT_OK) {
        * listenerFrerTableIndex = frerParameters.TSN_HardwareTableIndices.sequenceRecoveryTblIdx;
    }
    return rv;
}

int32_t sesGetFrerListenerStatistics(int32_t listenerFrerTableIndex)
{
    if (listenerFrerTableIndex == -1) return SES_OK;
    int rv = SES_OK;
    TSN_ieee802Dot1cbFrer_t monitorParams;

    memset( & monitorParams, 0, sizeof(TSN_ieee802Dot1cbFrer_t));
    monitorParams.TSN_HardwareTableIndices.sequenceRecoveryTblIdx = listenerFrerTableIndex;
    monitorParams.TSN_sequenceRecovery.port = 0;

    rv = SES_FrerGetSequenceRecoveryStatistics( & monitorParams);
    if (rv == SES_PORT_OK) {
        printf("\n--- FRER Listener Stats ---\n");
        printf(" Passed Packets (Valid)   :: %llu\n", monitorParams.TSN_perPortPerStreamCounters.rxPassedPkts);
        printf(" Discarded Packets (Dups) :: %llu\n", monitorParams.TSN_perPortPerStreamCounters.rxDiscardedPkts);
        printf(" Lost Packets             :: %llu\n", monitorParams.TSN_perPortPerStreamCounters.rxLostPkts);
        printf(" Out Of Order Packets     :: %llu\n", monitorParams.TSN_perPortPerStreamCounters.rxOutOfOrderPkts);
        printf(" Rogue Packets            :: %llu\n", monitorParams.TSN_perPortPerStreamCounters.rxRoguePkts);
    } else {
        printf("Failed to read FRER stats: %d\n", rv);
    }
    return rv;
}

// ---------------------------------------------------------------------
// Basic Environment Setup
// ---------------------------------------------------------------------
static int EX_HardcodeBoardSettings(uint8_t * primaryMac, uint8_t * portCount, SES_portInit_t * initializePorts_p)
{
    uint8_t mac_addr[6] = {0x7A, 0xC6, 0xBB, 0x11, 0x11, 0x11};
    memcpy(primaryMac, mac_addr, 6);
    * portCount = PORT_COUNT;

    for (int i = 0; i < * portCount; i++)
    {
        initializePorts_p[i].enablePort = 1;
        initializePorts_p[i].mii = SES_rgmiiMode;
        initializePorts_p[i].phyConfig.autoNegEnable = true;
        initializePorts_p[i].phyConfig.speed = SES_phySpeed1000;
        initializePorts_p[i].phyConfig.duplexMode = SES_phyDuplexModeFull;
        initializePorts_p[i].phyConfig.crossover = SES_autoMdi;
        initializePorts_p[i].miiClkDelays.enableRxDelay = SES_DISABLE_DELAY;
        initializePorts_p[i].miiClkDelays.enableTxDelay = SES_DISABLE_DELAY;
        initializePorts_p[i].miiClkDelays.clkSelection = SES_CLK_INTERNAL;
        initializePorts_p[i].phyConfig.phyPullupCtrl = SES_PHY_PULLUP_INTERNAL;
       
        uint8_t addrs[] = {0, 1, 2, 4, 8, 9};
        initializePorts_p[i].phyConfig.phyAddr = addrs[i];

        if (i == 0)
        {
            initializePorts_p[i].phyType = SES_phyUnmanaged;
            initializePorts_p[i].linkStatusPolarity = SES_LINK_ACTIVE_LOW;
        } else
        {
            initializePorts_p[i].phyType = SES_phyADIN1300;
        }
    }
    return SES_OK;
}

static bool EX_IsSpiModeValid(int spiMode)
{
    return (spiMode >= 0 && spiMode <= 4);
}

void handle_sigint(int sig)
{
    (void) sig; // Acknowledge parameter to stop compiler warning
    AppRunningStatus = 0;
}

From the below function I configured based on what given in driver guide 


int32_t EX_ConfigureLoopPreventionMissReturn(void);
int32_t configure_adin6310_talker(int32_t * frerTableIndex);
int32_t configure_adin6310_listener(int32_t * listenerFrerTableIndex);
int32_t sesGetFrerListenerStatistics(int32_t listenerFrerTableIndex);

I need to know is that anything I missed or I did some thing wrong.

Thank you.

Edit Notes

Updated Test cases
[edited by: prahadeeshDP at 4:28 AM (GMT -4) on 1 Jun 2026]
  • Hi,

    The switch uses a lookup table internally for FRER stream identification.

    If the traffic was already learned by the switch in the dynamic table before FRER was configured, the switch could be matching to the learned entry instead of the FRER lookup entry.

    Could you try flushing the dynamic table (SES_FlushDynamicTable) after configuring FRER talker/listener, then check whether the streams are now coming out of the switch with the R-TAG?

    Regards,

    Karl

  • Greetings, Karl.0

    Thank for your reply :)

    Spoiler: SES_FlushDynamicTable() not worked.

    QUESTION 1

    After configured the FRER talker/listener, I used SES_FlushDynamicTable But but still don't get the FRER status on port 4 and 5 it still prints zero with the function SES_FrerGetSequenceRecoveryStatistics in the listener side .in the mean time I tried to changed the code from Null Stream to Source MAC and VLAN Stream . after the change I can able to successfully get the Recovery Statistics in the port 1 of the listener side, not able to get the status in the port 4 and port 5 like in the GUI. now the traffic generator code sample moved to TCP  -> UDP server & client, I need to get status on port 4 & 5 so feedback need on this.

      

     Server/Client code: send 1 message every sec in UDP

    /*
    * Copyright (c) 2024 - 2026 Analog Devices, Inc. All Rights Reserved.
    */

    #include <stdlib.h>
    #include <stdio.h>
    #include <getopt.h>
    #include <string.h>
    #include <unistd.h>
    #include <signal.h>
    #include <inttypes.h>

    #include <sys/types.h>
    #include <sys/wait.h>

    #include "SES_PORT_interface.h"
    #include "SES_interface_management.h"
    #include "SES_codes.h"
    #include "SES_switch.h"
    #include "SES_port_api.h"
    #include "EX_ses_example_app.h"
    #include "EX_util.h"
    //#include "SES_app_debug.h"
    #include "SES_frer.h"

    #define PORT_COUNT 6
    #define SPI_SPEED 16000000

    // Port Map Definitions
    #define SES_PORT_0 0
    #define SES_PORT_1 1
    #define SES_PORT_2 2
    #define SES_PORT_3 3
    #define SES_PORTMAP_PORT_0 1
    #define SES_PORTMAP_PORT_1 2
    #define SES_PORTMAP_PORT_2 4
    #define SES_PORTMAP_PORT_3 8
    #define SES_PORTMAP_PORT_4 16
    #define SES_PORTMAP_PORT_5 32

    // Global Variables
    uint8_t AppRunningStatus = 1;
    struct sigaction sa;

    uint8_t Frer_Config_opt = 0;

    // Function Prototypes
    static bool EX_IsSpiModeValid(int spiMode);
    static int EX_HardcodeBoardSettings(uint8_t *primaryMac, uint8_t *portCount, SES_portInit_t *initializePorts_p);
    void handle_sigint(int sig);

    // FRER & Loop Protection Prototypes
    int32_t EX_ConfigureLoopPreventionMissReturn(void);
    int32_t configure_adin6310_talker(int32_t *frerTableIndex);
    int32_t configure_adin6310_listener(int32_t *listenerFrerTableIndex);
    static int sesGetFrerListenerStatistics(int32_t listenerFrerTableIndex);

    void sesGetAppInfo();
    static int sesGetStatisticsPortStatistics(uint8_t portCount);

    int main(int argc, char **argv)
    {
    int opt;
    int interfaceId = -1;
    int rv = SES_OK;
    char *interface_p = NULL;

    printf("Version : 2.21 - FRER(Embedded AM62p)\n");
    int input_valid = 0;
    char input_buffer[32];
    Frer_Config_opt = 1;
    while (!input_valid)
    {
    printf("\n--- FRER Configuration ---\n");
    printf("1. Talker Config\n");
    printf("2. Listener Config\n");
    printf("3. No FRER Config\n");
    printf("Enter option (1-3): ");

    if (fgets(input_buffer, sizeof(input_buffer), stdin) != NULL)
    {
    if (sscanf(input_buffer, "%hhd", &Frer_Config_opt) == 1)
    {
    if (Frer_Config_opt >= 1 && Frer_Config_opt <= 3) {
    input_valid = 1;
    } else {
    printf("-> Error: Out of range. Please enter 1, 2, or 3.\n");
    }
    }
    else
    {
    printf("-> Error: Invalid character. Please enter a number.\n");
    }
    }
    }

    #if SPIDEV
    const char *readyPin_p = NULL;
    #endif
    uint8_t primaryMac[6] = {0};
    uint8_t hostMac[6] = {0};
    uint8_t portCount;
    SES_portInit_t initializePorts_p[SES_MAX_PORTS] = {0};
    sesID_t deviceId = -1;
    SES_driverFunctions_t driverFunctions = {0};

    #if SPIDEV
    SES_PORT_SpidevInitParams_t spiInitParams = {0};
    while ((opt = getopt(argc, argv, "p:g:s:lh")) != -1)
    #else
    SES_PORT_ft4222InitParams_t spiInitParams = {{0}, 0, SES_PORT_SPI_notUsed};
    while ((opt = getopt(argc, argv, "p:s:lh")) != -1)
    #endif
    {
    switch (opt)
    {
    case 'p':
    interface_p = optarg;
    break;
    #if SPIDEV
    case 'g':
    readyPin_p = optarg;
    break;
    #endif
    case 's':
    spiInitParams.spiMode = strtol(optarg, NULL, 10);
    break;
    case 'h':
    default:
    printf("Usage: %s -p <interface> [-s <mode>]\n", argv[0]);
    exit(EXIT_FAILURE);
    }
    }

    // 1. Initialize Board Settings
    rv = EX_HardcodeBoardSettings(primaryMac, &portCount, initializePorts_p);
    if (rv != SES_OK)
    exit(EXIT_FAILURE);

    // 2. Initialize SES Library
    if (SES_Init() != SES_OK)
    return -1;

    // 3. YOUR SPI/Ethernet Selection Logic
    if (spiInitParams.spiMode == SES_PORT_SPI_notUsed)
    {
    if (EX_StringToMacAddress(interface_p, hostMac, ":") != SES_OK)
    exit(EXIT_FAILURE);
    driverFunctions.init_p = SES_PORT_ETH_Init;
    driverFunctions.release_p = SES_PORT_ETH_Release;
    driverFunctions.sendMessage_p = SES_PORT_ETH_SendMessage;
    driverFunctions.updateFilter_p = SES_PORT_ETH_UpdateFilter;
    rv = SES_AddHwInterface(hostMac, &driverFunctions, &interfaceId);
    }
    else
    {
    #if SPIDEV
    if (interface_p)
    spiInitParams.spiDevice = interface_p;
    if (readyPin_p)
    spiInitParams.gpioPin = readyPin_p;
    spiInitParams.speed = SPI_SPEED;
    #else
    if (interface_p)
    spiInitParams.deviceIndex = strtol(interface_p, NULL, 10);
    #endif
    driverFunctions.init_p = SES_PORT_SPI_Init;
    driverFunctions.release_p = SES_PORT_SPI_Release;
    driverFunctions.sendMessage_p = SES_PORT_SPI_SendMessage;
    rv = SES_AddHwInterface(&spiInitParams, &driverFunctions, &interfaceId);
    }

    if (rv != SES_OK)
    return rv;

    // 4. Add Device and Initialize ALL Ports
    rv = SES_AddDevice((uint32_t)interfaceId, primaryMac, &deviceId);
    if (rv == SES_OK)
    {
    rv = SES_InitializePorts(portCount, initializePorts_p);

    if (rv == SES_OK) {
    EX_ConfigureLoopPreventionMissReturn();
    }
    }

    // Print the Firmware Version
    sesGetAppInfo();

    // 6. Apply FRER Configuration
    int32_t talkerFrerTableIndex = -1;
    int32_t listenerFrerTableIndex = -1;

    switch(Frer_Config_opt){
    case 1 : // Talker
    configure_adin6310_talker(&talkerFrerTableIndex);
    printf("SES Application Running: FRER Talker Proxy\n");
    break;

    case 2 : // Listener
    configure_adin6310_listener(&listenerFrerTableIndex);
    printf("SES Application Running: FRER Listener Proxy\n");
    break;

    default:
    printf("No FRER Config\n");
    }

    printf("Flushing Dynamic Table to enforce FRER stream identification...\n");
    SES_FlushDynamicTable();

    // Setup ISR and Loop
    sa.sa_handler = &handle_sigint;
    sigaction(SIGINT, &sa, NULL);
    printf("Setup Finish\n");

    while (AppRunningStatus)
    {
    switch(Frer_Config_opt){
    case 1 : // Talker
    //printf(".\n"); // Keepalive marker for Talker
    break;

    case 2 : // Listener
    sesGetStatisticsPortStatistics(6);
    sesGetFrerListenerStatistics(listenerFrerTableIndex);
    break;

    default: // No Frer config
    printf("No FRER Config\n");
    }
    sleep(5); // Wait 2 seconds before repolling stats
    }

    SES_RemoveHwInterface(interfaceId);
    return 0;
    }

    // ---------------------------------------------------------------------
    // Loop Protection (Approach 2 - Miss Return)
    // ---------------------------------------------------------------------
    int32_t EX_ConfigureLoopPreventionMissReturn(void)
    {
    int32_t rv = 0;
    uint8_t portMap;
    bool cutThrough;
    uint8_t lookupDone;
    uint8_t txFilter;
    bool txFilterValid;
    uint8_t rxFilter;
    bool rxFilterValid;

    // Step 1: Protect Port 4 (Clear Port 5 map so Port 4 doesn't forward to Port 5)
    rv = SES_GetUnicastMissReturn(SES_macPort4, &portMap, &cutThrough, &lookupDone, &txFilter, &txFilterValid, &rxFilter, &rxFilterValid);
    if (rv == SES_PORT_OK) {
    portMap = portMap & ~(1 << 5); // 1 << 5 represents Port 5
    SES_SetUnicastMissReturn(SES_macPort4, portMap, cutThrough, lookupDone, txFilter, txFilterValid, rxFilter, rxFilterValid);
    }

    rv = SES_GetMulticastMissReturn(SES_macPort4, &portMap, &cutThrough, &lookupDone, &txFilter, &txFilterValid, &rxFilter, &rxFilterValid);
    if (rv == SES_PORT_OK) {
    portMap = portMap & ~(1 << 5);
    SES_SetMulticastMissReturn(SES_macPort4, portMap, cutThrough, lookupDone, txFilter, txFilterValid, rxFilter, rxFilterValid);
    }

    // Step 2: Protect Port 5 (Clear Port 4 map so Port 5 doesn't forward to Port 4)
    rv = SES_GetUnicastMissReturn(SES_macPort5, &portMap, &cutThrough, &lookupDone, &txFilter, &txFilterValid, &rxFilter, &rxFilterValid);
    if (rv == SES_PORT_OK) {
    portMap = portMap & ~(1 << 4); // 1 << 4 represents Port 4
    SES_SetUnicastMissReturn(SES_macPort5, portMap, cutThrough, lookupDone, txFilter, txFilterValid, rxFilter, rxFilterValid);
    }

    rv = SES_GetMulticastMissReturn(SES_macPort5, &portMap, &cutThrough, &lookupDone, &txFilter, &txFilterValid, &rxFilter, &rxFilterValid);
    if (rv == SES_PORT_OK) {
    portMap = portMap & ~(1 << 4);
    SES_SetMulticastMissReturn(SES_macPort5, portMap, cutThrough, lookupDone, txFilter, txFilterValid, rxFilter, rxFilterValid);
    }

    printf("Loop Protection (Miss Return Approach) Applied between Ports 4 & 5.\n");
    return SES_PORT_OK;
    }

    // ---------------------------------------------------------------------
    // FRER Talker Configuration
    // ---------------------------------------------------------------------

    int32_t configure_adin6310_talker(int32_t *frerTableIndex)
    {
    int32_t rv = 0;
    uint8_t sourceMAC[6] = { 0xC0, 0xD6, 0x0A, 0xF9, 0x6A, 0xD8 };

    TSN_ieee802Dot1cbFrer_t frerParameters;
    TSN_ieee802Dot1cbStream_t streamParameters;
    TSN_ieee802Dot1cbMaskAndMatch_t maskAndMatchParameters;

    memset(&frerParameters, 0, sizeof(TSN_ieee802Dot1cbFrer_t));
    memset(&streamParameters, 0, sizeof(TSN_ieee802Dot1cbStream_t));
    memset(&maskAndMatchParameters, 0, sizeof(TSN_ieee802Dot1cbMaskAndMatch_t));

    rv = SES_SetVlanMode(100, 0xFFF); // Allow VLAN 100 on all switch ports
    if (rv < SES_PORT_OK) printf("SES_SetVlanMode Error :: %d\n", rv);

    streamParameters.TSN_streamIdentity.identificationType = TSN_smacVlan;
    for (int i = 0; i < 6; i++) {
    streamParameters.TSN_streamIdentity.TSN_parameters.TSN_smacVlanStreamIdentification.sourceMac[i] = sourceMAC[i];
    }
    streamParameters.TSN_streamIdentity.TSN_parameters.TSN_smacVlanStreamIdentification.vlan = 100;

    // Egress via ports 4 and 5 for Redundant Paths
    streamParameters.portMap = SES_PORTMAP_PORT_4 | SES_PORTMAP_PORT_5;

    streamParameters.TSN_HardwareTableIndices.dynTblIdx[0] = -1;
    streamParameters.TSN_HardwareTableIndices.dynTblIdx[1] = -1;
    streamParameters.TSN_HardwareTableIndices.exTblruleId = -1;
    streamParameters.useStreamtable = false;

    frerParameters.TSN_sequenceGeneration.reset = false;
    frerParameters.TSN_sequenceRecovery.individualRecovery = false;

    // Traffic originating from Port 1
    frerParameters.TSN_streamSplit.port = SES_PORT_1;

    frerParameters.TSN_HardwareTableIndices.individualRecoveryTblIdx = -1;
    frerParameters.TSN_HardwareTableIndices.sequenceGenerationTblIdx = -1;
    frerParameters.TSN_HardwareTableIndices.sequenceRecoveryTblIdx = -1;
    frerParameters.TSN_HardwareTableIndices.txTransformTblIdx = -1;

    rv = SES_FrerConfigureTalkerProxyForStream(&frerParameters, &streamParameters, &maskAndMatchParameters);
    if (rv == SES_PORT_OK) {
    *frerTableIndex = frerParameters.TSN_HardwareTableIndices.sequenceGenerationTblIdx;
    }
    return rv;
    }

    // ---------------------------------------------------------------------
    // FRER Listener Configuration & Statistics
    // ---------------------------------------------------------------------

    int32_t configure_adin6310_listener(int32_t *listenerFrerTableIndex)
    {
    int32_t rv = 0;

    uint8_t sourceMAC[6] = { 0xC0, 0xD6, 0x0A, 0xF9, 0x6A, 0xD8 };

    TSN_ieee802Dot1cbFrer_t frerParameters;
    TSN_ieee802Dot1cbStream_t streamParameters;
    TSN_ieee802Dot1cbMaskAndMatch_t maskAndMatchParameters;

    memset(&frerParameters, 0, sizeof(TSN_ieee802Dot1cbFrer_t));
    memset(&streamParameters, 0, sizeof(TSN_ieee802Dot1cbStream_t));
    memset(&maskAndMatchParameters, 0, sizeof(TSN_ieee802Dot1cbMaskAndMatch_t));

    rv = SES_SetVlanMode(100, 0xFFF);
    streamParameters.TSN_streamIdentity.identificationType = TSN_smacVlan;
    for (int i = 0; i < 6; i++) {
    streamParameters.TSN_streamIdentity.TSN_parameters.TSN_smacVlanStreamIdentification.sourceMac[i] = sourceMAC[i];
    }
    streamParameters.TSN_streamIdentity.TSN_parameters.TSN_smacVlanStreamIdentification.vlan = 100;

    // Output reconstructed data strictly out of Port 1
    streamParameters.portMap = SES_PORTMAP_PORT_1;
    streamParameters.TSN_HardwareTableIndices.dynTblIdx[0] = -1;
    streamParameters.TSN_HardwareTableIndices.dynTblIdx[1] = -1;
    streamParameters.TSN_HardwareTableIndices.exTblruleId = -1;
    streamParameters.useStreamtable = false;

    frerParameters.TSN_sequenceRecovery.algorithm = TSN_vector;

    frerParameters.TSN_sequenceRecovery.historyLength = 2;
    frerParameters.TSN_sequenceRecovery.resetTimeout = 10000;

    frerParameters.TSN_sequenceRecovery.takeNoSequence = false;
    frerParameters.TSN_sequenceRecovery.individualRecovery = false;

    frerParameters.TSN_HardwareTableIndices.individualRecoveryTblIdx = -1;
    frerParameters.TSN_HardwareTableIndices.sequenceGenerationTblIdx = -1;
    frerParameters.TSN_HardwareTableIndices.sequenceRecoveryTblIdx = -1;
    frerParameters.TSN_HardwareTableIndices.txTransformTblIdx = -1;

    rv = SES_FrerConfigureListenerProxyForStream(&frerParameters, &streamParameters, &maskAndMatchParameters);
    if (rv == SES_PORT_OK) {
    *listenerFrerTableIndex = frerParameters.TSN_HardwareTableIndices.sequenceRecoveryTblIdx;
    }
    return rv;
    }

    static int sesGetFrerListenerStatistics(int32_t listenerFrerTableIndex)
    {
    if (listenerFrerTableIndex == -1) {
    return SES_OK; // Nothing to monitor if not initialized
    }

    int rv = SES_OK;
    TSN_ieee802Dot1cbFrer_t monitorParams;

    // Define the ingress ports you want to monitor (Redundant Link A and B) (Kept your custom logic)
    uint8_t portsToMonitor[] = {0, 1 ,2 ,3 ,4, 5};
    int numPorts = sizeof(portsToMonitor) / sizeof(portsToMonitor[0]);

    printf("\n--- FRER Listener Stats ---\n");

    // Print Table Header according to the new required order
    printf("%-5s | %-7s | %-11s | %-14s | %-18s | %-9s | %-12s | %-6s | %-20s\n",
    "Port", "Streams", "Passed-pkts", "Discarded-pkts", "OutOfOrder-pkts", "Lost-pkts", "Tagless-pkts", "Resets", "Encoder-err-pkts");
    printf("---------------------------------------------------------------------------------------------------------------------------------------\n");

    for (int i = 0; i < numPorts; i++) {
    monitorParams.TSN_HardwareTableIndices.sequenceRecoveryTblIdx = listenerFrerTableIndex;
    monitorParams.TSN_sequenceRecovery.port = portsToMonitor[i];

    rv = SES_FrerGetSequenceRecoveryStatistics(&monitorParams);

    if (rv == SES_PORT_OK) {
    printf(" %-4d | %-7d | %-11llu | %-14llu | %-18llu | %-9llu | %-12llu | %-6llu | %-20llu\n",
    monitorParams.TSN_sequenceRecovery.port,
    listenerFrerTableIndex,
    monitorParams.TSN_perPortPerStreamCounters.rxPassedPkts,
    monitorParams.TSN_perPortPerStreamCounters.rxDiscardedPkts,
    monitorParams.TSN_perPortPerStreamCounters.rxOutOfOrderPkts,
    monitorParams.TSN_perPortPerStreamCounters.rxLostPkts,
    monitorParams.TSN_perPortPerStreamCounters.rxTaglessPkts,
    monitorParams.TSN_perPortPerStreamCounters.rxResets,
    monitorParams.TSN_perPortPerStreamCounters.encodeErroredPkts);
    } else {
    printf(" %-4d | Failed to read stats. Error code: %-93d\n", portsToMonitor[i], rv);
    }
    }
    printf("---------------------------------------------------------------------------------------------------------------------------------------\n");

    return rv;
    }

    // ---------------------------------------------------------------------
    // Basic Environment Setup
    // ---------------------------------------------------------------------
    static int EX_HardcodeBoardSettings(uint8_t *primaryMac, uint8_t *portCount, SES_portInit_t *initializePorts_p)
    {
    uint8_t mac_addr[6] = {0};
    uint8_t mac_addr_talker[6] = {0x7A, 0xC6, 0xBB, 0x11, 0x11, 0x11};
    uint8_t mac_addr_listener[6] = {0x7A, 0xC6, 0xBB, 0x22, 0x22, 0x22};

    if(Frer_Config_opt == 1) //talker
    {
    memcpy(mac_addr, mac_addr_talker, 6);
    }
    if(Frer_Config_opt == 2)//listener
    {
    memcpy(mac_addr, mac_addr_listener, 6);
    }
    memcpy(primaryMac, mac_addr, 6);
    *portCount = PORT_COUNT;

    for (int i = 0; i < *portCount; i++)
    {
    initializePorts_p[i].enablePort = 1;
    initializePorts_p[i].mii = SES_rgmiiMode;
    initializePorts_p[i].phyConfig.autoNegEnable = true;
    initializePorts_p[i].phyConfig.speed = SES_phySpeed1000;
    initializePorts_p[i].phyConfig.duplexMode = SES_phyDuplexModeFull;
    initializePorts_p[i].phyConfig.crossover = SES_autoMdi;
    initializePorts_p[i].miiClkDelays.enableRxDelay = SES_DISABLE_DELAY;
    initializePorts_p[i].miiClkDelays.enableTxDelay = SES_DISABLE_DELAY;
    initializePorts_p[i].miiClkDelays.clkSelection = SES_CLK_INTERNAL;
    initializePorts_p[i].phyConfig.phyPullupCtrl = SES_PHY_PULLUP_INTERNAL;

    uint8_t addrs[] = {0, 1, 2, 4, 8, 9};
    initializePorts_p[i].phyConfig.phyAddr = addrs[i];
    if (i == 0)
    {
    initializePorts_p[i].phyType = SES_phyUnmanaged;
    initializePorts_p[i].linkStatusPolarity = SES_LINK_ACTIVE_LOW;
    }
    else
    {
    initializePorts_p[i].phyType = SES_phyADIN1300;
    }
    }
    return SES_OK;
    }

    static bool EX_IsSpiModeValid(int spiMode)
    {
    return (spiMode >= 0 && spiMode <= 4);
    }

    void handle_sigint(int sig)
    {
    (void)sig; // Acknowledge parameter to stop compiler warning
    AppRunningStatus = 0;
    }


    void sesGetAppInfo()
    {
    int rv;
    SES_appInfo_t appInfo;
    rv = SES_GetFirmwareInfo(&appInfo, sizeof(appInfo));
    if (rv != SES_OK)
    {
    printf("SES getFirmwareInfo error %d\n", rv);
    return;
    }

    printf("---------------------FIRMWARE DETAILS----------------------\n");
    printf("appInfoVersion :: %d\n", appInfo.appInfoVersion);
    printf("buildNumber :: %d\n", appInfo.buildNumber);
    printf("name :: %s\n", appInfo.name);
    printf("part Number :: %s\n", appInfo.partNum);
    printf("Version :: %s\n", appInfo.version);
    printf("-----------------------------------------------------------\n\n");
    }

    static int sesGetStatisticsPortStatistics(uint8_t portCount)
    {
    int rv = SES_OK;
    SES_statistic_t portStats;
    SES_mac_t macIdentifier;

    printf("\n--- Port Statistics ---\n");
    printf("%-4s | %-10s | %-10s | %-8s | %-8s | %-8s | %-8s | %-8s | %-8s | %-5s | %-5s\n",
    "Port", "RxBytes", "TxBytes", "RxUni", "TxUni", "RxBcast", "TxBcast", "RxMulti", "TxMulti", "RxErr", "TxErr");
    printf("-----------------------------------------------------------------------------------------------------------------------\n");

    for (int i = 0; i < portCount; i++)
    {
    switch (i) {
    case 0: macIdentifier = SES_macPort0; break;
    case 1: macIdentifier = SES_macPort1; break;
    case 2: macIdentifier = SES_macPort2; break;
    case 3: macIdentifier = SES_macPort3; break;
    case 4: macIdentifier = SES_macPort4; break;
    case 5: macIdentifier = SES_macPort5; break;
    default: continue;
    }

    rv = SES_GetStatistics(macIdentifier, &portStats, sizeof(SES_statistic_t));
    if (rv != SES_OK) continue;

    uint32_t rxErrors = portStats.rxAlignError + portStats.rxFcsError + portStats.rxLargeError + portStats.rxMacError;
    uint32_t txErrors = portStats.txSingleColl + portStats.txMultiColl + portStats.txExcessColl + portStats.txLateColl + portStats.txDeferred + portStats.txMacError;

    printf(" %-3d | %-10u | %-10u | %-8u | %-8u | %-8u | %-8u | %-8u | %-8u | %-5u | %-5u\n",
    i, portStats.rxByte, portStats.txByte, portStats.rxUnicast, portStats.txUnicast, portStats.rxBroadcast,
    portStats.txBroadcast, portStats.rxMulticast, portStats.txMulticast, rxErrors, txErrors);
    }
    printf("-----------------------------------------------------------------------------------------------------------------------\n");
    return rv;
    }

    Diagram:

    /*
    *       +-----------------------+                     +-----------------------+
    *       |        am62p_1        |                     |        am62p_2        |
    *       |     (Talker Node)     |                     |    (Listener Node)    |
    *       +-----------+-----------+                     +-----------+-----------+
    *                   | eth0                                        | eth0
    *                   |                                             |
    *                   |                                             |
    *                   v Port 1                                      ^ Port 1
    *       +-----------+-----------+                     +-----------+-----------+
    *       |      ADIN6310_1       |                     |      ADIN6310_2       |
    *       |    (Talker Proxy)     |                     |   (Listener Proxy)    |
    *       |                       |                     |                       |
    *       |  [Sequence Generator] |                     |  [Sequence Recovery]  |
    *       +-----+-----------+-----+                     +-----+-----------+-----+
    *      Port 4 |           | Port 5                   Port 4 |           | Port 5
    *             |           |                                 |           |
    *             |           +---------------------------------+           |
    *             |                   Redundant Link B                      |
    *             |                                                         |
    *             +---------------------------------------------------------+
    *                                 Redundant Link A
    */

    Print Log:

    --- Port Statistics ---
    Port | RxBytes | TxBytes | RxUni | TxUni | RxBcast | TxBcast | RxMulti | TxMulti | RxErr | TxErr
    -----------------------------------------------------------------------------------------------------------------------
    0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
    1 | 6227 | 12257 | 2 | 91 | 12 | 16 | 17 | 12 | 0 | 0
    2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
    3 | 0 | 10111 | 0 | 0 | 0 | 22 | 0 | 25 | 0 | 0
    4 | 10857 | 5065 | 91 | 0 | 11 | 10 | 8 | 14 | 0 | 0
    5 | 10857 | 5193 | 91 | 2 | 11 | 10 | 8 | 14 | 0 | 0
    -----------------------------------------------------------------------------------------------------------------------

    --- FRER Listener Stats ---
    Port | Streams | Passed-pkts | Discarded-pkts | OutOfOrder-pkts | Lost-pkts | Tagless-pkts | Resets | Encoder-err-pkts
    ---------------------------------------------------------------------------------------------------------------------------------------
    0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
    1 | 0 | 5 | 5 | 0 | 0 | 0 | 0 | 0
    2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
    3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
    4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
    5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
    ---------------------------------------------------------------------------------------------------------------------------------------
    Received from 10.5.50.2: FRER TESTING 1046
    Received from 10.5.50.2: FRER TESTING 1047
    Received from 10.5.50.2: FRER TESTING 1048
    Received from 10.5.50.2: FRER TESTING 1049
    Received from 10.5.50.2: FRER TESTING 1050

    --- Port Statistics ---
    Port | RxBytes | TxBytes | RxUni | TxUni | RxBcast | TxBcast | RxMulti | TxMulti | RxErr | TxErr
    -----------------------------------------------------------------------------------------------------------------------
    0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
    1 | 6476 | 12665 | 2 | 97 | 12 | 16 | 18 | 12 | 0 | 0
    2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
    3 | 0 | 10360 | 0 | 0 | 0 | 22 | 0 | 26 | 0 | 0
    4 | 11301 | 5314 | 97 | 0 | 11 | 10 | 8 | 15 | 0 | 0
    5 | 11301 | 5442 | 97 | 2 | 11 | 10 | 8 | 15 | 0 | 0
    -----------------------------------------------------------------------------------------------------------------------

    --- FRER Listener Stats ---
    Port | Streams | Passed-pkts | Discarded-pkts | OutOfOrder-pkts | Lost-pkts | Tagless-pkts | Resets | Encoder-err-pkts
    ---------------------------------------------------------------------------------------------------------------------------------------
    0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
    1 | 0 | 5 | 5 | 0 | 0 | 0 | 0 | 0
    2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
    3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
    4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
    5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
    ---------------------------------------------------------------------------------------------------------------------------------------
    Received from 10.5.50.2: FRER TESTING 1051
    Received from 10.5.50.2: FRER TESTING 1052
    Received from 10.5.50.2: FRER TESTING 1053
    Received from 10.5.50.2: FRER TESTING 1054
    Received from 10.5.50.2: FRER TESTING 1055

    --- Port Statistics ---
    Port | RxBytes | TxBytes | RxUni | TxUni | RxBcast | TxBcast | RxMulti | TxMulti | RxErr | TxErr
    -----------------------------------------------------------------------------------------------------------------------
    0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
    1 | 6540 | 13001 | 3 | 102 | 12 | 16 | 18 | 12 | 0 | 0
    2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
    3 | 0 | 10360 | 0 | 0 | 0 | 22 | 0 | 26 | 0 | 0
    4 | 11667 | 5378 | 102 | 1 | 11 | 10 | 8 | 15 | 0 | 0
    5 | 11667 | 5442 | 102 | 2 | 11 | 10 | 8 | 15 | 0 | 0
    -----------------------------------------------------------------------------------------------------------------------

    --- FRER Listener Stats ---
    Port | Streams | Passed-pkts | Discarded-pkts | OutOfOrder-pkts | Lost-pkts | Tagless-pkts | Resets | Encoder-err-pkts
    ---------------------------------------------------------------------------------------------------------------------------------------
    0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
    1 | 0 | 6 | 6 | 0 | 0 | 0 | 0 | 0
    2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
    3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
    4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
    5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
    ---------------------------------------------------------------------------------------------------------------------------------------
    Received from 10.5.50.2: FRER TESTING 1056
    Received from 10.5.50.2: FRER TESTING 1057
    Received from 10.5.50.2: FRER TESTING 1058
    Received from 10.5.50.2: FRER TESTING 1059
    Received from 10.5.50.2: FRER TESTING 1060

    --- Port Statistics ---
    Port | RxBytes | TxBytes | RxUni | TxUni | RxBcast | TxBcast | RxMulti | TxMulti | RxErr | TxErr
    -----------------------------------------------------------------------------------------------------------------------
    0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
    1 | 6540 | 13409 | 3 | 108 | 12 | 16 | 18 | 12 | 0 | 0
    2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
    3 | 0 | 10360 | 0 | 0 | 0 | 22 | 0 | 26 | 0 | 0
    4 | 12111 | 5378 | 108 | 1 | 11 | 10 | 8 | 15 | 0 | 0
    5 | 12111 | 5442 | 108 | 2 | 11 | 10 | 8 | 15 | 0 | 0
    -----------------------------------------------------------------------------------------------------------------------

    --- FRER Listener Stats ---
    Port | Streams | Passed-pkts | Discarded-pkts | OutOfOrder-pkts | Lost-pkts | Tagless-pkts | Resets | Encoder-err-pkts
    ---------------------------------------------------------------------------------------------------------------------------------------
    0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
    1 | 0 | 5 | 5 | 0 | 0 | 0 | 0 | 0
    2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
    3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
    4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
    5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
    ---------------------------------------------------------------------------------------------------------------------------------------
    Received from 10.5.50.2: FRER TESTING 1061
    Received from 10.5.50.2: FRER TESTING 1062
    Received from 10.5.50.2: FRER TESTING 1063
    Received from 10.5.50.2: FRER TESTING 1064
    Received from 10.5.50.2: FRER TESTING 1065

    --- Port Statistics ---
    Port | RxBytes | TxBytes | RxUni | TxUni | RxBcast | TxBcast | RxMulti | TxMulti | RxErr | TxErr
    -----------------------------------------------------------------------------------------------------------------------
    0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
    1 | 6540 | 13681 | 3 | 112 | 12 | 16 | 18 | 12 | 0 | 0
    2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
    3 | 0 | 10360 | 0 | 0 | 0 | 22 | 0 | 26 | 0 | 0
    4 | 12407 | 5378 | 112 | 1 | 11 | 10 | 8 | 15 | 0 | 0
    5 | 12407 | 5442 | 112 | 2 | 11 | 10 | 8 | 15 | 0 | 0
    -----------------------------------------------------------------------------------------------------------------------

    --- FRER Listener Stats ---
    Port | Streams | Passed-pkts | Discarded-pkts | OutOfOrder-pkts | Lost-pkts | Tagless-pkts | Resets | Encoder-err-pkts
    ---------------------------------------------------------------------------------------------------------------------------------------
    0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
    1 | 0 | 5 | 5 | 0 | 0 | 0 | 0 | 0
    2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
    3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
    4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
    5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
    ---------------------------------------------------------------------------------------------------------------------------------------

    What I get is the port connected to switch - 2 with am62p, I am not get the 4 and 5 status.

    Below diagram is FRER in GUI with Source MAC and VLAN Stream.
    (note: only the port config is littel bit changed ) the root port is P2



     


    QUESTION 2

    while we getting the data in FRER we remove one cable from FRER redundant ports and capture the wireshark on it we see the 0xf1c1 as a unkown type not as a FRER tag and no sequence numbe like the provide user guide of ADIN6310,

    Our Setup:
     the F1C1 Type as unknow hoe to fix this?

    Thank you.

  • Hi,

    Question 1:

    In the Wireshark capture from Question 2, the packet doesn't appear to include a VLAN tag.

    Could you please confirm whether the traffic is expected to have a VLAN?

    The initial code shared is matching the destination MAC address and VLAN ID. If the packet doesn't have a VLAN tag, it wouldn't match the Null stream.

    Also, could you try adding a short delay before configuring FRER. After port initialization, it would take some time (2-3 seconds) before the PHYs are brought up. This delay helps ensure the PHY link states are UP before configuring FRER. Some features require the PHY link state to be UP before they can be configured.

    Suggested sequence:

    1. Port Initialization
    2. Loop Protection
    3. Wait for PHY bring up
    4. Configure FRER

    You can also poll the PHY link state using SES_GetLinkState.

    Question 2:

    It could simply be a Wireshark version difference. What version are you currently using?

    I'm currently using v4.2.3, but newer versions should work as well.

    Regards,

    Karl

  • Hi,

    I'm following up if there's any update with the FRER issue.

    Thanks,

    Karl

  • Hi,

    I'm following up again if there's any progress regarding this issue on your side.

    Thanks,

    Karl

  • Hello Karl.O

    I'm deeply sorry for the late replay, i know you replayed 2 time and I also noticed in my mail, but we working on Bi-Directional FRER on it we faces few issue now we solve it no problem we receive data on both side via the VLAN. and one more interesting I notice after configured talker and listener in a Bi Directional FRER setup i wrongly  send data for listener to talker on it i receive two duplicate data at a same time ,that my bad  I swapped the server/client but any way after Bi-dir FRER no issues.

    bellow the full working BI-Directional FRER code.(with one minor issue)

    /*
     * Copyright (c) 2024 - 2026 Analog Devices, Inc. All Rights Reserved.
     */
    //main branch
    #include <stdlib.h>
    #include <stdio.h>
    #include <getopt.h>
    #include <string.h>
    #include <unistd.h>
    #include <signal.h>
    #include <inttypes.h>

    #include <sys/types.h>
    #include <sys/wait.h>

    #include "SES_PORT_interface.h"
    #include "SES_interface_management.h"
    #include "SES_codes.h"
    #include "SES_switch.h"
    #include "SES_port_api.h"
    #include "EX_ses_example_app.h"
    #include "EX_util.h"
    #include "SES_app_debug.h"
    #include "SES_frer.h"
    #include "SES_ptp_config.h"
    #include "SES_frer_config.h"

    #define EVK

    #define PORT_COUNT 6
    #define SPI_SPEED 16000000

    // Port Map Definitions
    #define SES_PORT_0 0
    #define SES_PORT_1 1
    #define SES_PORT_2 2
    #define SES_PORT_3 3
    #define SES_PORT_4 4
    #define SES_PORT_5 5
    #define SES_PORTMAP_PORT_0 1
    #define SES_PORTMAP_PORT_1 2
    #define SES_PORTMAP_PORT_2 4
    #define SES_PORTMAP_PORT_3 8
    #define SES_PORTMAP_PORT_4 16
    #define SES_PORTMAP_PORT_5 32

    // Global Variables
    uint8_t AppRunningStatus = 1;
    struct sigaction signal_exit;
    struct sigaction signal_restart;

    uint8_t Frer_Config_opt = 0;
    int ptpOpt = 0;

    // PTP Config Structures
    PtpConfig_t tcE2EConfig = {
        .switchMac = {0x7A, 0xC6, 0xBB, 0x11, 0x11, 0x11},
        .domainNumber = 0,
        .priority1 = 248, // Ignored by Transparent Clocks
        .priority2 = 248, // Ignored by Transparent Clocks
        .numberPtpPorts = 2,
        .linkPortNumber = {2, 3}, // Bridging traffic between Port 2 and 3
        .instanceType = TSN_ptp_instance_type_e2e_tc,
        .delayMechanism = TSN_ptp_delay_mechanism_e2e
    };

    PtpConfig_t ocConfig = {
        .switchMac = {0x7A, 0xC6, 0xBB, 0x11, 0x11, 0x11},
        .domainNumber = 0,
        .priority1 = 128, // Lower value (128) makes this device the Grandmaster
        .priority2 = 248,
        .numberPtpPorts = 1,   // Ordinary Clocks only use 1 port
        .linkPortNumber = {1}, // Operating on Port 1
        .instanceType = TSN_ptp_instance_type_oc,
        .delayMechanism = TSN_ptp_delay_mechanism_e2e
    };

    PtpConfig_t bcConfig = {
        .switchMac = {0x7A, 0xC6, 0xBB, 0x11, 0x11, 0x11},
        .domainNumber = 0,
        .priority1 = 248, // Standard priority (will yield to a GM with 128)
        .priority2 = 248,
        .numberPtpPorts = 2, // Typically enabled on all switch ports
        .linkPortNumber = {2, 3},
        .instanceType = TSN_ptp_instance_type_bc,
        .delayMechanism = TSN_ptp_delay_mechanism_e2e
    };

    PtpConfig_t gptpConfig = {
        .switchMac = {0x7A, 0xC6, 0xBB, 0x11, 0x11, 0x11},
        .domainNumber = 0,
        .priority1 = 248, // Standard priority (will yield to a GM with 128)
        .priority2 = 248,
        .numberPtpPorts = 2, // Typically enabled on all switch ports
        .linkPortNumber = {2, 3},
        .instanceType = TSN_ptp_instance_type_ptp_relay,
        .delayMechanism = TSN_ptp_delay_mechanism_p2p
    };

    #ifdef EVK
    // FRER Config Structures
    // Switch - 1
    FrerConfig_t talkerConfig1 = {
        .nodeType = FRER_NODE_TALKER,
        .streamIdType = TSN_smacVlan,
        .sourceMac = { 0xC0, 0xD6, 0x0A, 0xF9, 0x6A, 0xD8 },
        .vlan = 100,
        .egressPortMap = SES_PORTMAP_PORT_4 | SES_PORTMAP_PORT_5,
        .ingressSplitPort = SES_PORT_1
    };

    FrerConfig_t listenerConfig2 = {
        .nodeType = FRER_NODE_LISTENER,
        .streamIdType = TSN_smacVlan,
        .sourceMac = { 0xC0, 0xD6, 0x0A, 0xF9, 0x69, 0xC9 },
        .vlan = 100,
        .egressPortMap = SES_PORTMAP_PORT_1,
        .historyLength = 2,
        .resetTimeout = 10000
    };

    // Switch - 2
    FrerConfig_t listenerConfig1 = {
        .nodeType = FRER_NODE_LISTENER,
        .streamIdType = TSN_smacVlan,
        .sourceMac = { 0xC0, 0xD6, 0x0A, 0xF9, 0x6A, 0xD8 },
        .vlan = 100,
        .egressPortMap = SES_PORTMAP_PORT_1,
        .historyLength = 2,
        .resetTimeout = 10000
    };

    FrerConfig_t talkerConfig2 = {
        .nodeType = FRER_NODE_TALKER,
        .streamIdType = TSN_smacVlan,
        .sourceMac = { 0xC0, 0xD6, 0x0A, 0xF9, 0x69, 0xC9 },
        .vlan = 100,
        .egressPortMap = SES_PORTMAP_PORT_4 | SES_PORTMAP_PORT_5,
        .ingressSplitPort = SES_PORT_1
    };
    #endif


    // Function Prototypes
    static bool EX_IsSpiModeValid(int spiMode);
    static int EX_HardcodeBoardSettings(uint8_t *primaryMac, uint8_t *portCount, SES_portInit_t *initializePorts_p);
    void handle_sigint(int sig);
    void handle_sigquit(int sig);

    int main(int argc, char **argv)
    {
        int opt;
        int interfaceId = -1;
        int rv = SES_OK;
        char *interface_p = NULL;
       
        printf("Version : 2.21 - FRER(Embedded AM62p)\n");
        int input_valid = 0;
        char input_buffer[32];
       
        int32_t talkerFrerTableIndex1 = -1;
        int32_t listenerFrerTableIndex1 = -1;
        int32_t talkerFrerTableIndex2 = -1;
        int32_t listenerFrerTableIndex2 = -1;

    #ifdef EVK
        LoopProtectionRule_t TopologyRules[] = {
            { SES_macPort4, (1 << 5) }, // Prevent Port 4 traffic from looping to 5
            { SES_macPort5, (1 << 4) }  // Prevent Port 5 traffic from looping to 4
        };
    #endif

        uint8_t numberOfRules = sizeof(TopologyRules) / sizeof(TopologyRules[0]);

        while (!input_valid)
        {
            printf("\n--- FRER Configuration ---\n");
            printf("1. Talker Config\n");
            printf("2. Listener Config\n");
            printf("3. No FRER Config\n");
            printf("Enter option (1-3): ");

            if (fgets(input_buffer, sizeof(input_buffer), stdin) != NULL)
            {
                if (sscanf(input_buffer, "%hhd", &Frer_Config_opt) == 1)
                {
                    if (Frer_Config_opt >= 1 && Frer_Config_opt <= 3) {
                        input_valid = 1;
                    } else {
                        printf("-> Error: Out of range. Please enter 1, 2, or 3.\n");
                    }
                }
                else
                {
                    printf("-> Error: Invalid character. Please enter a number.\n");
                }
            }
        }

    #if SPIDEV
        const char *readyPin_p = NULL;
    #endif
        uint8_t primaryMac[6] = {0};
        uint8_t hostMac[6] = {0};
        uint8_t portCount;
        SES_portInit_t initializePorts_p[SES_MAX_PORTS] = {0};
        sesID_t deviceId = -1;
        SES_driverFunctions_t driverFunctions = {0};

    #if SPIDEV
        SES_PORT_SpidevInitParams_t spiInitParams = {0};
        while ((opt = getopt(argc, argv, "p:g:s:lh")) != -1)
    #else
        SES_PORT_ft4222InitParams_t spiInitParams = {{0}, 0, SES_PORT_SPI_notUsed};
        while ((opt = getopt(argc, argv, "p:s:lh")) != -1)
    #endif
        {
            switch (opt)
            {
            case 'p':
                interface_p = optarg;
                break;
    #if SPIDEV
            case 'g':
                readyPin_p = optarg;
                break;
    #endif
            case 's':
                spiInitParams.spiMode = strtol(optarg, NULL, 10);
                break;
            case 'h':
            default:
                printf("Usage: %s -p <interface> [-s <mode>]\n", argv[0]);
                exit(EXIT_FAILURE);
            }
        }

        // 1. Initialize Board Settings
        rv = EX_HardcodeBoardSettings(primaryMac, &portCount, initializePorts_p);
        if (rv != SES_OK)
            exit(EXIT_FAILURE);

        // 2. Initialize SES Library
        if (SES_Init() != SES_OK)
            return -1;

        // 3. SPI/Ethernet Selection Logic
        if (spiInitParams.spiMode == SES_PORT_SPI_notUsed)
        {
            if (EX_StringToMacAddress(interface_p, hostMac, ":") != SES_OK)
                exit(EXIT_FAILURE);
            driverFunctions.init_p = SES_PORT_ETH_Init;
            driverFunctions.release_p = SES_PORT_ETH_Release;
            driverFunctions.sendMessage_p = SES_PORT_ETH_SendMessage;
            driverFunctions.updateFilter_p = SES_PORT_ETH_UpdateFilter;
            rv = SES_AddHwInterface(hostMac, &driverFunctions, &interfaceId);
        }
        else
        {
    #if SPIDEV
            if (interface_p)
                spiInitParams.spiDevice = interface_p;
            if (readyPin_p)
                spiInitParams.gpioPin = readyPin_p;
            spiInitParams.speed = SPI_SPEED;
    #else
            if (interface_p)
                spiInitParams.deviceIndex = strtol(interface_p, NULL, 10);
    #endif
            driverFunctions.init_p = SES_PORT_SPI_Init;
            driverFunctions.release_p = SES_PORT_SPI_Release;
            driverFunctions.sendMessage_p = SES_PORT_SPI_SendMessage;
            rv = SES_AddHwInterface(&spiInitParams, &driverFunctions, &interfaceId);
        }

        if (rv != SES_OK)
            return rv;

        // 4. Add Device and Initialize ALL Ports
        rv = SES_AddDevice((uint32_t)interfaceId, primaryMac, &deviceId);
        if (rv == SES_OK)
        {
            rv = SES_InitializePorts(portCount, initializePorts_p);

            if (rv == SES_OK) {
                //EX_ConfigureLoopPreventionMissReturn(); //Hardcode
                int32_t status = EX_ConfigureDynamicLoopPrevention(TopologyRules, numberOfRules);

                if (status != SES_PORT_OK)
                    printf("Failed to apply dynamic loop protection. Error: %d\n", status);

            }
        }

        sleep(3);


        // Print the Firmware Version
        sesGetAppInfo();

        // 6. Apply FRER Configuration
        switch(Frer_Config_opt){
            case 1 : // Talker
                configure_adin6310_frer_node(&talkerConfig1, &talkerFrerTableIndex1);
                printf("FRER Listener Index: %d\n", talkerFrerTableIndex1);
               
                configure_adin6310_frer_node(&listenerConfig2, &listenerFrerTableIndex2);
                printf("FRER Listener Index: %d\n", listenerFrerTableIndex2);

                printf("SES Application Running: FRER Talker and Listener Proxy\n");

            break;

            case 2 : // Listener
                configure_adin6310_frer_node(&listenerConfig1, &listenerFrerTableIndex1);
                printf("FRER Listener Index: %d\n", listenerFrerTableIndex1);

                configure_adin6310_frer_node(&talkerConfig2, &talkerFrerTableIndex2);
                printf("FRER Talker Index: %d\n", talkerFrerTableIndex2);

                printf("SES Application Running: FRER Listener Proxy\n");
            break;

            default:
                printf("No FRER Config\n");
        }

        printf("Flushing Dynamic Table to enforce FRER stream identification...\n");
        SES_FlushDynamicTable();

        // Setup ISR and Loop
        // Ctrl+C to exit
        signal_exit.sa_handler = &handle_sigint;
        sigaction(SIGINT, &signal_exit, NULL);
       
        // Ctrl+\ to restart
        signal_restart.sa_handler = &handle_sigquit;
        sigaction(SIGQUIT, &signal_restart, NULL);

        printf("Setup Finish\n");
        printf("Press 'Ctrl + C' to Exit.\n");
        printf("Press 'Ctrl + \\' to Restart.\n");

        while (AppRunningStatus)
        {
            switch(Frer_Config_opt){
                case 1 : // Talker
                    sesGetStatisticsPortStatistics(6);
                    sesGetFrerListenerStatistics(listenerFrerTableIndex2);
                break;

                case 2 : // Listener
                    sesGetStatisticsPortStatistics(6);
                    sesGetFrerListenerStatistics(listenerFrerTableIndex1);
                break;

                default: // No Frer config
                    printf("No FRER Config\n");
            }
            sleep(5);
        }

        SES_RemoveHwInterface(interfaceId);
        return 0;
    }


    // ---------------------------------------------------------------------
    // Basic Environment Setup
    // ---------------------------------------------------------------------
    static int EX_HardcodeBoardSettings(uint8_t *primaryMac, uint8_t *portCount, SES_portInit_t *initializePorts_p)
    {
        uint8_t mac_addr[6] = {0};
        uint8_t mac_addr_talker[6] = {0x7A, 0xC6, 0xBB, 0x11, 0x11, 0x11};
        uint8_t mac_addr_listener[6] = {0x7A, 0xC6, 0xBB, 0x22, 0x22, 0x22};

        if(Frer_Config_opt == 1) //talker
        {
            memcpy(mac_addr, mac_addr_talker, 6);
        }

        if(Frer_Config_opt == 2)//listener
        {
            memcpy(mac_addr, mac_addr_listener, 6);
        }
        memcpy(primaryMac, mac_addr, 6);
        *portCount = PORT_COUNT;
    #ifdef EVK
        for (int i = 0; i < *portCount; i++)
        {
            initializePorts_p[i].enablePort = 1;
            initializePorts_p[i].mii = SES_rgmiiMode;
            initializePorts_p[i].phyConfig.autoNegEnable = true;
            initializePorts_p[i].phyConfig.speed = SES_phySpeed1000;
            initializePorts_p[i].phyConfig.duplexMode = SES_phyDuplexModeFull;
            initializePorts_p[i].phyConfig.crossover = SES_autoMdi;
            initializePorts_p[i].miiClkDelays.enableRxDelay = SES_DISABLE_DELAY;
            initializePorts_p[i].miiClkDelays.enableTxDelay = SES_DISABLE_DELAY;
            initializePorts_p[i].miiClkDelays.clkSelection = SES_CLK_INTERNAL;
            initializePorts_p[i].phyConfig.phyPullupCtrl = SES_PHY_PULLUP_INTERNAL;

            uint8_t addrs[] = {0, 1, 2, 4, 8, 9};
            initializePorts_p[i].phyConfig.phyAddr = addrs[i];
            if (i == 0)
            {
                initializePorts_p[i].phyType = SES_phyUnmanaged;
                initializePorts_p[i].linkStatusPolarity = SES_LINK_ACTIVE_LOW;
            }
            else
            {
                initializePorts_p[i].phyType = SES_phyADIN1300;
            }
        }
    #endif


        return SES_OK;
    }

    static bool EX_IsSpiModeValid(int spiMode)
    {
        return (spiMode >= 0 && spiMode <= 4);
    }

    void handle_sigint(int sig)
    {
        (void)sig; // Acknowledge parameter to stop compiler warning
        AppRunningStatus = 0;
    }

    void handle_sigquit(int sig)
    {
        (void)sig;
        AppRunningStatus = 0; // Break the while loop
        int32_t rv = SES_SystemReset();
        if (rv == SES_OK)
            printf("SWITCH RESET DONE !!\n");
        else
            printf("SWITCH FAILED TO RESET !!\n");
       
    }



    int32_t configure_adin6310_frer_node(FrerConfig_t *config, int32_t *frerTableIndex)
    {
        int32_t rv = 0;
       
        TSN_ieee802Dot1cbFrer_t frerParams;
        TSN_ieee802Dot1cbStream_t streamParams;
        TSN_ieee802Dot1cbMaskAndMatch_t maskMatchParams;
       
        memset(&frerParams, 0, sizeof(TSN_ieee802Dot1cbFrer_t));
        memset(&streamParams, 0, sizeof(TSN_ieee802Dot1cbStream_t));
        memset(&maskMatchParams, 0, sizeof(TSN_ieee802Dot1cbMaskAndMatch_t));

        // 1. Configure VLAN Mode
        rv = SES_SetVlanMode(config->vlan, 0xFFF);
        if (rv < SES_PORT_OK) printf("SES_SetVlanMode Error :: %d\n", rv);

        // 2. Map Stream Identification Types
        streamParams.TSN_streamIdentity.identificationType = config->streamIdType;
       
        switch (config->streamIdType) {
           
            case TSN_nullStream:
                memcpy(streamParams.TSN_streamIdentity.TSN_parameters.TSN_nullStreamIdentification.destinationMac, config->destMac, 6);
                streamParams.TSN_streamIdentity.TSN_parameters.TSN_nullStreamIdentification.vlan = config->vlan;
                break;

            case TSN_smacVlan:
                memcpy(streamParams.TSN_streamIdentity.TSN_parameters.TSN_smacVlanStreamIdentification.sourceMac, config->sourceMac, 6);
                streamParams.TSN_streamIdentity.TSN_parameters.TSN_smacVlanStreamIdentification.vlan = config->vlan;
                break;

            case TSN_dmacVlan:
                memcpy(streamParams.TSN_streamIdentity.TSN_parameters.TSN_dmacVlanStreamIdentification.TSN_down.destinationMac, config->activeDestMacDown, 6);
                memcpy(streamParams.TSN_streamIdentity.TSN_parameters.TSN_dmacVlanStreamIdentification.TSN_up.destinationMac, config->activeDestMacUp, 6);
                streamParams.TSN_streamIdentity.TSN_parameters.TSN_dmacVlanStreamIdentification.TSN_down.vlan = config->vlan;
                streamParams.TSN_streamIdentity.TSN_parameters.TSN_dmacVlanStreamIdentification.TSN_up.vlan = config->vlanUp;
                streamParams.TSN_streamIdentity.TSN_parameters.TSN_dmacVlanStreamIdentification.TSN_up.priority = 1;
                break;

            case TSN_ip:
                memcpy(streamParams.TSN_streamIdentity.TSN_parameters.TSN_ipStreamIdentification.destinationMac, config->destMac, 6);
                streamParams.TSN_streamIdentity.TSN_parameters.TSN_ipStreamIdentification.vlan = config->vlan;
                for (int i=0; i<4; i++) {
                    streamParams.TSN_streamIdentity.TSN_parameters.TSN_ipStreamIdentification.ipSource.TSN_ipv4Address[i] = config->sourceIp[i];
                    streamParams.TSN_streamIdentity.TSN_parameters.TSN_ipStreamIdentification.ipDestination.TSN_ipv4Address[i] = config->destIp[i];
                }
                streamParams.TSN_streamIdentity.TSN_parameters.TSN_ipStreamIdentification.dscp = 0x00;
                streamParams.TSN_streamIdentity.TSN_parameters.TSN_ipStreamIdentification.nextProtocol = config->nextProtocol;
                streamParams.TSN_streamIdentity.TSN_parameters.TSN_ipStreamIdentification.sourcePort = config->sourcePort;
                streamParams.TSN_streamIdentity.TSN_parameters.TSN_ipStreamIdentification.destinationPort = config->destPort;
                streamParams.TSN_streamIdentity.TSN_parameters.TSN_ipStreamIdentification.ipv4 = true;
                break;

            case TSN_maskAndMatch:
                memcpy(streamParams.TSN_streamIdentity.TSN_parameters.TSN_maskAndMatchIdentification.sourceMacMask, config->sourceMacMask, 6);
                memcpy(streamParams.TSN_streamIdentity.TSN_parameters.TSN_maskAndMatchIdentification.destinationMacMask, config->destMacMask, 6);
                memcpy(streamParams.TSN_streamIdentity.TSN_parameters.TSN_maskAndMatchIdentification.sourceMacMatch, config->sourceMac, 6);
                memcpy(streamParams.TSN_streamIdentity.TSN_parameters.TSN_maskAndMatchIdentification.destinationMacMatch, config->destMac, 6);
                streamParams.TSN_streamIdentity.TSN_parameters.TSN_maskAndMatchIdentification.msduMaskLength = config->msduMaskLength;
               
                for(int i=0; i<4; i++){
                    maskMatchParams.msduMask[i] = config->msduMask[i];
                    maskMatchParams.msduMatch[i] = config->msduMatch[i];
                }
                break;
               
            default:
                return SES_PARAM_ERROR;
        }

        // 3. Hardware Egress Mapping (Common to both)
        streamParams.portMap = config->egressPortMap;
        streamParams.TSN_HardwareTableIndices.dynTblIdx[0] = -1;
        streamParams.TSN_HardwareTableIndices.dynTblIdx[1] = -1;
        streamParams.TSN_HardwareTableIndices.exTblruleId = -1;
        streamParams.useStreamtable = false;

        // Reset Table Indices for FRER parameters
        frerParams.TSN_HardwareTableIndices.individualRecoveryTblIdx = -1;
        frerParams.TSN_HardwareTableIndices.sequenceGenerationTblIdx = -1;
        frerParams.TSN_HardwareTableIndices.sequenceRecoveryTblIdx = -1;
        frerParams.TSN_HardwareTableIndices.txTransformTblIdx = -1;

        // 4. Apply Talker vs Listener Logic
        if (config->nodeType == FRER_NODE_TALKER)
        {
            frerParams.TSN_sequenceGeneration.reset = false;
            frerParams.TSN_sequenceRecovery.individualRecovery = false;
            frerParams.TSN_streamSplit.port = config->ingressSplitPort; // Ingress port

            rv = SES_FrerConfigureTalkerProxyForStream(&frerParams, &streamParams, &maskMatchParams);
            if (rv == SES_PORT_OK && frerTableIndex != NULL) {
                *frerTableIndex = frerParams.TSN_HardwareTableIndices.sequenceGenerationTblIdx;
            }
        }
        else if (config->nodeType == FRER_NODE_LISTENER)
        {
            frerParams.TSN_sequenceRecovery.algorithm = TSN_vector;
            frerParams.TSN_sequenceRecovery.historyLength = config->historyLength;
            frerParams.TSN_sequenceRecovery.resetTimeout = config->resetTimeout;
            frerParams.TSN_sequenceRecovery.takeNoSequence = false;
            frerParams.TSN_sequenceRecovery.individualRecovery = false;

            rv = SES_FrerConfigureListenerProxyForStream(&frerParams, &streamParams, &maskMatchParams);
            if (rv == SES_PORT_OK && frerTableIndex != NULL) {
                *frerTableIndex = frerParams.TSN_HardwareTableIndices.sequenceRecoveryTblIdx;
            }
        }

        return rv;
    }


    int32_t EX_ConfigureDynamicLoopPrevention(LoopProtectionRule_t *rules, uint8_t ruleCount)
    {
        int32_t rv = SES_PORT_OK;
        uint8_t portMap;
        bool cutThrough;
        uint8_t lookupDone;
        uint8_t txFilter;
        bool txFilterValid;
        uint8_t rxFilter;
        bool rxFilterValid;

        for (uint8_t i = 0; i < ruleCount; i++) {
            uint8_t currentPort = rules[i].sourcePort;
            uint8_t blockMask = rules[i].blockedPortMask;

            // Apply to Unicast
            rv = SES_GetUnicastMissReturn(currentPort, &portMap, &cutThrough, &lookupDone, &txFilter, &txFilterValid, &rxFilter, &rxFilterValid);
            if (rv == SES_PORT_OK) {
                portMap = portMap & ~(blockMask); // Clear the bits for the blocked ports
                rv = SES_SetUnicastMissReturn(currentPort, portMap, cutThrough, lookupDone, txFilter, txFilterValid, rxFilter, rxFilterValid);
                if (rv != SES_PORT_OK) {
                    printf("Error setting Unicast miss return for port %d\n", currentPort);
                    return rv;
                }
            }

            // Apply to Multicast
            rv = SES_GetMulticastMissReturn(currentPort, &portMap, &cutThrough, &lookupDone, &txFilter, &txFilterValid, &rxFilter, &rxFilterValid);
            if (rv == SES_PORT_OK) {
                portMap = portMap & ~(blockMask); // Clear the bits for the blocked ports
                rv = SES_SetMulticastMissReturn(currentPort, portMap, cutThrough, lookupDone, txFilter, txFilterValid, rxFilter, rxFilterValid);
                if (rv != SES_PORT_OK) {
                    printf("Error setting Multicast miss return for port %d\n", currentPort);
                    return rv;
                }
            }
        }

        printf("Dynamic Loop Protection Applied for %d rules.\n", ruleCount);
        return SES_PORT_OK;
    }


    int sesGetFrerListenerStatistics(int32_t listenerFrerTableIndex)
    {
        if (listenerFrerTableIndex == -1) {
            return SES_OK;
        }

        int rv = SES_OK;
        TSN_ieee802Dot1cbFrer_t monitorParams;
       
        // Define the ingress ports want to monitor (Redundant Link A and B)
        uint8_t portsToMonitor[] = {0, 1 ,2 ,3 ,4, 5};
        int numPorts = sizeof(portsToMonitor) / sizeof(portsToMonitor[0]);

        printf("\n--- FRER Listener Stats ---\n");
       
        // Print Table Header
        printf("%-5s | %-7s | %-11s | %-14s | %-18s | %-9s | %-12s | %-6s | %-20s\n",
               "Port", "Streams", "Passed-pkts", "Discarded-pkts", "OutOfOrder-pkts", "Lost-pkts", "Tagless-pkts", "Resets", "Encoder-err-pkts");
        printf("---------------------------------------------------------------------------------------------------------------------------------------\n");

        for (int i = 0; i < numPorts; i++) {
            monitorParams.TSN_HardwareTableIndices.sequenceRecoveryTblIdx = listenerFrerTableIndex;
            monitorParams.TSN_sequenceRecovery.port = portsToMonitor[i];

            rv = SES_FrerGetSequenceRecoveryStatistics(&monitorParams);
           
            if (rv == SES_PORT_OK) {
                printf(" %-4d | %-7d | %-11llu | %-14llu | %-18llu | %-9llu | %-12llu | %-6llu | %-20llu\n",
                       monitorParams.TSN_sequenceRecovery.port,
                       listenerFrerTableIndex,
                       monitorParams.TSN_perPortPerStreamCounters.rxPassedPkts,
                       monitorParams.TSN_perPortPerStreamCounters.rxDiscardedPkts,
                       monitorParams.TSN_perPortPerStreamCounters.rxOutOfOrderPkts,
                       monitorParams.TSN_perPortPerStreamCounters.rxLostPkts,
                       monitorParams.TSN_perPortPerStreamCounters.rxTaglessPkts,
                       monitorParams.TSN_perPortPerStreamCounters.rxResets,
                       monitorParams.TSN_perPortPerStreamCounters.encodeErroredPkts);
            } else {
                printf(" %-4d | Failed to read stats. Error code: %-93d\n", portsToMonitor[i], rv);
            }
        }
        printf("---------------------------------------------------------------------------------------------------------------------------------------\n");
       
        return rv;
    }

    log: Not a bueatify one in formate.
    ///-------------------
    /// FULL WORKING AM62P-BIDIRECTION LOG
    ///-------------------


    //AM62P_1
    root@am62pxx-evm:~/TSN_2# ./ses-example-app -p /dev/spidev1.0 -s 1 -g /dev/gpiochip1:14
    Version : 2.21 - FRER(Embedded AM62p)

    --- FRER Configuration ---
    1. Talker Config
    2. Listener Config
    3. No FRER Config
    Enter option (1-3): 2
    Loop Protection (Miss Return Approach) Applied between Ports 4 & 5.
    ---------------------FIRMWARE DETAILS----------------------
    appInfoVersion   :: 1
    buildNumber      :: 329
    name             :: TSN Agent SES Application
    part Number      :: SC0000519
    Version          :: 005
    -----------------------------------------------------------

    FRER Listener Index: 0
    FRER Talker Index: 0
    SES Application Running: FRER Listener Proxy
    Flushing Dynamic Table to enforce FRER stream identification...
    Setup Finish

    --- Port Statistics ---
    Port | RxBytes    | TxBytes    | RxUni    | TxUni    | RxBcast  | TxBcast  | RxMulti  | TxMulti  | RxErr | TxErr
    -----------------------------------------------------------------------------------------------------------------------
     0   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     1   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     2   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     3   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     4   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     5   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
    -----------------------------------------------------------------------------------------------------------------------

    --- FRER Listener Stats ---
    Port  | Streams | Passed-pkts | Discarded-pkts | OutOfOrder-pkts    | Lost-pkts | Tagless-pkts | Resets | Encoder-err-pkts    
    ---------------------------------------------------------------------------------------------------------------------------------------
     0    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     1    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     2    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     3    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     4    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     5    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
    ---------------------------------------------------------------------------------------------------------------------------------------
    [ 2727.123073] am65-cpsw-nuss 8000000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off

    --- Port Statistics ---
    Port | RxBytes    | TxBytes    | RxUni    | TxUni    | RxBcast  | TxBcast  | RxMulti  | TxMulti  | RxErr | TxErr
    -----------------------------------------------------------------------------------------------------------------------
     0   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     1   | 1751       | 0          | 3        | 0        | 2        | 0        | 7        | 0        | 0     | 0    
     2   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     3   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     4   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     5   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
    -----------------------------------------------------------------------------------------------------------------------

    --- FRER Listener Stats ---
    Port  | Streams | Passed-pkts | Discarded-pkts | OutOfOrder-pkts    | Lost-pkts | Tagless-pkts | Resets | Encoder-err-pkts    
    ---------------------------------------------------------------------------------------------------------------------------------------
     0    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     1    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     2    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     3    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     4    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     5    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
    ---------------------------------------------------------------------------------------------------------------------------------------

    --- Port Statistics ---
    Port | RxBytes    | TxBytes    | RxUni    | TxUni    | RxBcast  | TxBcast  | RxMulti  | TxMulti  | RxErr | TxErr
    -----------------------------------------------------------------------------------------------------------------------
     0   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     1   | 3675       | 0          | 9        | 0        | 6        | 0        | 9        | 0        | 0     | 0    
     2   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     3   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     4   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     5   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
    -----------------------------------------------------------------------------------------------------------------------

    --- FRER Listener Stats ---
    Port  | Streams | Passed-pkts | Discarded-pkts | OutOfOrder-pkts    | Lost-pkts | Tagless-pkts | Resets | Encoder-err-pkts    
    ---------------------------------------------------------------------------------------------------------------------------------------
     0    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     1    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     2    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     3    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     4    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     5    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
    ---------------------------------------------------------------------------------------------------------------------------------------

    --- Port Statistics ---
    Port | RxBytes    | TxBytes    | RxUni    | TxUni    | RxBcast  | TxBcast  | RxMulti  | TxMulti  | RxErr | TxErr
    -----------------------------------------------------------------------------------------------------------------------
     0   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     1   | 4017       | 0          | 13       | 0        | 6        | 0        | 10       | 0        | 0     | 0    
     2   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     3   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     4   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     5   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
    -----------------------------------------------------------------------------------------------------------------------

    --- FRER Listener Stats ---
    Port  | Streams | Passed-pkts | Discarded-pkts | OutOfOrder-pkts    | Lost-pkts | Tagless-pkts | Resets | Encoder-err-pkts    
    ---------------------------------------------------------------------------------------------------------------------------------------
     0    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     1    | 0       | 0           | 0              | 0                  | 0         | 0            | 1      | 0                   
     2    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     3    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     4    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     5    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
    ---------------------------------------------------------------------------------------------------------------------------------------

    --- Port Statistics ---
    Port | RxBytes    | TxBytes    | RxUni    | TxUni    | RxBcast  | TxBcast  | RxMulti  | TxMulti  | RxErr | TxErr
    -----------------------------------------------------------------------------------------------------------------------
     0   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     1   | 5181       | 0          | 19       | 0        | 8        | 0        | 11       | 0        | 0     | 0    
     2   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     3   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     4   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     5   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
    -----------------------------------------------------------------------------------------------------------------------

    --- FRER Listener Stats ---
    Port  | Streams | Passed-pkts | Discarded-pkts | OutOfOrder-pkts    | Lost-pkts | Tagless-pkts | Resets | Encoder-err-pkts    
    ---------------------------------------------------------------------------------------------------------------------------------------
     0    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     1    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     2    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     3    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     4    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     5    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
    ---------------------------------------------------------------------------------------------------------------------------------------
    Received from 10.5.50.2: FRER TESTING 23492
    Received from 10.5.50.2: FRER TESTING 23493
    Received from 10.5.50.2: FRER TESTING 23494
    Received from 10.5.50.2: FRER TESTING 23495
    Received from 10.5.50.2: FRER TESTING 23496
    Received from 10.5.50.2: FRER TESTING 23497
    Received from 10.5.50.2: FRER TESTING 23498
    Received from 10.5.50.2: FRER TESTING 23499
    Received from 10.5.50.2: FRER TESTING 23500
    Received from 10.5.50.2: FRER TESTING 23501
    Received from 10.5.50.2: FRER TESTING 23502
    Received from 10.5.50.2: FRER TESTING 23503
    Received from 10.5.50.2: FRER TESTING 23504
    Received from 10.5.50.2: FRER TESTING 23505
    Received from 10.5.50.2: FRER TESTING 23506
    Received from 10.5.50.2: FRER TESTING 23507
    Received from 10.5.50.2: FRER TESTING 23508
    Received from 10.5.50.2: FRER TESTING 23509
    Received from 10.5.50.2: FRER TESTING 23510
    Received from 10.5.50.2: FRER TESTING 23511
    Received from 10.5.50.2: FRER TESTING 23512
    Received from 10.5.50.2: FRER TESTING 23513
    Received from 10.5.50.2: FRER TESTING 23514
    Received from 10.5.50.2: FRER TESTING 23515
    Received from 10.5.50.2: FRER TESTING 23516
    Received from 10.5.50.2: FRER TESTING 23517
    Received from 10.5.50.2: FRER TESTING 23518

    --- Port Statistics ---
    Port | RxBytes    | TxBytes    | RxUni    | TxUni    | RxBcast  | TxBcast  | RxMulti  | TxMulti  | RxErr | TxErr
    -----------------------------------------------------------------------------------------------------------------------
     0   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     1   | 5449       | 0          | 23       | 0        | 8        | 0        | 11       | 0        | 0     | 0    
     2   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     3   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
    Received from 10.5.50.2: FRER TESTING 23519
     4   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     5   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
    -----------------------------------------------------------------------------------------------------------------------

    --- FRER Listener Stats ---
    Port  | Streams | Passed-pkts | Discarded-pkts | OutOfOrder-pkts    | Lost-pkts | Tagless-pkts | Resets | Encoder-err-pkts    
    ---------------------------------------------------------------------------------------------------------------------------------------
     0    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     1    | 0       | 32          | 32             | 0                  | 2         | 0            | 0      | 0                   
     2    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     3    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     4    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     5    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
    ---------------------------------------------------------------------------------------------------------------------------------------
    Received from 10.5.50.2: FRER TESTING 23520
    Received from 10.5.50.2: FRER TESTING 23521
    Received from 10.5.50.2: FRER TESTING 23522
    Received from 10.5.50.2: FRER TESTING 23523
    Received from 10.5.50.2: FRER TESTING 23524
    Received from 10.5.50.2: FRER TESTING 23525
    Received from 10.5.50.2: FRER TESTING 23526
    Received from 10.5.50.2: FRER TESTING 23527
    Received from 10.5.50.2: FRER TESTING 23528
    Received from 10.5.50.2: FRER TESTING 23529
    Received from 10.5.50.2: FRER TESTING 23530
    Received from 10.5.50.2: FRER TESTING 23531
    Received from 10.5.50.2: FRER TESTING 23532
    Received from 10.5.50.2: FRER TESTING 23533
    Received from 10.5.50.2: FRER TESTING 23534
    Received from 10.5.50.2: FRER TESTING 23535
    Received from 10.5.50.2: FRER TESTING 23536
    Received from 10.5.50.2: FRER TESTING 23537
    Received from 10.5.50.2: FRER TESTING 23538
    Received from 10.5.50.2: FRER TESTING 23539
    Received from 10.5.50.2: FRER TESTING 23540
    Received from 10.5.50.2: FRER TESTING 23541
    Received from 10.5.50.2: FRER TESTING 23542
    Received from 10.5.50.2: FRER TESTING 23543
    Received from 10.5.50.2: FRER TESTING 23544
    Received from 10.5.50.2: FRER TESTING 23545
    Received from 10.5.50.2: FRER TESTING 23546
    Received from 10.5.50.2: FRER TESTING 23547
    Received from 10.5.50.2: FRER TESTING 23548
    Received from 10.5.50.2: FRER TESTING 23549
    Received from 10.5.50.2: FRER TESTING 23550
    Received from 10.5.50.2: FRER TESTING 23551
    Received from 10.5.50.2: FRER TESTING 23552
    Received from 10.5.50.2: FRER TESTING 23553
    Received from 10.5.50.2: FRER TESTING 23554
    Received from 10.5.50.2: FRER TESTING 23555
    Received from 10.5.50.2: FRER TESTING 23556
    Received from 10.5.50.2: FRER TESTING 23557
    Received from 10.5.50.2: FRER TESTING 23558
    Received from 10.5.50.2: FRER TESTING 23559
    Received from 10.5.50.2: FRER TESTING 23560
    Received from 10.5.50.2: FRER TESTING 23561
    Received from 10.5.50.2: FRER TESTING 23562
    Received from 10.5.50.2: FRER TESTING 23563
    Received from 10.5.50.2: FRER TESTING 23564
    Received from 10.5.50.2: FRER TESTING 23565
    Received from 10.5.50.2: FRER TESTING 23566
    Received from 10.5.50.2: FRER TESTING 23567
    Received from 10.5.50.2: FRER TESTING 23568

    --- Port Statistics ---
    Port | RxBytes    | TxBytes    | RxUni    | TxUni    | RxBcast  | TxBcast  | RxMulti  | TxMulti  | RxErr | TxErr
    -----------------------------------------------------------------------------------------------------------------------
     0   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     1   | 5993       | 8374       | 30       | 74       | 8        | 7        | 12       | 12       | 0     | 0    
     2   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     3   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
    Received from 10.5.50.2: FRER TESTING 23569
     4   | 7800       | 519        | 74       | 6        | 5        | 0        | 8        | 1        | 0     | 0    
     5   | 7800       | 519        | 74       | 6        | 5        | 0        | 8        | 1        | 0     | 0    
    -----------------------------------------------------------------------------------------------------------------------

    --- FRER Listener Stats ---
    Port  | Streams | Passed-pkts | Discarded-pkts | OutOfOrder-pkts    | Lost-pkts | Tagless-pkts | Resets | Encoder-err-pkts    
    ---------------------------------------------------------------------------------------------------------------------------------------
     0    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     1    | 0       | 53          | 53             | 0                  | 0         | 0            | 0      | 0                   
     2    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     3    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     4    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     5    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
    ---------------------------------------------------------------------------------------------------------------------------------------
    Received from 10.5.50.2: FRER TESTING 23570
    Received from 10.5.50.2: FRER TESTING 23571
    Received from 10.5.50.2: FRER TESTING 23572
    Received from 10.5.50.2: FRER TESTING 23573
    Received from 10.5.50.2: FRER TESTING 23574
    Received from 10.5.50.2: FRER TESTING 23575
    Received from 10.5.50.2: FRER TESTING 23576
    Received from 10.5.50.2: FRER TESTING 23577
    Received from 10.5.50.2: FRER TESTING 23578
    Received from 10.5.50.2: FRER TESTING 23579
    Received from 10.5.50.2: FRER TESTING 23580
    Received from 10.5.50.2: FRER TESTING 23581
    Received from 10.5.50.2: FRER TESTING 23582
    Received from 10.5.50.2: FRER TESTING 23583
    Received from 10.5.50.2: FRER TESTING 23584
    Received from 10.5.50.2: FRER TESTING 23585
    Received from 10.5.50.2: FRER TESTING 23586
    Received from 10.5.50.2: FRER TESTING 23587
    Received from 10.5.50.2: FRER TESTING 23588
    Received from 10.5.50.2: FRER TESTING 23589
    Received from 10.5.50.2: FRER TESTING 23590
    Received from 10.5.50.2: FRER TESTING 23591
    Received from 10.5.50.2: FRER TESTING 23592
    Received from 10.5.50.2: FRER TESTING 23593
    Received from 10.5.50.2: FRER TESTING 23594
    Received from 10.5.50.2: FRER TESTING 23595
    Received from 10.5.50.2: FRER TESTING 23596
    Received from 10.5.50.2: FRER TESTING 23597
    Received from 10.5.50.2: FRER TESTING 23598
    Received from 10.5.50.2: FRER TESTING 23599
    Received from 10.5.50.2: FRER TESTING 23600
    Received from 10.5.50.2: FRER TESTING 23601
    Received from 10.5.50.2: FRER TESTING 23602
    Received from 10.5.50.2: FRER TESTING 23603
    Received from 10.5.50.2: FRER TESTING 23604
    Received from 10.5.50.2: FRER TESTING 23605
    Received from 10.5.50.2: FRER TESTING 23606
    Received from 10.5.50.2: FRER TESTING 23607
    Received from 10.5.50.2: FRER TESTING 23608
    Received from 10.5.50.2: FRER TESTING 23609
    Received from 10.5.50.2: FRER TESTING 23610
    Received from 10.5.50.2: FRER TESTING 23611
    Received from 10.5.50.2: FRER TESTING 23612
    Received from 10.5.50.2: FRER TESTING 23613
    Received from 10.5.50.2: FRER TESTING 23614
    Received from 10.5.50.2: FRER TESTING 23615
    Received from 10.5.50.2: FRER TESTING 23616
    Received from 10.5.50.2: FRER TESTING 23617
    Received from 10.5.50.2: FRER TESTING 23618

    --- Port Statistics ---
    Port | RxBytes    | TxBytes    | RxUni    | TxUni    | RxBcast  | TxBcast  | RxMulti  | TxMulti  | RxErr | TxErr
    -----------------------------------------------------------------------------------------------------------------------
     0   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     1   | 6926       | 11818      | 34       | 114      | 9        | 9        | 14       | 12       | 0     | 0    
     2   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     3   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     4   | 11142      | 1476       | 114      | 10       | 6        | 1        | 8        | 3        | 0     | 0    
     5   | 11142      | 1476       | 114      | 10       | 6        | 1        | 8        | 3        | 0     | 0    
    -----------------------------------------------------------------------------------------------------------------------

    --- FRER Listener Stats ---
    Port  | Streams | Passed-pkts | Discarded-pkts | OutOfOrder-pkts    | Lost-pkts | Tagless-pkts | Resets | Encoder-err-pkts    
    ---------------------------------------------------------------------------------------------------------------------------------------
    Received from 10.5.50.2: FRER TESTING 23619
     0    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     1    | 0       | 51          | 51             | 0                  | 0         | 0            | 0      | 0                   
     2    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     3    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     4    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     5    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
    ---------------------------------------------------------------------------------------------------------------------------------------
    Received from 10.5.50.2: FRER TESTING 23620
    Received from 10.5.50.2: FRER TESTING 23621
    Received from 10.5.50.2: FRER TESTING 23622
    Received from 10.5.50.2: FRER TESTING 23623
    Received from 10.5.50.2: FRER TESTING 23624
    Received from 10.5.50.2: FRER TESTING 23625
    Received from 10.5.50.2: FRER TESTING 23626
    Received from 10.5.50.2: FRER TESTING 23627
    Received from 10.5.50.2: FRER TESTING 23628
    Received from 10.5.50.2: FRER TESTING 23629
    Received from 10.5.50.2: FRER TESTING 23630
    Received from 10.5.50.2: FRER TESTING 23631
    Received from 10.5.50.2: FRER TESTING 23632
    Received from 10.5.50.2: FRER TESTING 23633
    Received from 10.5.50.2: FRER TESTING 23634
    Received from 10.5.50.2: FRER TESTING 23635
    Received from 10.5.50.2: FRER TESTING 23636
    Received from 10.5.50.2: FRER TESTING 23637
    Received from 10.5.50.2: FRER TESTING 23638
    Received from 10.5.50.2: FRER TESTING 23639
    Received from 10.5.50.2: FRER TESTING 23640
    Received from 10.5.50.2: FRER TESTING 23641
    Received from 10.5.50.2: FRER TESTING 23642
    Received from 10.5.50.2: FRER TESTING 23643
    Received from 10.5.50.2: FRER TESTING 23644
    Received from 10.5.50.2: FRER TESTING 23645
    Received from 10.5.50.2: FRER TESTING 23646
    Received from 10.5.50.2: FRER TESTING 23647
    Received from 10.5.50.2: FRER TESTING 23648
    Received from 10.5.50.2: FRER TESTING 23649
    Received from 10.5.50.2: FRER TESTING 23650
    Received from 10.5.50.2: FRER TESTING 23651
    Received from 10.5.50.2: FRER TESTING 23652
    Received from 10.5.50.2: FRER TESTING 23653
    Received from 10.5.50.2: FRER TESTING 23654
    Received from 10.5.50.2: FRER TESTING 23655
    Received from 10.5.50.2: FRER TESTING 23656
    Received from 10.5.50.2: FRER TESTING 23657
    Received from 10.5.50.2: FRER TESTING 23658
    Received from 10.5.50.2: FRER TESTING 23659
    Received from 10.5.50.2: FRER TESTING 23660
    Received from 10.5.50.2: FRER TESTING 23661
    Received from 10.5.50.2: FRER TESTING 23662
    Received from 10.5.50.2: FRER TESTING 23663
    Received from 10.5.50.2: FRER TESTING 23664
    Received from 10.5.50.2: FRER TESTING 23665
    Received from 10.5.50.2: FRER TESTING 23666
    Received from 10.5.50.2: FRER TESTING 23667
    Received from 10.5.50.2: FRER TESTING 23668

    --- Port Statistics ---
    Port | RxBytes    | TxBytes    | RxUni    | TxUni    | RxBcast  | TxBcast  | RxMulti  | TxMulti  | RxErr | TxErr
    -----------------------------------------------------------------------------------------------------------------------
     0   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     1   | 7674       | 17214      | 40       | 174      | 10       | 12       | 14       | 15       | 0     | 0    
     2   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     3   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     4   | 16494      | 2266       | 174      | 16       | 8        | 2        | 10       | 3        | 0     | 0    
     5   | 16494      | 2266       | 174      | 16       | 8        | 2        | 10       | 3        | 0     | 0    
    -----------------------------------------------------------------------------------------------------------------------

    --- FRER Listener Stats ---
    Port  | Streams | Passed-pkts | Discarded-pkts | OutOfOrder-pkts    | Lost-pkts | Tagless-pkts | Resets | Encoder-err-pkts    
    ---------------------------------------------------------------------------------------------------------------------------------------
     0    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
    Received from 10.5.50.2: FRER TESTING 23669
     1    | 0       | 51          | 51             | 0                  | 0         | 0            | 0      | 0                   
     2    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     3    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     4    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     5    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
    ---------------------------------------------------------------------------------------------------------------------------------------
    Received from 10.5.50.2: FRER TESTING 23670
    Received from 10.5.50.2: FRER TESTING 23671
    Received from 10.5.50.2: FRER TESTING 23672
    Received from 10.5.50.2: FRER TESTING 23673
    Received from 10.5.50.2: FRER TESTING 23674
    Received from 10.5.50.2: FRER TESTING 23675
    Received from 10.5.50.2: FRER TESTING 23676
    Received from 10.5.50.2: FRER TESTING 23677
    Received from 10.5.50.2: FRER TESTING 23678
    Received from 10.5.50.2: FRER TESTING 23679
    Received from 10.5.50.2: FRER TESTING 23680
    Received from 10.5.50.2: FRER TESTING 23681
    Received from 10.5.50.2: FRER TESTING 23682
    Received from 10.5.50.2: FRER TESTING 23683
    Received from 10.5.50.2: FRER TESTING 23684
    Received from 10.5.50.2: FRER TESTING 23685
    Received from 10.5.50.2: FRER TESTING 23686
    Received from 10.5.50.2: FRER TESTING 23687
    Received from 10.5.50.2: FRER TESTING 23688
    Received from 10.5.50.2: FRER TESTING 23689
    Received from 10.5.50.2: FRER TESTING 23690
    Received from 10.5.50.2: FRER TESTING 23691
    Received from 10.5.50.2: FRER TESTING 23692
    Received from 10.5.50.2: FRER TESTING 23693
    Received from 10.5.50.2: FRER TESTING 23694
    Received from 10.5.50.2: FRER TESTING 23695
    Received from 10.5.50.2: FRER TESTING 23696
    Received from 10.5.50.2: FRER TESTING 23697
    Received from 10.5.50.2: FRER TESTING 23698
    Received from 10.5.50.2: FRER TESTING 23699
    Received from 10.5.50.2: FRER TESTING 23700
    Received from 10.5.50.2: FRER TESTING 23701
    Received from 10.5.50.2: FRER TESTING 23702
    Received from 10.5.50.2: FRER TESTING 23703
    Received from 10.5.50.2: FRER TESTING 23704
    Received from 10.5.50.2: FRER TESTING 23705
    Received from 10.5.50.2: FRER TESTING 23706
    Received from 10.5.50.2: FRER TESTING 23707
    Received from 10.5.50.2: FRER TESTING 23708
    Received from 10.5.50.2: FRER TESTING 23709
    Received from 10.5.50.2: FRER TESTING 23710
    Received from 10.5.50.2: FRER TESTING 23711
    Received from 10.5.50.2: FRER TESTING 23712
    Received from 10.5.50.2: FRER TESTING 23713
    Received from 10.5.50.2: FRER TESTING 23714
    Received from 10.5.50.2: FRER TESTING 23715
    Received from 10.5.50.2: FRER TESTING 23716
    Received from 10.5.50.2: FRER TESTING 23717
    Received from 10.5.50.2: FRER TESTING 23718

    --- Port Statistics ---
    Port | RxBytes    | TxBytes    | RxUni    | TxUni    | RxBcast  | TxBcast  | RxMulti  | TxMulti  | RxErr | TxErr
    -----------------------------------------------------------------------------------------------------------------------
     0   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     1   | 7942       | 20320      | 44       | 214      | 10       | 13       | 14       | 15       | 0     | 0    
     2   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     3   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     4   | 19846      | 2558       | 214      | 20       | 9        | 2        | 10       | 3        | 0     | 0    
     5   | 19846      | 2558       | 214      | 20       | 9        | 2        | 10       | 3        | 0     | 0    
    -----------------------------------------------------------------------------------------------------------------------

    --- FRER Listener Stats ---
    Port  | Streams | Passed-pkts | Discarded-pkts | OutOfOrder-pkts    | Lost-pkts | Tagless-pkts | Resets | Encoder-err-pkts    
    ---------------------------------------------------------------------------------------------------------------------------------------
     0    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     1    | 0       | 50          | 50             | 0                  | 0         | 0            | 0      | 0                   
    Received from 10.5.50.2: FRER TESTING 23719
     2    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     3    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     4    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     5    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
    ---------------------------------------------------------------------------------------------------------------------------------------
    Received from 10.5.50.2: FRER TESTING 23720
    Received from 10.5.50.2: FRER TESTING 23721
    Received from 10.5.50.2: FRER TESTING 23722
    Received from 10.5.50.2: FRER TESTING 23723
    Received from 10.5.50.2: FRER TESTING 23724
    Received from 10.5.50.2: FRER TESTING 23725
    Received from 10.5.50.2: FRER TESTING 23726
    Received from 10.5.50.2: FRER TESTING 23727
    Received from 10.5.50.2: FRER TESTING 23728
    Received from 10.5.50.2: FRER TESTING 23729
    Received from 10.5.50.2: FRER TESTING 23730
    Received from 10.5.50.2: FRER TESTING 23731
    Received from 10.5.50.2: FRER TESTING 23732
    Received from 10.5.50.2: FRER TESTING 23733
    Received from 10.5.50.2: FRER TESTING 23734
    Received from 10.5.50.2: FRER TESTING 23735
    Received from 10.5.50.2: FRER TESTING 23736
    Received from 10.5.50.2: FRER TESTING 23737
    Received from 10.5.50.2: FRER TESTING 23738
    Received from 10.5.50.2: FRER TESTING 23739
    Received from 10.5.50.2: FRER TESTING 23740
    Received from 10.5.50.2: FRER TESTING 23741
    Received from 10.5.50.2: FRER TESTING 23742
    Received from 10.5.50.2: FRER TESTING 23743
    Received from 10.5.50.2: FRER TESTING 23744
    Received from 10.5.50.2: FRER TESTING 23745
    Received from 10.5.50.2: FRER TESTING 23746
    Received from 10.5.50.2: FRER TESTING 23747
    Received from 10.5.50.2: FRER TESTING 23748
    Received from 10.5.50.2: FRER TESTING 23749
    Received from 10.5.50.2: FRER TESTING 23750
    Received from 10.5.50.2: FRER TESTING 23751
    Received from 10.5.50.2: FRER TESTING 23752
    Received from 10.5.50.2: FRER TESTING 23753
    Received from 10.5.50.2: FRER TESTING 23754
    Received from 10.5.50.2: FRER TESTING 23755
    Received from 10.5.50.2: FRER TESTING 23756
    Received from 10.5.50.2: FRER TESTING 23757
    Received from 10.5.50.2: FRER TESTING 23758
    Received from 10.5.50.2: FRER TESTING 23759
    Received from 10.5.50.2: FRER TESTING 23760
    Received from 10.5.50.2: FRER TESTING 23761
    Received from 10.5.50.2: FRER TESTING 23762
    Received from 10.5.50.2: FRER TESTING 23763
    Received from 10.5.50.2: FRER TESTING 23764
    Received from 10.5.50.2: FRER TESTING 23765
    Received from 10.5.50.2: FRER TESTING 23766
    Received from 10.5.50.2: FRER TESTING 23767
    Received from 10.5.50.2: FRER TESTING 23768

    --- Port Statistics ---
    Port | RxBytes    | TxBytes    | RxUni    | TxUni    | RxBcast  | TxBcast  | RxMulti  | TxMulti  | RxErr | TxErr
    -----------------------------------------------------------------------------------------------------------------------
     0   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     1   | 8344       | 24391      | 50       | 273      | 10       | 13       | 14       | 15       | 0     | 0    
     2   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     3   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     4   | 24271      | 2996       | 273      | 26       | 9        | 2        | 10       | 3        | 0     | 0    
     5   | 24271      | 2996       | 273      | 26       | 9        | 2        | 10       | 3        | 0     | 0    
    -----------------------------------------------------------------------------------------------------------------------

    --- FRER Listener Stats ---
    Port  | Streams | Passed-pkts | Discarded-pkts | OutOfOrder-pkts    | Lost-pkts | Tagless-pkts | Resets | Encoder-err-pkts    
    ---------------------------------------------------------------------------------------------------------------------------------------
     0    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     1    | 0       | 50          | 50             | 0                  | 0         | 0            | 0      | 0                   
    Received from 10.5.50.2: FRER TESTING 23769
     2    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     3    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     4    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     5    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
    ---------------------------------------------------------------------------------------------------------------------------------------
    Received from 10.5.50.2: FRER TESTING 23770
    Received from 10.5.50.2: FRER TESTING 23771
    Received from 10.5.50.2: FRER TESTING 23772
    Received from 10.5.50.2: FRER TESTING 23773
    Received from 10.5.50.2: FRER TESTING 23774
    Received from 10.5.50.2: FRER TESTING 23775
    Received from 10.5.50.2: FRER TESTING 23776
    Received from 10.5.50.2: FRER TESTING 23777
    Received from 10.5.50.2: FRER TESTING 23778
    Received from 10.5.50.2: FRER TESTING 23779
    Received from 10.5.50.2: FRER TESTING 23780
    Received from 10.5.50.2: FRER TESTING 23781
    Received from 10.5.50.2: FRER TESTING 23782
    Received from 10.5.50.2: FRER TESTING 23783
    Received from 10.5.50.2: FRER TESTING 23784
    Received from 10.5.50.2: FRER TESTING 23785
    Received from 10.5.50.2: FRER TESTING 23786
    Received from 10.5.50.2: FRER TESTING 23787
    Received from 10.5.50.2: FRER TESTING 23788
    Received from 10.5.50.2: FRER TESTING 23789
    Received from 10.5.50.2: FRER TESTING 23790
    Received from 10.5.50.2: FRER TESTING 23791
    Received from 10.5.50.2: FRER TESTING 23792
    Received from 10.5.50.2: FRER TESTING 23793
    Received from 10.5.50.2: FRER TESTING 23794
    Received from 10.5.50.2: FRER TESTING 23795
    Received from 10.5.50.2: FRER TESTING 23796
    Received from 10.5.50.2: FRER TESTING 23797
    Received from 10.5.50.2: FRER TESTING 23798
    Received from 10.5.50.2: FRER TESTING 23799
    Received from 10.5.50.2: FRER TESTING 23800
    Received from 10.5.50.2: FRER TESTING 23801
    Received from 10.5.50.2: FRER TESTING 23802
    Received from 10.5.50.2: FRER TESTING 23803
    Received from 10.5.50.2: FRER TESTING 23804
    Received from 10.5.50.2: FRER TESTING 23805
    Received from 10.5.50.2: FRER TESTING 23806
    Received from 10.5.50.2: FRER TESTING 23807
    Received from 10.5.50.2: FRER TESTING 23808
    Received from 10.5.50.2: FRER TESTING 23809
    Received from 10.5.50.2: FRER TESTING 23810
    Received from 10.5.50.2: FRER TESTING 23811
    Received from 10.5.50.2: FRER TESTING 23812
    Received from 10.5.50.2: FRER TESTING 23813
    Received from 10.5.50.2: FRER TESTING 23814
    Received from 10.5.50.2: FRER TESTING 23815
    Received from 10.5.50.2: FRER TESTING 23816
    Received from 10.5.50.2: FRER TESTING 23817
    Received from 10.5.50.2: FRER TESTING 23818

    --- Port Statistics ---
    Port | RxBytes    | TxBytes    | RxUni    | TxUni    | RxBcast  | TxBcast  | RxMulti  | TxMulti  | RxErr | TxErr
    -----------------------------------------------------------------------------------------------------------------------
     0   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     1   | 8612       | 27377      | 54       | 313      | 10       | 13       | 14       | 18       | 0     | 0    
     2   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     3   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     4   | 27429      | 3288       | 313      | 30       | 9        | 2        | 12       | 3        | 0     | 0    
     5   | 27429      | 3288       | 313      | 30       | 9        | 2        | 12       | 3        | 0     | 0    
    -----------------------------------------------------------------------------------------------------------------------

    --- FRER Listener Stats ---
    Port  | Streams | Passed-pkts | Discarded-pkts | OutOfOrder-pkts    | Lost-pkts | Tagless-pkts | Resets | Encoder-err-pkts    
    ---------------------------------------------------------------------------------------------------------------------------------------
     0    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     1    | 0       | 51          | 51             | 0                  | 0         | 0            | 0      | 0                   
     2    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
    Received from 10.5.50.2: FRER TESTING 23819
     3    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     4    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     5    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
    ---------------------------------------------------------------------------------------------------------------------------------------

    root@am62pxx-evm:~/TSN_2# ping 10.5.50.2
    PING 10.5.50.2 (10.5.50.2) 56(84) bytes of data.
    64 bytes from 10.5.50.2: icmp_seq=1 ttl=64 time=0.264 ms
    64 bytes from 10.5.50.2: icmp_seq=2 ttl=64 time=0.234 ms
    64 bytes from 10.5.50.2: icmp_seq=3 ttl=64 time=0.254 ms
    64 bytes from 10.5.50.2: icmp_seq=4 ttl=64 time=0.226 ms
    64 bytes from 10.5.50.2: icmp_seq=5 ttl=64 time=0.211 ms
    ^C
    --- 10.5.50.2 ping statistics ---
    5 packets transmitted, 5 received, 0% packet loss, time 4092ms
    rtt min/avg/max/mdev = 0.211/0.237/0.264/0.019 ms
    [1]-  Killed                  ./server 8080
    root@am62pxx-evm:~/TSN_2# ping 10.5.51.21
    PING 10.5.51.21 (10.5.51.21) 56(84) bytes of data.
    64 bytes from 10.5.51.21: icmp_seq=1 ttl=64 time=0.381 ms
    64 bytes from 10.5.51.21: icmp_seq=2 ttl=64 time=0.207 ms
    64 bytes from 10.5.51.21: icmp_seq=3 ttl=64 time=0.216 ms
    64 bytes from 10.5.51.21: icmp_seq=4 ttl=64 time=0.216 ms
    ^C




    //AM62P_2-----------------------------------------------------------------------------------------------------------------------------------

    root@am62pxx-evm:~/TSN# ./ses-example-app -p /dev/spidev1.0 -s 1 -g /dev/gpiochip1:14
    Version : 2.21 - FRER(Embedded AM62p)

    --- FRER Configuration ---
    1. Talker Config
    2. Listener Config
    3. No FRER Config
    Enter option (1-3): 1
    Loop Protection (Miss Return Approach) Applied between Ports 4 & 5.
    ---------------------FIRMWARE DETAILS----------------------
    appInfoVersion   :: 1
    buildNumber      :: 329
    name             :: TSN Agent SES Application
    part Number      :: SC0000519
    Version          :: 005
    -----------------------------------------------------------

    FRER Listener Index: 0
    FRER Listener Index: 0
    SES Application Running: FRER Talker and Listener Proxy
    Flushing Dynamic Table to enforce FRER stream identification...
    Setup Finish

    --- Port Statistics ---
    Port | RxBytes    | TxBytes    | RxUni    | TxUni    | RxBcast  | TxBcast  | RxMulti  | TxMulti  | RxErr | TxErr
    -----------------------------------------------------------------------------------------------------------------------
     0   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     1   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     2   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     3   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     4   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     5   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
    -----------------------------------------------------------------------------------------------------------------------

    --- FRER Listener Stats ---
    Port  | Streams | Passed-pkts | Discarded-pkts | OutOfOrder-pkts    | Lost-pkts | Tagless-pkts | Resets | Encoder-err-pkts    
    ---------------------------------------------------------------------------------------------------------------------------------------
     0    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     1    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     2    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     3    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     4    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     5    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
    ---------------------------------------------------------------------------------------------------------------------------------------
    [ 5729.748325] am65-cpsw-nuss 8000000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
    Received from 10.5.50.1: FRER TESTING 111
    Received from 10.5.50.1: FRER TESTING 112
    Received from 10.5.50.1: FRER TESTING 113
    Received from 10.5.50.1: FRER TESTING 114
    Received from 10.5.50.1: FRER TESTING 115

    --- Port Statistics ---
    Port | RxBytes    | TxBytes    | RxUni    | TxUni    | RxBcast  | TxBcast  | RxMulti  | TxMulti  | RxErr | TxErr
    -----------------------------------------------------------------------------------------------------------------------
     0   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     1   | 4956       | 265        | 52       | 4        | 3        | 0        | 6        | 0        | 0     | 0    
     2   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     3   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     4   | 289        | 5298       | 4        | 52       | 0        | 3        | 0        | 6        | 0     | 0    
     5   | 289        | 5298       | 4        | 52       | 0        | 3        | 0        | 6        | 0     | 0    
    -----------------------------------------------------------------------------------------------------------------------

    --- FRER Listener Stats ---
    Port  | Streams | Passed-pkts | Discarded-pkts | OutOfOrder-pkts    | Lost-pkts | Tagless-pkts | Resets | Encoder-err-pkts    
    ---------------------------------------------------------------------------------------------------------------------------------------
     0    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     1    | 0       | 7           | 7              | 0                  | 2         | 0            | 0      | 0                   
     2    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     3    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     4    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     5    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
    ---------------------------------------------------------------------------------------------------------------------------------------
    Received from 10.5.50.1: FRER TESTING 116
    Received from 10.5.50.1: FRER TESTING 117
    Received from 10.5.50.1: FRER TESTING 118
    Received from 10.5.50.1: FRER TESTING 119
    Received from 10.5.50.1: FRER TESTING 120

    --- Port Statistics ---
    Port | RxBytes    | TxBytes    | RxUni    | TxUni    | RxBcast  | TxBcast  | RxMulti  | TxMulti  | RxErr | TxErr
    -----------------------------------------------------------------------------------------------------------------------
     0   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     1   | 10278      | 2075       | 112      | 10       | 6        | 2        | 8        | 5        | 0     | 0    
     2   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     3   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     4   | 1476       | 10992      | 10       | 112      | 1        | 6        | 3        | 8        | 0     | 0    
     5   | 1476       | 10992      | 10       | 112      | 1        | 6        | 3        | 8        | 0     | 0    
    -----------------------------------------------------------------------------------------------------------------------

    --- FRER Listener Stats ---
    Port  | Streams | Passed-pkts | Discarded-pkts | OutOfOrder-pkts    | Lost-pkts | Tagless-pkts | Resets | Encoder-err-pkts    
    ---------------------------------------------------------------------------------------------------------------------------------------
     0    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     1    | 0       | 5           | 5              | 0                  | 0         | 0            | 0      | 0                   
     2    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     3    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     4    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     5    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
    ---------------------------------------------------------------------------------------------------------------------------------------
    Received from 10.5.50.1: FRER TESTING 121
    Received from 10.5.50.1: FRER TESTING 122
    Received from 10.5.50.1: FRER TESTING 123
    Received from 10.5.50.1: FRER TESTING 124
    Received from 10.5.50.1: FRER TESTING 125

    --- Port Statistics ---
    Port | RxBytes    | TxBytes    | RxUni    | TxUni    | RxBcast  | TxBcast  | RxMulti  | TxMulti  | RxErr | TxErr
    -----------------------------------------------------------------------------------------------------------------------
     0   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     1   | 13536      | 2689       | 152      | 14       | 7        | 3        | 10       | 5        | 0     | 0    
     2   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     3   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     4   | 2120       | 14502      | 14       | 152      | 2        | 7        | 3        | 10       | 0     | 0    
     5   | 2120       | 14502      | 14       | 152      | 2        | 7        | 3        | 10       | 0     | 0    
    -----------------------------------------------------------------------------------------------------------------------

    --- FRER Listener Stats ---
    Port  | Streams | Passed-pkts | Discarded-pkts | OutOfOrder-pkts    | Lost-pkts | Tagless-pkts | Resets | Encoder-err-pkts    
    ---------------------------------------------------------------------------------------------------------------------------------------
     0    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     1    | 0       | 6           | 6              | 0                  | 0         | 0            | 0      | 0                   
     2    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     3    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     4    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     5    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
    ---------------------------------------------------------------------------------------------------------------------------------------
    Received from 10.5.50.1: FRER TESTING 126
    Received from 10.5.50.1: FRER TESTING 127
    Received from 10.5.50.1: FRER TESTING 128
    Received from 10.5.50.1: FRER TESTING 129
    Received from 10.5.50.1: FRER TESTING 130

    --- Port Statistics ---
    Port | RxBytes    | TxBytes    | RxUni    | TxUni    | RxBcast  | TxBcast  | RxMulti  | TxMulti  | RxErr | TxErr
    -----------------------------------------------------------------------------------------------------------------------
     0   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     1   | 18364      | 3091       | 212      | 20       | 9        | 3        | 10       | 5        | 0     | 0    
     2   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     3   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     4   | 2558       | 19696      | 20       | 212      | 2        | 9        | 3        | 10       | 0     | 0    
     5   | 2558       | 19696      | 20       | 212      | 2        | 9        | 3        | 10       | 0     | 0    
    -----------------------------------------------------------------------------------------------------------------------

    --- FRER Listener Stats ---
    Port  | Streams | Passed-pkts | Discarded-pkts | OutOfOrder-pkts    | Lost-pkts | Tagless-pkts | Resets | Encoder-err-pkts    
    ---------------------------------------------------------------------------------------------------------------------------------------
     0    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     1    | 0       | 5           | 5              | 0                  | 0         | 0            | 0      | 0                   
     2    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     3    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     4    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     5    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
    ---------------------------------------------------------------------------------------------------------------------------------------
    Received from 10.5.50.1: FRER TESTING 131
    Received from 10.5.50.1: FRER TESTING 132
    Received from 10.5.50.1: FRER TESTING 133
    Received from 10.5.50.1: FRER TESTING 134
    Received from 10.5.50.1: FRER TESTING 135

    --- Port Statistics ---
    Port | RxBytes    | TxBytes    | RxUni    | TxUni    | RxBcast  | TxBcast  | RxMulti  | TxMulti  | RxErr | TxErr
    -----------------------------------------------------------------------------------------------------------------------
     0   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     1   | 21124      | 3359       | 252      | 24       | 9        | 3        | 10       | 5        | 0     | 0    
     2   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     3   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     4   | 2850       | 22696      | 24       | 252      | 2        | 9        | 3        | 10       | 0     | 0    
     5   | 2850       | 22696      | 24       | 252      | 2        | 9        | 3        | 10       | 0     | 0    
    -----------------------------------------------------------------------------------------------------------------------

    --- FRER Listener Stats ---
    Port  | Streams | Passed-pkts | Discarded-pkts | OutOfOrder-pkts    | Lost-pkts | Tagless-pkts | Resets | Encoder-err-pkts    
    ---------------------------------------------------------------------------------------------------------------------------------------
     0    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     1    | 0       | 5           | 5              | 0                  | 0         | 0            | 0      | 0                   
     2    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     3    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     4    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     5    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
    ---------------------------------------------------------------------------------------------------------------------------------------
    Received from 10.5.50.1: FRER TESTING 136
    Received from 10.5.50.1: FRER TESTING 137
    Received from 10.5.50.1: FRER TESTING 138
    Received from 10.5.50.1: FRER TESTING 139
    Received from 10.5.50.1: FRER TESTING 140

    --- Port Statistics ---
    Port | RxBytes    | TxBytes    | RxUni    | TxUni    | RxBcast  | TxBcast  | RxMulti  | TxMulti  | RxErr | TxErr
    -----------------------------------------------------------------------------------------------------------------------
     0   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     1   | 25416      | 3761       | 312      | 30       | 9        | 3        | 12       | 5        | 0     | 0    
     2   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     3   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     4   | 3288       | 27354      | 30       | 312      | 2        | 9        | 3        | 12       | 0     | 0    
     5   | 3288       | 27354      | 30       | 312      | 2        | 9        | 3        | 12       | 0     | 0    
    -----------------------------------------------------------------------------------------------------------------------

    --- FRER Listener Stats ---
    Port  | Streams | Passed-pkts | Discarded-pkts | OutOfOrder-pkts    | Lost-pkts | Tagless-pkts | Resets | Encoder-err-pkts    
    ---------------------------------------------------------------------------------------------------------------------------------------
     0    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     1    | 0       | 5           | 5              | 0                  | 0         | 0            | 0      | 0                   
     2    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     3    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     4    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     5    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
    ---------------------------------------------------------------------------------------------------------------------------------------
    Received from 10.5.50.1: FRER TESTING 141
    Received from 10.5.50.1: FRER TESTING 142
    Received from 10.5.50.1: FRER TESTING 143
    Received from 10.5.50.1: FRER TESTING 144
    Received from 10.5.50.1: FRER TESTING 145

    --- Port Statistics ---
    Port | RxBytes    | TxBytes    | RxUni    | TxUni    | RxBcast  | TxBcast  | RxMulti  | TxMulti  | RxErr | TxErr
    -----------------------------------------------------------------------------------------------------------------------
     0   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     1   | 28518      | 4029       | 352      | 34       | 10       | 3        | 12       | 5        | 0     | 0    
     2   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     3   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     4   | 3580       | 30696      | 34       | 352      | 2        | 10       | 3        | 12       | 0     | 0    
     5   | 3580       | 30696      | 34       | 352      | 2        | 10       | 3        | 12       | 0     | 0    
    -----------------------------------------------------------------------------------------------------------------------

    --- FRER Listener Stats ---
    Port  | Streams | Passed-pkts | Discarded-pkts | OutOfOrder-pkts    | Lost-pkts | Tagless-pkts | Resets | Encoder-err-pkts    
    ---------------------------------------------------------------------------------------------------------------------------------------
     0    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     1    | 0       | 5           | 5              | 0                  | 0         | 0            | 0      | 0                   
     2    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     3    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     4    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     5    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
    ---------------------------------------------------------------------------------------------------------------------------------------
    Received from 10.5.50.1: FRER TESTING 146
    Received from 10.5.50.1: FRER TESTING 147
    Received from 10.5.50.1: FRER TESTING 148
    Received from 10.5.50.1: FRER TESTING 149
    Received from 10.5.50.1: FRER TESTING 150

    --- Port Statistics ---
    Port | RxBytes    | TxBytes    | RxUni    | TxUni    | RxBcast  | TxBcast  | RxMulti  | TxMulti  | RxErr | TxErr
    -----------------------------------------------------------------------------------------------------------------------
     0   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     1   | 33004      | 5007       | 412      | 40       | 11       | 3        | 12       | 8        | 0     | 0    
     2   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     3   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     4   | 4351       | 35548      | 40       | 412      | 2        | 11       | 5        | 12       | 0     | 0    
     5   | 4351       | 35548      | 40       | 412      | 2        | 11       | 5        | 12       | 0     | 0    
    -----------------------------------------------------------------------------------------------------------------------

    --- FRER Listener Stats ---
    Port  | Streams | Passed-pkts | Discarded-pkts | OutOfOrder-pkts    | Lost-pkts | Tagless-pkts | Resets | Encoder-err-pkts    
    ---------------------------------------------------------------------------------------------------------------------------------------
     0    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     1    | 0       | 6           | 6              | 0                  | 0         | 0            | 0      | 0                   
     2    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     3    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     4    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     5    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
    ---------------------------------------------------------------------------------------------------------------------------------------
    Received from 10.5.50.1: FRER TESTING 151
    Received from 10.5.50.1: FRER TESTING 152
    Received from 10.5.50.1: FRER TESTING 153
    Received from 10.5.50.1: FRER TESTING 154
    Received from 10.5.50.1: FRER TESTING 155

    --- Port Statistics ---
    Port | RxBytes    | TxBytes    | RxUni    | TxUni    | RxBcast  | TxBcast  | RxMulti  | TxMulti  | RxErr | TxErr
    -----------------------------------------------------------------------------------------------------------------------
     0   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     1   | 35695      | 6305       | 451      | 44       | 11       | 6        | 12       | 8        | 0     | 0    
     2   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     3   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     4   | 5337       | 38473      | 44       | 451      | 4        | 11       | 5        | 12       | 0     | 0    
     5   | 5337       | 38473      | 44       | 451      | 4        | 11       | 5        | 12       | 0     | 0    
    -----------------------------------------------------------------------------------------------------------------------

    --- FRER Listener Stats ---
    Port  | Streams | Passed-pkts | Discarded-pkts | OutOfOrder-pkts    | Lost-pkts | Tagless-pkts | Resets | Encoder-err-pkts    
    ---------------------------------------------------------------------------------------------------------------------------------------
     0    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     1    | 0       | 6           | 6              | 0                  | 0         | 0            | 0      | 0                   
     2    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     3    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     4    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     5    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
    ---------------------------------------------------------------------------------------------------------------------------------------
    Received from 10.5.50.1: FRER TESTING 156
    Received from 10.5.50.1: FRER TESTING 157
    Received from 10.5.50.1: FRER TESTING 158
    Received from 10.5.50.1: FRER TESTING 159
    Received from 10.5.50.1: FRER TESTING 160

    --- Port Statistics ---
    Port | RxBytes    | TxBytes    | RxUni    | TxUni    | RxBcast  | TxBcast  | RxMulti  | TxMulti  | RxErr | TxErr
    -----------------------------------------------------------------------------------------------------------------------
     0   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     1   | 39899      | 6919       | 512      | 51       | 11       | 6        | 12       | 10       | 0     | 0    
     2   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     3   | 0          | 0          | 0        | 0        | 0        | 0        | 0        | 0        | 0     | 0    
     4   | 5919       | 43043      | 51       | 512      | 4        | 11       | 6        | 12       | 0     | 0    
     5   | 5919       | 43043      | 51       | 512      | 4        | 11       | 6        | 12       | 0     | 0    
    -----------------------------------------------------------------------------------------------------------------------

    --- FRER Listener Stats ---
    Port  | Streams | Passed-pkts | Discarded-pkts | OutOfOrder-pkts    | Lost-pkts | Tagless-pkts | Resets | Encoder-err-pkts    
    ---------------------------------------------------------------------------------------------------------------------------------------
     0    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     1    | 0       | 6           | 6              | 0                  | 0         | 0            | 0      | 0                   
     2    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     3    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     4    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     5    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
    ---------------------------------------------------------------------------------------------------------------------------------------
    Received from 10.5.50.1: FRER TESTING 161
    Received from 10.5.50.1: FRER TESTING 162
    Received from 10.5.50.1: FRER TESTING 163
    Received from 10.5.50.1: FRER TESTING 164
    Received from 10.5.50.1: FRER TESTING 165


    the minor issue:

    am62p-1
    --- FRER Listener Stats ---
    Port  | Streams | Passed-pkts | Discarded-pkts | OutOfOrder-pkts    | Lost-pkts | Tagless-pkts | Resets | Encoder-err-pkts    
    ---------------------------------------------------------------------------------------------------------------------------------------
     0    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     1    | 0       | 5           | 5              | 0                  | 0         | 0            | 0      | 0                   
     2    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     3    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     4    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                  <---no print data "like 5"    
     5    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                  <---no print data "like 5"
    ---------------------------------------------------------------------------------------------------------------------------------------

    am62p-2

    --- FRER Listener Stats ---
    Port  | Streams | Passed-pkts | Discarded-pkts | OutOfOrder-pkts    | Lost-pkts | Tagless-pkts | Resets | Encoder-err-pkts    
    ---------------------------------------------------------------------------------------------------------------------------------------
     0    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     1    | 0       | 50          | 50             | 0                  | 0         | 0            | 0      | 0                   
     2    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     3    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   
     4    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   <---no print data "like 50"
     5    | 0       | 0           | 0              | 0                  | 0         | 0            | 0      | 0                   <---no print data "like 50"
    ---------------------------------------------------------------------------------------------------------------------------------------

    look the port 4 and 5 on the both frer Status there are no passed packet in the prints !!

    hope your next replay might have the solution.

    by karl.O Suggested sequence: worked great !

    1. Port Initialization
    2. Loop Protection
    3. Wait for PHY bring up
    4. Configure FRER

    its a  nice idea SES_GetLinkState we used in code, but not in the thread.

    Wireshark version difference: 3.1.some number.

    I am not tryed, I need ask permission to our companys ITS dept to install v4.2.3 or above version, i maybe work on i.

    Thanks Karl.O 







        

  • the above sample code I missed Frer structure


    typedef enum {
        FRER_NODE_TALKER = 0,
        FRER_NODE_LISTENER = 1
    } FrerNodeType_t;

    typedef struct {
        FrerNodeType_t nodeType;                                    
        TSN_streamIdFunction_t streamIdType;          

        /* Common L2 / L3 Parameters */
        uint8_t sourceMac[6];
        uint8_t destMac[6];
        uint16_t vlan;

        /* DMAC VLAN Specific (Active Dest MAC) */
        uint8_t activeDestMacDown[6];
        uint8_t activeDestMacUp[6];
        uint16_t vlanUp;

        /* IP Stream Specific */
        uint8_t sourceIp[4];
        uint8_t destIp[4];
        uint16_t sourcePort;
        uint16_t destPort;
        TSN_nextProtocol_t nextProtocol;

        /* Mask and Match Specific */
        uint8_t sourceMacMask[6];
        uint8_t destMacMask[6];
        uint8_t msduMask[4];
        uint8_t msduMatch[4];
        uint16_t msduMaskLength;

        /* Hardware & Port Configuration */
        uint32_t egressPortMap;    
        uint8_t ingressSplitPort;  
        uint16_t historyLength;    
        uint32_t resetTimeout;
       
    } FrerConfig_t;

    typedef struct {
        uint8_t sourcePort;        
        uint8_t blockedPortMask;  
    } LoopProtectionRule_t;
  • I'm glad you were able to configure and test FRER in your setup.

    In the listener configuration, the sequence recovery function is applied on the listener's configured egress port, where duplicate frames are evaluated and eliminated before the recovered stream is forwarded.

    As a result, if Ports 4 and 5 only receive redundant traffic and are not the point where sequence recovery is performed, FRER sequence recovery statistics would not be expected on those ports.

Before You Switch


Switching languages will make ADI Explorer unavailable. Resume your session by switching back to English and reopening ADI Explorer.