You are on page 1of 93

ALTTC / DX/ K.

Suresh/ Border Gateway Protocol Version 4 Slide - 1


ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 2
Border Gateway Protocol -- Introduction

Loop-free inter-domain routing


BGPBGP
BGP
The 4 is1theimplemented
first
4 deployment
current version
version of to
between Autonomous
handle aggregation
first in 1989(CIDR) &
BGP 4started
Systems
defined in 1993
in(AS)
RFC 1771
supernetting

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 3


BGP 4 -- A PATH VECTOR PROTOCOL

BGP 4 is a path vector protocol


BGP4 is in
fecilitates often run between
loop-free two
Inter domain
different
routing Autonomous Systems
RoutingTCP
Uses information
port 179carries the
for BGP
sequence of path (AS numbers) the
connections
route has traversed

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 4


Autonomous System (AS)
Single
Public
Each Routing
AS AS Policy
cannumbers
run their ranges
own setfrom
of Interior
0~ 64511
Single
GatewayTechnical Administration
Protocols (IGPs)
AS
IGPs number
can be
Private ASis a 16
RIP, bit identifying
OSPF,
numbers IGRP, number
rangesEIGRP,
from
assigned by an Internet Registry
IS-IS
64512etc.~ 65535

AS 9829 BGP AS 4775


OSPF OSPF

VSNL
DTS, NIB

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 5


Stub ASs

Providerexit
Single has point
a statictoroute towards
Outside the Stub AS
world
Also known aggregate
The provider as Single-homed
the Static routes towards the
Need
internet not really learn the routes from its
provider.
Inefficient if customer has Too many discontiguous
Stub
subnetsAS. Traffic can be default to the provider

Static
AS xxxxx AS 4775
STUB
AS
Default ISP

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 6


Stub AS -- Using BGP4

Difficult
Stub to get
AS can run a BGP
registered
4 with AS
the
Number from the InterNIC If the
provider
Routing Policies are the extension
Routing updates
of the policies are
of the exchanged
provider
dynamically
The provider allots the customer
Routing
an AS umberpolicies can pool
from the private be
implemented
of ASs (64512 using BGP 4
~ 65535)

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 7


Multihomed Nontransit AS
A nontransit AS does not allow transit traffic through it
More than one exit point to the outside world
Non transit AS would advertise its own routes and
would not advertise
Multihomed to a routes
single that are learned
or multiple from other
providers
ASs

AS xxxxx AS 4775
MTNL VSNL

Non Transit AS
ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 8
Multihomed Transit AS
BGP4 is used inside an AS to exchange BGP updates
More than one exit point to the outside world
BGP running inside an AS is called Internal BGP (IBGP)
Allows transit traffic to go through it
BGP running between ASs are called External BGP
(EBGP)

AS xxxxx AS 4775
MTNL VSNL

Transit AS
ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 9
Transit & Border Routers
Routers that are running IBGP are called transit
ASBR
routersadvertises its own routes along with the routes
learned from other ASs for the flow of transit traffic
Routers that are running EBGP with other ASs are
Shields all nonAutonomous
usually called transit routers that are
System not Routers
Border running
IBGP
(ASBR)

AS Border
AS xxxxx Routers AS 4775
MTNL VSNL

Transit
Router
Transit AS
ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 10
IBGP vs EBGP

Routers
The commands
that belong
for configuring
to the same EBGP
AS and
Routers that belong to different ASs and
IBGP are BGP
exchange the routing
same with
updates
the are
exception
said to be
of
exchange BGP routing updates are said to be
neighborinternal
running ebgp-multihop
BGP (IBGP)
command applicable
running external BGP.
in EBGP

GP
EB
VSNL
IBGP

DTS

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 11


BGP Peer connection

• EBGP neighbors are usually connected


directly
• Within an AS, IBGP peers do not have to
be directly connected (since IGP is
running)
• IBGP, the IP address can be the IP
address of any of the router's interfaces or
Loopback interface
• The BGP speakers within an AS must be
fully meshed logically

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 12


ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 13
BGP Message Header
• Marker field [16 bytes]
– used for authentication or for detectinfg loss of sync.
• Length [2 byte]
– BGP Message length including the header
– Minimum is 19 bytes(for keepalive messages) &
maximum is 4096 bytes
• Type [1 byte]
– Open, Update, Notification or Keepalive

0 7 15 23 31

Marker[16]

