Showing posts with label BGP. Show all posts
Showing posts with label BGP. Show all posts

Monday, January 30, 2017

BGP Notification Message

NOTIFICATION messages are sent when there is a fatal error condition. If a NOTIFICATION message is sent, the BGP peer session is torn down and reset.

Below is Notification message packet capture


Details of the Error codes are documented in the table below.

BGP Update Message

UPDATE messages are used to exchange routes between peers.

Below is a packet capture showing Update Message



BGP KEEPALIVE messages

BGP Keepalive Packet Capture

KEEPALIVE messages are sent periodically (every 60 seconds by default) to ensure that the remote peer is still available. If a router does not receive a KEEPALIVE from a peer for a Hold-time period (by default, 180 seconds), the router declares that peer dead.


BGP Open Message

BGP Open Message Packet Capture

BGP forms its peer relationships through a series of messages. First, an
OPEN message is sent between peers to initiate the session. The OPEN
message contains several parameters:
• BGP Version – must be the same between BGP peers
• Local AS Number
• BGP Router ID



Friday, November 6, 2015

What are advantages of MPLS?

Main Benefit of MPLS - BGP Free CORE


When the IP network of a service provider must forward traffic, each router must look up the destination IP address of the packet. If the packets are sent to destinations that are external to the service provider network, those external IP prefixes must be present in the routing table of each router. BGP carries external prefixes, such as the customer prefixes or the Internet prefixes. This means that all routers in the service provider network must run BGP.MPLS, however, enables the forwarding of packets based on a label lookup rather than a lookup of the IP addresses. MPLS enables a label to be associated with an egress router rather than with the destination IP address of the packet. The label is the information attached to the packet that tells every intermediate router to which egress edge router it must be forwarded. The core routers no longer need to have the information to forward the packets based on the destination IP address. Thus, the core routers in the service provider network no longer need to run BGP. The router at the edge of the MPLS network still needs to look at the destination IP address of the packet and hence still needs to run BGP. Each BGP prefix on the ingress MPLS routers has a BGP next-hop IP address associated with it. This BGP next-hop IP address is an IP address of an egress MPLS router. The label that is associated with an IP packet is the label that is associated with this BGP next-hop IP address. Because every core router forwards a packet based on the attached MPLS label that is associated with the BGP next-hop IP address, each BGP next-hop IP address of an egress MPLS router must be known to all core routers. Any interior gateway routing protocol, such as OSPF or ISIS, can accomplish this task . An Internet service provider (ISP) that has 200 routers in its core network needs to have BGP running on all 200 routers. If MPLS is implemented on the network, only the edge routers—which might be 50 or so routers—need to run BGP. All routers in the core of the network are now forwarding labeled packets, without doing an IP lookup, so they are now relieved from the burden of running BGP. Because the full Internet routing table is well above 150,000 routes, not having to run BGP on all routers is a serious consideration. Routers without the full Internet routing table need a lot less memory. You can run the core routers without the complexity of having to run BGP on them.

Wednesday, October 28, 2015

Why is it required that iBGP peers always form full mesh?

eBGP uses the AS_PATH as loop avoidance mechanism since iBGP router doesn't change AS_PATH attribute while advertising routes to another iBGP peer we can't use it as loop avoidance in iBGP. To avoid loop iBGP peer doesn't advertised routes learned from another iBGP peer. So in order for an iBGP peers to receive all routes need to establish BGP session with all other peers hence full mesh.

Monday, October 26, 2015

BGP interview Questions

Here is a list of questions that I could come across while i studied BGP topics. This is a very rough draft.

