OcNOS-SP : System Management Guide : System Management Configuration Guide : Ethernet Interface Loopback Support
Ethernet Interface Loopback Support
Overview
This feature support is to provide additional hardware diagnostic functionality for physical ports on boards. This feature will enable the user to determine if there are any issues in the physical port at the MAC and the PHY layer.
To achieve this functionality, the Ethernet interfaces can be configured as the loopback interfaces. Looping back the packets are possible either at MAC layer or at PHY layer. Also packets can be looped either from Egress to Ingress or Ingress to Egress. On enabling this feature, if all the TX packets are looped back to RX, it indicates there is no issue with the hardware at the particular layer configured, either MAC or PHY.
Local Loopback
Tx PHY Loopback
 
When the loopback Tx PHY is enabled on an Ethernet interface, packets that the traffic generator receives on such an interface are loop-backed to the originator and forwarded to the destination.
Because loopback is enabled as the Tx PHY in the diagram above, packets will loop at the physical layer, and the same number of packets will be returned to the traffic generator from the DUT's Egress to Ingress side. Thus, the Tx and Rx counts of receiving and transmitting interfaces are the same. The packets are looped and also forwarded to their next destination.
Tx MAC Loopback
 
Loopback Tx MAC is enabled on the Ethernet interface, and when packets from the traffic generator arrive on such an interface, they are loop-backed to the originator rather than being forwarded.
In the above diagram, as loopback is enabled as a Tx MAC, the packets will loop at the MAC layer (data link layer), and the same number of packets are returned from the egress side to the ingress side of the DUT to the traffic generator. Thus, the Tx and Rx counts of receiving and transmitting interfaces are the same. The packets are looped but not forwarded further.
Remote Loopback
Rx PHY Loopback
 
Loopback Rx PHY is enabled on the ethernet interface, and when packets from the traffic generator arrive at a remote node via such an interface, they are loop-backed to the originator and forwarded to the next route.
In the above diagram, as loopback is enabled as Rx PHY on DUT2, the packets will loop at the physical layer of the DUT2, and the same number of packets are returned from the ingress to the egress side of the DUT2 to DUT1 and the traffic generator. Thus, the Tx and Rx counts of receiving and transmitting interfaces are the same. The packets are looped back to Traffic Generator1 as well as forwarded to Traffic Generator2.
Rx MAC Loopback
 
Loopback Rx MAC is enabled on the ethernet interface, and when packets from the traffic generator arrive at a remote node via such an interface, they are loop-backed to the originator but not forwarded to the next route.
In the above diagram, as loopback is enabled as Rx MAC on DUT2, the packets will loop at the MAC layer (data link layer) of the DUT2, and the same number of packets are returned from the ingress to the egress side of the DUT2 to DUT1 and the traffic generator. Thus, the Tx and Rx counts of receiving and transmitting interfaces are the same. The packets are looped back to Traffic Generator1, but not forwarded to Traffic Generator2.
Topology
Loopback configuration nodes
Configurations
R1
 
#configure terminal
Enter into the configure terminal mode.
R1(config)#hostname R1
Configure the hostname
R1(config)#commit
Commit the configuration
R1(config)#bridge 1 protocol rstp vlan-bridge
Configure bridge
R1(config)#vlan database
Enter into vlan database
R1(config-vlan)#vlan 2 bridge 1
Configure vlans
R1(config-vlan)#exit
Exit the vlan database mode
R1(config)#interface ce1/1
Enter into interface ce1/1
R1(config-if)#switchport
Configure switchport
R1(config-if)#bridge-group 1
Configure bridge-group
R1(config-if)#switchport mode trunk
Configure switchport mode as trunk
R1(config-if)#switchport trunk allowed vlan add 2
Add all the vlans to the interface
R1(config-if)#exit
Exit the interface mode
R1(config)#interface ce5/1
Enter into interface ce1/1
R1(config-if)#switchport
Configure switchport
R1(config-if)#bridge-group 1
Configure bridge-group
R1(config-if)#switchport mode trunk
Configure switchport mode as trunk
R1(config-if)#switchport trunk allowed vlan add 2
Add all the vlans to the interface
R1(config-if)#loopback tx phy
Configure loopback tx phy
R1(config-if)#exit
Exit the interface level
R1(config)#no mac-address-table learning bridge 1 interface ce1/1
Disable the mac-learning on the device
R1(config)#no mac-address-table learning bridge 1 interface ce5/1
Disable the mac-learning on the device
R1(config)#commit
Commit the configuration
R1(config)#exit
Exit from configuration mode
R2
 
