cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
416
Views
1
Helpful
3
Replies

EVPN Multihome Port Active - ESI Modulo Operation confusion !

Hi,

I have a working EVPN Port Active Setup where one PE is active and one Standby as expected.

The part that escapes me is the modulo operation to determine which PE is active and which is standby

It appears that this is an odd/even 'modulo 2' operation on octets 3-6 of the ESI, and the result if zero will match the lower router id and if one will match the higher router id

So how do you calculate <ESI octets 3-6> MOD 2  ?

I dont understand how the modulo operation is performed and I need that so I can then construct meaningful ESI.

It like saying is ff.ff.ff odd or even??  !

need some help pls

thanks

Mark

1 Accepted Solution

Accepted Solutions

@Mark Pace Balzan 

Mmmmm, you're correct !!! Modulo operation should be performe on the entire decimal representation of the concatenated octets 3-6, not individually on each octet.

Also, iyou always want the even result for deterministic selection, setting the last two octets to zero is a valid approach. This way, the decimal representation of octets 3-6 will always be an even number, and applying the modulo 2 operation will consistently yield 0. This ensures a predictable selection of the active PE based on your specified criteria.

 
 
 
Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

View solution in original post

3 Replies 3

M02@rt37
VIP
VIP

Hello @Mark Pace Balzan 

The modulo operation is used to determine whether a value is even or odd. The modulo operation calculates the remainder when dividing one number by another. In your case, you're looking to perform the modulo 2 operation on octets 3-6 of the ESI to determine if it's even or odd.

3 steps:

1. Take the hexadecimal value of octets 3-6 of the ESI.
2. Convert the hexadecimal value to decimal.
3. Perform the modulo 2 operation on the decimal value.

For example, let's say the value of octets 3-6 is ff.ff.ff.ff. In decimal, this is 255.255.255.255. Now, perform the modulo 2 operation:


255 % 2 = 1

The result is 1, indicating that the value is odd.

If you have a different ESI, follow the same steps to determine whether the modulo 2 operation results in 0 (even) or 1 (odd). This logic is commonly used to decide which router becomes active or standby in certain protocols.

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

Hi

thanks for the explanation and clarification

while i have octets 3-6 as ff.ff.ff.ff in my example, which is 255.255.255.255 in decimal, you perform operation on only one 255 'octet' ?  Am i missing something there ?

Also i guess to make selection of active/standby deterministic, its perhaps good practise to always leave the last two octets set as zero to always get a 0 (even), assuming that I always want the (even) PE to be the selected one. does that make sense ?

 

thanks again for your help

 

Mark

@Mark Pace Balzan 

Mmmmm, you're correct !!! Modulo operation should be performe on the entire decimal representation of the concatenated octets 3-6, not individually on each octet.

Also, iyou always want the even result for deterministic selection, setting the last two octets to zero is a valid approach. This way, the decimal representation of octets 3-6 will always be an even number, and applying the modulo 2 operation will consistently yield 0. This ensures a predictable selection of the active PE based on your specified criteria.

 
 
 
Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.