Mostrando entradas con la etiqueta MST. Mostrar todas las entradas
Mostrando entradas con la etiqueta MST. Mostrar todas las entradas

lunes, 20 de agosto de 2012

Spanning Tree: Priority vs cost

En spanning tree, siempre que tengamos dos caminos redundantes para alcanzar a nuestro root bridge podemos elegir que camino queremos utilizar. Para hacer esto spanning tree dispone de dos parámetros que son configurables, pero que funcionan de manera diferente.

  • Priority: Priority permite establecer un valor que obligatoriamente tiene que ser múltiplo de 64 y que por defecto es 128, en el cual estableceremos la prioridad del puerto. El puerto con una prioridad menor será el puerto que utilizaremos para alcanzar a root, independientemente del coste que tenga el puerto, la prioridad siempre manda.
Ejemplo:

-Antes-

Rack05SW3(config-if)#do show spanning-tree mst 1
##### MST1    vlans mapped:   11,22,33
Bridge        address aabb.cc00.0900  priority      32769 (32768 sysid 1)
Root          address aabb.cc00.0700  priority      24577 (24576 sysid 1)
            port    Et1/3           cost      2000000              rem hops 19

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Et1/1            Desg FWD 2000000   128.34   Shr
Et1/2            Desg FWD 2000000   128.35   Shr
Et1/3            Root FWD 2000000   128.36   Shr
Et2/0            Desg FWD 2000000   128.65   Shr
Et2/1            Desg FWD 2000000   128.66   Shr
Et2/2            Desg FWD 2000000   128.67   Shr
Et2/3            Desg FWD 2000000   128.68   Shr


-Después-


 
Rack05SW3(config-if)#spanning-tree mst 1 port-priority 64
Rack05SW3(config-if)#do show spanning-tree mst 1
##### MST1    vlans mapped:   11,22,33
Bridge        address aabb.cc00.0900  priority      32769 (32768 sysid 1)
Root          address aabb.cc00.0700  priority      24577 (24576 sysid 1)
            port    Et1/3           cost      2000000              rem hops 19

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Et1/1            Desg FWD 2000000   128.34   Shr
Et1/2            Desg FWD 2000000   128.35   Shr
Et1/3            Root FWD 2000000    64.36   Shr
Et2/0            Desg FWD 2000000   128.65   Shr
Et2/1            Desg FWD 2000000   128.66   Shr
Et2/2            Desg FWD 2000000   128.67   Shr
Et2/3            Desg FWD 2000000   128.68   Shr

  • Cost:   Cost es la forma natural de coste de spanning tree, el camino con el menor coste para llegar a root es el camino que elegiremos. Podemos configurar el coste también a nivel de puerto, pero en cualquier caso priority siempre se impondrá ante cost.
Ejemplo:

-Antes-

Rack05SW3(config-if)#do show spanning-tree mst 1
##### MST1    vlans mapped:   11,22,33
Bridge        address aabb.cc00.0900  priority      32769 (32768 sysid 1)
Root          address aabb.cc00.0700  priority      24577 (24576 sysid 1)
            port    Et1/3           cost      2000000              rem hops 19

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Et1/1            Desg FWD 2000000   128.34   Shr
Et1/2            Desg FWD 2000000   128.35   Shr
Et1/3            Root FWD 2000000   128.36   Shr
Et2/0            Desg FWD 2000000   128.65   Shr
Et2/1            Desg FWD 2000000   128.66   Shr
Et2/2            Desg FWD 2000000   128.67   Shr
Et2/3            Desg FWD 2000000   128.68   Shr

-Después-

Rack05SW3(config-if)#spanning-tree mst 1 cost 100
Rack05SW3(config-if)#do show spanning-tree mst 1 
##### MST1    vlans mapped:   11,22,33
Bridge        address aabb.cc00.0900  priority      32769 (32768 sysid 1)
Root          address aabb.cc00.0700  priority      24577 (24576 sysid 1)
            port    Et1/3           cost      100                  rem hops 19

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Et1/1            Desg FWD 2000000   128.34   Shr
Et1/2            Desg FWD 2000000   128.35   Shr
Et1/3            Root FWD 100       128.36   Shr
Et2/0            Desg FWD 2000000   128.65   Shr
Et2/1            Desg FWD 2000000   128.66   Shr
Et2/2            Desg FWD 2000000   128.67   Shr
Et2/3            Desg FWD 2000000   128.68   Shr