Length [2] Type [1]


ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 14
BGP Message Types

• Four BGP4 message types


used by the BGP Peers
specified in RFC 1771 are:
–Open message
–Update message
–Notification message
–Keep-alive message
ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 15
BGP Open Message
• Open Messsage opens a BGP session
between peers
• It is the first message sent by each
side after TCP connection is
established
• Open messages are confirmed using a
keep-alive message and a BGP session
is established
• The Peers now exchange routing
updates, notifications and keep-alive
messages
ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 16
BGP Open Message Format
BGP Identifier
Authentication
Only one
Hold-Time [2 :code:
optionalSender’s
parameter Router
Indicates
bytes]---Maximum type ID is
the
seconds (Highest
type
currently
that can IP
of
BGP
Version
Two
Optional open
[1
BGP messages
byte]---Provides
routers
Parameters
Parameters
authentication
defined: authentication
being Length
used.
are
the
establish BGP
a comprised
[var]---Contains
[1
information
version
peer number
relationship
byte]---Length
with a of
list
of a
the
of
elapse
address
AS without
Number an Router
of[2the update
bytes]--- AS or a keep-alive
Interfaces)
number of the itfollowing
ormessagecan for
sender. be
using
BGP
optionalthe Open
header
Authentication
fields
closing the BGP and
parameters message
data: additional
(if
field
session any).
(if
Contains fields
any). as follows
fields
data asforshown
used by BGPthe
loopback address of the Router
below
authentication
session mechanism (if used).

0 7 15 23 31
Version
Autonomous System
Hold Time
BGP Identifier
Opt parm Len
Optional Parameters

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 17


BGP Update message

• An update message is used to provide


routing updates to other BGP systems
• Allows routers to construct a consistent
view of the network topology
• Updates are sent using the TCP
connection using tcp/port 179 to for
reliable delivery
• Update messages can withdraw one or
more unfeasible routes from the routing
table and simultaneously can advertise a
route

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 18


BGP Update Message Fields
Unfeasible
Total Routes Length
Path Attribute Length--Total
--Totallength
lengthofof
withdrawn
the path
Network Layerroutes
attributes field
field or that theInformation
Reachability field is not
BGP update messages
Withdrawn Routesa list -- List comprise of a
present.
(NLRI)---Contains of of
IP IP address
address prefixes
BGP
Path
for header
prefixes
Attributes
the and
for routes
advertised additional
being
-- Characteristics
routes fields
withdrawn from
of the
service
advertised path
Unfeasible Routes Length (2 Unreachable
routes
Withdrawn bytes)
Routes (variable) information

Total Path Attribute Length Path


(2bytes) Attribute
Path Attribute (Variable) information
Length (1byte) Prefix
NLRI
(variable)
<length.prefix> information

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 19


BGP Path Attributes (frequently used)
• ORIGIN: Mandatory attribute that defines the origin (originating
AS number)
• AS_Path: Mandatory attribute composed of a sequence of AS
paths route has traversed
• NEXT_HOP: Mandatory attribute defines the IP address of the
ASBR to be used for next hop to destinations listed in the
network layer reachability information field
• MULT_EXIT_DISC: Optional attribute used to discriminate
between multiple exit points to a neighboring autonomous
system
• LOCAL_PREF: Discretionary attribute used to specify the degree
of preference for an advertised route
• ATOMIC_ AGGREGATE: Discretionary attribute used to disclose
information about route selections
• AGGREGATOR: Optional attribute that contains information
about aggregate routes
• COMMUNITY: IP address of the community (routers)
ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 20
BGP Notification message

Cease
Open
Message
The
Error Message
(6):Header
Code:
Data: Closes
notification Error
Indicates
Contains a BGP
Error (2):
message
the(1):
data connection
Indicates
Indicates
type is
basedofsent a aat
error
on problem
theerror
when request
problem
the
that with
an withan
of
error
occurred.
codea
Hold
Update
This Time
packet Expired
Message (4):
isinMachine
used
Error Indicates
to(3):indicate
Indicates that
some the hold-time
a Indicates
problem
sort of error
with
Error
Finite
a
open
BGP
message
condition
and
The Subcode:
State
device
message,
following
error is
header, Provides
the
detected
subcode
are such
absence
such
the error
fields. Error
more
as
as of
types specific
(5):
unsupported
any fatal
unacceptable
This defined
field information
errors.
by
is message
one
used an
version
byte
to
has
an expired,
condition
update to after
message,
the which
peers such
of thetime
as a BGP
originating
a malformed node
router. will be
attribute
about
unexpected
number,
length,
diagnose
field: the unacceptable
Notifications nature
the event.
unacceptable
are
reasonof the
used for reported
toautonomous
close
the marker anerror. system
active
field
notification number
session
value,
message with
or
considered
list, nonfunctional.
or IPattribute
details list
address,
unacceptable
error or error, or
unsupported
message invalid
type. next-hop attribute.
authentication code.

