---
title: Load Balance
slug: aidc/load-balance
description: roce configuration
createdAt: 2025-12-01T11:11:08.000Z
---

:::hint{type="warning"}
Features below are only supported on CX864E-N.
:::

# <font color="#1d50a2">Packet Spray</font>

<font color="#1d05a2">Table 1 Packet Spray</font>

| **Command**                                                  | **Purpose**                                            |
| ------------------------------------------------------------ | ------------------------------------------------------ |
| **hash algorithm&#x20;**\{**random**\|**round\_robin**}      | Configure the hash algorithm of LAG based on packets.  |
| **hash algorithm ecmp&#x20;**\{**random**\|**round\_robin**} | Configure the hash algorithm of ECMP based on packets. |

### <font color="#1d50a2">hash algorithm \{random|round\_robin\}</font>

**\[Command]**
**hash algorithm** \{**random**|**round\_robin**}

**\[Purpose]**
Configure the hash algorithm of LAG based on packets.

**\[Parameters]**

| **Parameter**    | **Description**                               |
| ---------------- | --------------------------------------------- |
| **random**       | Random hash allocation of packets.            |
| **round\_robin** | Sequential round-robin allocation of packets. |

**\[View]**
LAGIF Configuration View

**\[Notes]**
Run **commit** to take effect.
Defaults to hash based on five-tuple.
Only CX864-N supports this feature.
Run command **no hash algorithm** to restore to the default configuration.

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# interface link-aggregation 100
sonic(config-lagif-100)# hash algorithm random
Please enter 'commit' to make hash algorithm command take effect
sonic(config-lagif-100)# commit
```

### <font color="#1d50a2">hash algorithm ecmp \{random|round\_robin\}</font>

**\[Command]**
**hash algorithm ecmp** \{**random**|**round\_robin**}

**\[Purpose]**
Configure the hash algorithm of ECMP based on packets.

**\[Parameters]**

| **Parameter**    | **Description**                               |
| ---------------- | --------------------------------------------- |
| **random**       | Random hash allocation of packets.            |
| **round\_robin** | Sequential round-robin allocation of packets. |

**\[View]**
Global Configuration View

**\[Notes]**
Defaults to hash based on five-tuple.
Only CX864-N supports this feature.
The ECMP hash algorithm and the LAG hash algorithm are independently controlled.
Please configure the hash algorithm before route distribution. If the hash algorithm is modified after routes have been distributed, the routes need to be regenerated.
Run command **no hash algorithm ecmp** to restore to the default configuration.

**\[Use Cases]**

```plaintext
onic# configure terminal
sonic(config)# hash algorithm ecmp random
```

# <font color="#1d50a2">ARS</font>

## <font color="#1d50a2">ARS View</font>

<font color="#1d05a2">Table 2 ARS View</font>

| **Command**            | **Purpose**                              |
| ---------------------- | ---------------------------------------- |
| **show ars instance**  | Display ARS instance configuration       |
| **show ars interface** | Display the ARS status of the interface. |
| **show ars profile**   | Display ARS profile configuration.       |

### <font color="#1d50a2">show ars instance</font>

**\[Command]**
**show ars instance**

**\[Purpose]**
Display ARS instance configuration.

**\[View]**
Privileged User View

**\[Use Cases]**

```plaintext
sonic# show ars instance
Instance Name    Assign Mode            Idle Time    Max Flows  Binding Status
---------------  -------------------  -----------  -----------  ----------------
test             per_flowlet_quality          256          512  N/A
```

### <font color="#1d50a2">show ars interface</font>

**\[Command]**
**show ars instance**

**\[Purpose]**
Display the ARS status of the interface.

**\[View]**
Privileged User View

**\[Use Cases]**

```plaintext
sonic# show ars interface
Interface    Status       Scaling Factor
-----------  -----------  ----------------
0/0          Enabled      10000
0/1          Enabled      10000
0/2          Enabled      10000
0/3          Enabled      10000
0/4          Enabled      10000
0/5          Enabled      10000
0/6          Enabled      10000
0/7          Enabled      10000
0/8          Enabled      10000
……
```

### <font color="#1d50a2">show ars profile</font>

**\[Command]**
**show ars profile**

**\[Purpose]**
Display ARS profile configuration.

**\[View]**
Privileged User View

**\[Use Cases]**

```plaintext
sonic# show ars profile
Algorithm    IPv4 Enable    IPv6 Enable      Load Past Min    Load Past Max    Overall Max Flows    Remaining Max Flows
-----------  -------------  -------------  ---------------  ---------------  -------------------  ---------------------
EWMA         True           True                         0             4096                 8128                   7616
```

## <font color="#1d50a2">ARS Config</font>

<font color="#1d05a2">Table 3 ARS Config</font>

| **Command**                                                                        | **Purpose**                                                                          |
| ---------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
| **ars profile**                                                                    | Create ARS profile.                                                                  |
| **ars instance** *instance\_name*                                                  | Create ARS instance.                                                                 |
| **ars nexthop-group** \{*A.B.C.D/M*\|*A\::B/M*} **instance***&#x20;instance\_name* | Bind the ARS instance to an ECMP group.                                              |
| **idle-time** *time\_value*                                                        | Set the flow splitting interval                                                      |
| **max-flows** *flow\_value*                                                        | Set the maximum number of flowlets that ECMP can track simultaneously in macro-flow. |
| **ars disable**                                                                    | Disable ARS at interface level.                                                      |

### <font color="#1d50a2">ars profile</font>

**\[Command]**
**ars profile**

**\[Purpose]**
Create ARS profile.

**\[View]**
Global Configuration View.

**\[Notes]**
Enable ARS globally and create a profile to automatically bind to the switch. This will take effect globally.
Currently, the device supports only one profile.
Run command **no ars profile** to delete the ARS profile.

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# ars profile
sonic(config-arsprofile)# show this
!
ars profile
```

