Rappel de ce qu'est un EtherChannel :

Un EtherChannel ou aggrégat de lien en Français, permet d'aggréger plusieurs liens physique pour n'en former qu'un logique. Cela permet "d'augmenter la bande passante".

Fonctionnement de l'EtherChannel :

Schéma de répartition :

Schéma de répartion
On voit bien que les EterChannels ayant un nombre de ports impaires, la répartion n'est pas symétriques.

Description de la répartition :

La répartition s'effectue sur le résultat d'un hash à 8 valeurs possible (0 à 7) qui se dépend de la méthode de load balancing utilisée. Le résultat de ce hash et appelé RBH (Resultat Bundle Hash) qui est propriétaire Cisco.

Nous pouvons voir le résultat directe de la répartition via certaines commandes qui diffèrent d'un modèle à l'autre :

1 3750# test etherchannel load-balance interface port-channel 1 mac 0000.1111.2222 3333.4444.5555
2 Would select Gi1/0/1 of Po1

 1 4500-VSS-MEC# show platform software etherchannel port-channel 1 map ip 2.2.2.2 1.1.1.1
 2 
 3 Executing the command on VSS member switch role = VSS Active, id = 1
 4 
 5 Map port for Ip 2.2.2.2, 1.1.1.1 is Te1/1/1(Po1)
 6 NOTE: Software forwarded traffic will use Te1/1/1(Po1)
 7 
 8 Executing the command on VSS member switch role = VSS Standby, id = 2
 9 
10 Map port for Ip 2.2.2.2, 1.1.1.1 is Te2/1/1(Po1)
11 NOTE: Software forwarded traffic will use Te2/1/1(Po1)

!!!Attention!!! dans un VSS, un etherchannel de type MEC (Multi-chassis EtherChannel) privilégie le port de sortie qui est sur le même switch que le port d'entrée. MEC hash
Cela a aussi un impact lors de la perte de liens sur un switch, voici un exemple : MEC hash

1 6500# remote login switch
2 Trying Switch ...
3 Entering CONSOLE for Switch
4 Type "^CCC" to end this session
5 
6 6500-sp# test etherchannel load-balance interface po1 ip 1.1.1.1 2.2.2.2
7 Computed RBH: 0x5
8 Would select Gi2/2 of Po1

Nous allons comprendre comment le port est choisi, il faut juste partir du principe que le RBH nous est fourni (car son algorithme est propriétaire et c'est peut être pas interessant à calculer).
Nous prennons dans un premier temps un EtherChannel sur 2 ports G3/2 et G3/3.

Informations sur l'EtherChannel :

 1 switch#show interface po1 etherchannel
 2 Age of the Port-channel   = 1d:1h:11m:11s
 3 Logical slot/port   = 14/1          Number of ports = 2
 4 GC                  = 0x00000000      HotStandBy port = null
 5 Port state          = Port-channel Ag-Inuse
 6 Protocol            =    -
 7 
 8 Ports in the Port-channel:
 9 
10 Index   Load   Port     EC state        No of bits
11 ------+------+------+------------------+-----------
12 1      55     Gi3/2    On/FEC           4
13 0      AA     Gi3/3    On/FEC           4
14 
15 Time since last port bundled:    1d:11h:1m:11s    Gi3/2
16 Time since last port Un-bundled: 1d:11h:11m:11s    Gi3/3

Les points à regarder sont, l'association du champ Load et Port et la valeur du champ Load.

Il faut ensuite convertir les valeurs héxadécimales de Load en binaire :
Convertion Héxa en Bin

Pour le port G3/2 qui a la Load 55, les bits 6, 4, 2, 0 matchent. Les RBH ayant une valeur de 6, 4, 2, 0 passerons pas le port G3/2.
Pour le port G3/3 qui a la Load AA, les bits 7, 5, 3, 1 matchent. Les RBH ayant une valeur de 7, 5, 3, 1 passerons pas le port G3/3. On voit aussi que le champ No of bits indique le nombre de bits qui matchent.

Vérifications :

 1 switch#test etherchannel load-balance interface port-channel 1 ip 5.5.5.5 2.2.2.2
 2 Computed RBH: 0x0
 3 Would select Gi3/2 of Po1
 4 
 5 switch#test etherchannel load-balance interface port-channel 1 ip 1.1.1.1 2.2.2.6
 6 Computed RBH: 0x1
 7 Would select Gi3/3 of Po1
 8 
 9 switch#test etherchannel load-balance interface port-channel 1 ip 10.10.10.4 10.10.10.30
10 Computed RBH: 0x2
11 Would select Gi3/2 of Po1
12 
13 switch#test etherchannel load-balance interface port-channel 1 ip 3.3.3.3 2.2.2.2
14 Computed RBH: 0x3
15 Would select Gi3/3 of Po1
16 
17 switch#test etherchannel load-balance interface port-channel 1 ip 1.1.1.1 2.2.2.3
18 Computed RBH: 0x4
19 Would select Gi3/2 of Po1
20 
21 switch#test etherchannel load-balance interface port-channel 1 ip 1.1.1.1 2.2.2.2
22 Computed RBH: 0x5
23 Would select Gi3/3 of Po1
24 
25 switch#test etherchannel load-balance interface port-channel 1 ip 1.1.1.1 2.2.2.9
26 Computed RBH: 0x6
27 Would select Gi3/2 of Po1
28 
29 switch#test etherchannel load-balance interface port-channel 1 ip 1.1.1.1 2.2.2.8
30 Computed RBH: 0x7
31 Would select Gi3/3 of Po1

Exemple avec un EtherChannel de 3 ports :

 1 switch#show interface port-channel 1 etherchannel
 2 Port-channel1   (Primary aggregator)
 3 Age of the Port-channel   = 0d:01h:05m:54s
 4 Logical slot/port   = 14/1          Number of ports = 3
 5 HotStandBy port = null
 6 Port state          = Port-channel Ag-Inuse
 7 Protocol            =   LACP
 8 Fast-switchover     = disabled
 9 
10 Ports in the Port-channel:
11 
12 Index   Load   Port     EC state        No of bits
13 ------+------+------+------------------+-----------
14 0      49     Gi3/1    Active           3
15 1      92     Gi3/2    Active           3
16 2      24     Gi3/3    Active           2
17 <SNiP>

Convertion du champ Load en binaire :
Convertion Héxa en Bin
On voit bien que la répartion est inégale entre les différents port car les ports G3/1 et G3/2 matchent 3 bits alors que le port G3/3 n'en matche que 2 bits.