0 7 15 23 31
Error Code Error Subcode
Data

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 21


BGP Keep-alive message

• Keep-alive message notifies


BGP peers that a device is
active
• Keep-alive messages are sent
at sufficient intervel to keep
the sessions from expiring

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 22


BGP Keep-alive Message (contd.)
• Keep alive messages are sent at the rate that the
hold timer will not overflow
• The recommended rate is 1/3rd of the hold time
interval
• Hold time interval is normally set to 180 seconds
and Keep-alive messages are sent periodically at 60
seconds
• If keep alive or Update message is not received for
more than the hold timer value a notification
message has been sent and the BGP connection will
be closed
• The keep alive message is a 19-byte BGP header
without any data.

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 23


ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 24
EBGP & IBGP -- Figure 1

AS100 AS 300

A D

129.213.1.2 192.208.10.1

EBGP EBGP

129.213.1.1 192.208.10.2
IBGP
B C

175.220.212.1 175.220.1.2
AS 200

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 25


BGP Peers (neighbors) -- Refer Fig 1

The following commands configure BGP


on Router A:C:
router bgp 100
200
neighbor
Any 175.220.212.1
129.213.1.1
two routers remote-as
remote-as
that have 200
200 a
opened
Routers A & B , Routers B & C, Routers
neighbor
TCP 192.208.10.1
connection to remote-as
each other300
for the
C & D are BGP peers
The following of
purpose commands configurerouting
exchanging BGP
Within an AS, BGP peers do not have to
The
on Router
following
B: commands
information are known configure
as BGPor
peers
be directly connected.
onneighbors
router
Router
bgpD:200
router bgp129.213.1.2
neighbor 300 remote-as 100
neighbor 175.220.1.2
192.208.10.2remote-as
remote-as200
200

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 26


BGP Peers (neighbors) - Configuration

The following commands configure


BGP on Router C: A:
router bgp 200
100
neighbor 175.220.212.1
129.213.1.1 remote-as
remote-as
200
200
neighbor 192.208.10.1 remote-as 300
The following commands configure
BGPfollowing
The on Routercommands
B: configure
routeronbgp
BGP Router
200 D:
neighbor
router bgp129.213.1.2
300 remote-as 100
neighbor 192.208.10.2
175.220.1.2 remote-as
remote-as200
200

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 27


Show ip bgp neighbors command
RouterA# show ip bgp neighbors
BGP neighbor is 129.213.1.1, remote AS 200,
external link
BGP version 4, remote router ID 175.220.212.1
BGP state = established, table version = 3, up for
0:10:59
Last read 0:00:29, hold time is 180, keepalive
interval is 60 seconds
Minimum time between advertisement runs is 30
seconds
Received 2828 messages, 0 notifications, 0 in queue
Sent 2826 messages, 0 notifications, 0 in queue
Connections established 11; dropped 10
ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 28
How to Reset the BGP connection ?

• To reset the session, at the system


prompt, issue the EXEC command
specifying the IP address of that
neighbor.
• clear ip bgp [ip address of the peer]

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 29


Internal BGP
180.10.30.1 AS 100

D IBGP
150.10.30.1 190.10.50.1
BGP Configuration
Commands are: IBGP
A 170.10.20.1 B 175.10.40.2

