Thursday, 11 October 2012

11 - L3 Switching - Understanding CEF Optimization


A foundation look at what exactly CEF is and how it works:








When switch boots up, everything has to be learnt (routes etc) this is then copied down to the FIB
FIB = Forwarding Information Base (Which is a high speed cache in the ASIC)

The ADJ table holds all the Layer 2 information (Mac etc)

Now once the switch has booted up, the switch proactivly checks all the routes in the FIB and then finds all the MAC addresses for the next hop addresses (upstream routers/L3/static etc)

So by the time this switch/router is ready to forward packets it already has the entire routing table cached and it has all the ARP mappings/next hop MAC addresses.

So now when a packet comes into the router/switch it comes straight into the hardware, looks at hardware cache /routing table, has MAC already, swaps the header and out it goes at WIRE SPEED at LAYER 3!

So all inter-vlan traffic, routed ports and routing all happens in CEF at wire speed. Major advantage




Now days all L3 switches come with CEF enabled by default, meaning you have to disable it if you dont want it.

to enable
conf t
ip cef

handy command/feature to find bandwidth hogs (ip cef traffic-statistics)




You can run the command on the VLANS,:


so the switch has all these prefixes/routes in its FIB, also if we check the ARP table we can see this has been
moved in the adjacency table for CEF, 


So when copying data from one host to another in different VLANS, we dont need an routing lookups (we have it all already), it has it all already and off it goes!


Wednesday, 10 October 2012

08 - STP - Rapid Spanning Tree Concepts and Configuration








portfast - on the host links interface range <ports>
spanning-tree port fast







To enable RSTP
spaning-tree mode rapid-pvst - do this on all the switches participating




Im going to uplug the uplink between Switch B and A, we should see the port change from altn/BLK to FWD straight away

we did not see any loss!!!! - compare this to STP - BIG DIFFERENCE!


 

9 - EtherChannel - Aggregating Redundant Links




Can bundle upto 8 ports
You get aggregated bandwidth, no wasted bandwidth, also load-balancing
Automatic failover if one of the links fails.
Its logical too, so this simplifies the management (apply config to etherchannel not the ports)


PAGP: If both auto, it wont be an etherchannel, one side has to be in desirable state.
best way to hard code both to ON

Only difference between the modes, well mainly the PAGP is cisco propietary and was invented first before a industry standard was around! Cisco kept it on and now you have a choice ... BUT obviously PAGP is cisco kit only.



L2  etherchannel
simple bundling of ports, Layer 2 domain

L3 etherchannel
you can put all ports in layer2, but assign them to a port channel interface, so you could have routing between your distribution layer and core layer, it allows for very fast convergence at the access layer! which some people are doing now. have routing at all layers.



Lets start with the Layer 2 etherchannel first:


config wise, just going with something simple, i have chosen PAGP:

inter range fas 0/23 - 24
channel-protocol pagp
channel-group 1 mode desirable

Modes shown here:



Once configured on both sides, a neat command is show etherchannel detail - handy nice layout of information (bonus of showing load of port-channel too)


Building upon the original configuration:


Need to remove the port-channel as we have negotiated a Layer 2 Etherchannel and it would of not allowed us to apply the switchport first.

inter range fas 0/23 - 24
no channel-group 1

no switchport  <--- Enable layer3
channel-group 1 mode desirable

interface port-channel 1
no switchport   <--- Enable layer3
ip address 10.1.1.1 255.255.255.0




The last point does not affect the port-channel! only the port .... so if you apply config moving it in a different VLAN etc it will be dropped from the bundle.


10 - L3 Switching - InterVLAN Routing Extraordinaire






*didnt doc this as its pretty basic and i know it inside out,








Okay and i can ping from both hosts to both the respective vlans/SVI's



Lets look at the next part:


So we can turn fa0/24 into a routed port! lets do that:


10.1.24.2 is the router the other end of the link, the router is also running EIGRP, lets enable THAT TOOO.




We have an EIGRP neighbour, lets check the routing table



How kool is that! we have "SWOUTER" lol! SWEEET!


Dont ask about the diagram, if your have seen the CBT nugget your'll get it lol:



Packet goes to the router, so once the first packet has been to the router, all future
packets go to the hardware part of the switch (ASIC)/CEF and they just fly by!



Layer3 vs Multilayer switching

L3 = switch has a router in it
multilayer = has ability to cache route info (CEF)

every L3 switch is a multilayer switch
however not every multilayer switch is a L3 switch

Tuesday, 9 October 2012

7 - STP - Foundation Per-VLASpanning Tree Concepts 2N 









Switch A is the root switch (the dingy little switch in the cupboard lol) whereas we want
Switch G, as all links/paths are going to find the BEST route to this switch, so it is very IMPORTANT 
that the correct switch is elected the root switch.






So now the flood of traffic that is coming into that distribution switch is now heading to that poking little access switch in the closet!  So the limit of our network is the backplane of that root bridge (which could be like a 1900 switch lol)



So potentially we could be looking at the access switch crashing during peak times of the day and the whole network goes down...until spanning tree re converges and finds a new root path and starts unblocking ports etc



The root switch should be one of our CORE switches,






So looking at the topology with tweaking the priority PER VLAN:


WOW! just think about it, right now im thinking of the spanning tree instances at work....you really need to draw this out to see the big picture and how exactly traffic is flowing .... as we have seeen, that DEFAULT doesn't always equal best.




Lets verify the above, if we look at switch A, we see that to get to the ROOT Bridge/ID it goes out of fa0/11 and we can see the MAC of Switch B,

Bridge ID, it Switch A (see MAC)

100MB links = cost 19



So looking alittle further down the output on Switch A, we can see the port states,


Lets have a look at the first command:
spanning-tree vlan x root primary


this sets the priority to the IEEE recommended standard of 24577


So lets test this out, lets ping from host 10.1.1.10 to host 10.1.1.5, traffic will flow this way

I will pull out the link between SwitchA and SwitchB, causing spanning tree to re-converge:



still waiting .....


RIGHT, Lets check Switch C
fas0/24 is now in a FWD start and is the Root Port!



so we could be looking at 50 seconds total if the port is a blocked port (the backup link) that is NOT ACCEPTABLE in todays standards.





tags:
PVST, spanning-tree