Vous êtes sur la page 1sur 28

Implementing Cisco IP Routing


IP Routing Overview
Path Control


that glues internet


BGP Basics
Routing protocol to exchange routing information between
different networks

RFC4276 : Implementation report on BGP

RFC4277 : Operational experiences using BGP

IETF Working Groups

IDR (Internet-Domain Routing : http://datatracker.ietf.org/wg/idr)
SIDR (Secure IDR : http://datatracker.ietf.org/wg/sidr

AS (Autonomous System)
Used to uniquely identify networks with a common routing policy

Autonomous System
Collection of networks with
same routing policy
Single routing protocol
Usually under single
ownership, trust and
administrative control.
Identify by a unique AS
Number (ASN)

2 octet (16bit) integer number

4 octet (32bit) integer number

Autonomous System Number (ASN)

0 65535 Original 16bit range
65536 4294967295 32bit range RFC4893

Usage :

0 and 65535 reserved/cannot be used

1 64495 public (Telkomsels AS Number 23693)
64496 64511 documentation purpose RFC5398
64512 65534 private (Telkomsel used 64689 as Internal AS number)
23456 represent 32bit range in 16bit world
65536 65551 documentation purpose RFC5398
65552 4294967295 public

32bit range representation specified in RFC5396, defines asplain as

standard notation (Jan 2009)

BGP Basics

BGP shares some characteristics with some routing protocols
already studied :
BGP supports VLSM and summarization.
BGP will send full updates when two routers initially become
neighbors and will send only partial updates after that.
BGP does create and maintain neighbor relationships before
exchanging routes, and keepalives are sent to keep this
relationship alive.

BGP States

Router is searching the routing table to see whether a route exists to reach
the neighbor.


Router found a route to neighbor and has completed three-way TCP


Open sent

Open message sent, with parameter for BGP Session.

Open confirm Router received agreement on the parameters for establishing a session.
Alternatively, the router goes into active state if no response to open

Peering is established, routing begins.

BGP Peering Process

Connection Oriented used TCP port 179 to create neighbor
Sent keepalives message to maintain relationship
Once the connection is established, BGP Speaker exchange
routes and sync their tables. (only at initial process).
After initial exchange, BGP Speaker will only send further
updates upon a change in the network topology.
No require prospective neighbor to be the same AS.

BGP Messages Type

Before establishing a BGP peer connection the two neighbors must perform the
standard TCP three-way handshake and open a TCP connection to port 179.

After the TCP session is established, BGP peers exchanges several messages to
open and confirm connection parameters and to send BGP routing information.

All BGP messages are unicast to the one neighbor over the TCP connection.

There are four BGP message types:

Type 1: OPEN
Type 3: UPDATE

BGP Messages Type - OPEN

After the TCP session is established, both

neighbors send Open messages.
This message is used to establish connections
with peers.
Each neighbor uses this message to identify itself
and to specify its BGP operational parameters
BGP version number (defaults to version 4)
AS number: AS number of the originating
router, determines if BGP session is EBGP or
BGP identifier: IP address that identifies the
neighbor using the same method as OSPF router
Optional parameter: authentication,
multiprotocol support and route refresh.

BGP Message Type - Keepalives

This message type is sent periodically between peers to maintain

connections and verify paths held by the router sending the keep alive.
If a router accepts the parameters specified in its neighbors Open
message, it responds with a Keep alive.
Subsequent Keepalives are sent every 60 seconds by Cisco default or
equal to one-third the agreed-upon hold time (180 seconds).
If the periodic timer is set to a value of zero (0), no keep lives are sent.

BGP Message Type - Updates

The UPDATE messages contain all the information BGP uses to construct a loopfree picture of the internetwork.
Update messages advertises feasible routes, withdrawn routes, or both.
The three basic components of an UPDATE message are:
Network-Layer Reachability Information (NLRI)
Path Attributes
Withdrawn Routes

BGP Message Type - Notifications

The NOTIFICATION message is sent when BGP detects an error condition

Peering session is terminated and the TCP is connection is closed.
The cause of the error condition is sent to the peer for debugging and

eBGP vs iBGP

RTA(config)#router bgp 100

RTA(config-router)#neighbor remote-as 200
RTB(config)#router bgp 200
RTB(config-router)#neighbor remote-as 100

RTB: Note that the neighbor commands remote-as value, 100, is different from the
AS number specified by the router bgp command (200).
Because the two AS numbers are different, BGP will start an EBGP connection with RTA.
Communication will occur between autonomous systems.

eBGP vs iBGP

RTB(config)#router bgp 200

RTB(config-router)#neighbor remote-as 200
RTB(config-router)#neighbor update-source loopback 0
RTC(config)#router bgp 200
RTC(config-router)#neighbor remote-as 200
RTC(config-router)#neighbor update-source loopback 0

Since the remote-as value (200) is the same as RTBs BGP AS number, BGP recognizes that this
connection will occur within AS 200, so it attempts to establish an IBGP session.
In reality, AS 200 is not a remote AS at all; it is the local AS, since both routers live there. But for
simplicity, the keyword remote-as is used when configuring both EBGP and IBGP sessions.

IGP/BGP Models

BGP Route Selection Algorithm

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:

1. If the path specifies a next hop that is inaccessible, drop the update
2. Prefer the path with the largest weight.
3. If the weights are the same, prefer the path with the largest local preference.
4. If the local preferences are the same, prefer the path that was originated by BGP running on this router.
5. If no route was originated, prefer the route that has the shortest AS_path.
6. 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).
7. If the origin codes are the same, prefer the path with the lowest MED attribute.
8. If the paths have the same MED, prefer the external path over the internal path.
9. If the paths are still the same, prefer the path through the closest IGP neighbor.
10. Prefer the path with the lowest IP address, as specified by the BGP router ID.

BGP Example Configuration

To begin configuring a BGP process, issue the following familiar command:

Router(config)#router bgp AS-number

BGP configuration commands appear on the surface to mirror the syntax of familiar IGP
(for example, RIP, OSPF) commands.
Although the syntax is similar, the function of these commands is significantly different.
Note: Cisco IOS permits only one BGP process to run at a time, thus, a router cannot
belong to more than one AS.

BGP Example Configuration

Router(config-router)#network network-number [mask network-mask]

The network command is used with IGPs, such as RIP, to determine the interfaces on
which to send and receive updates, as well as which directly connected networks to
However, when configuring BGP, the network command does not affect what
interfaces BGP runs on.
In BGP, the network command tells the BGP process what locally learned networks
to advertise. .

BGP Example Configuration

These networks must also exist in the local routers routing

table (show ip route), or they will not be sent out in updates.
You can use the mask keyword with the network command to specify
individual subnets.
Routes learned by the BGP process are propagated by default, but are
often filtered by a routing policy.

BGP Example Configuration

Router(config-router)#neighbor ip-address remote-as AS-number

In order for a BGP router to establish a neighbor relationship with another BGP
router, you must issue the this configuration command.
This command serves to identify a peer router with which the local router will establish
a session.
The AS-number argument determines whether the neighbor router is an EBGP or an
IBGP neighbor.

Verifying BGP Configuration


the router has not installed the BGP routes you expect, you can use
the show ip bgp command to verify that BGP has learned these routes.

RTA#show ip bgp
BGP table version is 3, local router ID is
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
* i1.0.0.0
* i192.168.1.32/27

Next Hop

Metric LocPrf Weight Path

0 200 400 e
0 i
0 i
0 200 i

Route Reflector
Loop avoidance rule : that any route received from an iBGP
neighbor must not be advertised to any other iBGP
iBGP require all router running iBGP should be connected in
logical full mesh topology to allow routing information
propagation through out the network.
Full mesh = not scalable solution for large network.
Two solutions :

BGP Confederations
Route Reflector

Route Reflector
RFC 2796
Route Reflectors

Relaxed iBGP loop-prevention rules

Allowed to readvertise in certain cases

Speaker classification
Route Reflector (RR)
Route Reflector client (client)
Regular iBGP speaker (non-client)

Route Reflector

A route reflector is BGP router that is allowed to break the iBGP loop avoidance rule.
Route reflectors can advertise updates received from an iBGP peer to another iBGP
peer under specific conditions.
By breaking the rules, route reflectors are used to eliminate the full mesh requirement
and allow for building iBGP networks that scale easily and cleanly.

Route Reflector
RR learns prefix from :

eBGP peer:
Advertise to all clients and

Reflect to all clients

Reflect to all other clients
and to non-clients