170.10.20.2 175.10.40.1
This process
Internal
Router is not flexible
CBGP (IBGP)
IBGP bgp
The
router is more
routes 400flexible
learned via E C
Router
Router
EBGP
neighbor BA175.10.40.2
IBGP could controls
be redistributedthe
remote-as 100 170.10.0.0 175.10.0.0
router
exchange
router
into IGP
network bgp
bgp 100
of
100
witin AS information
175.10.0.0
neighbor 180.10.30.1 remote-as 100 AS 300 AS 400
within these
neighbor
Then
Router the ASroutes can
D 150.10.30.1 remote-as
be 100
neighbor
Presents
neighbor 190.10.50.1
a100
consistent
bgp175.10.40.1
redistributed
router remote-as
view
again remote-as
into 100
400
neighbor
of theAS
neighbor
another 170.10.20.2
AS to external
180.10.30.1
150.10.30.1 remote-as100
remote-as 300 All IBGP speakers within
network
neighbors
network
neighbor 150.10.0.0
190.10.50.1 remote as 100 an AS to be fully meshed
190.10.0.0
network
ALTTC / DX/180.10.0.0
K.Suresh/ Border Gateway Protocol Version 4 Slide - 30
Use of loopback Interfaces in IBGP
Router B
Loopback interfaces are often used by IBGP peers
loopback
Loopback interface
interface 0is advantageous
interfaces are rarely used andbetween EBGP
eliminates a
Router
If A
Physical Address is used for BGP connection
ip address
peers
dependency 150.212.1.1
becauseon theEBGP 255.255.0.0
state ofpeers are usually directly
the interface
router
between bgp 100
!connectedPeers and
and if the specified interface were to
depend on 100
a particular physical
neighbor
become 150.212.1.1
unavailable, remote-as
Router A would not be able to
router bgp 100
interface for connectivity.
establish a BGP session
neighbor 190.225.11.1 with Router
remote-as 100 B
neighbor 190.225.11.1 update-source loopback 0

Loopback Interface 0
150.212.1.1
190.225.11.1 E2
A IBGP B
E1
AS 100

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 31


External BGP (EBGP)
• When two BGP speakers not in the same
AS run External BGP
• Various EBGP Configuration discussed
here are:
– EBGP Multihop
– EBGP Load Balancing
– Synchronization of EBGP with IGPs
– No Synchronisation of EBGP with IGPs

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 32


EBGP Multihop
Usually,B
Router Athe two EBGP speakers are directly connected
over WAN
loopback
Since interface
Connection
Router A &B 0 references an external neighbor by
ip
an address
address
Sometimes 129.213.1.1
180.225.11.1
theythat is be
cannot not directly
directly connected, its
connected
!
configuration must include static routes or must enable
To declare
router
an IGP bgp thatthe
100
300
so that theneighbors
EBGP Peer is reach
can not directly connected
each other.
ebgp-multihop command
neighbor 129.213.1.1
180.225.11.1 is used
remote-as
remote-as 100
300
Note Multihop
neighbor is usedebgp-multihop
180.225.11.1
129.213.1.1 only for EBGP, but not for IBGP.
ebgp-multihop
neighbor 129.213.1.1
180.225.11.1update-source
update-sourceloopback
loopback00

Loopback Interface 0 Loopback Interface 0


129.213.1.1 180.225.11.1

E2
EBGP

B E1
A 129.213.1.3 B
AS 100 129.213.1.2 AS 300

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 33


EBGP Load Balancing
Router
Routerbgp
router B
A 200100
interface
By
Static
using
interface
neighbor loopback
routes
the are 0
Loopback
loopback
160.10.1.1
150.10.1.1 0used interfaces
to introduce
remote-as 200for EBGP
100 twousing
equal-cost
ebgp-
ip
ip address
multihop
paths
neighborto the
address 160.10.1.1
command
160.10.1.1
150.10.1.1
150.10.1.1 255.255.255.0
destination.
load The
balancing
same effect
ebgp-multihop
255.255.255.0 between couldtwo
alsoASs
be
!over
accomplished
! parallel
neighbor serial
by using
160.10.1.1
150.10.1.1 lines an
canIGP
be achieved
update-source loopback 0
ip
ip route
route 150.10.0.0
network 160.10.0.0 255.255.0.0 1.1.1.2
150.10.0.0 255.255.0.0
160.10.0.0 1.1.1.1 **
**Static
Staticroute
route
ip
ip route
route 150.10.0.0 255.255.0.0 2.2.2.2
160.10.0.0 255.255.0.0 2.2.2.1. ****Static
Staticroute
route

Loopback Interface 0 Loopback Interface 0


150.10.1.1 EBGP 160.10.1.1
1.1.1.1 1.1.1.2

2.2.2.1 2.2.2.2
A B
150.10.0.0 160.10.0.0 AS 200
AS 100

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 34