#configure terminal
Enter into the configure terminal mode.
R2(config)#hostname R2
Configure the hostname
R2(config)#commit
Commit the configuration
R2(config)#exit
Come out of configuration mode
R2#conf terminal
Enter into the configure terminal mode
R2(config)#bridge 1 protocol rstp vlan-bridge
Configure bridge
R2(config)#vlan database
Enter into vlan database
R2(config-vlan)#vlan 2 bridge 1
Configure vlans
R2(config-vlan)#exit
Exit the vlan database mode
R2(config)#interface ce3/1
Enter into interface ce3/1
R2(config-if)#switchport
Configure switchport
R2(config-if)#bridge-group 1
Configure bridge-group
R2(config-if)#switchport mode trunk
Configure switchport mode as trunk
R2(config-if)#switchport trunk allowed vlan add 2
Add the vlan to the interface
R2(config-if)#exit
Exit the interface mode
R2(config-if)#interface ce29/1
Enter into interface ce29/1
R2(config-if)#switchport
Configure switchport
R2(config-if)#bridge-group 1
Configure bridge-group
R2(config-if)#switchport mode trunk
Configure switchport mode as trunk
R2(config-if)#switchport trunk allowed vlan add 2
Add the vlan to the interface
R2(config-if)#exit
Exit from interface level
R2(config)#no mac-address-table learning bridge 1 interface ce3/1
Disable the mac-learning on the device
R2(config)#no mac-address-table learning bridge 1 interface ce29/1
Disable the mac-learning on the device
R2(config)#commit
Commit the configuration
R2(config)#exit
Exit from configuration mode
Validation
R1
R1#show running-config interface ce1/1
!
interface ce1/1
switchport
bridge-group 1
switchport mode trunk
switchport trunk allowed vlan add 2
!
R1#show running-config interface ce5/1
!
interface ce5/1
switchport
bridge-group 1
switchport mode trunk
switchport trunk allowed vlan add 2
loopback tx phy
!
R1# show interface ce5/1
Interface ce5/1
Flexport: Breakout Control Port (Active): Break Out disabled
Hardware is ETH Current HW addr: 34ef.b689.e04a
Physical:34ef.b689.e04a Logical:(not set)
Forward Error Correction (FEC) configured is Auto (default)
FEC status is N/A
Port Mode is trunk
Interface index: 5045
Metric 1 mtu 1500 duplex-full link-speed 40g
Debounce timer: disable
Loopback Type: PHY
<UP,BROADCAST,RUNNING,MULTICAST>
VRF Binding: Not bound
DHCP client is disabled.
Last Flapped: 2021 Oct 23 15:57:01 (00:08:51 ago)
Statistics last cleared: 2021 Oct 23 15:54:44 (00:11:08 ago)
5 minute input rate 255 bits/sec, 0 packets/sec
5 minute output rate 255 bits/sec, 0 packets/sec
RX
unicast packets 0 multicast packets 2272 broadcast packets 0
input packets 2272 bytes 153730
jumbo packets 0
undersize 0 oversize 0 CRC 0 fragments 0 jabbers 0
input error 0
input with dribble 0 input discard 7
Rx pause 0
TX
unicast packets 0 multicast packets 4333 broadcast packets 0
output packets 4333 bytes 293304
jumbo packets 0
output errors 0 collision 0 deferred 0 late collision 0
output discard 0
Tx pause 0
 
R1# show interface brief
--------------------------------------------------------------------------------
Ethernet Type PVID Mode Status Reason Speed Port Ctl Br/Bu Loopbk
Interface Ch #
--------------------------------------------------------------------------------
ce5/1 ETH 1 trunk up none 10g -- Br Yes PHY
R2
R2#show running-config interface ce3/1
!
interface ce3/1
switchport
bridge-group 1
switchport mode trunk
switchport trunk allowed vlan add 2
!
 
R2#show running-config interface ce29/1
!
interface ce29/1
switchport
bridge-group 1
switchport mode trunk
switchport trunk allowed vlan add 2
!
R2#
 
Interface counters before configuring loopback on both the devices:
========================================================
R1#show interface counters rate gbps
+-------------------+--------------+-------------+--------------+-------------+
| Interface | Rx gbps | Rx pps | Tx gbps | Tx pps |
+-------------------+--------------+-------------+--------------+-------------+
ce1/1 8.65 8446138 0.00 0
ce5/1 0.00 0 8.65 8446125
R1#
 
 
R2#show interface counters rate gbps
+-------------------+--------------+-------------+--------------+-------------+
| Interface | Rx gbps | Rx pps | Tx gbps | Tx pps |
+-------------------+--------------+-------------+--------------+-------------+
ce3/1 0.00 0 8.65 8446188
ce29/1 8.65 8446254 0.00 0
Interface counters after configuring loopback tx phy
R1
R1#show interface counters rate gbps
+-------------------+--------------+-------------+--------------+-------------+
| Interface | Rx gbps | Rx pps | Tx gbps | Tx pps |
+-------------------+--------------+-------------+--------------+-------------+
ce1/1 8.65 8446147 8.65 8446319
ce5/1 8.65 8446194 8.65 8446194
R1#
 