### <font color="#1d50a2">ars instance *instance\_name*</font>

**\[Command]**
**ars instance** *instance\_name*

**\[Purpose]**
Create ARS instance.

**\[Parameters]**

| **Parameter**    | **Description**                      |
| ---------------- | ------------------------------------ |
| *instance\_name* | Name of ARS instance, in string form |

**\[View]**
Global Configuration View.

**\[Notes]**
Run command **no ars instance** *instance\_name* to delete the ARS instance .

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# ars instance test
sonic(config-ars-instance-test)# show this
!
ars instance test
```

### <font color="#1d50a2">ars nexthop-group \{*A.B.C.D/M*|*A\:\:B/M*\} instance *instance\_name*</font>

**\[Command]**
**ars nexthop-group** \{*A.B.C.D/M*|*A\::B/M*} **instance** *instance\_name*

**\[Purpose]**
Bind the ARS instance to an ECMP group.

**\[Parameters]**

| **Parameter**    | **Description**                                                                                          |
| ---------------- | -------------------------------------------------------------------------------------------------------- |
| *A.B.C.D/M*      | IPv4 destination address, bound to the ECMP group where the next hop of the destination address belongs. |
| *A\::B/M*        | IPv6 destination address, bound to the ECMP group where the next hop of the destination address belongs. |
| *instance\_name* | Name of ARS instance, in string form.                                                                    |

**\[View]**
Global Configuration View.

**\[Notes]**
ECMP groups and ARS instances can only be bound one-to-one.
Run command **no ars nexthop-group** \{*A.B.C.D/M* |*A\::B/M*} **instance** *instance\_name* to delete the bond with ECMP group.

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# ars instance test
sonic(config-ars-instance-test)# exit
sonic(config)# ars nexthop-group 10.0.0.0/24 instance test
```

### <font color="#1d50a2">idle-time time\_value</font>

**\[Command]**
**idle-time** *time\_value*

**\[Purpose]**
Set the flow splitting interval.

**\[Parameters]**

| **Parameter** | **Description**                                                                   |
| ------------- | --------------------------------------------------------------------------------- |
| *time\_value* | Idle duration in microseconds. The range is 1-1048, and the default value is 256. |

**\[View]**
Flow splitting is triggered if the frame interval exceeds this time;
ARS instance Configuration View.

**\[Notes]**
Run command **no idle-time** to restore the idle duration value to the default value.

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# ars instance test
sonic(config-ars-instance-test)# idle-time 200
sonic(config-ars-instance-test)# show this
!
ars instance test
 idle-time 200
```

### <font color="#1d50a2">max-flows *flow\_value*</font>

**\[Command]**
**max-flows** *flow\_value*

**\[Purpose]**
Set the maximum number of flowlet that ECMP group can track simultaneously in macro-flow table.

**\[Parameters]**

| **Parameter** | **Description**                                                                                    |
| ------------- | -------------------------------------------------------------------------------------------------- |
| *flow\_value* | The number of flowlet, optional parameters 32/64/ 128/256/512/1k/2k, and the default value is 512. |

**\[View]**
ARS instance Configuration View.

**\[Notes]**
It is recommended to use the default value.
Run command **no max-flows** to restore the number of flowlet to the default value.

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# ars instance test
sonic(config-ars-instance-test)# max-flows 1k
!
ars instance test
 max-flows 1k
```

### <font color="#1d50a2">ars disable</font>

**\[Command]**
**ars disable**

**\[Purpose]**
Disable ARS at interface-level.

**\[View]**
Physical Interface Configuration View.

**\[Notes]**
Run command **no ars disable** to enable ARS.

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# interface ethernet 0/400
sonic(config-if-0/400)# ars disable
sonic(config-if-0/400)# show this
!
interface ethernet 0/400
 ars disable
 fec rs
 mtu 9216
 speed 800000
```