Synchronisation
•BGP synchronization rule states that if an
an AS provides transit service to another AS,
BGP should not advertise a route until all of
the routers within the AS have learned about
the route via an IGP.
•Disabling synchronization allows BGP to
converge more quickly but it might result in
dropped transit packets.
•We can disable synchronization if one of
the following condition is true:
• If the AS does not pass traffic from one AS
to another AS.
ALTTC•/ DX/
All K.Suresh/
the transit
Borderroutes
Gateway in the AS
Protocol run4
Version BGP.
Slide - 35
Synchronisation

As 100
150.10.0.0
IGP IGP
RE

RA IBGP RB
2.2.2.2

2.2.2.1

RC RD
As 300
170.10.0.0 As 400

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 36


Advertising Networks
A network that resides within an AS is said to
originate from that network
To inform other ASs about its networks, the AS
advertises them
BGP uses three ways to advertise the networks
that it originates:
- Redistributing Static Routes
-Redistributing Dynamic Routes
-Using the network Command
Routes advertised by the above techniques are
advertised in addition to other BGP routes
ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 37
ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 38
BGP Decision Making Algorithm

BGP Decision Algorithm -

•When a BGP speaker receives updates from multiple


ASs
that describe different paths to the same destination,
it
must choose the single best path for reaching that
destination.

•Once chosen, BGP propagates the best path to its


neighbors.

•The decision is based on the value of attributes - such


as
next hop, administrative weights, local preference, the
ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 39
BGP Attributes for Decision Making

• Origin
• Weight
• Community

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 40


What is an Attribute ?

BGP Attributes are a Set of Parameters that


• Describes the characteristics of a particular prefix (route)
• 13 attributes
• Some are mandatory
• The BGP decision process uses these attributes to
select its best routes
• Attributes are part of each BGP update packet

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 41


AS_Path attribute

An AS_set is a
mathematical
set of all the
ASs that have
been
traversed.
ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 42
AS_Path Tree
AS2
AS1 AS3

AS4 ASn-1

AS5 ASn
AS_Path Tree

• BGP constructs a graph (Tree) of autonomous


systems
(ASs) based on the information exchanged
between
BGP neighbors
• As far as BGP is concerned, the whole Internet is a
ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 43
Loop Condition Addressed by AS Path-Attribute

AS2 172.16.10.0/24- -2
1

172.16.10.0/24-
-1
AS1 AS3
172.16.10.0/24

172.16.10.0/24- -4 3 2 AS4 172.16.10.0/24- -3 2


1 1
AS1 sees its AS number in the AS_path list and does
not accept the update.
ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 44
Best Path selection using AS Path-Attribute

• AS - Path Information is one of


the attributes BGP looks as to
determine the best route to take
to get to a destination

• If all other attributes are


identical, a shorter path is always
preferred.

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 45


Next Hop Attribute

I can reach 150.10.0.0/16


via 150.10.1.1
I can reach 160.10.0.0/16
via 150.10.1.1

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 46


Next Hop Attribute

128.213.1.0/24
192.212.1.0/24
3.3.3.3 1.1.1.1 LA

S0
2.2.2.2 EBGP
SJ SF
IBGP

I can reach 128.213.1.0/24


via next hop 1.1.1.1 I can reach 128.213.1.0/24
I can reach 192.212.1.0/24 via next hop 1.1.1.1
via next hop 2.2.2.2

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 47


BGP Table & IP Routing Table

BGP Table of SJ Router


Destination Next Hop
192.212.1.0/24 2.2.2.2
128.213.1.0/24 1.1.1.1

IP Routing Table of SJ Router


Destination Next Hop
192.212.1.0/24 2.2.2.2
2.2.2.0/24 3.3.3.3
3.3.3.0/24 Connected, Serial 0
128.213.1.0/24 1.1.1.1
1.1.1.0/24 3.3.3.3

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 48


Next Hop - Multi Access (MA) Media

• A media is considered MA if routers connected


to that media have the capability to exchange
data in a many to many relationship.

• Routers on MA media share the same IP subnet


and can physically access all other routers on
the media in one hop (directly connected).

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 49


Next Hop - Multi Access (MA) Media

10.10.10.0/24

.2 RTC
EBGP

RTA .1 OSPF

IP has a rule on MA
media that states that a .3 RTB
router should always
advertise the actual
source of the
route in case the source 11.11.11.0/24
is on the same MA as
the router.
ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 50
Next
BGPHop
Local
- Multi
Preference
Access (MA)
Attribute
Media