R2#show interface counters rate gbps
+-------------------+--------------+-------------+--------------+-------------+
| Interface | Rx gbps | Rx pps | Tx gbps | Tx pps |
+-------------------+--------------+-------------+--------------+-------------+
ce3/1 0.00 0 0.00 0
R2#
Removing the Loopback Configuration
R1
 
R1#configure terminal
Enter into configure terminal mode
R1(config)#in ce5/1
Enter into interface level
R1(config-if)#no loopback
Un-configure the loopback
R1(config-if)#commit
Commit the configuration
R1(config-if)#end
Exit from the configuration mode
Loopback tx mac
 
R1#configure terminal
Enter into configure terminal mode
R1(config)#in ce5/1
Enter into interface level
R1(config-if)#loopback tx mac
Configure loopback tx mac
R1(config-if)#commit
Commit the configuration
R1(config-if)#end
Exit from the configuration mode
Validation
R1
R1#show running-config interface ce1/1
!
interface ce1/1
switchport
bridge-group 1
switchport mode trunk
switchport trunk allowed vlan add 2
!
R1#show running-config interface ce5/1
!
interface ce5/1
switchport
bridge-group 1
switchport mode trunk
switchport trunk allowed vlan add 2
loopback tx mac
!
R1# sh interface ce5/1
Interface ce5/1
Flexport: Breakout Control Port (Active): Break Out disabled
Hardware is ETH Current HW addr: 34ef.b689.e04a
Physical:34ef.b689.e04a Logical:(not set)
Forward Error Correction (FEC) configured is Auto (default)
FEC status is N/A
Port Mode is trunk
Interface index: 5045
Metric 1 mtu 1500 duplex-full link-speed 40g
Debounce timer: disable
Loopback Type: MAC
<UP,BROADCAST,RUNNING,MULTICAST>
VRF Binding: Not bound
DHCP client is disabled.
Last Flapped: 2021 Oct 23 15:57:01 (00:08:51 ago)
Statistics last cleared: 2021 Oct 23 15:54:44 (00:11:08 ago)
5 minute input rate 255 bits/sec, 0 packets/sec
5 minute output rate 255 bits/sec, 0 packets/sec
RX
unicast packets 0 multicast packets 2272 broadcast packets 0
input packets 2272 bytes 153730
jumbo packets 0
undersize 0 oversize 0 CRC 0 fragments 0 jabbers 0
input error 0
input with dribble 0 input discard 7
Rx pause 0
TX
unicast packets 0 multicast packets 4333 broadcast packets 0
output packets 4333 bytes 293304
jumbo packets 0
output errors 0 collision 0 deferred 0 late collision 0
output discard 0
Tx pause 0
 
R1# show interface brief
--------------------------------------------------------------------------------
Ethernet Type PVID Mode Status Reason Speed Port Ctl Br/Bu Loopbk
Interface Ch #
--------------------------------------------------------------------------------
ce5/1 ETH 1 trunk up none 10g -- Br Yes MAC
 
R2
R2#show running-config interface ce3/1
!
interface ce3/1
switchport
bridge-group 1
switchport mode trunk
switchport trunk allowed vlan add 2
!
 
R2#show running-config interface ce29/1
!
interface ce29/1
switchport
bridge-group 1
switchport mode trunk
switchport trunk allowed vlan add 2
!
R2#
Interface counters before configuring loopback on both the devices
R1#show interface counters rate gbps
+-------------------+--------------+-------------+--------------+-------------+
| Interface | Rx gbps | Rx pps | Tx gbps | Tx pps |
+-------------------+--------------+-------------+--------------+-------------+
ce1/1 8.65 8432138 0.00 0
ce5/1 0.00 0 8.65 8430125
R1#
 