BGP Questions
- How do you inject a network into bgp ? the command
- what is r - rib failure in sh ip bgp? - it means it is best route in bgp but we lost from the routing table as it is learnt via another protocol
- what is command  no auto-summary in bgp config? it means that put the exact network and the exact mask and it will advertise( classless).so if you have lot of 10.0.0.0 network and you insert command "network 10.0.0.0" inside bgp these networks wont be advertise via bgp. this is because autosummary is off by default and we need to type exact network and mask. if we turn on autosummary and then do this classfull network command we will see all 10 networks inside bgp
- what is no synchronization command in bgp config? if sych is off it means that i will not use the bgp route unless it is learnt via an igp. Now it is no sync by default.
- In bgp what are origin code of "i" and "?" - i means this network is into bgp from the network command and is configured on this router. "?" means that this network is into bgp from the redistribute command under bgp config
- what is sourcing a default route in bgp - it means that r1---->r2.. suppose r1 wants to inform r2 that is r2 wants to send traffic anywhere and is not specified in r2 table then send it to me r1
- How to source a default route? on r1 put the command " neighbor r2ip default-originate" . you wont see a default route on r1 . but if you check sh ip bgp of r2 you will see 0.0.0.0 next hop r1
- what is aggregation(summary) routes in bgp? how to do it? - it is here we take many detailed networks and advertise them as block of single larger address.We do this to reduce the number of router in bgp on internet.
- what is split horizon rule of bgp? as89(R8) ----- as3(R6 --R5--R3)
R8 sends ebgp update to R6. R6 will send ibgp update to R5 . But R5 will not send ibgp updat to R3 or any other internal bgp neighbors.
- why peering with loopback interface is good instead of physical interface?
- What are the ways to overcome full mesh topology in ibgp network? - confederation and routereflectors
- what are the two benefits of route reflectors? - 1) eleminate need for full mesh - ie send one update to route reflector the route reflector sends update to all its clients
2) loop prevention through cluster id- ie if i am a route reflector and i receive a route with my own cluster id i discard it.
- Explain configuring rr. ?  as3(R6 --R5--R3) on R5 we want it to be rr. neighbor 3.3.3.3 remote-as 3, neighbor 3.3.3.3 route-reflector-client. -> this is the only command needed on R5 ie rr and it will start sending updates to R3
- On router how will you check if that router is advertising bgp routes down to its neighbor ? sh ip bgp neighbor <neighbor ip> advertised-route
- does bgp send all routes it knows via bgp to its neighbor? entire sh ip bgp table? - no bgp send to its neighbor only valid routes with > sign
- if a client sends and update to rr, do  clients and nonclients get it? answer yes
- if a nonclient send a update to rr , do  clients and nonclients get it? - clients get it. Non clients dont get it
-
- in confederations does the rule of ttl of 1 between two ebgp apply? how to overcome it?.- yes it applies. to overcome it neighbor <ip> ebgp-multihop <coutn
- How to configure peer groups? neighbor MYPEERS peer-group, neighbor MYPEERS remote-as 123, neighbor MYPEERS update-source lo, neighbpr 1.1.1.1 peer-group MYPEERS
- what is bgp update-group? bgp dynamically assigns neighbors to update groups
- what is commmand to enable password for forming bgp neighbor? we need to do neighbor 1.1.1.1 password xyz
- what is ttl security in bgp?  neighbor <ip> ttl-security hops <number of hops> put on both routers
- What is NHS ? explain with example
- what is default ttl for ibgp neighbors and ebgp neighbors?
- what modifications are needed to ttl if ebgp neighbors are not directly connected
- what is advantage of peering with neighbors loopback ip address instead of physical address
- If we want to neighbor up with peers loopback address what is the additional command and what is the implication if we do not use that commnad and still use loopback to peer up with neighbor
- There are two bgp neighbors. You want one neighbor to always be server and other to be client. How can you do that? hint - update loopback sourc on one neighbor.
other neighbor dont mention this commnad... R1 forms neighborship with 2.2.2.2 using loopback and R2 when trying to form neibhborship with R1 loopback dont use update loopback source and it wil form neighborship as already it will see that it has a neighbor statement

R1-----------------------------------------------------------------------R2
on R1 - neighbor 2.2.2.2 update source lo 0
Now R1 forms neighbor with 2.2.2.2 from 1.1.1.1
From R2 - neibhbor 1.1.1.1 (no update source)
R2 thinks I already have neibhborship with 1.1.1.1 so forms neibhbor.
In this case R2 will always be server , R1 always client