• When there are multiple paths to the same destination,


the local preference attribute indicate preferred path
and gets exchanged between IBGP peers only and not
passed to EBGP peers.
• Local to AS
• Used to influence BGP path selection
• Path with highest local preference wins
• Part of routing updates in the same AS
• Discretionary attribute (type code 5)
• A degree of preference given to a route to compare it
with other routes for the same destination.
• Higher Local Pref -> Route is more preferred

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 51


BGP Local Preference Attribute

Local preference is usually


used to set the exit point of
an AS to reach a certain
destination

Set local preference to 500


this will force the traffic to
go out via this link Set local preference to
300

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 52


BGP Weight Attribute

• Weight attribute is local to the router and


does not get propagated in routing updates
• Used in path selection cases when there is
more then one route to the same destination
• By default the weight attribute is 32768 for
paths that the router originates and 0 for
other paths
• Routes with a higher weight are preferred
when there are multiple routes to the same
estination
• Weight attribute is a special Cisco attribute
ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 53
BGP Multi-Exit Discriminator (MED) Attribute

(Type code 4) - optional

• Hint to external neighbors about preferred path into an


AS that has multiple entry prints

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 54


BGP Multi-Exit Discriminator (MED) Attribute

Preferred path
•Customers that
connect to same
provider in
multiple locations could
exchange metrics with their Lower metric
providers to influence each
other’s outbound traffic,
which leads to better load
balancing.

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 55


BGP Multi-Exit Discriminator (MED) Attribute

SF NY
MED=50
XNET YNET

MED=200
MED=150 128.213.0.0/16

ANET
SJ LA

SF could have influenced its decision by using local preference


inside XNET to override the metrics coming outside ASs.

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 56


Applying Policy with BGP

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 57


BGP Communities

• A community is a group of destinations with common


property.
- (Type code 8)

- not restricted to one AS

• Group of Networks - Edu, Govt etc.

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 58


BGP Communities

- transitive

• Format : aa : nn
• ‘aa’ - ASN
• ‘nn’ - 1 to 4,294,901,760

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 59


BGP Communities

• Communities are used to


simplify routing policies
by identifying routes
based on a logical
property rather than IP
prefix or an ASN
** To control routes to
accept, prefer
and
pass on to
other BGP
neighbors

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 60


BGP ORIGIN Attribute
•Origin attribute provides information about the
origin
of the route
•BGP considers three types of origins
•IGP - The route is interior to the originating
AS
•EGP - The route is learned via Exterior
Gateway
Protocol (EGP)
•Incomplete - The origin of the route is
unknown
or learn in some other way
•BGP considers the origin attribute in its decision
making process to establish a preference ranking
among multiple routes
ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 61
Summary of the BGP Path Selection Process

• BGP selects only one path as the best


path.
• When the path is selected, BGP puts the
selected path in its routing table and
propagates the path to its neighbors.
• BGP uses the following criteria, in the
order presented, to select a path for a
destination:

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 62


Summary of the BGP Path Selection Process

• If the path specifies a next hop that is


inaccessible, drop the update.
• Prefer the path with the largest weight.
• If the weights are the same, prefer the path
with the largest local preference.
• If the local preferences are the same,
prefer the path that was originated by BGP
running on this router.
• If no route was originated, prefer the route
that has the shortest AS_path.

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 63


Summary of the BGP Path Selection Process

• If all paths have the same AS_path length,


prefer the path with the lowest origin type
(where IGP is lower than EGP, and EGP is
lower than Incomplete).
• If the origin codes are the same, prefer the
path with the lowest MED attribute.
• If the paths have the same MED, prefer the
external path over the internal path.
• If the paths are still the same, prefer the
path through the closest IGP neighbor.
• Prefer the path with the lowest IP address,
as specified by the BGP router ID.

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 64


ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 65
Controlling the Flow of BGP Updates

Controlling the flow of BGP


updates. :
 Administrative Distance
 BGP Filtering
 BGP Peer Groups
 CIDR and Aggregate
Addresses
 Confederations
 Route Reflectors
 Route
