Saturday, October 11, 2014

BGP Attributes



BGP Attributes


Routes learn through BGP has some properties. These properties can be used to determine best route to destination when there are multiple routes to same destination. These properties are attributes.

BGP attributes list
  • Weight
  • Local Preference 
  • Multi-exit discriminator
  • Origin
  • AS_Path
  • Next Hop
  • Community

Weight

Weight attribute is Cisco defined attribute. It is local to a router. The weight attribute is not advertise to a neighboring router.If the router learns about more than one routes to same destination, the route with the highest weight will be preferred.


CT843902.jpg
Router A is receiving advertisement for Network 172.16.1.0 from router B and C. When router A receives advertisement for network 172.16.1.0 from router B, weight is set to 50. When router A receives advertisement for network 172.16.1.0 from router C, weight is set to 100. Both paths will be in BGP routing table with their respective weight. The route with highest weight will be installed in IP routing table.

Local Preference

Local preference attributes used to prefer exit point from local AS(Autonomous System).Local preference can be propagate through local AS.

CT843903.jpg
AS 100 receiving two advertisement for network 172.16.1.0 from AS200. When router A receives advertisement for network 172.16.1.0 from AS 200, local preference is set to 50 and when router B receives advertisement for network 172.16.1.0 from AS200 , local preference is set to 100. Routers A and B will exchange local preference values. Router B has highest local preference value. Router B will be used as exit point from AS 100 to reach network 172.16.1.0 in AS 200.


AS_PATH Attribute


When a route advertisement passes through an AS, AS number is prepended to that update.

bgp-toc10.gif


An AS_Path attribute is actually a list of AS that a route has passed in order to reach destination.
In the example, RTB advertises network 190.10.0.0. When that update reaches AS 300, RTC will append its own AS number to that update. SO when 190.10.0.0 reaches RTA, it has two AS number attached 200 and 300. For RTA to reach network 190.10.0.0,  the path would be  AS 300 and AS 200.



BGP Backdoor

bgp-toc15.gif
 In this network diagram RTC and RTA runs ebgp. RTA and RTC runs ebgp. RTA and RTB runs IGP protocol such as IGRP, RIP or EGIRP.
RTA would be getting two routes update for 160.0.0.0 network from RTB and RTC.
RTA will choose ebgp updates because it has less AD value 20 which is less than IGP protocol.
If we want RTA to learn update from RTB we have two option
Increase ebgp distance or
Decrease IGP distance

Instead of modfying cost, we can use BGP backdoor.
BGP backdoor makes IGP rote preferred route.

RTA#
router eigrp 10

network 150.10.0.0

router bgp 100
neighbor 2.2.2.1 remote-as 300
network 160.10.0.0 backdoor







Tuesday, August 20, 2013

                                                 STP


Redudant links are good for network.There are two links between switches(SW1 and SW2). These multiple links between swicthes are good idea but it can create many problems if we do not use loop avoidance method in our network.

Suppose in our network we have not use loop avoidance method and there are multiple links between swicthes SW1 and SW2.
Users are connected on both switches. If user on sw1 want to connect with user on sw2 there will be loop. Frame will continously circulate between switches. User will recieve same frame multiple time. Swith will update its mac address databse based on frame it received from different interfaces.

To overcome loop problem we use STP in our network.


802.1d is default version on cisco swithes. The new version is 802.1w.
The main role of STP is to prevent loop in network. It monitors network to find all links and make sure no loop occurs by blocking redudant links.STP uses STA(spanning tree algorithm) to provide loop avoidance network.
There are tasks STP perform
The first task is to select root bridge in the network.

Selection of Root Bridge.
Root bridge is the bridge with the best bridge id. Root bridge serve as the focal point in the network. All the decision in the network such as which port to block and which port to put in forwarding state are made from prespective of root bridge.STP uses bridge id to determine root brdige in the network. Bridge id 8 bytes which include bridge priority and bridge mac address.


Two switches are connected with multiple links.To determine root bridge, switches will send BPDU messages every 2 second. These bpdu include bridge id. Bridge id include bride priority and bridge mac address. The default bridge priority is 32768. Two swicthes will compare their bridge id. The switch which has lowest bridge id will become root bridge. first bridge priority is compare from bridge id then mac address are compare if both switches has same priority.


SW1 bridge priority 32768 and mac address 1111.1111.1111 and SW2 bridge priority 32768 and mac address 2222.2222.2222. Both switches sw1 and sw2 has same priority so their mac addresses will be compared. SW1 has lowest mac address so it will become root bridge in the netwok. SW2 is non root switch.All the ports on root bridge are designated ports.





Next task is selection of Root Port

Root port is the best path from non root bridge to reach Root bridge.To select root port
Port oppiste ot root port are always dessignated ports.