As A First Step In Identifying The Causes Of Packet Looping In The Internet, This Paper Solely Focuses On Understanding Routing Loops In Path Vector Routing Protocols In General, And In BGP In Particular.
BEFORE GOTO BGP FIRST KNOW WHAT IS ROUTING?
Routing Is A Way To Get One Packet From One Destination To The Next. Routers Or Software In A Computer Determines The Next Network Point To Which A Packet Should Be Forwarded Toward Its Final Destination. The Router Is Connected To At Least Two Networks And Makes A Decision Which Way To Send Each Data Packet Based On Its Current State Of The Networks It Is Connected To.
A Router Is Located At Any Point Of Networks Or Gateway, Including Each Internet POP. A Router Creates Or Maintains A Table Of The Available Routes And Their Conditions And Uses This Information Along With Distance And Cost Algorithms To Determine The Best Route For A Given Packet. Typically, A Packet May Travel Through A Number Of Network Points With Routers Before Arriving At Its Destination.
ROUTING COMPONENTS :
Routing Involves Two Basic Activities : Determining The Optimal Routing Paths For Destination Networks And Transporting Information Groups, Also Known As Packets, Through An Internetwork. Within The Context Of Routing, The Latter Can Be Referred To As Switching.
BGP OVERVIEW :
The Border Gateway Protocol (BGP) Is An Inter-Autonomous System Routing Protocol Designed For Transmission Control Protocol / Internet Protocol (TCP/IP) Networks.
The Internet Consists Of Autonomous Systems (Ases) Operated By Different Institutions. Within An As, Routing Is Controlled By Intra-Domain Protocols Such As OSPF, IS-IS, And RIP. Border Gateway Protocol (BGP) Is The Internet’s Inter-Domain Routing Protocol.
The Initial Version Of The BGP Protocol Was Published In [RFC1105].BGP Version 2 Is Defined In [RFC1163]. BGP Version 3 Is Defined In RFC1267]. BGP Version 4 Is Defined In [RFC1771] And [RFC4271].
Path-Vector Routing Algorithms Were Designed As An Improvement Over Previous Distance Vector Routing Algorithms. One Of BGP’s Primary Reasons For Adopting A Path-Vector Approach Is To Eliminate Routing Loops.
The BGP-4 Management Information Base (MIB) Has Been Published [BGP-MIB]. The MIB Was Updated From Previous Versions, Which Are Documented In [RFC1657] And [RFC1269], Respectively.
Apart From A Few System Variables, The BGP MIB Is Broken Into Two Tables:
The Peer Table Reflects Information About BGP Peer Connections, Such As Their State And Current Activity.
The Received Path Attribute Table Contains All Attributes Received From All Peers Before Local Routing Policy Has Been Applied. The Actual Attributes Used In Determining A Route Are A Subset Of The Received Attribute Table.
THE BORDER GATEWAY PROTOCOL (BGP) CONTAINS TWO DISTINCT SUB SETS:
1. External BGP (EBGP)
2. And Internal BGP (IBGP).
IN Above Figure, If An Autonomous System Has Multiple BGP Speakers, It Could Be Used As A Transit Service For Other Ass. As You See Below, AS200 Is A Transit Autonomous System For AS100 And AS300.
It Is Necessary To Ensure Reachability For Networks Within An AS Before Sending The Information To Other External Ass. This Is Done By A Combination Of Internal BGP Peering Between Routers Inside An AS And By Redistributing BGP Information To Internal Gateway Protocols Running In The AS.
EBGP vs IBGP:
When You Read About BGP, Often You See EBGP Or IBGP Mentioned. These Are Both BGP Routing, But BGP Used In Different Roles. Exterior BGP (EBGP) Involves Packets Crossing Multiple Autonomous Systems (Ases) Where Interior BGP (IBGP) Involves Packets That Stay Within A Single AS. For Example The AS_PATH Attribute Is Only Useful For EBGP Where Routes Pass Through Multiple Ases.
These Two Modes Are Important Because Some Features Of BGP Are Only Used For One Of EBGP Or IBGP.
For Example Confederations Are Used In EBGP, And Route Reflectors Are:
Only Used In IBGP. Also Routes Learned From IBGP Have Priority Over EBGP Learned Routes.
Both EBGP And IBGP Are Terms Used With The Routing Protocol BGP. In Theoretical Terms, The Main Difference Between The Two Is EBGP Runs Between Two BGP Routers In Different Autonomous System (As), However, IBGP Runs Between Two BGP Routers In The Same As. Before We Discuss The Differences Between EBGP And IBGP, Let Us Have A Basic Understanding Of EBGP And IBGP.
WHAT IS EBGP (Exterior BGP)?
BGP Runs Between Routers In Different Autonomous Systems. By Default, In EBGP (Peering In Two Different As), IP TTL Is Set To 1, Which Means Peers Are Assumed To Be Directly Connected.
In This Case, When Packet Crosses One Router, TTL Becomes 0 And Then The Packet Will Be Dropped Beyond That. In Cases Where The Two Neighbors Are Not Directly Connected, For Example, Peering With Loopback Interfaces Or Peering When Devices Are Multiple Hops Away, We Need To Add Command “Neighbor X.X.X.X EBGP-Multihop
Otherwise, BGP Neighborship Will Not Be Established. In Addition, EBGP Peer Will Advertise All The Best Routes It Knows Or It Has Learnt From Its Peers (Whether EBGP Peer Or IBGP Peer), Which Is Not, In The Case Of IBGP.
WHAT IS IBGP (Interior BGP)?
In IBGP, There Is No Restriction That Neighbors Have To Be Connected Directly; However, An IBGP Peer Will Not Advertise The Prefix It Learned From An IBGP Peer To Another IBGP Peer. This Restriction Is There To Avoid Loops Within The Same As. To Clarify This, When A Route Is Passed To A EBGP Peer, The Local As Number Gets Added To The Prefix In As-Path, So If We Receive The Same Packet Back Stating Our As In As-Path, We Know That It Is A Loop, And That Packet Gets Dropped. However, When A Route Is Advertised To An IBGP Peer, The Local As Number Is Not Added To As-Path, Since The Peers Are In Same As.
TO AVOID LOOPS IN SAME AS, THERE ARE TWO METHODS USED :
1. FULL MESHED TOPOLOGY : In This, All The Routers In The Same As Have To Be Connected To Each Other. For Example, If We Have N Routers, Then We Must Have N (N-1)/2 IBGP Sessions. We Can Avoid This By Introducing Route Reflectors.
2. USE OF ROUTE-REFLECTORS : It Is An Alternative Method To Overcome Full Mesh Scenario. In This Case, IBGP Sessions Are Established With A Central Point. This Central Point Is Called Route Reflector And The Other IBGP Routers Are Called Route Reflector Clients.
BGP BACKGROUND :
BGP Is A Path-Vector Based Protocol. BGP Was First Used In 1989. The Current Version, BGP-4, Was Released In 1995 And Is Defined In RFC 1771. That RFC Has Since Been Replaced By The More Recent RFC 4271. The Main Benefits Of BGP-4 Are Classless Inter-Domain Routing, And Aggregate Routes. BGP Is The Only Routing Protocol To Use TCP For A Transport Protocol. Other Routing Protocols Use UDP.
BGP Makes Routing Decisions Based On Path, Network Policies And Rulesets Instead Of The Hop-Count Metric As RIP Does, Or Cost-Factor Metrics As OSPF Does. BGP-4+ Supports IPv6.
It Was Introduced In RFC 2858 And RFC 2545. BGP-4 Also Supports BGP Is The Routing Protocol Used On The Internet. It Was Designed To Replace The Old Exterior Gateway Protocol (EGP) Which Had Been Around Since 1982, And Was Very Limited. In Doing So, BGP Enabled More Networks To Take Part In The Internet Backbone To Effectively Decentralize It And Make The Internet More Robust, And Less Dependent On A Single ISP Or Backbone Network.
INTRODUCTION OF BGP - 4:
BGP Is A Modern Routing Protocol Designed To Scale To The Largest Networks And Create Stable Routes Between Organizations. BGP Supports Variable-Length Subnet Mask (VLSM), Classless Inter domain Routing (CIDR), And Summarization.
BORDER GATEWAY PROTOCOL (BGP) Version 4 Is The Life Blood Of The Internet. It Is Responsible For Exchanging Routing Information Between All Of The Major Internet Service Providers (ISPS), As Well Between Larger Client Sites And Their Respective ISPS. And In Some Large Enterprise Networks, BGP Is Used To Interconnect Different Geographical Or Administrative Regions.
BGP Is An Extremely Complex Protocol Used Throughout The Internet And Within Multinational Organizations. Its Main Purpose Is To Connect Very Large Networks Or Autonomous Systems. Large Organizations Use BGP As The Glue Between Divisions.
BGP - 4 Is An Inter-Autonomous System Routing Protocol Designed For TCP/IP Internets. The Primary Function Of A BGP Speaking System Is To Exchange Network Reachability Information With Other BGP Systems. This Network Reachability Information Includes Information On The List Of Autonomous Systems (ASEs) That Reachability Information Traverses.
This Information Is Sufficient To Construct A Graph Of AS Connectivity For This Reachability, From Which Routing Loops May Be Pruned And Some Policy Decisions, At The AS Level, May Be Enforced.
BGP – 4 Is An Exterior Gateway Protocol (EGP), Which Means That It Exchanges Routing Information Between Autonomous Systems (As). It Also Uses A Different Basic Algorithm For Building A Loop-Free Topology Than Any Of Those Protocols. RIP Is A Distance Vector Protocol, OSPF Is A Link State Protocol, And EIGRP Is A Distance Vector Protocol That Incorporates Many Of The Advantages Of A Link State Protocol.
BGP, On The Other Hand, Uses A Path Vector Algorithm. This Means That Instead Of Reducing Each Route's Relative Importance In The Routing Table To A Single Metric Or Cost Value, BGP Keeps A List Of Every As That The Path Passes Through. It Uses This List To Eliminate Loops Because A Router Can Check Whether A Route Has Already Passed Through A Particular As By Simply Looking At The Path.
NOTE : BGP Is The Only Routing Protocol In Use Today That Supports Interdomain Routing. The Equipment And Networks Controlled By An Organization Are Called An Autonomous System (AS). Autonomous Means Independent, And When You Use BGP You Cannot Force Another Organization To Route Traffic Nor Can They Force Routing Decisions On You.
WHEN WE USE BGP?
Because Of Its Complexity And Specialization For Exterior Functions, BGP Is Best In Some Specific Cases:
■ BGP Is The Only Routing Protocol That Can Connect Your Organization To Multiple Autonomous Systems. For Instance, Sometimes Multiple Internet Links Are Used For Redundancy And Route Optimization Purposes.
■ BGP Should Be Considered If You Need To Implement A Routing Policy That Is Only Possible With BGP, For Instance, To Control The Link To Your ISP.
■ Finally, BGP Is A Must If Your Organization Acts As A Transit AS And Connects Other AS Together. An ISP Is An Example Of A Transit AS.
USAGE APPLICATIONS :
DO NOT USE BGP IS ONE OF THE FOLLOWING CONDITIONS EXISTS :
On The Contrary, BGP Is Probably Not Needed Unless The Preceding Circumstances Applies. If Your Routing Requirements Can Be Met In A Simpler Way, For Instance With A Default Route, Then Do Not Encumber Yourself With The Monetary, Financial, And Intellectual Overhead Of BGP.
And Above All, Do Not Use BGP If Your Router Has Insufficient Processor Or Memory Resources Or If You Are Not Absolutely Sure Of The Potential Effects Of Your BGP Configuration.
HOW DOES BGP WORK?
When BGP Routers Start A Connection, They Negotiate Which (If Any) Optional Features Will Be Used Such As Multiprotocol Extensions That Can Include IPv6 And VPNs.
BGP ROUTE STABILITY :
Another Key Point About BGP Is That BGP Wants The Network To Be Quiet. Whereas IGPS Want The Latest Information And Are Constantly Adjusting Routes Based On New Information, BGP Is Designed To Prefer Routes That Are Stable And Not Constantly Re-Advertised. Also, BGP Configurations Normally Require Complex Policy Decisions. Thus, Given This Complexity Coupled With The Extreme Size Of The BGP Routing Table (Often Hundreds Of Thousands Of Routes), It Is Not Surprising That Constantly Adjusting Routes Could Overwhelm BGP.
BGP OPERATION BASICS :
BGP Associates Networks With Autonomous Systems. Other Internet Routers Then Send Traffic To Your Network Toward Your AS. When That Traffic Arrives At Your Edge BGP Routers, It Is Typically The Job Of An IGP (Such As EIGRP Or OSPF) To Find The Best Internal Path. BGP Is A Path-Vector Routing Protocol. Routes Are Tracked In Terms Of The AS They Pass Through,And Routers Avoid Loops By Rejecting Routes That Have Already Passed Through Their AS.
WHAT IS AN AUTONOMOUS SYSTEM (ASN) NUMBER?
An Autonomous System Is One Network Or Sets Of Networks Under A Single Administrative Control. An Autonomous System Might Be The Set Of All Computer Networks Owned By A Company, Or A College. Companies And Organizations Might Own More Than One Autonomous System, But The Idea Is That Each Autonomous System Is Managed Independently With Respect To BGP. An Autonomous System Is Often Referred To As An 'AS'.
A Very Important Number In This Configuration Is The Autonomous System (AS) Number. In This Example, It’s 55555, In The Line Route BGP 55555.
This Number Uniquely Identifies The Routing Domain Under Your Control That Connects To The Internet. BGP Is A “Path Vector” Routing Protocol. In Its Most Basic Sense, BGP’s Job Is To Choose The Shortest Path Through The Internet Cloud Of Autonomous Systems.
You Can Obtain The BGP AS Number From The American Registry For Internet Numbers (ARIN). The AS Number Uniquely Identifies You In The BGP Cloud Of The Internet. The American Registry For Internet Numbers (ARIN) Defines Autonomsous System Numbers As:
"Autonomous System Numbers (ASNS) Are Globally Unique Numbers That Are Used To Identify Autonomous Systems (AS) And Which Enable An AS To Exchange Exterior Routing Information Between Neighboring AS. An AS Is A Connected Group Of IP Networks That Adhere To A Single And Clearly Defined Routing Policy."
To Identify Each Autonomous System, A 'Globally Unique' Number Is Assigned To Them From A Centralized Authority (ARIN) So That There Are No Duplicate Numbers. Globally Unique Means Exactly That. Within The Entire Internet All Around The Globe, The AS Number Should Be Unique.
The AS Number Will Be From 1 To 64511, And The Next Highest Unused Number Is What Is Generally Assigned. These Numbers Are Referred To As 'AS Numbers'. The American Registry For Internet Numbers (ARIN) Is The Authority Responsible For Tracking And Assigning These Numbers As Well As Managing IP Address Allocations And Assignments. ARIN Charges A Fee To Organizations Wishing To Obtain An AS Number To Cover The Administrative Costs Associated With Managing AS Number Registrations And Assignments.
To Receive An AS Number From ARIN, You Must Be Able To Prove You Are 'Dual Homed' To The Internet, Which Means That You Have More Than One Internet Provider With Which You Plan To Run BGP. You Must Also Have A 'Unique Routing Policy' That Differs From Your BGP Peers. Some Companies Have Difficulty Getting An AS Number.
PRIVATE AS NUMBERS (64512 - 65535):
If It Is Not Necessary To Connect To The Internet, Or You Are Part Of A Special Type Of BGP Configuration You Can Use Any Of The AS Numbers 64512 Through 65535. However, These Numbers Should NOT Be Seen On The Global Internet. One Example Of When You Might Use Private AS Numbers Is In BGP Confederations. The Confederation AS Number Should Not Be Seen On The Global Internet.
AUTONOMOUS SYSTEM NUMBERS AND BGP :
BGP Learns And Exchanges Path Information Regarding The Route To A Given Destination Network By Keeping Lists Of AS Numbers And Associating Them With Destination Networks. This Is Why AS Numbers Should Be Unique. BGP Makes Certain That An AS Number Does Not Appear In A Path More Than Once, Thereby Preventing Routing Loops.
As Currently Defined, BGP Requires That All BGP Speakers Within A Single As Must Be Fully Meshed. The Result Is That For N BGP Speakers Within An As N*(N-1)/2 Unique IBGP Sessions Are Required.
This "Full Mesh" Requirement Clearly Does Not Scale When There Are A Large Number Of IBGP Speakers Within The Autonomous System, As Is Common In Many Networks Today.
AUTONOMOUS SYSTEM (AS) TERMS AND DEFINITIONS :
AS Confederation :
A Collection Of Autonomous Systems Advertised As A Single As Number To BGP Speakers That Are Not Members Of The Confederation.
AS Confederation Identifier :
An Externally Visible Autonomous System Number That Identifies The Confederation As A Whole.
Member-AS :
An Autonomous System That Is Contained In A Given As Confederation.
Member-AS Number :
An Autonomous System Number Visible Only Internal To A BGP Confederation.
BGP OPERATION :
BGP Performs Three Types Of Routing :
INTERAUTONOMOUS SYSTEM ROUTING: Occurs Between Two Or More BGP Routers In Different Autonomous Systems. Peer Routers In These Systems Use BGP To Maintain A Consistent View Of The Internetwork Topology. BGP Neighbors Communicating Between Autonomous Systems Must Reside On The Same Physical Network. The Internet Serves As An Example Of An Entity That Uses This Type Of Routing Because It Is Comprised Of Autonomous Systems Or Administrative Domains. Many Of These Domains Represent The Various Institutions, Corporations, And Entities That Make Up The Internet. BGP Is Frequently Used To Provide Path Determination To Provide Optimal Routing Within The Internet.
INTRA - AUTONOMOUS SYSTEM ROUTING: Occurs Between Two Or More BGP Routers Located Within The Same Autonomous System. Peer Routers Within The Same Autonomous System Use BGP To Maintain A Consistent View Of The System Topology.
BGP Also Is Used To Determine Which Router Will Serve As The Connection Point For Specific External Autonomous Systems. Once Again, The Internet Provides An Example Of Inter -Autonomous System Routing.
An Organization, Such As A University, Could Make Use Of BGP To Provide Optimal Routing Within Its Own Administrative Domain Or Autonomous System. The BGP Protocol Can Provide Both Inter- And Intra-Autonomous System Routing Services.
PASS - THROUGH AUTONOMOUS SYSTEM ROUTING: Occurs Between Two Or More BGP Peer Routers That Exchange Traffic Across An Autonomous System That Does Not Run BGP. In A Pass-Through Autonomous System Environment, The BGP Traffic Did Not Originate Within The Autonomous System In Question And Is Not Destined For A Node In The Autonomous System. BGP Must Interact With Whatever Intra-Autonomous System Routing Protocol Is Being Used To Successfully Transport BGP Traffic Through That Autonomous System.
PRIMARY FUNCTION OF A BGP :
The Primary Function Of A BGP Speaking System Is To Exchange Network Reachability Information With Other BGP Systems. This Network Reachability Information Includes Information On The List Of Autonomous Systems (Ases) That Reachability Information Traverses.
This Information Is Sufficient For Constructing A Graph Of AS Connectivity For This Reachability From Which Routing Loops May Be Pruned, And, At The AS Level, Some Policy Decisions May Be Enforced.
BGP-4 Provides A Set Of Mechanisms For Supporting Classless Inter-Domain Routing (CIDR). These Mechanisms Include Support For Advertising A Set Of Destinations As An IP Prefix,And Eliminating The Concept Of Network "Class" Within BGP. BGP-4 Also Introduces Mechanisms That Allow Aggregation Of Routes, Including Aggregation Of AS Paths.
BGP ATTRIBUTES :
BGP Associates Several Different Basic Attributes With Each Route Prefix. Attributes Are Contained In Update Messages Passed Between BGP Peers For Advertise Routers.
Before We Examine The Specific Attributes, We Need To Understand The Categories Used To Differentiate BGP Attributes. Some Attributes Are Required, Some Are Not, Some Attributes Will Be Carried Between Routers, Where Others Will Not.
BGP Associates Several Different Basic Attributes With Each Route Prefix. These Attributes Include Useful Pieces Of Information About The Route, Where It Came From, And How To Reach It. Well Known Attributes Must Be Supported By Every BGP Implementation.
Some Well Known Attributes Are Mandatory. All Of The Mandatory Attributes Must Be Included With Every Route Entry. A BGP Router Will Generate An Error Message If It Receives A Route That Is Missing One Or More Well Known Mandatory Attributes.
There Are Also Well Known Discretionary Attributes, Which Every BGP Router Must Recognize And Support, But That Don't Have To Be Present With Every Route Entry. Whenever A Router Passes Along A Route That It Has Learned Via BGP To Another BGP Peer, It Must Include All Of The Well Known Attributes That Came With This Route, Including Any Discretionary Attributes. Of Course, The Router May Need To Update Some Of These Attributes Before Passing Them Along, To Include Itself In The Path, For Example.
BGP Routes Can Also Include One Or More Optional Attributes. These Are Not Necessarily Supported By All BGP Implementations. Optional Attributes Can Be Either Transitive Or Nontransitive, Which Is Specified By A Special Flag In The Attribute Type Field. If A Router Receives A Route With A Transitive Optional Attribute, It Will Pass This Information Along Intact To Other BGP Routers, Even If It Doesn't Understand The Option. The Router Will Mark The Partial Bit In The Attribute Flags To Indicate That It Was Unable To Handle This Attribute, However.
The Router Will Quietly Drop Any Unrecognized Nontransitive Optional Attributes From The Route Information Without Taking Any Action.
THE MOST COMMON BGP ATTRIBUTES: There Are Basically Two Major Types Of Attribute :
1. WELL KNOWN ATTRIBUTE.
2. OPTIONAL ATTRIBUTE.
WELL KNOWN :
Well Known Attributes Are Must Be Recognized By Each Compliant Of BGP Implementations. Well Known Attributes Are Propagated To Other Neighbors Also.
FURTHER DIVIDED INTO :
1) Mandatory : It Is BGP Well Known Attributes. Mandatory Attributes Are Must Be Present In All Update Message Passed between BGP Peers. It Is Present In Route Description. Must Be Supported And Propagated.
2) Discretionary : It Is BGP Well Known Attributes. Discretionary Attributes May Be Present On Update Message. Must Be Supported; Propagation Optional.
OPTIONAL:
Optional Attributes Are Recognized By Some Implementation Of BGP & Expected That Not Recognized By Everyone. Optional Attributes Are Propagated To Their Neighbors Based On The Meanings.
FURTHER DIVIDED INTO :
1) TRANSITIVE: Optional Transitive Attributes Don’t Have To Be Supported, But Must Be Passed Onto Peers.
Marked As Partial If Unsupported By Neighbor.
2) NON TRANSITIVE: Optional Non-Transitive Attributes Don’t Have To Be Supported, And Can Be Ignored.
Deleted If Unsupported By Neighbor.
THE BGP ATTRIBUTES ARE LISTED BELOW :
1. WEIGHT (ATTRIBUTE TYPE – MANDATORY):
Weight Is A Cisco-Defined Attribute That Is Local To A Router. The Weight Attribute Is Not Advertised To Neighboring Routers. If The Router Learns About More Than One Route To The Same Destination, The Route With The Highest Weight Is Preferred.
2. Local Preference (Attribute Type – Discretionary ):
The Local Preference Attribute Is Used To Prefer An Exit Point From The Local Autonomous System. Unlike The Weight Attribute, The Local Preference Attribute Is Propagated Throughout The Local AS. If There Are Multiple Exit Points From The AS, The Local Preference Attribute Is Used To Select The Exit Point For A Specific Route.
3. AS Path (Attribute Type – Mandatory):
When A Route Advertisement Passes Through An Autonomous System, The AS Number Is Added To An Ordered List Of AS Numbers That The Route Advertisement Has Traversed.
4. Origin :
The Origin Attribute Indicates How BGP Learned About A Particular Route. The Origin Attribute Can Have One Of Three Possible Values:
A) IGP – The Route Is Interior To The Originating AS. This Value Is Set When The Network Router Configuration Command Is Used To Inject The Route Into BGP.
B) EGP - The Route Is Learned Via The Exterior Gateway Protocol (EGP).
C) Incomplete – The Origin Of The Route Is Unknown Or Is Learned Some Other Way. An Origin Of Incomplete Occurs When A Route Is Redistributed Into BGP.
5) Multi-Exit Discriminator (Attribute Type - Non Transitive ):
The Multi-Exit Discriminator (MED) Or Metric Attribute Is Used As A Suggestion To An External AS Regarding The Preferred Route Into The AS That Is Advertising The Metric.
6) Next-Hop (Attribute Type – Mandatory) :
The EBGP Next-Hop Attribute Is The IP Address That Is Used To Reach The Advertising Router. For EBGP Peers, The Next-Hop Address Is The IP Address Of The Connection Between The Peers.
7) Community (Attribute Type - Transitive ) :
The Community Attribute Provides A Way Of Grouping Destinations, Called Communities, To Which Routing Decisions (Such As Acceptance, Preference, And Redistribution) Can Be Applied. Route Maps Are Used To Set The Community Attribute. The Predefined Community Attributes Are As Follows:
– > No - Export: Do Not Advertise This Route To EBGP Peers.
– > No - Advertise: Do Not Advertise This Route To Any Peer.
– > Internet :Advertise This Route To The Internet Community; All Routers In The Network Belong To It.
8) Atomic Aggregate (Attribute Type - Discretionary ):
Notes That Route Summarization Has Been Performed.
9) Aggregator (Attribute Type - Transitive ):
Identifies The Router And AS Where Summarization Was Performed.
10) Originator ID (Attribute Type - Non Transitive ):
> Identifies A Route Reflector.
11) Cluster List (Attribute Type - Non Transitive ):
Records The Route Reflector Clusters The Route Has Traverse
BGP ROUTE SELECTION PROCESS :
BBP Doesn't Support Multipath Routing By Default. So If There Are Two Or More Paths To A Destination, BGP Will Go To Great Extremes To Ensure That Only One Of Them Is Actually Used.
BGP Decides Which Route To Use By Applying A Series Of Tests In Order. It Is Important To Understand These Tests And The Order That The Router Looks At Them, Particularly When You Are Trying To Influence Which Routes Are Used. Otherwise You Might End Up Wasting A Lot Of Time Trying To Adjust Your Routing Tables By Using One Method, While The Router Is Making The Actual Decision At Some Earlier Step, And Never Seeing Your Adjustments.
Note : That At Each Step, There May Be Several Routes To The Same Destination Prefix That All Meet The Requirement, Or Are Equal After A Particular Test. In That Case, BGP Will Proceed To The Next Test To Attempt To Break The Tie.
We Should Point Out That These Are The Route Selection Rules On Cisco Routers. Several Of These Rules Are Not Part Of The BGP Specification.
So For Non Cisco Equipment You Should Consult The Vendor's BGP Documentation To See What The Differences Are.
1.The First Test Is Whether The Next Hop Router Is Accessible. By Default, Routers Do Not Update The Next-Hop Attribute When Exchanging Routes By IBGP. So It Is Possible To Receive A Route Whose Next Hop Router Is Actually Several Hops Away, And Perhaps Unreachable. BGP Will Not Pass These Routes To The Main Routing Table, But It Will Keep Them In Its Own Route Database.
2.If Synchronization Is Enabled, The Router Will Ignore Any IBGP Routes That Are Not Synchronized.
3.The Third Test Uses The Cisco Proprietary Weight Parameter, Selecting The Route With The Largest Weight Value. This Parameter Is Not Part Of The Routing Protocol. Adjusting The Weight Of A Particular Route On A Router Will Only Affect Route Selection On This Router. It Is A Purely Local Concept. The Default Weight Value Is Zero, Except For Locally Sourced Routes, Which Get A Default Weight Of 32,768. The Maximum Possible Weight Is 65,535.
4.If The Weights Are The Same, BGP Then Selects The Route With The Highest Local Preference Value, From The Local_Pref Attribute. Routers Only Include This Attribute When Communicating Within An As (IBGP). For External Routes, The Router That Receives A Particular Route Via EBGP Sets The Local Preference Value. For Internal Routes, It Is Set By The Router That Introduced The Route Into BGP. This Allows You To Force Every Router In Your As To Preferentially Send Traffic For A Particular Destination Through A Particular EBGP Link.
5.Next, The Router Looks To See If Any Of The Equivalent Routes Were Originated Locally On This Router By Either A Network Or An Aggregate Command, With Those Originated Locally By A Network Command Being Preferred.
6.If Two Or More Routes To The Same Destination Network Are Still Equal, The Router Moves On To Look At The As_Path. This Is The Path Vector That Gives BGP Its Essential Character. It Is A Set Of As Numbers That Describes The Path To The Destination Network.
7.A BGP Router Will Prefer Any Routes That Originate Inside Its Own As.
8.For Routes That Originate Outside Of The As, BGP Will Prefer The One With The Shortest Path (I.E., The One With The Fewest ASNS). This Is A Simple Indication Of The Most Direct Path.
9.BGP Then Looks At The Origin Attribute If The As Path Lengths Are The Same, And Selects IGP Routes In Preference To EGP, And EGP In Preference To Incomplete Routes. An Incomplete Route Is One That Is Injected Into BGP Via Redistribution, So BGP Isn't Able To Vouch For Its Validity.
10.The Next Test Looks At The Multiple Exit Discriminator (Med) And Selects Route With The Lowest Value. The Med Is Only Used If Both Routes Are Received From The Same As, Or If The Command BGP Always-Compare-Med Has Been Enabled. With This Command Enabled, BGP Will Compare Med Values Even If They Come From Different Ass, Although To Reach This Step The As_Paths Must Have The Same Length. Note That If You Use This Command At All, You Should Use It Throughout The As Or You Risk Creating Routing Loops. Med Values Are Only Propagated To Adjacent Ass, So Routers That Are Further Downstream Don't See Them At All.
11.BGP Will Prefer EBGP To IBGP Paths. This Helps To Eliminate Loops By Ensuring That The Route Selected Is The One That Leads Out Of The As Most Directly. Note That The IBGP Routes Don't Include Internal Routes That Are Sourced From Within Your As Because They Are Selected At Step Number 5 Above. So This Test Looks Only At Routes To External Destinations.
12. The Next Test Compares The IGP Costs Of The Paths To The Next Hop Routers And Selects The Closest One. This Helps To Ensure That Faster Links And Shorter Paths Are Used When Possible.
13.Next, BGP Will Look At The Ages Of The Routes And Use The Oldest Route To A Particular Destination. This Is An Indication Of Stability. If Two Routes Are Otherwise Equivalent, It Is Best To Use The One That Appears To Be The Most Stable.
14.And Finally, If The Routes Are Still Equivalent, BGP Resorts To The Router IDS Of The Next Hop Routers To Break Any Ties, Selecting The Next Hop Router With The Lowest Router Id. Since Router Ids Are Unique, This Is Guaranteed To Eliminate Any Remaining Duplicate Route Problems.
Note : That There Are Subtle Variations To These Rules For Special Situations Such As As Confederations, And Many Individual Rules Can Be Disabled If You Want The Router To Skip Them.
Cisco Has Also Implemented A BGP Multipath Option That Changes This Route Selection Process Somewhat.
If You Enable Multiple Path Support, BGP Will Still Perform The First Seven Tests, Evaluating Everything Up To And Including The Med Values.
But If Two Or More Routes Are Still Equivalent At This Point, The Router Will Install Some Or All Of Them, Depending On How You Implement This Feature.
THE BEST ROUTE SELECTION CRITERIA OCCURS IN THIS ORDER :
Steps The Route Must Pass For It To Get A Place In The Routing Table, First One Match, All Below Are Skipped, So The Order Is Very Important.
The Best Routes (Valid And Reachable) Are Propagated To BGP Neighbors.
The Best BGP Routes Are Copied Into The IP Routing Table After The Router Checks Administrative Distance Value.
BGP ROUTES INJECTION PROCESS :
The BGP Process Injects Local Routes In Two Different Ways :
1. Using The Network Configuration Commands. This Command Lists Networks That Are Candidates If They Appear In The Routing Table.
2. Using Redistribution From Another Routing Protocol.
BGP SPEAKER ROUTERS :
Any Router Configured For BGP Is Considered A BGP Speaker. This Means That A Speaker Router Advertises BGP Routes To Its Peers. Any Routers On The Network That Are Not Speaker Routers Are Not Treated As BGP Routers.
The Internet Is Viewed As A Set Of Arbitrarily Connected As's. Routers That Communicate Directly With Each Other Via BGP Are Known As BGP Speakers. BGP Speakers Can Be Located Within The Same As Or In Different As's. BGP Speakers In Each As Communicate With Each Other To Exchange Network Reachability Information Based On A Set Of Policies Established Within Each As. For A Given BGP Speaker, Some Other BGP Speaker With Which The Given Speaker Communicates Is Referred To As An External Peer If The Other Speaker Is In A Different As, While If The Other Speaker Is In The Same As It Is Referred To As An Internal Peer.
There Can Be As Many BGP Speakers As Deemed Necessary Within An As. Usually, If An As Has Multiple Connections To Other As's, Multiple BGP Speakers Are Needed. All BGP Speakers Representing The Same As Must Give A Consistent Image Of The As To The Outside. This Requires That The BGP Speakers Have Consistent Routing Information Among Them. These Gateways Can Communicate With Each Other Via BGP Or By Other Means. The Policy Constraints Applied To All BGP Speakers Within An As Must Be Consistent. Techniques Such As Using A Tagged IGP May Be Employed To Detect Possible Inconsistencies.
In The Case Of External Peers, The Peers Must Belong To Different As's, But Share A Common Data Link Subnet Work. This Common Subnet Work Should Be Used To Carry The BGP Messages Between Them. The Use Of BGP Across An Intervening As Invalidates The As Path Information. An Autonomous System Number Must Be Used With BGP To Specify Which Autonomous System The BGP Speaker Belongs To.
BGP Requires A Neighbor Relationship To Be Established Before Any Information Is Exchanged Between BGP Speakers. BGP Does Not Dynamically Discover Routers Interested In Running BGP; Instead, BGP Is Configured With A Specific Neighbor IP Address.
BGP SUPPORTS TWO KINDS OF NEIGHBORS :
Normally, External Neighbors Are Adjacent To Each Other And Share A Subnet, While Internal Neighbors May Be Anywhere In The Same Autonomous System.
Two BGP Routers Become Neighbors Or Peers Once They Establish A TCP Connection Between One Another. The TCP Connection Is Essential In Order For The Two Peer Routers To Start Exchanging Routing Updates.
Two BGP Speaking Routers Trying To Become Neighbors Will First Bring Up The TCP Connection Between One Another And Then Send Open Messages In Order To Exchange Values Such As The AS Number, The BGP Version They Are Running (Version 3 Or 4), The BGP Router ID And The Keepalive Hold Time, Etc.
After These Values Are Confirmed And Accepted The Neighbor Connection Will Be Established. Any State Other Than Established Is An Indication That The Two Routers Did Not Become Neighbors And Hence The BGP Updates Will Not Be Exchanged.
TO THE CONFIGURATION OF A BGP NEIGHBORING SESSION, THE FOLLOWING TASKS MUST BE COMPLETED:
NOTE : Both Sides Of The BGP Session Must Be Fully Configured Before A BGP Session Can Be Established.
HOW BGP ESTABLISHED NEIGHBORS RELATIONSHIP :
TCP, BGP Is Connection-Oriented. An Underlying Connection Between Two BGP Speakers Is Established Before Any Routing Information Is Exchanged. This Connection Takes Place On TCP Port 179. As With EIGRP And OSPF, Keepalive Messages Are Sent Out By The BGP Speakers In Order To Keep This Relationship Alive.
Once The Connection Is Established, The BGP Speakers Exchange Routes And Synchronize Their Tables. After This Initial Exchange, A BGP Speaker Will Only Send Further Updates Upon A Change In The Network Topology.
The IGP Protocols That Use Autonomous Systems, IGRP And EIGRP, Require Prospective Neighbors To Be In The Same As. This Is Not True With BGP. Routers Can Be In Different Autonomous Systems And Still Exchange Routes. The BGP Neighbors Do Not Have To Be Directly Connected, And Often Are Not, But Do Need To Be Able To Reach The Ip Addresses They Use In Their Neighbor Statements.
A BGP Peer That Is In The Same As Is Referred To As An Internal BGP (IBGP) Peer, Where A BGP Peer In Another As Is An External BGP (EBGP) Peer.
Like Most Other Dynamic Protocols, BGP Uses Periodic Keepalive Messages To Ensure Availability Of BGP Neighbors.
The Keepalive Timer Is One Third Of The Holdtime. If Three Consecutive Keepalive Messages Are Missed From A Particular BGP Neighbor, The Holdtime Expires And That Neighbor Is Considered Dead. In RFC 1771, The Suggested Value For The Holdtime Is 90 Seconds, And The Suggested Value For The Keepalive Timer Is 30 Seconds. These Values Are Negotiated Between BGP Neighbors When The Neighbors First Come Up. RFC 1771 Also Requires That "An Implementation Of BGP Must Allow These Timers To Be Configurable."
When BGP Is Configured With A Neighbor IP Address, It Goes Through A Series Of Stages BGP SIX STATE MECHANISM) Before It Reaches The Desired Established State In Which BGP Has Negotiated All The Required Parameters And Is Willing To Exchange BGP Routes.
BGP SIX STATE MECHANISM (Session Establishment) :
BGP Goes Through The Following Stages Of Neighbor Relationship, Per RFC 1771. BGP Peer Uses A Simple Finite State Machine (FSM) That Consists Of Six States. That Are:
1. IDLE STATE
2. CONNECT STATE
3. ACTIVE STATE
4. OPENSENT STATE
5. OPENCONFIRM STATE
6. ESTABLISHED STATE
The Show IP BGP Summary Command Gives An Overview Of The Session Status:
ACTIVE STATE :
This State Indicates BGP Is Trying To Initiate A TCP Connection With The BGP Neighbor. There Can Be Three States Of Transition From Active State.
If The TCP Connection To Neighbor Is Successful Then Open Message Is Sent To BGP Neighbor And The State Is Transitioned To Opensent Also The Connectretry Timer Is Cleared. The Hold Time Is Set To 4 Minutes In This Case.
If The Connectretry Timer Expires While Waiting In This State The Process Transitions Back To Connect State And Resets The Connectretry Timer. Initiates A TCP Connection To The Neighbor And Waits For The Neighbor’s Connection. If The Neighbor Attempts To Establish A TCP Session With Unexpected IP Address, Then The Connectretry Timer Is Reset, Connection Is Refused And The BGP Process Stays In The Active State.
Any Other Input Event Except A BGP Start Event While Waiting For The Neighbors TCP Connection Transitions BGP Back To Idle State. Note That A BGP Start Event Is Ignored In The Active State.
OPENSENT STATE :
Indicates An Open Message Has Been Sent To The BGP Neighbor And BGP Is Waiting To Hear An Open Message From That Neighbor. There Are Three Possibilities From This State, BGP Can Either Progress To Openconfirm State Or To Active State Or Back To Idle State.
It Progresses To Openconfirm State If The Open Message Is Received From The Neighbor And The Open Message Has No Errors. Also A The Hold Time Is Negotiated And The Keepalive Timers Are Set. A Keepalive Message Is Also Sent Once It Transitions To Openconfirm State.
It Transitions Back To Idle State If The Open Message Received Has Errors, A Notification Message Is Sent Indicating Error And BGP Transitions Back To Idle State.
It Transitions To Active State If A TCP Disconnect Is Received Before The Open Message, Upon Receiving The TCP Disconnect, The BGP Connection Is Closed And The Connectretry Timer Is Reset.
IDLE STATE :
Idle State Occurs In One Of The Two Scenarios:
1. When The BGP First Starts Or
2. When An Error Has Caused BGP To Transition To This State From Any Other State.
BGP Always Starts In Idle State And A BGP Start Event Triggers The BGP Process To Initialize. The BGP Start Event Occurs When An Operator Configures A New BGP Process Or An Existing BGP Is Reset By The Router Or By An Operator. After The Start Event BGP Process Initializes All BGP Resources, Starts A Connectretry Timer And Initializes A TCP Connection To The Neighbor, Then Changes Its State From Idle To Connect And Waits In Connect State Listening For The TCP Connection From Neighbor.
If An Error Caused The BGP Process To Transition To Idle State, Then The Router Automatically Tries To Issue Another Start Event But To Avoid Constant Flapping By Trying To Restart The BGP Process Constantly In Error Conditions, Some Limitations Are Imposed Using The Connectretry Timer.
The Router Sets The Connectretry Timer And Will Not Attempt To Restart BGP Until This Timer Expires. This Takes Care Of A Router Constantly Trying To Initialize BGP When There Are Persistent Error Conditions And Forces The Router To Wait Until The Timer Expires.
On Cisco The Initial Connectretry Timer Is 60 Seconds And For Each Subsequent Attempt It Becomes Twice Of The Previous Connectretry Time, Exponentially Increasing The Consecutive Wait Times.
CONNECT STATE :
This Is The State Where The BGP Process Is Waiting For The Completion Of The TCP Connection With The Neighbor. There Are Three Possible Outcomes From This State.
1. Progress To Opensent State If All Is Well
2. Progress To Active State Indicating A Problem
3. Transition To Idle State Again
On Successful TCP Connection, BGP Process Clears The Connectretry Timer And Sends An Open Message To The BGP Neighbor. The State Is Progressed To Opensent.
On An Unsuccessful TCP Connection, The BGP Process Resets The Connectretry Timer And Transitions To Active State.
If The Connectretry Expires In Connect State While Still Waiting For Any TCP Connection Outcome, Then The Connectretry Timer Is Reset And Another Attempt Is Made To Establish The TCP Connection With The Neighbor, And The Process Stays In Connect State Until The Timer Expires. Any Other Event In This State Causes The Transition Back To Idle State.
OPENCONFIRM STATE :
In This State The BGP Process Is Just Waiting For A Keepalive Or A Notification Message. There Are Two Possible Transitions From This State.
If A Keepalive Message Is Received Then BGP State Transitions To Established State. If A Notification Message Is Received Then BGP State Transitions To Idle State. Also If The Hold Timer Expires Or A Stop Event Occurs Then BGP Transitions To Idle State And A Notification Message Is Sent To The Neighbor
ESTABLISHED STATE :
This State Indicates That The BGP Session To The Peer Is Fully Established And Both The BGP Peers Can Exchange Keepalives, Update And Notification Messages.
The Hold Timer Is Restarted Every Time When A Keepalive Or An Update Message Is Received.
If A Notification Message Is Received Then The State Transitions To Idle And Any Other Event Except The BGP Start Event, Which Is Ignored Causes BGP To Send A Notification To Neighbor And Transition To Idle State. Note That A BGP Start Event Is Also Ignored In The Established State.
SUMMARIZE THE BGP SIX STATE MECHANISM:
IDLE STATE :
Refuse All Incoming BGP Connections
Start Event Triggers The Initialization Of
Initiates A TCP Connection With Its Configured BGP Peer.
Listens For A TCP Connection From Its Peer.
Changes Its State To Connect.
If An Error Occurs At Any State Of The FSM Process, The BGP Session Is Terminated Immediately And Returned To The Idle State. Some Of The Reasons Why A Router Does Not Progress From The Idle State Are:
TCP Port 179 Is Not Open.
A Random TCP Port Over 1023 Is Not Open.
Peer Address Configured Incorrectly On Either Router.
As Number Configured Incorrectly On Either Router.
CONNECT STATE:
Waits For Successful TCP Negotiation With Peer.
BGP Does Not Spend Much Time In This State If The TCP Session Has Been Successfully Established.
Sends Open Message To Peer And Changes State To Opensent.
If An Error Occurs, BGP Moves To The Active State. Some Reasons For The Error Are:
TCP Port 179 Is Not Open.
A Random TCP Port Over 1023 Is Not Open.
Peer Address Configured Incorrectly On Either Router.
As Number Configured Incorrectly On Either Router.
ACTIVE STATE:
If The Router Was Unable To Establish A Successful TCP Session, Then It Ends Up In The Active State.
BGP FSM Will Try To Restart Another TCP Session With The Peer And, If Successful, Then It Will Send An Open Message To The Peer.
If It Is Unsuccessful Again, The FSM Is Reset To The Idle State.Repeated Failures May Result In A Router Cycling Between The Idle And Active States. Some Of The Reasons For This Include:
TCP Port 179 Is Not Open.
A Random TCP Port Over 1023 Is Not Open.
BGP Configuration Error.
Network Congestion.
Flapping Network Interface.
OPENSENT STATE:
BGP FSM Listens For An Open Message From Its Peer.
Once The Message Has Been Received, The Router Checks The Validity Of The Open Message.
If There Is An Error It Is Because One Of The Fields In The Open Message Doesn’t Match Between The Peers, E.G. BGP Version Mismatch, MD5 Password Mismatch, The Peering Router Expects A Different My As. The Router Will Then Send A Notification Message To The Peer Indicating Why The Error Occurred.
If There Is No Error, A Keepalive Message Is Sent, Various Timers Are Set And The State Is Changed To Openconfirm.
OPENCONFIRM STATE:
The Peer Is Listening For A Keepalive Message From Its Peer.
If A Keepalive Message Is Received And No Timer Has Expired Before Reception Of The Keepalive, Bgp Transitions To The Established State.
If A Timer Expires Before A Keepalive Message Is Received, Or If An Error Condition Occurs, The Router Transitions Back To The Idle State.
ESTABLISHED STATE:
In This State, The Peers Send Update Messages To Exchange Information About Each Route Being Advertised To The BGP Peer.
If There Is Any Error In The Update Message Then A Notification Message Is Sent To The Peer, And BGP Transitions Back To The Idle State.
If A Timer Expires Before A Keepalive Message Is Received, Or If An Error Condition Occurs, The Router Transitions Back To The Idle State.
BGP MESSAGE TYPES :
BGP USES 4 MESSAGE TYPES FOR COMMUNICATION :
1. Open
2. Keepalive
3. Update
4. Notification
OPEN MESSAGE :
Each BGP Speaker Uses Open Message To Identify Itself To Its Peer And To Also Specify Its BGP Operational Parameters. The BGP Operational Parameters Must Match Between Both The BGP Speakers And Both Of Them Have To Agree On Them In Order To Make Successful Peering. BGP Open Message Is Sent After A TCP Session Is Established Between The BGP Speakers Who Are Trying To Establish The Peering.
THE OPEN MESSAGE CONTAINS THE FOLLOWING INFORMATION :
1. BGP Version Number
2. AS Number
3. Hold Time
4. BGP Identifier
BGP VERSION NUMBER: Must Match Between Both The BGP Speakers, The Version Number Can Be 2,3 Or 4. By Default It Will Be BGP-4 Unless The BGP Speaker Is Set To Run An Earlier Version. If The BGP Version Number Does Not Match Then The Connection Is Closed And A New Connection Is Attempted Upon The Lower BGP Version Number.
The Router Running The Higher BGP Version Number Attempts To Establish A Connection By Lowering It BGP Version Number To Its Peer’s BGP Version Number. This Negotiation Continues Until Both BGP Speakers Agree On The Same Value (Lower Value If Any One Speaker Is Not Running Version 4)
AS NUMBER : Determines If The BGP Session Will Be IBGP Or If It Will Be An EBGP Session. Each Router Announces Its Own AS Number In The Open Message.
Autonomous System Definition: Within The Internet, An Autonomous System (AS) Is A Collection Of Connected IP Routing Prefixes Under The Control Of One Or More Network Operators That Presents A Common, Clearly Defined Routing Policy To The Internet.
The Range For AS Numbers Is 0 – 65535, Where 0, 56320–64511 And 65535 Are Reserved By IANA And Cannot Be Used In Any Routing Environment. ASN 0 May Be Used To Label Non-Routed Networks. AS Numbers Can Be Public Or Private. Public AS Numbers Are Assigned By IANA, Private AS Numbers Can Range Between 64512 Through 65534.
HOLD TIME : Is The Maximum Number Of Seconds That Can Elapse Before Receiving A Keepalive Or An Update Message.
The Calculated Value Indicates The Maximum Number Of Seconds That May Elapse Between The Receipt Of Successive KEEPALIVE, And/Or UPDATE Messages By The Sender.
Hold Time Values Must Match Between Both The BGP Speakers, If The Hold Time Values Differ Then The Lower Value Is Selected As Hold Time For The Connection. If The Hold Time Is Set To Zero Then No Keepalives Are Sent. If Keeplaives Are Needed Then The Lowest Hold Time Value Which Can Be Set Is 3 Seconds For Cisco Implementation Of BGP.
BGP IDENTIFIER : Is The IP Address That Identifies A BGP Speaker.This 4-Octet Unsigned Integer Indicates The BGP Identifier Of The Sender. A Given BGP Speaker Sets The Value Of Its BGP Identifier To An IP Address Assigned To That BGP Speaker. The Value Of The BGP Identifier Is Determined On Startup And Is The Same For Every Local Interface And Every BGP Peer.
If BGP Identifier Is Not Manually Set Then Cisco Defaults To Use The BGP Identifier As Numerically Highest Loopback Address And If No Loopback Address Is Configured On The Router Then Numerically Highest IP Address On A Physical Interface Is Used.
Open Message Also Carries Some Optional Parameters Like Multiprotocol Support, Authentication, Etc.
KEEPALIVE MESSAGE :
If The Parameters In The Open Message Are Accepted Then The Router Responds With A Keepalive Message.
Keepalive Messages Ensure That The Connections To BGP Peers Are Alive.
Cisco Default Keepalive Interval Is 60 Seconds And The Hold Time Interval Is 180 Seconds (3 X Keepalive).
Keepalives Are Sent Every 60 Seconds And After Not Receiving Any Keepalive Message From BGP Peer For 180 Seconds, The Connection To That Peer Is Declared As Dead And The Bgp Neighbor Is Reported As Down.
UPDATE MESSAGE :
Update Messages Are Used To Update The BGP Neighbor About The Network Layer Reachability Information (NLRI) And The Path Attributes Associated With That NLRI. NLRI Is Simply The Combination Of IP Address Prefix And Length (Subnet Mask) In The Format X.X.X.X /Mask For IPv4 Addresses. Path Attributes Are Used In The Selection Of Shortest Path Or To Detect Any Routing Loops. Update Messages Advertise Both Feasible Routes And Also The Withdrawn Routes. Withdrawn Routes Let The BGP Neighbor Know Of Any Destinations Which Have Become Unreachable.
NOTIFICATION MESSAGE :
Notification Messages Are Sent Whenever An Error Is Detected And Will Always Cause The BGP Connection To Close.
NOTIFICATION MESSAGE HAS 3 FIELDS :
1. Error Code (1-Byte)
2. Error Subcode (1-Byte)
3. Data (Variable)
Upon Looking At The Notification Message You Can Find Out What Is The Probable Cause Of The Notification Message Which Caused The Neighbor’s BGP Session To Close. Below Are The Error-Codes And Their Corresponding Sub-Codes Which Can Help Determine What Type Of Event Triggered The BGP To Close The Session.
ERROR CODE AND ITS DETILS :
1. Message Header Error : – >
Connection Not Synchronized.
Bad Message Type.
2. OPEN Message Error: - >
Unsupported Version Number.
Bad Peer AS.
Bad BGP Identifier.
Unsupported Optional Parameters.
Authentication Failure.
Unacceptable Hold Timer.
Unsupported Capabilit.
3. UPDATE Message Error: - >
Malformed Attribute List.
Unrecognized Well Know Attribute.
Missing Well-known Attribute.
Attribute Flags Error.
Attribute Length Error.
Invalid Origin Attribute.
AS Routing Loop.
Invalid NEXT_HOP Attribute.
Optional Attribute Error.
Invalid Network Field.
Malformed AS_PATH.
4. Hold Timer Expired
5. Finite State machine Error.
6. Cease (FATAL ERROR).
BGP – TIMERS :
The Keepalive Timer Is The Number Of Seconds A BGP Router Waits For A Keep-Alive Message From A Neighbor Before Deciding The Connection Is Down.
The Hold Down Timer Is The Number Of Seconds A BGP Router Waits After Not Receiving A Keepalive, Update, Or Notification Message Before Declaring That A Connection A Neighbor Is Down.
BGP Sends 19 Byte Long KEEPALIVE Messages At An Interval Specified By The KEEPALIVE Interval Timer In The BGP Router Configuration (The Default Is 60 Seconds). If A BGP Peer Misses Three Keepalives (180 Seconds) All Routes From That Peer Are Suppressed According To The HOLD DOWN Timer Setting.
The HOLD DOWN Timer Determines How Long A Peer Should Wait To Hear A KEEPALIVE Or UPDATE Message Before Assuming The Neighbor Is Down, Shutting Down The BGP Session, And Withdrawing All Routes From It's Announcements.
When A Session Is Started, BGP Negotiates Holdtime With The Neighbor, And Selects The Smaller Value. The Keepalive Timer Is Then Set Based On The Negotiated Holdtime And The Configured Keepalive Time.
If The Negotiated Hold Down Timer Value Is Zero, No KEEPALIVES Will Be Sent. This May Prevent A BGP Session From Becoming Established Depending Upon The Manufacturer's Implementation, Or It May Cause Packets To Be Dropped As They Are Forwarded To A BGP Device That Is No Longer Operational, But Which Could Not Be Detected Because There Are No KEEPALIVE Messages Being Exchanged.
Use The Timers BGP Command To Adjust BGP Network Timers Between Neighbors.
Use The No Timers BGP Command To Reset To Timers To Their Default Values.
By Default:
Keepalive: 60 Seconds,
Holdtime: 180 Seconds.
COMMAND MODE: ROUTER CONFIGURATION EXAMPLE.
Router(Config-Router)#Timers BGP 30 90
Router(Config-Router)#End
Router#Show Running-Config BGP .
BGP MASSAGES SIZE:
BGP-1:
Message Size Varies From 8 To 1024 Bytes.
BGP-2:
This Version Removed The Concept Of "Up", "Down", And "Horizontal" Relations Between Autonomous Systems That Were Present In Version 1. BGP-2 Introduced The Concept Of Path Attributes. In Addition, BGP-2 Clarified Parts Of The Protocol That Were "Under-Specified".
Message Size Varies From 19 To 4096 Bytes.
BGP-3:
This Version Lifts Some Of The Restrictions On The Use Of The NEXT_HOP Path Attribute, And Added The BGP Identifier Field To The BGP OPEN Message. It Also Clarifies The Procedure For Distributing BGP Routes Between The BGP Speakers Within An Autonomous System.
Message Size Varies From 19 To 4096 Bytes.
BGP-4:
This Version Redefines The Previously Class-Based Network Layer Reachability Portion Of The Updates To Specify Prefixes Of Arbitrary Length In Order To Represent Multiple Classful Networks In A Single Entry. The AS_PATH Attribute Has Been Modified So That Sets Of Autonomous Systems, As Well As Individual Ass May Be Described. In Addition, The INTER-AS METRIC Attribute Has Been Redefined As The MULTI-EXIT DISCRIMINATOR. The LOCAL-PREFERENCE And AGGREGATOR Attributes Have Been Added.
Message Size Varies From 19 To 4096 Bytes.
Supports CIDR.
THERE ARE THREE MOST IMPORTANT KEYWORDS WHICH WE SHOULD HAVE IN MIND WHILE SETTING UP BGP NEIGHBOR RELATIONSHIP :
1. EBGP-MULTIHOP :
In EBGP, Neighbor Relationships Are Only Formed If We Have Directly Connected Networks. We Would Require To Use EBGP-Multihop Keyword With Neighbor Statement So That Neighbors Which Are Not Directly Connected Can Form Relationship With Each Other. We Need To Specify A Number With EBGP - Multihop Keyword, Number Can Be Between 1-255. This Number Represents How Many Hop Counts Is The Router Away.
Used When To EBGP Speakers Cannot Be Directly Connected. Its Configuration Must Include Static Routes Or Must Enable An IGP So That The Neighbors Can Reach Each Other. If You Have Multiple Physical Connections Between EBGP Neighbors, Using A Loopback Interface And Static Routes To The Loopback Interface Allows You To Load Balance The Traffic Between The Multiple Connections.
BGP PEER GROUPS :
A BGP Peer Group Is A Group Of BGP Neighbors Of The Router Being Configured That All Have The Same Update Policies. Peer Groups Simplify Configurations And Make Them Easier To Read. They Are More Efficient Because Updates Are Generated Only Once Per Peer Group, Rather Than Once Per Neighbor. A Neighbor Can Only Be Part Of One Peer Group. 2. UPDATE-SOURCE :We Need To Specify The Interface Which Will Be Used To Update Neighbor Table Incase Routers Are Not Directly Connected. Without Update-Source We Will Not Be Able To Form BGP Neighbor Relationships. Update - Source Keyword Will Update The Interface Which Will Be Used To Form Neighbor Relationship.
3. NEXT - HOP-SELF :
When EBGP Relation Replicates, Next Hop Always Changes. IBGP Routers Only Connected With Other IBGP Routers In Same As Will Not Be Able To Talk With Routers Outside The As, If They Are Not Directly Connected With Each Other. We Would Require A Next-Hop-Self Keyword In The IBGP Router Which Is Directly Connected With EBGP Neighbor So That Other Router In Same As (IBGP) Can Talk With EBGP Routers.
ESTABLISHING CONNECTION TO PEERS :
When A BGP Speaker Establishes Connection With Any BGP Speaking Router, Both The Routers Exchange Their Full BGP Routing Tables. Only Incremental Updates Are Done After Full Routing Table Exchange Has Completed. Incremental Updates Happen Only When Some Information Has Changed And Only The Changed Information Is Exchanged.
BGP Does Not Use Periodic Updates As Other Routing Protocols Do, Therefore The Mechanism To Maintain And Detect A Connection To BGP Peer Is Done Through The Exchange Of Keepalive Messages.
LOAD BALANCING OVERVIEW IN BGP :
If There Is More Than One Equal-Cost Path To A Particular Destination Then Cisco’s Implementation Of EBGP Defaults To Select Only One Path. This Can However Be Changed By The Maximum-Path Command And Can Be In The Range Of 1-6. The Load Balancing Will Only Work With EBGP And IBGP Can Use Only One Link.
BGP SPLIT HORIZON:
The BGP Split Horizon Rule Governs IBGP Behavior. This BGP Rule Specifies That Routes Learned Via IBGP Are Never Propagated To Other IBGP Peers.
IGP ADJACENCIES:
Interior Routing Protocols Form Adjacency Relationships With Directly Connected Neighbors.
IBGP FULL MESH:
By Full Mesh All IBGP Neighbors, When A Change Is Received From An External AS, The BGP Router For This AS Is Responsible For Informing All Of Its IBGP Neighbors Of The Change.
IBGP Neighbors That Receive This Update Do Not Send It To Any Other IBGP Neighbor, Because They Assume The Sending IBGP Neighbor Is Fully Meshed With All Other IBGP Speakers And Has Sent Each IBGP Neighbor The Update.
BGP SYNCHRONIZATION :
The BGP Synchronization Requirement States That Before Ibgp Can Propagate A Route, The Route Must Be Known From Another Source. That Is To Say, The Route Must Be Learned From An IGP. This Synchronization Is To Ensure That A Router Really Knows How To Get To The Locations It Advertises.
If You Have A Transit Autonomous System With Only The Edge Routers Running Ibgp, You Are Relying On The IGP To Carry The Traffic Between The IBGP Routers. It Is Therefore Important For The IGP To Have The Information In Its Routing Table To Fulfill This Task. The Synchronization Rule Is Beneficial For The Following Reasons:
■ It Prevents Traffic From Being Forwarded To Unreachable Destinations.
■ It Reduces Unnecessary Traffic.
■ It Ensures Consistency Within The Autonomous System.
The Synchronization Rule Is On By Default And Is Turned Off On Some Occasions. (Just Remember That The Synchronization Requirement Exists For A Reason!) It Might Be Useful To Turn Off Synchronization For The Following Reasons:
■ All The Routers In The AS Are Running BGP.
■ All The BGP Routers Inside The AS Are Meshed.
■ When The AS Is Not A Transit Autonomous System.
To Turn Off Synchronization, Use The Following Command:
Router(Config-Router)# No Synchronization
Turning Off Synchronization Allows Routers To Advertise Routes Into BGP Before The IGP Has A Copy Of The Route In Its Routing Table.
BGP TABLES (BGP Record Keeping) :
Routing With BGP Involves Three Tables:
■ Neighbor Table
■ BGP Table
■ IP Routing Table
BGP Keeps Its Own Table For Storing BGP Information Received From And Sent To BGP Neighbors And The Best BGP Routes Are Passed On To The IP Routing Table. This Table Is Also Known As The BGP Table,
NEIGHBOR TABLE - > List Of BGP Neighbors
BGP TABLE (FORWARDING DATABASE) - > List Of All Networks Learned From Each Neighbor, Can Contain Multiple Paths To Destination Networks, Contains BGP Attributes For Each Path.
IP ROUTING TABLE - > List Of Best Paths To Destination Networks
BGP ROUTING :
As With Any Routing Protocol, BGP Maintains Routing Tables, Transmits Routing Updates, And Bases Routing Decisions On Routing Metrics. The Primary Function Of A BGP System Is To Exchange Network-Reachability Information, Including Information About The List Of Autonomous System Paths, With Other BGP Systems. This Information Can Be Used To Construct A Graph Of Autonomous System Connectivity From Which Routing Loops Can Be Pruned And With Which Autonomous System-Level Policy Decisions Can Be Enforced.
BGP Devices Exchange Routing Information Upon Initial Data Exchange And After Incremental Updates. When A Router First Connects To The Network, BGP Routers Exchange Their Entire Bgp Routing Tables. Similarly, When The Routing Table Changes, Routers Send The Portion Of Their Routing Table That Has Changed. BGP Routers Do Not Send Regularly Scheduled Routing Updates, And BGP Routing Updates Advertise Only The Optimal Path To A Network.
Each BGP Router Maintains A Routing Table That Lists All Feasible Paths To A Particular Network. The Router Does Not Refresh The Routing Table, However. Instead, Routing Information Received From Peer Routers Is Retained Until An Incremental Update Is Received.
BGP Uses A Single Routing Metric To Determine The Best Path To A Given Network. This Metric Consists Of An Arbitrary Unit Number That Specifies The Degree Of Preference Of A Particular Link. The BGP Metric Is Typically Assigned To Each Link By The Network Administrator. The Value Assigned To A Link Can Be Based On Any Number Of Criteria, Including The Number Of Autonomous Systems Through Which The Path Passes, Stability, Speed, Delay, Or Cost.
BGP PATH DETERMINATION :
A Metric Is A Standard Of Measurement, Such As Path Length, That Is Used By Routing Algorithms To Determine The Optimal Path To A Destination. To Aid In This Process Of Path Determination, Routing Algorithms Initialize And Maintain Routing Tables, Which Contain Route Information. This Information Can Vary Widely Depending On Which Routing Algorithm Generated The Routes.
Routing Algorithms Fill Routing Tables With A List Of Networks And Its Corresponding "Next Hop" On The Way Its Destination. When A Router Receives An Incoming Packet, It Checks The Destination Address And Attempts To Associate This Address With A Next Hop BGP Is Having Only A Single Routing Table Where It Used To Store The Routes And Process For The Best Path Calculation.
As With Any Routing Protocol, BGP Maintains Routing Tables, Transmits Routing Updates, And Bases Routing Decisions On Routing Metrics. The Primary Function Of A BGP System Is To Exchange Network-Reachability Information, Including Information About The List Of Autonomous System Paths, With Other BGP Systems. This Information Can Be Used To Construct A Graph Of Autonomous System Connectivity From Which Routing Loops Can Be Pruned And With Which Autonomous System-Level Policy Decisions Can Be Enforced.
Each BGP Router Maintains A Routing Table That Lists All Feasible Paths To A Particular Network. The Router Does Not Refresh The Routing Table, However. Instead, Routing Information Received From Peer Routers Is Retained Until An Incremental Update Is Received.
BGP Devices Exchange Routing Information Upon Initial Data Exchange And After Incremental Updates. When A Router First Connects To The Network, BGP Routers Exchange Their Entire BGP Routing Tables. Similarly, When The Routing Table Changes, Routers Send The Portion Of Their Routing Table That Has Changed. BGP Routers Do Not Send Regularly Scheduled Routing Updates, And BGP Routing Updates Advertise Only The Optimal Path To A Network.
NOTE: In Addition, BGP Supports Tools (Such As Route Maps And Distribute Lists) That Allow Administrators To Manipulate Traffic Flow Based On BGP Attributes.
SUMMARY OF BGP - PROTOCOL SPECIFICATIONS :
Routing Protocol Used To Exchange Routing Information Between Networks - Exterior Gateway Protocol.
The BGP Default Value Of Weight Is 0 And The Range Is From 0 To 65535. If We Change The Weight Value Of One Router That Change Will Not Propagate To Other Router And The Route With Maximum Weight Value Will Be Considered As The Best Route.
Protocol Type - > Path Vector
Peering Mechanism - > Manual Peering Between Neighbors
EBGP AD - > 20
IBGP AD - > 200
Rights - > Open Standard
Supported Protocols - > IPv4, IPv6
Transport - > TCP/179
Update Mode - > Only Triggered
Timers - > Hello (60 Sec)
Authentication - > None, MD5
Specifications - > RFC 4271
BASIC BGP CONFIGURATION TASKS
The BGP Configuration Tasks Are Divided Into Basic And Advanced Tasks. The First Three Basic Tasks Are Required To Configure BGP; The Remaining Basic And Advanced Tasks Are Optional.
BASIC BGP CONFIGURATION TASKS ARE DISCUSSED IN THE FOLLOWING SECTIONS:
Enable BGP Routing
Configure BGP Neighbors
Configure BGP Soft Reconfiguration
Reset BGP Connections
Configure BGP Interactions With Igps
Configure BGP Administrative Weights
Configure BGP Route Filtering By Neighbor
Configure BGP Path Filtering By Neighbor
Disable Next-Hop Processing On Bgp Updates
Configure The BGP Version
Set The Network Weight
Configure The Multi Exit Discriminator Metric
Monitor And Maintain Bgp
ADVANCED BGP CONFIGURATION TASKS
Advanced, Optional BGP Configuration Tasks Are Discussed In The Following Sections:
Use Route Maps to Modify Updates
Reset EBGP Connections Immediately upon Link Failure
Configure Aggregate Addresses
Disable Automatic Summarization of Network Numbers
Configure BGP Community Filtering
Configure a Routing Domain Confederation
Configure a Route Reflector
Configure Neighbor Options
Configure BGP Peer Groups
Indicate Backdoor Routes
Modify Parameters While Updating the IP Routing Table
Set Administrative Distance
Adjust BGP Timers
Change the Local Preference Value
Redistribute Network 0.0.0.0
Select Path Based on MEDs from Other Autonomous Systems
Configure Route Dampening
ENABLING BGP ROUTING :
To Enable BGP Routing And Establish A BGP Routing Process, Use The Following Commands Beginning In Global Configuration Mode:
STEP 1:
Router(config)# router bgp as-number - > Enables a BGP routing process, which places the router in router configuration mode.
STEP 2:
Router(config-router)# network network-number [mask network-mask] [route-map route-map-name]- > Flags a network as local to this autonomous system and enters it to the BGP table.
CONFIGURING BGP NEIGHBORS :
BGP Supports Two Kinds Of Neighbors :
Internal Neighbors Are In The Same Autonomous System; External Neighbors Are In Different Autonomous Systems.
External Neighbors Are Adjacent To Each Other And Share A Subnet, While Internal Neighbors May Be Anywhere In The Same Autonomous System.
TO CONFIGURE BGP NEIGHBORS, USE THE FOLLOWING COMMAND IN ROUTER CONFIGURATION MODE :
Router(Config-Router)# Neighbor {Ip-Address | Peer-Group-Name}Remote-As As-Number - > Specifies A BGP Neighbor.
Router# Show IP BGP Neighbors Ip-Address - > Displays Whether A Neighbor Supports The Route Refresh Capability. If The Specified Router Supports The Route Refresh Capability, The Following Message Is Displayed: Received Route Refresh Capability From Peer.
RESET BGP CONNECTIONS :
Router# Clear IP BGP {* |Neighbor-Address | Peer-Group-Name}Soft In - > Performs A Dynamic Soft Reset On The Connection Specified In The Command. The Neighbor-Address Argument Specifies The Connection To Be Reset. Use The * Keyword To Specify That All Connections Be Reset.
Clear IP BGP Address - > Reset A Particular BGP Connection.
Clear IP BGP * - > Reset All BGP Connections.
CONFIGURE BGP INTERACTIONS WITH IGPS :
To Disable Synchronization, Perform The Following Task In Router Configuration Mode:
No Synchronization - > Disable Synchronization Between BGP And An IGP.
We Do Not Need Synchronization. If You Will Not Be Passing Traffic From A Different Autonomous System Through Your Autonomous System, Or If All Routers In Your Autonomous System Will Be Running BGP, You Can Disable Synchronization. Disabling This Feature Can Allow You To Carry Fewer Routes In Your IGP And Allow BGP To Converge More Quickly.
NOTE :When You Disable Synchronization, You Should Also Clear BGP Sessions Using The Clear IP BGP Command.
REDISTRIBUTE :
A Common Design Is To Redistribute One Or Two Routes And To Make Them Exterior Routes In IGRP, Or Have Your BGP Speaker Generate A Default Route For Your Autonomous System. When Redistributing From BGP Into IGP, Only The Routes Learned Using EBGP Get Redistributed.
Redistributed Into BGP From The EGP Protocol Will Be Given The BGP Origin Attribute "EGP.
BGP ADMINISTRATIVE WEIGHTS:
An Administrative Weight Is A Number That You Can Assign To A Path So That You Can Control The Path Selection Process. The Administrative Weight Is Local To The Router.
A Weight Can Be A Number From 0 To 65535. Paths That The Cisco IOS Software Originates Have Weight 32768 By Default; Other Paths Have Weight 0.
If You Have Particular Neighbors That You Want To Prefer For Most Of Your Traffic, You Can Assign A Higher Weight To All Routes Learned From That Neighbor.
Neighbor {Ip-Address | Peer-Group-Name} Weight Weight - > Specify A Weight For All Routes From A Neighbor.
Also You Can Assign Weights Based On Autonomous System Path Access Lists. STEP 1:
Ip As-Path Access-List Access-List-Number {Permit | Deny} As-Regular-Expression - > Define A BGP-Related Access List.
STEP 2:
Router BGP Autonomous-System - >Enter router configuration mode.
STEP 3:
Neighbor Ip-Address Filter-List Access-List-Number Weight Weight - > Configure Administrative Weight On All Incoming Routes Matching An Autonomous System Path Filter.
BGP ROUTE FILTERING BY NEIGHBOR :
Restrict The BGP Routing Updates To And From Particular Neighbors.
Neighbor {Ip-Address | Peer-Group-Name} Distribute-List Access-List-Number | Name {In | Out}- > Filter BGP Routing Updates To/From Neighbors As Specified In An Access List.
BGP PATH FILTERING BY NEIGHBOR :
To Filtering Routing Updates Based On Network Numbers, You Can Specify An Access List Filter On Both Incoming And Outbound Updates Based On The BGP Autonomous System Paths. Each Filter Is An Access List Based On Regular Expressions.
STEP 1:
Ip As-Path Access-List Access-List-Number {Permit | Deny} As-Regular-Expression- > Define A BGP-Related Access List.
STEP 2:
Router BGP Autonomous-System - > Enter Router Configuration Mode.
STEP 3:
Neighbor {Ip-Address | Peer-Group-Name} Filter-List Access-List-Number {In | Out | Weight Weight}- > Router BGP Autonomous-System
DISABLE NEXT-HOP PROCESSING ON BGP UPDATES :
To Disable Next-Hop Processing For BGP Updates To A Neighbor. This Might Be Useful In Nonmeshed Networks Such As Frame Relay Or X.25, Where BGP Neighbors Might Not Have Direct Access To All Other Neighbors On The Same IP Subnet.
Neighbor {Ip-Address | Peer-Group-Name} Next-Hop-Self - > Disable next-hop processing on BGP updates to a neighbor.
Configuring This Command Causes The Current Router To Advertise Itself As The Next Hop For The Specified Neighbor. Therefore, Other BGP Neighbors Will Forward To It Packets For That Address.
This Is Useful In A Nonmeshed Environment, Since You Know That A Path Exists From The Present Router To That Address. In A Fully Meshed Environment, This Is Not Useful, Since It Will Result In Unnecessary Extra Hops And Because There Might Be A Direct Access Through The Fully Meshed Cloud With Fewer Hops.
CONFIGURE THE BGP VERSION :
By Default, BGP Sessions Begin Using BGP Version 4 And Negotiating Downward To Earlier Versions If Necessary. To Prevent Negotiation And Force The BGP Version Used To Communicate With A Neighbor.
Neighbor {Ip-Address | Peer-Group-Name} Version Value- > Specify The BGP Version To Use When Communicating With A Neighbor. SET THE NETWORK WEIGHT
Weight Is A Parameter That Affects The Best Path Selection Process. Network Address Mask Weight Weight [Route-Map Map-Name] - > Set the weight for a network.
MULTI EXIT DISCRIMINATOR METRIC:
BGP Uses The Multi Exit Discriminator (MED) Metric As A Hint To External Neighbors About Preferred Paths. (The Name Of This Metric For BGP Versions 2 And 3 Is INTER_AS_METRIC.)
You Can Set The MED Of The Redistributed Routes By Performing The Following Task. All The Routes Without A MED Will Also Be Set To This Value.
Default-Metric Number - > Set A Multi Exit Discriminator.
You Can Set The MED Using The Route-Map Command.
ADVANCED BGP CONFIGURATION TASKS :
Advanced BGP Configuration Tasks - >
BGP IN A SIMPLE EXAMPLE :
In Its Simplest Configuration, BGP Exchanges Routes Between A Router 1 (AS 65500) In One AS And Another Router 2 (AS 65501) In A Different AS:
CONFIGURATION ON ROUTER 1 (1st Router):
Router1#Configure Terminal
Enter Configuration Commands, One Per Line. End With CNTL/Z.
Router1(Config)#Interface Serial0
Router1(Config-If)#Ip Address 192.168.55.6 255.255.255.252
Router1(Config-If)#Exit
Router1(Config)#Router Bgp 65500
Router1(Config-Router)#Network 192.168.1.0
Router1(Config-Router)#Neighbor 192.168.55.5 Remote-As 65501
Router1(Config-Router)#No Synchronization
Router1(Config-Router)#Exit
Router1(Config)#End
Router1#
THE SECOND ROUTER IS IN AS 65501:
Router2#Configure Terminal
Enter Configuration Commands, One Per Line. End With CNTL/Z.
Router2(Config)#Interface Serial0
Router2(Config-If)#Ip Address 192.168.55.5 255.255.255.252
Router2(Config-If)#Exit
Router2(Config)#Router Bgp 65501
Router2(Config-Router)#Network 172.25.17.0 Mask 255.255.255.0
Router2(Config-Router)#Neighbor 192.168.55.6 Remote-As 65500
Router2(Config-Router)#No Synchronization
Router2(Config-Router)#Exit
Router2(Config)#End
Router2#
DISCUSSION :
This Example Shows Two Routers In Different Autonomous Systems. Router1 Is In AS 65500, And Is Configured To Share Routing Information Only For A Single Network Using The Command Network 192.168.1.0. Because This Is A Classful Network, We Don't Need To Include A Mask. However, You Will Notice That The Syntax Of The Network Command On Router2 Is Different:
Router2(Config-Router)#Network 172.25.17.0 Mask 255.255.255.0
This Is Because The Routing Information We Want To Share Only Includes 172.25.17.0/24, And Not The Entire Classful Network, 172.25.0.0/16.
The First Thing You Should Do After Configuring Two Routers For BGP Is To Ensure That They Are Able To Establish A BGP Connection. You Can Verify This With The Command
Show Ip Bgp Summary:
Router1#Show Ip Bgp Summary
BGP Router Identifier 192.168.99.5, Local AS Number 65500
BGP Table Version Is 7, Main Routing Table Version 7
4 Network Entries And 4 Paths Using 484 Bytes Of Memory
2 BGP Path Attribute Entries Using 196 Bytes Of Memory
BGP Activity 11/7 Prefixes, 11/7 Paths
Neighbor V AS Msgrcvd Msgsent Tblver Inq Outq Up/Down State/Pfxrcd
192.168.55.5 4 65501 17 18 7 0 0 00:12:38 2
Router1#
Here You Can See That Router1 Has A BGP Neighbor, 192.168.55.5, In AS 65501. The Most Critical Detail Here Is The Last Column, State/Pfxrcd. In This Column, You Will See Either A Word, Indicating The State Of The Peer Connection, Or A Number, Indicating The Number Of Routing Prefixes (That Is, The Number Of Distinct Subnets In The Routing Table) That Have Been Received From This Peer.
In This Case, The Router Had A Valid BGP Session With The Neighbor Device, 192.168.55.5 For Just Over 12 Minutes. If This Session Is Broken For Any Reason, You Will Most Likely See Either The Word "Active" Or "Idle" In This Field. The Following Output Shows Another Peer Device, 172.25.2.2, Which Is Down:
Router1#Show Ip Bgp Summary
BGP Router Identifier 192.168.99.5, Local AS Number 65500
BGP Table Version Is 7, Main Routing Table Version 7
4 Network Entries And 4 Paths Using 484 Bytes Of Memory
2 BGP Path Attribute Entries Using 196 Bytes Of Memory
BGP Activity 11/7 Prefixes, 11/7 Paths
Neighbor V AS Msgrcvd Msgsent Tblver Inq Outq Up/Down State/Pfxrcd
192.168.55.5 4 65501 17 18 7 0 0 00:12:38 2
172.25.2.2 4 65531 527 526 0 0 0 21:05:23 Active
Router1#
More Than One Engineer Has Seen The Word "Active" (Or "Connect") Here And Thought That The Session Was Active. But, In Fact It Means That This Peer Relationship Is Currently Down. The BGP Connection Is Only Up If You See A Number In The Last Column. Note Also That The Word "Idle" In This Column Indicates That The Router Doesn't Believe That A Session Is Even Possible With This Peer Device, Or That It Has Not Yet Attempted To Connect (The Router Will Wait Several Seconds Before Attempting A Connection). If The Idle Condition Persists, This Usually Indicates That The Remote Peer Is Unreachable. A Persistent "Active" State, On The Other Hand, Most Likely Indicates A Configuration Problem.
It Often Takes Almost A Minute To Establish A BGP Peer Connection, So Be Patient If You Don't See The Peers Immediately Connect. If After This Time They Still Have Failed To Connect, You Should Double Check Your "Neighbor" Configuration Statements. Make Sure That You Have The Right Remote IP Address And AS Number, In Particular.
If These Are Correct, And You Can Ping The Remote Peer's IP Address. Then You Should Make Sure That The Routers Are Using The Interfaces That You Think They Are To Reach The Destination.
The Example In The Solutions Section Of This Recipe Shows An Ebgp Peer Relationship Because We Have Configured Different Asns On The Two Routers:
Router1(Config)#Router Bgp 65500
Router1(Config-Router)#Neighbor 192.168.55.5 Remote-As 65501
IPv6 - BGP CONFIGURING:
First Set The IP Address On The Interface,
Router#Conf T
Enter Configuration Commands, One Per Line. End With CNTL/Z.
Router(Config)#Int Fa 0/0
Router(Config-If)#Ipv6 Address 3ffe:1234:1234::1/64
Then, It Can Be An Idea To Nullroute The Prefix You Are Going To Announce,It Is Good Practice Because It Will Also Effectively Blackhole Traffic Destined To Unexisting Networks.
This Will Be Announced Into BGP With The Redistribute Static Configuration Item.
Router#Conf T
Router(Config)#Ipv6 Route 3ffe:2000::/32 Null 0
Now We Create A Prefix List That Permits Only This Network, This Is Very Important To Avoid Leaks Of Prefixes To Your Peers.
This Prefix List Is Going To Be Applied Outbound On To The BGP Peering.
Router#Conf T
Enter Configuration Commands, One Per Line. End With CNTL/Z.
Router(Config)#Ipv6 Prefix-List Announceas65001-Ipv6 Seq 5 Permit 3FFE:2000::/32
! Better Safe Than Sorry
Router(Config)#Ipv6 Prefix-List Announceas65001-Ipv6 Seq 5000 Deny ::/0 Le 128
Now We Are Ready To Configure The BGP Peering Session, Most Of The Commands Can Be Applied To Peer Groups.
Router#Conf T
Enter Configuration Commands, One Per Line. End With CNTL/Z.
Router(Config)#Router Bgp 65001
Router(Config-Router)#Redistribute Static
Router(Config-Router)#Neighbor 3ffe:1234:1234::2 Remote-As 65002
Router(Config-Router)#Address-Family Ipv6 Unicast
Router(Config-Router-Af)#Neighbor 3ffe:1234:1234::2 Activate
Router(Config-Router-Af)#Neighbor 3ffe:1234:1234::2 Soft-Reconfiguration Inbound
Router(Config-Router-Af)#Redistribute Static
Router(Config-Router-Af)#Neighbor 3ffe:1234:1234::2 Prefix-List Announceas65001-Ipv6 Out
This Will Redistribute The Static Nullroute We Made Earlier To The Peer At 3ffe:1234:1324::2, And The Peering Session Should Be Up By Now.
To Verify It On The Other End:
Router2#Sh Ip Bgp Ipv6 Unicast
BGP Table Version Is 8, Local Router ID Is 10.0.0.1
Status Codes: S Suppressed, D Damped, H History, * Valid, > Best, I – Internal,
R RIB-Failure, S Stale
Origin Codes: I – IGP, E – EGP, ? – Incomplete
Network Next Hop Metric Locprf Weight Path
*> 3FFE:2000::/32 3FFE:1234:1234::1
0 0 65001 ?
As You Can See, The Network 3ffe:2000::/32 Is Now Announced On This Peering Session,
The Route Is Sourced From AS65001. You Can Also Get This On The Summary:
Router2#Sh Ip Bgp Ipv6 Unicast Summary
BGP Router Identifier 10.0.0.1, Local AS Number 65002
BGP Table Version Is 8, Main Routing Table Version 8
1 Network Entries Using 152 Bytes Of Memory
1 Path Entries Using 76 Bytes Of Memory
2/1 BGP Path/Bestpath Attribute Entries Using 248 Bytes Of Memory
1 BGP AS-PATH Entries Using 24 Bytes Of Memory
0 BGP Route-Map Cache Entries Using 0 Bytes Of Memory
0 BGP Filter-List Cache Entries Using 0 Bytes Of Memory
BGP Using 500 Total Bytes Of Memory
BGP Activity 2/1 Prefixes, 4/3 Paths, Scan Interval 60 Secs
Neighbor V AS Msgrcvd Msgsent Tblver Inq Outq Up/Down State/Pfxrcd
3FFE:1234:1234::1
4 65001 26 23 8 0 0 00:05:54 1
If You Want To See The Prefixes Announced To A Peer Or Received From A Peer.
This Requires Soft Reconfiguration Inbound Configured On The Peering Session,
Neighbor 3ffe:1234:1234::2 Soft-Reconfiguration Inbound In Configuration.
Router2#Sh Ip Bgp Ipv6 Unicast Neighbors 3ffe:1234:1234::1 Received-Routes
BGP Table Version Is 8, Local Router ID Is 10.0.0.1
Status Codes: S Suppressed, D Damped, H History, * Valid, > Best, I – Internal,
R RIB-Failure, S Stale
Origin Codes: I – IGP, E – EGP, ? – Incomplete
Network Next Hop Metric Locprf Weight Path
*> 3FFE:2000::/32 3FFE:1234:1234::1
0 0 65001 ?
Total Number Of Prefixes 1
The Prefix 3ffe:2000::/32 Is Received From 3ffe:1234:1234::1.
Router#Sh Ip Bgp Ipv6 Unicast Neighbors 3ffe:1234:1234::2 Advertised-Routes
BGP Table Version Is 3, Local Router ID Is 10.0.0.2
Status Codes: S Suppressed, D Damped, H History, * Valid, > Best, I – Internal,
R RIB-Failure, S Stale
Origin Codes: I – IGP, E – EGP, ? – Incomplete
Network Next Hop Metric Locprf Weight Path
*> 3FFE:2000::/32 :: 0 32768 ?
Total Number Of Prefixes 1
Next IPv6 EXAMPLE - 2
There Are Two Types Of Ipv6 Arrangements With Bgp Native And Tunnel. Tunnel Is The Most Common As It Costs Nothing To The End User, But As Far As Configuration Of BGP Protocol Goes, Tunnel And Native Have No Relevance In The Scope Of The Routing Protocol Configuration.
IPv6 - BGP SIMPLE CONFIGURATION EXAMPLE
WE HAVE TWO SIMPLE ROUTERS SUCH AS ROUTER-1 AND ROUTER-2.
CONFIGURATION :
ON ROUTER 1
Ipv6 Unicast-Routing
Interface Loopback99
No Ip Address
Ipv6 Address 2001:Db8:1111::1/48
Interface Serial2/0
Ipv6 Address 2001:Db8:0:Cc00::1/48
Router Bgp 65100
No Bgp Default Ipv4-Unicast
Neighbor Group1 Peer-Group
Neighbor 2001:Db8:0:Cc00::2 Remote-As 65100
Neighbor 2001:Db8:0:Cc00::2 Peer-Group Group1
Address-Family Ipv6
Neighbor Group1 Activate
Neighbor 2001:Db8:0:Cc00::2 Peer-Group Group1
Network 2001:Db8:1111::1/48
Exit-Address-Family
ROUTER2
Ipv6 Unicast-Routing
Interface Loopback99
No Ip Address
Ipv6 Address 2001:Db8:1111::2/48
Interface Serial2/0
Ipv6 Address 2001:Db8:0:Cc00::2/48
Router Bgp 65100
No Bgp Default Ipv4-Unicast
Neighbor Group1 Peer-Group
Neighbor 2001:Db8:0:Cc00::1 Remote-As 65100
Neighbor 2001:Db8:0:Cc00::1 Peer-Group Group1
Address-Family Ipv6
Neighbor Group1 Activate
Neighbor 2001:Db8:0:Cc00::1 Peer-Group Group1
Network 2001:Db8:1111::2/48
Exit-Address-Family
VERIFICATION:
Router1#Sh Ipv6 Int Br
Serial2/0 [Up/Up]
Fe80::C804:12ff:Fedc:8
2001:Db8:0:Cc00::1
Loopback99 [Up/Up]
Fe80::C804:12ff:Fedc:8
2001:Db8:1111::1
Router2#Sh Ipv Int B
Serial2/0 [Up/Up]
Fe80::C805:12ff:Fedc:8
2001:Db8:0:Cc00::2
Loopback99 [Up/Up]
Fe80::C805:12ff:Fedc:8
2001:Db8:1111::2
Router1#
Sh Bgp Ipv6 Unicast Sum
Neighbor V As Msgrcvd Msgsent Tblver Inq Outq Up/Down State/Pfxrcd
2001:Db8:0:Cc00::2
4 65100 6 6 2 0 0 00:02:17 1
Router2#
Sh Bgp Ipv6 Unicast Sum
Neighbor V As Msgrcvd Msgsent Tblver Inq Outq Up/Down State/Pfxrcd
2001:Db8:0:Cc00::1
4 65100 6 6 2 0 0 00:02:41 1
Router1#
Sh Bgp Ipv6 Unicast Neighbors 2001:Db8:0:Cc00::2 Advertised-Routes
Bgp Table Version Is 2, Local Router Id Is 1.1.1.1
Status Codes: S Suppressed, D Damped, H History, * Valid, > Best, I – Internal,
R Rib-Failure, S Stale
Origin Codes: I – Igp, E – Egp, ? – Incomplete
Network Next Hop Metric Locprf Weight Path
*> 2001:Db8:1111::1/48
:: 0 32768 I
Router2#
Sh Bgp Ipv6 Uni Nei 2001:Db8:0:Cc00::1 Adver
Bgp Table Version Is 2, Local Router Id Is 2.2.2.2
Status Codes: S Suppressed, D Damped, H History, * Valid, > Best, I – Internal,
R Rib-Failure, S Stale
Origin Codes: I – Igp, E – Egp, ? – Incomplete
Network Next Hop Metric Locprf Weight Path
*> 2001:Db8:1111::2/48
:: 0 32768 I
Router1#
Sh Bgp Ipv6 Unicast Neighbors 2001:Db8:0:Cc00::2 Routes
Bgp Table Version Is 2, Local Router Id Is 1.1.1.1
Status Codes: S Suppressed, D Damped, H History, * Valid, > Best, I – Internal,
R Rib-Failure, S Stale
Origin Codes: I – Igp, E – Egp, ? – Incomplete
Network Next Hop Metric Locprf Weight Path
* I2001:Db8:1111::1/48
2001:Db8:0:Cc00::2
0 100 0 I
Router2#
Sh Bgp Ipv6 Uni Nei 2001:Db8:0:Cc00::1 Routes
Bgp Table Version Is 2, Local Router Id Is 2.2.2.2
Status Codes: S Suppressed, D Damped, H History, * Valid, > Best, I – Internal,
R Rib-Failure, S Stale
Origin Codes: I – Igp, E – Egp, ? – Incomplete
Network Next Hop Metric Locprf Weight Path
* I2001:Db8:1111::2/48
2001:Db8:0:Cc00::1
0 100 0 I
Troubleshooting
R2#Deb Bgp Ipv6 Unicast Updates
Router2#Clear Bgp Ipv6 Unicast * Soft
Router2#
00:22:50: Bgp(1): 2001:Db8:0:Cc00::1 Send Update (Format) 2001:Db8:1111::2/48, Next
2001:Db8:0:Cc00::2, Metric 0, Path
00:22:50: Bgp(1): Updgrp 1 – 2001:Db8:0:Cc00::1 Enqueued 1 Updates, Average/Maximum Size (Bytes) 75/75
00:22:50: Bgp(1): 2001:Db8:0:Cc00::1 Rcvd Update W/ Attr: Nexthop 2001:Db8:0:Cc00::1, Origin I, Localpref 100, Metric 0
00:22:50: Bgp(1): 2001:Db8:0:Cc00::1 Rcvd 2001:Db8:1111::/48
MULTIPROTOCOL BGP FOR IPV6 CONFIGURATION EXAMPLE :
Sample Configuration For Multi Protocol Border Gateway Protocol (BGP) For IPv6. BGP Is An Exterior Gateway Protocol (EGP) Used Mainly To Connect Separate Routing Domains That Contain Independent Routing Policies (Autonomous Systems). BGP Is Commonly Used To Connect To A Service Provider For Access To The Internet.
BGP Can Also Be Used Within An Autonomous System, And This Variation Is Referred To As Internal BGP (IBGP). Multiprotocol BGP Is An Enhanced BGP That Carries Routing Information For Multiple Network Layer Protocol Address Families, Such As, Ipv6 Address Family And For IP Multicast Routes. All BGP Commands And Routing Policy Capabilities Can Be Used With Multiprotocol BGP.
CONFIGURATIONS :
This Is The Sample Configuration Of IPv6 Multiprotocol BGP For The Routers Shown In The Diagram:
ROUTER A:
Ipv6 Unicast-Routing
Ipv6 Cef
Interface Loopback0
No Ip Address
Ipv6 Address 2010:Ab8:2::/48
Ipv6 Enable
!
Interface Loopback10
No Ip Address
Ipv6 Address 2010:Ab8:3::/48
Ipv6 Enable
!
Interface Fastethernet0/0
No Ip Address
Duplex Auto
Speed Auto
Ipv6 Address 2010:Ab8:0:2::/64 Eui-64
Ipv6 Enable
!
Router Bgp 1
Bgp Router-Id 1.1.1.1
No Bgp Default Ipv4-Unicast
!--- Without Configuring ""No Bgp Default Ipv4-Unicast"" Only Ipv4 Will Be
!--- Advertised
Bgp Log-Neighbor-Changes
Neighbor 2010:Ab8:0:2:C601:10ff:Fe58:0 Remote-As 2
!
Address-Family Ipv6
Neighbor 2010:Ab8:0:2:C601:10ff:Fe58:0 Activate
Network 2010:Ab8:2::/48
Network 2010:Ab8:3::/48
Exit-Address-Family
!
ON ROUTER B:
Ipv6 Unicast-Routing
Ipv6 Cef
Interface Fastethernet0/0
No Ip Address
Duplex Auto
Speed Auto
Ipv6 Address 2010:Ab8:0:2::/64 Eui-64
Ipv6 Enable
!
Router Bgp 2
Bgp Router-Id 2.2.2.2
No Bgp Default Ipv4-Unicast
Bgp Log-Neighbor-Changes
Neighbor 2010:Ab8:0:2:C600:10ff:Fe58:0 Remote-As 1
!
Address-Family Ipv6
Neighbor 2010:Ab8:0:2:C600:10ff:Fe58:0 Activate
Exit-Address-Family
!
TO VERIFY :
Show Ipv6 Route
Show Ipv6 Route Bgp
Show Bgp Ipv6 Unicast Summary
This Command Displays The Ipv6 Routing Table.
R1#Show Ipv6 Route
Ipv6 Routing Table - 5 Entries
Codes: C - Connected, L - Local, S - Static, R - Rip, B - Bgp
U - Per-User Static Route, M - Mipv6
I1 - Isis L1, I2 - Isis L2, Ia - Isis Interarea, Is - Isis Summary
O - Ospf Intra, Oi - Ospf Inter, Oe1 - Ospf Ext 1, Oe2 - Ospf Ext 2
On1 - Ospf Nssa Ext 1, On2 - Ospf Nssa Ext 2
D - Eigrp, Ex - Eigrp External
C 2010:Ab8:0:2::/64 [0/0]
Via ::, Fastethernet0/0
L 2010:Ab8:0:2:C601:10ff:Fe58:0/128 [0/0]
Via ::, Fastethernet0/0
B 2010:Ab8:2::/48 [20/0]
Via Fe80::C600:10ff:Fe58:0, Fastethernet0/0
B 2010:Ab8:3::/48 [20/0]
Via Fe80::C600:10ff:Fe58:0, Fastethernet0/0
L Ff00::/8 [0/0]
Via ::, Null0
Show Ipv6 Route Bgp
When You Specify A Protocol, Only Routes For That Particular Routing Protocol Are Shown. This Sample Output Is From The Show Ipv6 Route Command When Entered With The Bgp Keyword:
R1#Show Ipv6 Route Bgp
Ipv6 Routing Table - 5 Entries
Codes: C - Connected, L - Local, S - Static, R - Rip, B - Bgp
U - Per-User Static Route, M - Mipv6
I1 - Isis L1, I2 - Isis L2, Ia - Isis Interarea, Is - Isis Summary
O - Ospf Intra, Oi - Ospf Inter, Oe1 - Ospf Ext 1, Oe2 - Ospf Ext 2
On1 - Ospf Nssa Ext 1, On2 - Ospf Nssa Ext 2
D - Eigrp, Ex - Eigrp External
B 2010:Ab8:2::/48 [20/0]
Via Fe80::C600:10ff:Fe58:0, Fastethernet0/0
B 2010:Ab8:3::/48 [20/0]
Via Fe80::C600:10ff:Fe58:0, Fastethernet0/0
Show Bgp Ipv6 Unicast Summary
This Command Provides Output Similar To The Show Ip Bgp Summary Command, Except It Is Ipv6-Specific.
R1#Show Bgp Ipv6 Unicast Summary
Bgp Router Identifier 2.2.2.2, Local As Number 2
Bgp Table Version Is 3, Main Routing Table Version 3
2 Network Entries Using 304 Bytes Of Memory
2 Path Entries Using 152 Bytes Of Memory
2/1 Bgp Path/Bestpath Attribute Entries Using 248 Bytes Of Memory
1 Bgp As-Path Entries Using 24 Bytes Of Memory
0 Bgp Route-Map Cache Entries Using 0 Bytes Of Memory
0 Bgp Filter-List Cache Entries Using 0 Bytes Of Memory
Bgp Using 728 Total Bytes Of Memory
Bgp Activity 2/0 Prefixes, 2/0 Paths, Scan Interval 60 Secs
Neighbor V As Msgrcvd Msgsent Tblver Inq Outq Up/Down State/Pfxrcd
2010:Ab8:0:2:C600:10ff:Fe58:0
4 1 15 14 3 0 0 00:11:52 2
FOR MORE INFO - > CISCO – BORDER GATEWAY PROTOCOL (BGP) NEIGHBORS CONCEPTS:
For More About - > CISCO – BGP LAB VIRTUAL LINK:
For More About - > CISCO – BGP LAB (REDISTRIBUTE BGP VERSUS OSPF)
For More About - > CISCO – BGP LAB “ROUTE REFLECTED CLIENT:
CONCLUSION:
The Goal Of This Article Is To Give An Easy Way To Understand The “Cisco – Basic BGP Configuration” .Hope This Article Will Help Every Beginners Who Are Going To Start Cisco Lab Practice Without Any Doubts.
Some Topics That You Might Want To Pursue On Your Own That We Did Not Cover In This Article Are Listed Here, Thank You And Best Of Luck.
This Article Written Author By: Premakumar Thevathasan. CCNA, CCNP, CCIP, MCSE, MCSA, MCSA - MSG, CIW Security Analyst, CompTIA Certified A+.
DISCLAIMER:
This Document Carries No Explicit Or Implied Warranty. Nor Is There Any Guarantee That The Information Contained In This Document Is Accurate. Every Effort Has Been Made To Make All Articles As Complete And As Accurate As Possible.
It Is Offered In The Hopes Of Helping Others, But You Use It At Your Own Risk. The Author Will Not Be Liable For Any Special, Incidental, Consequential Or Indirect Any Damages Due To Loss Of Data Or Any Other Reason That Occur As A Result Of Using This Document. But No Warranty Or Fitness Is Implied. The Information Provided Is On An "As Is" Basic. All Use Is Completely At Your Own Risk.
For Home Page Of - > SCN InF4 TECH
To Send Email
Window Minimize OR Window Maximize
2 comments:
Teaching Excellence:
Sir ,you are a professional teaching is very Excellence sir.we always grateful to you sir.you are always our guru.you are having more years of expertise sir.That what your teaching is always good,
thank you sir.
Robot Sumit.
http://www.net130.com/technic/ciscotech/bgp1%20command.pdf
Post a Comment