- how do you change the router id of bgp and does it have impact on existing bgp established sessions?
- How do you inject a network into bgp ? the command
- what is r - rib failure in sh ip bgp? - it means it is best route in bgp but we lost from the routing table as it is learnt via another protocol
- what is command  no auto-summary in bgp config? it means that put the exact network and the exact mask and it will advertise( classless).so if you have lot of 10.0.0.0 network and you insert command "network 10.0.0.0" inside bgp these networks wont be advertise via bgp. this is because autosummary is off by default and we need to type exact network and mask. if we turn on autosummary and then do this classfull network command we will see all 10 networks inside bgp
- what is no synchronization command in bgp config? if sych is off it means that i will not use the bgp route unless it is learnt via an igp. Now it is no sync by default.
- In bgp what are origin code of "i" and "?" - i means this network is into bgp from the network command and is configured on this router. "?" means that this network is into bgp from the redistribute command under bgp config
- what is sourcing a default route in bgp - it means that r1---->r2.. suppose r1 wants to inform r2 that is r2 wants to send traffic anywhere and is not specified in r2 table then send it to me r1
- How to source a default route? on r1 put the command " neighbor r2ip default-originate" . you wont see a default route on r1 . but if you check sh ip bgp of r2 you will see 0.0.0.0 next hop r1
- what is aggregation(summary) routes in bgp? how to do it? - it is here we take many detailed networks and advertise them as block of single larger address.We do this to reduce the number of router in bgp on internet.
- what is split horizon rule of bgp? as89(R8) ----- as3(R6 --R5--R3)
R8 sends ebgp update to R6. R6 will send ibgp update to R5 . But R5 will not send ibgp updat to R3 or any other internal bgp neighbors.
- why peering with loopback interface is good instead of physical interface?
- What are the ways to overcome full mesh topology in ibgp network? - confederation and routereflectors
- what are the two benefits of route reflectors? - 1) eleminate need for full mesh - ie send one update to route reflector the route reflector sends update to all its clients
2) loop prevention through cluster id- ie if i am a route reflector and i receive a route with my own cluster id i discard it.
- Explain configuring rr. ?  as3(R6 --R5--R3) on R5 we want it to be rr. neighbor 3.3.3.3 remote-as 3, neighbor 3.3.3.3 route-reflector-client. -> this is the only command needed on R5 ie rr and it will start sending updates to R3
- On router how will you check if that router is advertising bgp routes down to its neighbor ? sh ip bgp neighbor <neighbor ip> advertised-route
- does bgp send all routes it knows via bgp to its neighbor? entire sh ip bgp table? - no bgp send to its neighbor only valid routes with > sign
- if a client sends and update to rr, do  clients and nonclients get it? answer yes
- if a nonclient send a update to rr , do  clients and nonclients get it? - clients get it. Non clients dont get it
-
- in confederations does the rule of ttl of 1 between two ebgp apply? how to overcome it?.- yes it applies. to overcome it neighbor <ip> ebgp-multihop <coutn
- How to configure peer groups? neighbor MYPEERS peer-group, neighbor MYPEERS remote-as 123, neighbor MYPEERS update-source lo, neighbpr 1.1.1.1 peer-group MYPEERS
- what is bgp update-group? bgp dynamically assigns neighbors to update groups
- what is commmand to enable password for forming bgp neighbor? we need to do neighbor 1.1.1.1 password xyz
- what is ttl security in bgp?  neighbor <ip> ttl-security hops <number of hops> put on both routers
- explain origin code in bgp? - i put into bgp with network statement.
-what are well know mandatoryattributes? give examples - well know is recognized by every bgp speaker and must be present in update eg. nh, aspath.
-what are well know discretionary? give examples - well know is recognized by every bgp speaker and discretionary means may or may not be present in an update eg atomic path aggregator
- what are optional transitive? give examples - optional may or may not be recognized by other bgp neighbors, and transitive means passed betn ebgp and ibgp neighbors
- what are optional nontransitive? give examples - non transitive means passed only between ibgp neighbors
- what is the most important aspect of as path attribute? - loop prevention, if an as sees its own as path in the updates it will not accept it
- how will u influence r6 to be the egress for all traffic to 2,2,2,2 route - set the local pref to be highest for 2.2.2.2 route on r6 . this is propagated to all nodes in as3 and all take r6 as best path to egress out to 2.2.2.2 n- w
- how will you influence ingress traffic on one link when you are hultihomed to single service provider? advertise med for the particular neighbor with lower med value
- what is atomic aggregate and aggrigator?  atomic aggregate - here atomic means one.this means we advertise one summary inor out of the as.
 aggregator is the individual who did the aggregation.
- how do we maniputlate outbound taffic ? Local pref and weight
- what is aspath prepending?why use it? - this is used to influence others to take a particular path.
- why use med when we can do inbound traffic manipulation using aspath prepend? - aspath prepand we do not know what the policy of the other as is towards our as.
- what is a distribute list explain with eg
- what is a route map explain with eg
- what is a pefix list explain with eg
- difference between acl distribute list prefix list and route map explain?
- how to load balance across multiple bgp paths
- is it possible to connecect to two diff isp? how do we do that? does load balancing work? - we must have our own as herer to connect to two diff isps
- Range of pivate AS number? and range of public AS number? - 64512 to 65535

Sunday, October 25, 2015

BGP PATH VECTOR PROTOCOL

Why is BGP called a Path Vector Protocol ?

BGP is a distance vector protocol in that each BGP node relies on downstream neighbors to pass along routes from their routing table; the node makes its route calculations based on those advertised routes and passes the results to upstream neighbors. However, other distance vector protocols quantify the distance with a single number, representing hop count. In contrast, BGP uses a list of AS numbers through which a packet must pass to reach the destination.Because this list fully describes the path a packet must take, BGP is called a path vector routing protocol to contrast it with traditional distance vector protocols.