# Truncation and Load Balancing

Packet truncation, also called packet slicing, involves discarding bytes from a packet. It removes the payload and provides only the necessary metadata for analysis, and thereby reducing the disk storage requirement at the tool farms.&#x20;

Port-channel by default provides symmetric hashing for IPv4 and IPv6 traffic, making the source-destination pair redirected to the same tool-connected port(s).

The following image shows a visual representation of truncation and load balancing:

<figure><img src="https://1388938575-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgveMX7pjkcYNKb9VKSp2%2Fuploads%2FGsozYELhlonR5i7y1wX7%2FScreenshot%202022-09-26%20at%2012.06.35%20PM.png?alt=media&#x26;token=24480038-f92e-411c-9885-c26250b5cf5b" alt=""><figcaption><p>Truncation and Load-Balancing</p></figcaption></figure>

### Configuration:

*1. Configure Network/Tool port(s)*

```
//Network ports
configure terminal
interface ethernet Ethernet12
forward-error-correction rs
type network
end
```

```
//Tool ports
configure terminal
interface ethernet Ethernet64/72
forward-error-correction rs
type tool
end
```

2\. Configure packet truncation

```
configure terminal
interface ethernet Ethernet12
truncate 64
end
```

3\. *Configure port-channel with Tool port(s)*

```
configure terminal
port-channel 10 ports Ethernet64,Ethernet72
end
```

4\. *Configure flow*

```
flow flow2
network-ports Ethernet12
tool-ports port-channel10
rule 1 permit src-ip 1.1.1.1/32 dest-ip 2.2.2.2/32 protocol tcp counters enable
rule 2 permit src-ip 2401::1 src-netmask f::f dest-ip 2401::2 dest-netmask f::f counters enable
```

*5. Verify*

```
// verify Truncation
pbnoscli# show interface npb Ethernet12/1
===================================
Interface : Ethernet12/1      
===================================
Mode           : vlan-aware      
Ingress-vlan   : 14              
Egress-tagging : disable         
Truncate       : 64              
pbnoscli# 

```

```
// verify port-channel status
pbnoscli# show port-channel information 
===================================
Name         : port-channel10
Member ports : Ethernet64/1[up] Ethernet63/1[up] 
===================================
pbnoscli# 
```

```
// verify flow
pbnoscli# show flow summary 
Flow-Name       Rule-Id        Status      Counter-Value
=========================================================
flow2           2             Active          50414924        
flow2           1             Active          50410923        
pbnoscli#      
```

```
// verify Loadbalancing 
pbnoscli# show interface counters
========================================================================================================================================================================================
Port                           InOctets       InUcastPackets       InMcastPackets       InBcastPackets            OutOctets      OutUcastPackets      OutMcastPackets      OutBcastPackets
========================================================================================================================================================================================
Ethernet1/1                           0                    0                    0                    0                    0                    0                    0                    0
Ethernet2/1                           0                    0                    0                    0                    0                    0                    0                    0
Ethernet3/1                           0                    0                    0                    0                    0                    0                    0                    0
Ethernet4/1                17597009152             68738285                    0                    0                  239                    0                    1                    0
<..>
Ethernet63/1                          0                    0                    0                    0                  240                    0                    1                    0
Ethernet64/1                          0                    0                    0                    0                    0                    0                    0                    0
pbnoscli#
```