También hay que tener en cuenta, que por defecto los switches configurarán valores a spanning tree según el tipo de interfaz, ya sea Giga, Ethernet, FastEthernet...etc. Dejo la tabla de referencia que nunca viene mal para tenerlo en cuenta.

SpeedPort CostComment
10 Mbps100Ethernet
20 Mbps56EtherChannel
30 Mbps47EtherChannel
40 Mbps41EtherChannel
50 Mbps35EtherChannel
54 Mbps33802.11 wireless
60 Mbps30EtherChannel
70 Mbps26EtherChannel
80 Mbps23EtherChannel
100 Mbps19Fast Ethernet
200 Mbps12Fast EtherChannel
300 Mbps9Fast EtherChannel
400 Mbps8Fast EtherChannel
500 Mbps7Fast EtherChannel
600 Mbps6Fast EtherChannel
700 Mbps5Fast EtherChannel
800 Mbps5Fast EtherChannel
1 Gbps4Gigabit Ethernet
2 Gbps3Gigabit EtherChannel
10 Gbps210G Ethernet
20 Gbps120G EtherChannel
40 Gbps140G EtherChannel

lunes, 16 de julio de 2012

MST: Otra evolución de spanning tree(802.1s)


 Este artículo es una introducción a MST, no pretende abarcar todo el contenido de MST, pero sirve como una guia introductoria, con sus comandos básicos, y si gusta, quizá haya mas artículos sobre MST.

Spanning Tree desde que fue dado a luz hace muchos años ha sufrido muchas evoluciones, dichas evoluciones van siempre orientadas a hacer un poco mas llevable un protocolo que desde la perspectiva de diseño siempre ha sido poco flexible.

MST es una de estas evoluciones, en realidad el MST 802.1s es una evolución de rapid spanning tree. MST aborda el hecho de que resulta un malgasto de recursos el tener una instancia de spanning tree, con su root, y su calculo del mejor camino para cada vlan, sobre todo cuando en el 99% de las LAN tienen la misma topología para todas las vlan, o como mucho una topología con un root para las pares, y otra para las impares, de cara al balanceo de carga.

Lo cierto es que cuando hay un cambio de topología porque un trunk se cae, en los spanning tree "tradicionales" se produce una marabunta de bpdu's que inundan la red, calculos independientes por vlan de root, y seamos realistas, es poco práctico.

MST en lo que consiste a grandes rasgos es, en lugar de tener una instancia de spanning tree para todas las vlan como el STP tradicional, ni tampoco tener una instancia de spanning tree para cada vlan, coge el concepto de ambos y lo funde. Una instancia de spanning tree para cada "grupo" de vlans.

En MST se crean instancias, una es la instancia de STP por defecto, que es la instancia 0, o tambien conocida como IST.

Configuración:

spanning-tree mode mst <---- activa MST
spanning-tree mst configuration
name <nombre_de_la_region>
revision <numero> <----al estilo VTP 
instance <numero> vlan <vlans_metidas_en_la_instancia>

La gran putada de MST es que hay que ir configurandolo igual switch por switch, y si la pifias los puertos empezaran a bloquearse porque los switches se veran entre ellos como regiones diferentes, por lo que para muchas redes resulta poco escalable. Para un entorno de operador, o un entorno muy estable quizá si resulta adecuado ya que ahorra recursos, aunque las migraciones a MST suelen ser complicadas.

Añadir ya de paso como nota positiva que VTP versión 3 permite la propagación de la información de MST, lo cual quitaría el principal handicap de MST.

Ejemplo:

Dos switches y alguno mas colgando que tendría la configuración basica de MST, pero nada de prioridades de root.

Switch 1:

spanning-tree mst configuration
 name ARBOL
 revision 1
 instance 1 vlan 17, 39, 45
 instance 2 vlan 24, 56, 100
!
spanning-tree mst 1 priority 24576  <---root para la instancia 1
spanning-tree mst 2 priority 28672  <---backup root instancia 2


Switch 2:

spanning-tree mst configuration
 name ARBOL
 revision 1
 instance 1 vlan 17, 39, 45
 instance 2 vlan 24, 56, 100
!
spanning-tree mst 1 priority 28672<---backup root instancia 1
spanning-tree mst 2 priority 24576<---root para la instancia 2

Output de switch 1:

show spanning-tree

MST0
  Spanning tree enabled protocol mstp
  Root ID    Priority    32768
             Address     aabb.cc00.0700
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32768  (priority 32768 sys-id-ext 0)
             Address     aabb.cc00.0700
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et1/2               Desg FWD 2000000   128.35   Shr
Et1/3               Desg FWD 2000000   128.36   Shr
Et2/0               Desg FWD 2000000   128.65   Shr
Et2/1               Desg FWD 2000000   128.66   Shr
Et2/2               Desg FWD 2000000   128.67   Shr
Et2/3               Desg FWD 2000000   128.68   Shr

         
MST1
  Spanning tree enabled protocol mstp
  Root ID    Priority    24577
             Address     aabb.cc00.0700
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    24577  (priority 24576 sys-id-ext 1)
             Address     aabb.cc00.0700
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et1/2               Desg FWD 2000000   128.35   Shr
Et1/3               Desg FWD 2000000   128.36   Shr
Et2/0               Desg FWD 2000000   128.65   Shr
Et2/1               Desg FWD 2000000   128.66   Shr
Et2/2               Desg FWD 2000000   128.67   Shr
Et2/3               Desg FWD 2000000   128.68   Shr

         
MST2
  Spanning tree enabled protocol mstp
  Root ID    Priority    24578
             Address     aabb.cc00.0800
             Cost        2000000
             Port        67 (Ethernet2/2)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    28674  (priority 28672 sys-id-ext 2)
             Address     aabb.cc00.0700
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et1/2               Desg FWD 2000000   128.35   Shr
Et1/3               Desg FWD 2000000   128.36   Shr
Et2/0               Desg FWD 2000000   128.65   Shr
Et2/1               Desg FWD 2000000   128.66   Shr
Et2/2               Root FWD 2000000   128.67   Shr
Et2/3               Altn BLK 2000000   128.68   Shr

Output switch 2

show spanning-tree

MST0
  Spanning tree enabled protocol mstp
  Root ID    Priority    32768
             Address     aabb.cc00.0700
             Cost        0
             Port        67 (Ethernet2/2)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32768  (priority 32768 sys-id-ext 0)
             Address     aabb.cc00.0800
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et1/2               Desg FWD 2000000   128.35   Shr
Et1/3               Desg FWD 2000000   128.36   Shr
Et2/0               Desg FWD 2000000   128.65   Shr
Et2/1               Desg FWD 2000000   128.66   Shr
Et2/2               Root FWD 2000000   128.67   Shr
Et2/3               Altn BLK 2000000   128.68   Shr

         
MST1
  Spanning tree enabled protocol mstp
  Root ID    Priority    24577
             Address     aabb.cc00.0700
             Cost        2000000
             Port        67 (Ethernet2/2)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    28673  (priority 28672 sys-id-ext 1)
             Address     aabb.cc00.0800
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et1/2               Desg FWD 2000000   128.35   Shr
Et1/3               Desg FWD 2000000   128.36   Shr
Et2/0               Desg FWD 2000000   128.65   Shr
Et2/1               Desg FWD 2000000   128.66   Shr
Et2/2               Root FWD 2000000   128.67   Shr
Et2/3               Altn BLK 2000000   128.68   Shr

         
MST2
  Spanning tree enabled protocol mstp
  Root ID    Priority    24578
             Address     aabb.cc00.0800
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    24578  (priority 24576 sys-id-ext 2)
             Address     aabb.cc00.0800
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et1/2               Desg FWD 2000000   128.35   Shr
Et1/3               Desg FWD 2000000   128.36   Shr
Et2/0               Desg FWD 2000000   128.65   Shr
Et2/1               Desg FWD 2000000   128.66   Shr
Et2/2               Desg FWD 2000000   128.67   Shr
Et2/3               Desg FWD 2000000   128.68   Shr
Como se puede ver en lo resaltado en azul, existe una instancia 0, pero sus funciones las contaremos en otro capitulo, mientras tanto disfrutad con ello ;) .