R2#show interface counters rate gbps
+-------------------+--------------+-------------+--------------+-------------+
| Interface | Rx gbps | Rx pps | Tx gbps | Tx pps |
+-------------------+--------------+-------------+--------------+-------------+
ce3/1 0.00 0 8.65 8429188
ce29/1 8.65 8430254 0.00 0
Interface counters after configuring loopback tx phy
R1#show interface counters rate gbps
+-------------------+--------------+-------------+--------------+-------------+
| Interface | Rx gbps | Rx pps | Tx gbps | Tx pps |
+-------------------+--------------+-------------+--------------+-------------+
ce1/1 8.65 8446147 8.65 8446319
ce5/1 8.65 8446194 8.65 8446194
R1#
 
R2#show interface counters rate gbps
+-------------------+--------------+-------------+--------------+-------------+
| Interface | Rx gbps | Rx pps | Tx gbps | Tx pps |
+-------------------+--------------+-------------+--------------+-------------+
ce3/1 0.00 0 0.00 0
ce29/1 0.00 0 0.00 0
 
R2#
Removing the Loopback Configuration
R1
 
R1#configure terminal
Enter into configure terminal mode
R1(config)#in ce5/1
Enter into interface level
R1(config-if)#no loopback
Un-configure the loopback
R1(config-if)#commit
Commit the configuration
R1(config-if)#end
Exit from the configuration mode
Loopback rx phy
 
R2#configure terminal
Enter into configure terminal mode
R2(config)#in ce29/1
Enter into interface level
R2(config-if)#loopback rx phy
Configure loopback rx phy
R2(config-if)#commit
Commit the configuration
R2(config-if)#end
Exit from the configuration mode
Validation
R2
R2#show interface ce29/1
Interface ce29/1
Flexport: Breakout Control Port (Active): Break Out disable
Hardware is ETH Current HW addr: 80a2.357f.4ebd
Physical:80a2.357f.4ebd Logical:(not set)
Forward Error Correction (FEC) configured is Auto (default)
FEC status is N/A
Port Mode is trunk
Interface index: 5001
Metric 1 mtu 1500 duplex-full link-speed 40g
Debounce timer: disable
Loopback Type: R-PHY
<UP,BROADCAST,RUNNING,MULTICAST>
VRF Binding: Not bound
DHCP client is disabled.
Last Flapped: 2019 Apr 30 10:03:23 (00:00:58 ago)
Statistics last cleared: 2019 Apr 30 09:43:30 (00:20:51 ago)
30 second input rate 8648972937 bits/sec, 8446291 packets/sec
30 second output rate 20723 bits/sec, 38 packets/sec
RX
unicast packets 3390485528 multicast packets 6205 broadcast packets 0
input packets 3390494721 bytes 433982963744
jumbo packets 0
undersize 0 oversize 0 CRC 0 fragments 1 jabbers 0
input error 1
input with dribble 0 input discard 39330
Rx pause 0
TX
unicast packets 0 multicast packets 6009 broadcast packets 0
output packets 6009 bytes 408564
jumbo packets 0
output errors 0 collision 0 deferred 0 late collision 0
output discard 0
Tx pause 0
 
R2#show interface brief
--------------------------------------------------------------------------------
Ethernet Type PVID Mode Status Reason Speed Port Ctl Br/Bu Loopbk
Interface Ch #
--------------------------------------------------------------------------------
ce29/1 ETH 1 trunk up none 10g -- Br Yes R-PHY
Interface counters before configuring on both the devices
R1#show interface counters rate gbps
+-------------------+--------------+-------------+--------------+-------------+
| Interface | Rx gbps | Rx pps | Tx gbps | Tx pps |
+-------------------+--------------+-------------+--------------+-------------+
ce1/1 8.65 8446138 0.00 0
ce5/1 0.00 0 8.65 8446125
R1#
 
R2#show int counters rate gbps
+-------------------+--------------+-------------+--------------+-------------+
| Interface | Rx gbps | Rx pps | Tx gbps | Tx pps |
+-------------------+--------------+-------------+--------------+-------------+
ce3/1 0.00 0 8.65 8446188
ce29/1 8.65 8446254 0.00 0
R2#
Interface counters after configuring rx phy on R2 device
R1#show interface counters rate gbps
+-------------------+--------------+-------------+--------------+-------------+
| Interface | Rx gbps | Rx pps | Tx gbps | Tx pps |
+-------------------+--------------+-------------+--------------+-------------+
ce1/1 8.65 8446140 8.65 8446141
ce5/1 8.65 8446058 8.65 8446058
R1#
 
R2#show interface cou rate gbps
+-------------------+--------------+-------------+--------------+-------------+
| Interface | Rx gbps | Rx pps | Tx gbps | Tx pps |
+-------------------+--------------+-------------+--------------+-------------+
ce3/1 0.00 0 8.65 8446218
ce29/1 8.65 8446222 0.00 0
R2#