ALTTC Flap
/ DX/ K.Suresh/ Dampening
Border Gateway Protocol Version 4 Slide - 66
Administrative Distance
Administrative distance is used to discriminate between
routes learned from more than one protocol.
The route with the lowest administrative distance is
installed in the IP routing table.
BGP default distances
Distance Default value Function
External 20 Applied to routes learned from
EBGP
Internal 200 Applied to routes learned from
IBGP
Local 200 Applied to routes originated by the
router
Distance does not influence the BGP path selection
algorithm, but it does influence whether BGP
learned
routes
ALTTC are installed
/ DX/ K.Suresh/ in the Protocol
Border Gateway IP routing table.
Version 4 Slide - 67
BGP Filtering

BGP4 controls the sendin/ receiving of updates by:


• Prefix Filtering - To restrict the routing information that the
router learns or advertises based on an access list
• AS Path Filtering - Access list on the value of AS path
attribute.
• Route Map Filtering - Filtering using the routemaps
• Community Filtering - Filtering updates from community of
routers
• Route Filtering is essential in defining routing policies
• Filtering and manipulating a route involves
• Identifying Routes
• Permitting or Denying the Routes
• Manipulating Attributes

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 68


Internal BGP

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 69


Internal BGP

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 70


Scaling the IBGP Mesh

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 71


BGP Confederation

• Confederation reduces the number of peers


within the AS

• A confederation is a technique f or
reducing the IBGP mess inside the AS

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 72


BGP Confederation

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 73


BGP Route Reflectors (RR)

A BGP speaker does not advertise a route learned


from another
IBGP speaker to a third IBGP speaker. RRs ease this
limitation
and allow a router to advertise (reflect) IBGP -
learned routes
to other IBGP speakers, thereby reducing the number
of IBGP
peers within an AS.

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 74


BGP Confederation

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 75


Achieving Stability

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 76


Relationship with IGP

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 77


Peer Groups

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 78


Route Flap Dampening

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 79


Mechanism to minimise instability

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 80


Flap dampening Terminology

A route that is flapping receives


a penalty of 1000 (numeric
value)
for each flap.
When the accumulated penalty
reaches a configurable limit,BGP
suppresses advt. Of the route
even
if the route is up.
The accumulated penalty is decr-
emented by the half life time.
When the accumulated penalty
is less then the the reused limit,
the
ALTTC / DX/ K.Suresh/ Border Gateway route is
Protocol advertised
Version 4 again.
Slide - 81
Flap dampening (contd.)

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 82


BGP soft re-configuration

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 83


Cisco IOS Version Information
TM

Internetwork Operating System

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 84


ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 85
Fig 14

AS 200
A 190.10.0.0
AS 100 B
170.10.0.0

AS 300
180.10.0.0 C

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 86


Fig 15

AS 100
150.10.0.0
150.10.50.1
IBGP

150.10.30.1 150.10.30.2

170.10.20.1 A B

170.10.20.2

As 300 C
170.10.0.0

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 87


Fig 16

AS 100 150.10.50.1
150.10.0.0 IBGP

150.10.30.1 150.10.30.2

170.10.20.1 A B

170.10.20.2 170.10.20.3

C
As 300 D
180.20.0.0

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 88


Fig 17

AS 100 150.10.50.1
150.10.0.0 IBGP

150.10.30.1 150.10.30.2

170.10.20.1 A B

PVC Frame Relay Network

170.10.20.2 170.10.20.3

C
AS 400 D
AS 300 180.20.0.0

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 89


Fig 10

AS 100 E
150.10.0.0 IGP IGP

IBGP
2.2.2.2 A B
2.2.2.1
D
AS 300 C AS 400
170.10.0.0 175.10.0.0

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 90


Fig 11

AS 100
150.10.0.0
3.3.3.3 IGP 3.3.3.2

2.2.2.2 A IBGP B 1.1.1.1


2.2.2.1 1.1.1.2
D
As 300 C As 400
170.10.0.0 175.10.0.0

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 91


Fig 12

AS 100
150.10.0.0
3.3.3.3 RIP 3.3.3.2
2.2.2.2 A IBGP B 4.4.4.2
2.2.2.1 4.4.4.1

AS 300 C AS 400 D
170.10.0.0 160.10.0.0

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 92


Fig 13

AS200
Static/OSPF 2.2.2.2 175.220.0.0 /16
2.2.2.1
IBGP
1.1.1.2 C B
1.1.1.1
AS 300 AS 100 A
D
129.213.1.0

ALTTC / DX/ K.Suresh/ Border Gateway Protocol Version 4 Slide - 93