SANOG23 Introduction To Routing Tutorial PDF
SANOG23 Introduction To Routing Tutorial PDF
Srinath Beldona
Senior Technical Specialist
srinath@apnic.net
• Department of Defense
(DoD) in the US created the Application Layer
Application
Layer Presentation Layer
Session Layer
Originally as defined
Comparing the OSI & TCP/IP Model
Application Layer
Application
Layer Presentation Layer
Session Layer
Internet
Router 1 Router 2
Switch 1 Switch 2
Typical communication in a Network
Host B
Host A
Router 1 Router 2
S Switch 1 Switch 2 D
• Architecture
– Connection oriented
– Connectionless
– (where should reliability be done?)
• Services
– Routing (Path selection)
– Adaptation to different lower layers
Objectives for Routing Algorithms
• Goals
– Optimality
– Fairness
– Stability
– Robustness
– Correctness
– Simplicity
• Centralized
• Isolated
• Distributed
Distributed Routing
• Metric - Vector Algorithms
– sometimes called shortest path
– Bellman-Ford most famous
– Knowledge of immediate neighbors
– Result is “first step” in path to ultimate destination
• Link State Algorithms
– OSPF {Open Shortest Path First}
– Knowledge of network layer map (connectivity)
Summary of Network layer functions
IP Addressing and its role in
Routing
Why do we need IP addresses?
• Impossible to engineer a universal network from a single
network technology because no single network suffices for
all uses
• Some technologies such as Ethernet LANs are good for
high speed connection within a Local Area only.
• Some technologies such as Serial Interfaces were very
good for use within in a Wide Area environment
• Critical need for internetworking between various LAN and
WAN technologies
• Different technological approaches create issues such as
Physical addresses used in one technology vs another.
Example Ethernet Mac address, Addressing Token ring,
FDDI Addressing etc.
Why do we need IP addresses?
• Networks commonly built using disparate technologies
• Internetworking using Logical Addressing helps connectivity of
disparate networks
• This approach hides the details of the underlying L2 and L1
technologies completely
• The primary goal is a system that hides the details of underlying
network hardware while providing universal communication
services.
• Two fundamental observations about the design of
communication systems:
– Network-Level Interconnection a No single network hardware technology
can satisfy all constraints.
– Users desire universal interconnection
• The need for all computers to communicate using a universal set
of machine identifiers. Unique IP Addresses become a key
requirement
IP Addresses in a Network
• Every host in the Internet requires a unique IP address for communication.
This is a key architectural requirement
• An IP address uniquely identifies a network interface on a host.
• A host may have many interfaces
• Each IP Address
consists of a network
portion and a host Internet
portion.
• Combining network Router 1 Network A Network B Router 2
and host portion of
the IP address, all Switch 1 Switch 2
machines on the
internet can be
uniquely identified on
Host A.1 Host A.2 Host A.3
the internet. Host B.1 Host B.2 Host B.3
IP Address: 32-Bit Binary Number
History of IP Addressing
• Classful IP Addressing
– When IP was first standardized in September 1981, the specification
required that each system attached to an IP-based Internet be assigned
a unique, 32-bit Internet address value.
• Systems that have interfaces to more than one network require a
unique IP address for each network interface.
• The first part of an Internet address identifies the network on
which the host resides, while the second part identifies the
particular host on the given network.
Classful IP Addressing
• To provide the flexibility required to support networks of
varying sizes, the Internet designers decided that the IP
address space should be divided into three address
classes-Class A, Class B, and Class C. This is often
referred to as Classful addressing.
Dotted-Decimal Notation
The router accepts all traffic from the Internet addressed to network 130.5.0.0,
and forwards traffic to the interior sub networks based on the third octet of the
Classful address.
Advantages of Subnetting
• The size of the global Internet routing table does not grow
• Net Administrator has the flexibility to deploy additional
subnets without obtaining a new network number from the
Internet agency
• Route flapping (that is, the rapid changing of routes) within
the private network does not affect the Internet routing table
as they need not know about the reachability of each
subnet
Routing Protocols & Classful Addressing
• Classful Routing Updates
– Classful routing protocols (i.e. RIPv1, IGRP & BGP v3 )
do not send subnet masks in their routing updates.
– The routing update could determine the subnet mask
simply by examining the value of the first octet in the
network address
Classless Inter-domain Routing
(CIDR – RFC 1519)
• Advantages of CIDR
– More efficient use of IPv4 address space
– Route summarization
• reduce routing table size
• reduce routing update traffic
Classless Inter-domain Routing
(CIDR – RFC 1519)
• Requires subnet mask to be included in routing
update because address class is meaningless
• The network portion of the address is determined by
the network subnet mask, also known as the network
prefix, or prefix length (/8, /19, etc.).
• The network address is no longer determined by the
class of the address
• Blocks of IP addresses could be assigned to a
network based on the requirements of the customer,
ranging from a few hosts to hundreds or thousands
of hosts.
Classless IP Addressing
• Classless IP Addressing
• CIDR & Route Summarization
– Variable Length Subnet Masking (VLSM)
– Allows a subnet to be further sub-netted
• according to individual needs
– Prefix Aggregation a.k.a. Route Summarization
– CIDR allows for routes to be summarized as a single route
Classless IP Addressing and Routing
• For Route Summarization
• Propagating VLSM and supernet routes requires a classless routing
protocol, because the subnet mask can no longer be determined by
the value of the first octet.
• Classless routing protocols include the subnet mask with the network
address in the routing update.
• RIPv2, EIGRP, IS-IS, OSPF and BGP
VLSM
• Classful routing
– -only allows for one
subnet mask for all
networks
• VLSM & classless routing
-This is the process of
subnetting a subnet
-More than one
subnet mask can be
used
-More efficient use of IP
addresses as compared
to classful IP
addressing
The need to route
Router as a Computer
Internet
Internet
Internet
172.16.2.2 172.16.2.3 172,16,2.4
E 1/0
172.16.1.2 172.16.1.3 172.16.1.4
Router 3 171.16.3.0/24
Default Route configuration to connect to the Internet 171.16.3.1 Fa0/1
Switch
R1# conf term 2
R1(config)# ip route 0.0.0.0 0.0.0.0 interface ethernet 1/0 11.250.250.1
• -More secure
• Disadvantages of static routing
– Network changes require manual reconfiguration
– Does not scale well in large topologies
Dynamic Routing
Characteristics of Dynamic Routing
• Metric
– A value used by a routing protocol to determine which
routes are better than others.
Routing Protocols Metrics
• Load balancing
– This is the ability of a router to distribute packets among
multiple same cost paths
Administrative Distance of a Route
• Purpose of a metric
– It’s a calculated value used to determine the best path to a
destination
• Static Routes
– Administrative distance of a static route has a default value of 1
Administrative Distance of a Route
85
IPv6
• Internet is starting to use IPv6
– Addresses are 128 bits long
– Internet addresses range from 2000::/16 to 3FFF::/16
– The remaining IPv6 range is reserved or has “special” uses
86
IPv4
• Internet still uses IPv4
– (legacy protocol)
– Addresses are 32 bits long
– Range from 1.0.0.0 to 223.255.255.255
– 0.0.0.0 to 0.255.255.255 and 224.0.0.0 to 255.255.255.255
have “special” uses
87
IP address format
• Address and subnet mask
– IPv4 written as
• 12.34.56.78 255.255.255.0 or
• 12.34.56.78/24
– IPv6 written as
• 2001:db8::1/128
– mask represents the number of network bits in the address
– The remaining bits are the host bits
88
What does a router do?
89
A day in a life of a router
find path
forward packet, forward packet, forward packet,
forward packet...
find alternate path
forward packet, forward packet, forward packet,
forward packet…
repeat until powered off
90
Routing versus Forwarding
• Routing = building
maps and giving
directions
• Forwarding = moving
packets between
interfaces according to
the “directions”
91
IP Routing – finding the path
• Path derived from information received from a
routing protocol
• Several alternative paths may exist
– best path stored in forwarding table
92
IP route lookup
• Based on destination IP address
• “longest match” routing
– More specific prefix preferred over less specific prefix
– Example: packet with destination of 2001:db8::1/128 is
sent to the router announcing 2001:db8:1::/48 rather than
the router announcing 2001:db8::/32.
93
IP route lookup
• Based on destination IP address
2001:db8::/32
Packet: Destination R3 announced from
IP address: 2001:db8::1 here
R1 R2
R4
2001:db8::/32 → R3
2001:db8:1::/16→ R4 2001:db8:1::/48
announced from
2001:db9::/32 → R5
here
2001:dba::/32 → R6
……
R2’s IP routing table
94
IP route lookup:
Longest match routing
• Based on destination IP address
2001:db8::/32
Packet: Destination R3 announced from
IP address: 2001:db8::1 here
R1 R2
R4
2001:db8::/32 → R3 2001:db8::1 && ffff:ffff:: 2001:db8:1::/48
2001:db8:1::/48 → R4 vs. Match! announced from
2001:db9::/32 → R5 2001:db8:: && ffff:ffff:: here
2001:dba::/32 → R6
……
2001:db8::/32
Packet: Destination R3 announced from
IP address: 2001:db8::1 here
R1 R2
R4
2001:db8::/32 → R3 2001:db8::1 && ffff:ffff:ffff:: 2001:db8:1::/16
2001:db8:1::/48 → R4 vs. announced from
2001:db9::/32 → R5 2001:db8:1:: && ffff:ffff:ffff:: here
2001:dba::/32 → R6
…… Match as well!
R2’s IP routing table
96
IP route lookup:
Longest match routing
• Based on destination IP address
2001:db8::/32
Packet: Destination R3 announced from
IP address: 2001:db8::1 here
R1 R2
R4
2001:db8::/32 → R3 2001:db8:1::/48
2001:db8:1::/48 → R4 2001:db8::1 && ffff:ffff::
vs. announced from
2001:db9::/32 → R5
2001:db9:: && ffff:ffff:: here
2001:dba::/32 → R6
……
Does not match!
R2’s IP routing table
97
IP route lookup:
Longest match routing
• Based on destination IP address
2001:db8::/32
Packet: Destination R3 announced from
IP address: 2001:db8::1 here
R1 R2
R4
2001:db8::/32 → R3 2001:db8:1::/48
2001:db8:1::/48 → R4 announced from
2001:db9::/32 → R5 2001:db8::1 && ffff:ffff:: here
2001:dba::/32 → R6 vs. Does not match!
…… 2001:dba:: && ffff:ffff::
R2’s IP routing table
98
IP route lookup:
Longest match routing
• Based on destination IP address
2001:db8::/32
Packet: Destination R3 announced from
IP address: 2001:db8::1 here
R1 R2
R4
2001:db8::/32 → R3 2001:db8:1::/48
2001:db8:1::/48 → R4 Longest match, 48 bit netmask announced from
2001:db9::/32 → R5
here
2001:dba::/32 → R6
……
100
Routing Tables Feed the Forwarding
Table
Connected Routes
Static Routes
101
RIBs and FIBs
• FIB is the Forwarding Table
– It contains destinations and the interfaces to get to those
destinations
– Used by the router to figure out where to send the packet
– Careful! Some people still call this a route!
102
Explicit versus Default Routing
• Default:
– simple, cheap (cycles, memory, bandwidth)
– low granularity (metric games)
• Hybrid
– minimise overhead
– provide useful granularity
– requires some filtering knowledge
103
Egress Traffic
• How packets leave your network
• Egress traffic depends on:
– route availability (what others send you)
– route acceptance (what you accept from others)
– policy and tuning (what you do with routes from others)
– Peering and transit agreements
104
Ingress Traffic
• How packets get to your network and your
customers’ networks
• Ingress traffic depends on:
– what information you send and to whom
– based on your addressing and AS’s
– based on others’ policy (what they accept from you and
what they do with it)
105
Autonomous System (AS)
AS 100
106
Definition of terms
• Neighbours
– AS’s which directly exchange routing information
– Routers which exchange routing information
• Announce
– send routing information to a neighbour
• Accept
– receive and use routing information sent by a neighbour
• Originate
– insert routing information into external announcements
(usually as a result of the IGP)
• Peers
– routers in neighbouring AS’s or within one AS which
exchange routing and policy information
107
Routing flow and packet flow
packet flow
accept announce
AS 1 announce
routing flow
accept AS 2
packet flow
108
Routing flow and Traffic flow
• Traffic flow is always in the opposite direction of the
flow of Routing information
– Filtering outgoing routing information inhibits traffic flow
inbound
– Filtering inbound routing information inhibits traffic flow
outbound
109
Routing Flow/Packet Flow:
With multiple ASes
AS 1
AS 34
N1
AS16
AS 8
N16
AS 1
AS 34
N1
AS16
AS 8
N16
111
Routing Policy
• Used to control traffic flow in and out of an ISP
network
• ISP makes decisions on what routing information to
accept and discard from its neighbours
– Individual routes
– Routes originated by specific ASes
– Routes traversing specific ASes
– Routes belonging to other groupings
• Groupings which you define as you see fit
112
Routing Policy Limitations
red
red
Internet AS99
green green
packet flow
• AS99 uses red link for traffic to the red AS and the
green link for remaining traffic
• To implement this policy, AS99 has to:
– Accept routes originating from the red AS on the red link
– Accept all other routes on the green link
113
Routing Policy Limitations
red
red Internet
AS22 AS99
green green
packet flow
• AS99 would like packets coming from the green AS to
use the green link.
• But unless AS22 cooperates in pushing traffic from the
green AS down the green link, there is very little that
AS99 can do to achieve this aim
114
Routing Policy Issues
• April 2013:
– 12900 IPv6 prefixes & 460000 IPv4 prefixes
• Not realistic to set policy on all of them individually
– 44500 origin AS’s
• Too many to try and create individual policies for
115
Routing Protocols
We now know what routing means…
…but what do the routers get up to?
And why are we doing this anyway?
116
1: How Does Routing Work?
• Internet is made up of the ISPs who connect to
each other’s networks
• How does an ISP in Kenya tell an ISP in Japan what
customers they have?
• And how does that ISP send data packets to the
customers of the ISP in Japan, and get responses
back
– After all, as on a local ethernet, two way packet flow is
needed for communication between two devices
117
2: How Does Routing Work?
• ISP in Kenya could buy a direct connection to the
ISP in Japan
– But this doesn’t scale – thousands of ISPs, would need
thousands of connections, and cost would be astronomical
118
3: How Does Routing Work?
• This process is called “Routing”
• The mechanisms used are called “Routing Protocols”
• Routing and Routing Protocols ensures that the
Internet can scale, that thousands of ISPs can
provide connectivity to each other, giving us the
Internet we see today
119
4: How Does Routing Work?
• ISP in Kenya doesn’t actually tell his neighbouring
ISPs the names of the customers
– (network equipment does not understand names)
120
Routing Protocols
• Routers use “routing protocols” to exchange routing
information with each other
– IGP is used to refer to the process running on routers inside
an ISP’s network
– EGP is used to refer to the process running between routers
bordering directly connected ISP networks
121
What Is an IGP?
• Interior Gateway Protocol
• Within an Autonomous System
• Carries information about internal infrastructure
prefixes
• Two widely used IGPs:
– OSPF
– ISIS
122
Why Do We Need an IGP?
• ISP backbone scaling
– Hierarchy
– Limiting scope of failure
– Only used for ISP’s infrastructure addresses, not customers
or anything else
– Design goal is to minimise number of prefixes in IGP to aid
scalability and rapid convergence
123
What Is an EGP?
• Exterior Gateway Protocol
• Used to convey routing information between
Autonomous Systems
• De-coupled from the IGP
• Current EGP is BGP
124
Why Do We Need an EGP?
• Scaling to large network
– Hierarchy
– Limit scope of failure
125
Interior versus Exterior
Routing Protocols
• Interior • Exterior
– automatic neighbour – specifically configured peers
discovery – connecting with outside
– generally trust your IGP networks
routers – set administrative boundaries
– prefixes go to all IGP routers – binds AS’s together
– binds routers in one AS
together
126
Interior versus Exterior
Routing Protocols
• Interior • Exterior
– Carries ISP infrastructure – Carries customer prefixes
addresses only – Carries Internet prefixes
– ISPs aim to keep the IGP – EGPs are independent of ISP
small for efficiency and network topology
scalability
127
Hierarchy of Routing Protocols
Other ISPs
BGP4
BGP4
and OSPF/ISIS
BGP4 Static/BGP4
IXP Customers
128
FYI: Cisco IOS Default Administrative
Distances
Route Source Default Distance
Connected Interface 0
Static Route 1
Enhanced IGRP Summary Route 5
External BGP 20
Internal Enhanced IGRP 90
IGRP 100
OSPF 110
IS-IS 115
RIP 120
EGP 140
External Enhanced IGRP 170
Internal BGP 200
Unknown 255
129
Routing Basics
ISP Workshops
130
Distance Vector routing
protocols
Distance Vector Routing Protocols
139
Link State
A Q 2
B Z 13
Q Y
C X 13
140
Link State Routing
• Neighbour discovery
• Constructing a Link State Packet (LSP)
• Distribute the LSP
– (Link State Announcement – LSA)
• Compute routes
• On network failure
– New LSPs flooded
– All routers recompute routing table
141
Low Bandwidth Utilisation
LSA
X R1
LSA
Alternate Path R2
N1
R1 X
Primary Path
R3
N2
143
Fast Convergence
• Finding a new route
– LSA flooded throughout
area
LSA
– Acknowledgement based
– Topology database
synchronised
– Each router derives routing
N1
R1 X
table to destination
network
144
OSPF Areas
• Area is a group of
contiguous hosts and
networks
– Reduces routing traffic R1 R2
145
Virtual Links between OSPF Areas
backbone Rd Ra
links Area 1
– Increases complexity R6
R3
146
Classification of Routers
R1 IR R2
IR
Area 2 Area 3
Rc Rb
ABR/BR
Area 0
Rd Ra
• Internal Router (IR)
ASBR IR/BR
R5 R4
• Area Border Router (ABR)
To other AS
• Backbone Router (BR)
Area 1
R3 • Autonomous System
Border Router (ASBR)
147
OSPF Route Types
R1 IR R2
IR
Area 2 Area 3
Rc Rb
ABR/BR
Area 0 • Intra-area Route
Rd Ra
– all routes inside an area
ASBR
• Inter-area Route
R5 R4
To other AS – routes advertised from one
area to another by an Area
Area 1 Border Router
R3
• External Route
– routes imported into OSPF
from other protocol or static
routes 148
External Routes
• Prefixes which are redistributed into OSPF from
other protocols
• Flooded unaltered throughout the AS
– Recommendation: Avoid redistribution!!
RIP
EIGRP
BGP
OSPF Static
R2
Connected
Redistribute etc.
149
External Routes
• Type 1 external metric: metrics are added to the
summarised internal link cost
to N1
Cost = 10 External Cost = 1
R2
R1
to N1
Cost = 8 R3 External Cost = 2
to N1
Cost = 10 External Cost = 1
R2
R1
to N1
Cost = 8 R3 External Cost = 2
152
The Hello Protocol
• Responsible for
establishing and
maintaining neighbour Hello
relationships
• Elects designated router
Hello
on multi-access networks Hello
153
The Hello Packet
• Contains:
– Router priority
– Hello interval Hello
– Router dead interval
– Network mask
– List of neighbours
Hello
– DR and BDR Hello
– Options: E-bit, MC-bit,…
(see A.2 of RFC2328)
154
Designated Router
• There is ONE designated router per multi-access
network
– Generates network link advertisements
– Assists in database synchronization
Backup
Designated Designated
Router Router
Designated Backup
Router Designated Router
155
Designated Router by Priority
131.108.3.2 131.108.3.3
R1 DR R2
144.254.3.5
156
Neighbouring States
• Full
– Routers are fully adjacent
– Databases synchronised
– Relationship to DR and BDR
Full
DR BDR
157
Neighbouring States
• 2-way
– Router sees itself in other Hello packets
– DR selected from neighbours in state 2-way or greater
2-way
DR BDR
158
When to Become Adjacent
• Underlying network is point to point
• Underlying network type is virtual link
• The router itself is the designated router or the
backup designated router
• The neighbouring router is the designated router or
the backup designated router
159
LSAs Propagate Along Adjacencies
DR BDR
160
Broadcast Networks
• IP Multicast used for Sending and Receiving Updates
– All routers must accept packets sent to AllSPFRouters
(224.0.0.5)
– All DR and BDR routers must accept packets sent to
AllDRouters (224.0.0.6)
161
Routing Protocol Packets
• Share a common protocol header
• Routing protocol packets are sent with type of
service (TOS) of 0
• Five types of OSPF routing protocol packets
– Hello – packet type 1
– Database description – packet type 2
– Link-state request – packet type 3
– Link-state update – packet type 4
– Link-state acknowledgement – packet type 5
162
Different Types of LSAs
• Six distinct type of LSAs
– Type 1: Router LSA
– Type 2: Network LSA
– Type 3 & 4: Summary LSA
– Type 5 & 7: External LSA (Type 7 is for NSSA)
– Type 6: Group membership LSA
– Type 9, 10 & 11: Opaque LSA (9: Link-Local, 10: Area)
163
Router LSA (Type 1)
• Describes the state and cost of the router’s links to
the area
• All of the router’s links in an area must be
described in a single LSA
• Flooded throughout the particular area and no more
• Router indicates whether it is an ASBR, ABR, or end
point of virtual link
164
Network LSA (Type 2)
• Generated for every transit broadcast and NBMA
network
• Describes all the routers attached to the network
• Only the designated router originates this LSA
• Flooded throughout the area and no more
165
Summary LSA (Type 3 and 4)
• Describes the destination outside the area but still
in the AS
• Flooded throughout a single area
• Originated by an ABR
• Only inter-area routes are advertised into the
backbone
• Type 4 is the information about the ASBR
166
External LSA (Type 5 and 7)
• Defines routes to destination external to the AS
• Default route is also sent as external
• Two types of external LSA:
– E1: Consider the total cost up to the external destination
– E2: Considers only the cost of the outgoing interface to the
external destination
167
Inter-Area Route Summarisation
• Prefix or all subnets
• Prefix or all networks
• ‘Area range’ command
R2
Backbone
Area 0
168
No Summarisation
• Specific Link LSA advertised out of each area
• Link state changes propagated out of each area
1.A
1.B
1.C 3.A
1.D 3.B
Area 0 3.C
2.A 3.D
2.B
2.C
2.D
1.B 3.B
1.A 3.A
2.B
1.C 1.D 2.A 3.C 3.D
2.C 2.D
169
With Summarisation
• Only summary LSA advertised out of each area
• Link state changes do not propagate out of the area
1 3
Area 0
2
1.B 3.B
1.A 3.A
2.B
1.C 1.D 2.A 3.C 3.D
2.C 2.D
170
No Summarisation
• Specific Link LSA advertised in to each area
• Link state changes propagated in to each area
2.A 2.B
2.C 2.D
3.A 3.B 1.A 1.B
3.C 3.D 1.C 1.D
Area 0 2.A 2.B
1.A 1.B 2.C 2.D
1.C 1.D
3.A 3.B
3.C 3.D
1.B 3.B
1.A 3.A
2.B
1.C 1.D 2.A 3.C 3.D
2.C 2.D
171
With Summarisation
• Only summary link LSA advertised in to each area
• Link state changes do not propagate in to each area
2 1
3 2
Area 0
1
3
1.B 3.B
1.A 3.A
2.B
1.C 1.D 2.A 3.C 3.D
2.C 2.D
172
Types of Areas
• Regular
• Stub
• Totally Stubby
• Not-So-Stubby
• Only “regular” areas are useful for ISPs
– Other area types handle redistribution of other routing
protocols into OSPF – ISPs don’t redistribute anything
into OSPF
173
Regular Area (Not a Stub)
• From Area 1’s point of view, summary networks from other
areas are injected, as are external networks such as X.1
ASBR
X.1 External
networks
X.1
2 1
3 2 X.1
Area 0
X.1
1
3
2.B
1.D X.1 2.A 3.D
1.C 3.C
2.C 2.D
174
Normal Stub Area
• Summary networks, default route injected
• Command is area x stub
ASBR
X.1 External
networks
Default
2 1
3 2 Default
Area 0
Default
1
3
X.1 2.B
1.C 1.D 2.A 3.C 3.D
2.C 2.D
175
Totally Stubby Area
• Only a default route injected
– Default path to closest area border router
• Command is area x stub no-summary ASBR
X.1 External
networks
1
Totally Default 2 Default
Stubby Area Area 0
Default
1
3
2.B
1.D X.1 2.A 3.D
1.C 3.C
2.C 2.D
176
Not-So-Stubby Area
• Capable of importing routes in a limited fashion
• Type-7 LSA’s carry external information within an NSSA
• NSSA Border routers translate selected type-7 LSAs into type-5 external
network LSAs ASBR
X.1 External
networks
1
Not-So- Default 2 Default
Stubby Area Area 0 X.2
Default
X.2 1
3 X.2
X.2
X.1 1.B 3.B
1.A X.1 3.A
X.2 X.1
2.B
1.C 1.D 2.A 3.C 3.D
External
networks
2.C 2.D
177
ISP Use of Areas
• ISP networks use:
– Backbone area
– Regular area
• Backbone area
– No partitioning
• Regular area
– Summarisation of point to point link addresses used within
areas
– Loopback addresses allowed out of regular areas without
summarisation (otherwise iBGP won’t work)
178
Addressing for Areas
Area 0
network 192.168.1.0
range 255.255.255.192
180
BGP as an Inter AS Routing
protocol
Border Gateway Protocol
• A Routing Protocol used to exchange routing
information between different networks
– Exterior gateway protocol
• Described in RFC4271
– RFC4276 gives an implementation report on BGP
– RFC4277 describes operational experiences using BGP
182
BGP
• Path Vector Protocol
• Incremental Updates
• Many options for policy enforcement
• Classless Inter Domain Routing (CIDR)
• Widely used for Internet backbone
• Autonomous systems
183
Path Vector Protocol
• BGP is classified as a path vector routing protocol
(see RFC 1322)
– A path vector protocol defines a route as a pairing between
a destination and the attributes of the path to that
destination.
AS Path
184
Path Vector Protocol
AS11268
AS6337
AS7018
AS500
AS6461
AS600
185
Definitions
• Transit – carrying traffic across a network, usually
for a fee
• Peering – exchanging routing information and traffic
• Default – where to send traffic when there is no
explicit match in the routing table
186
Default Free Zone
Backbone
provider B Provider D
provider F
transit
AS 100
190
Autonomous System Number (ASN)
• ASNs are distributed by the Regional Internet
Registries
– They are also available from upstream ISPs who are
members of one of the RIRs
• Current 16-bit ASN assignments up to 63487 have
been made to the RIRs
– Around 44500 are visible on the Internet
– Around 1500 left unassigned
• Each RIR has also received a block of 32-bit ASNs
– Out of 4800 assignments, around 3700 are visible on the
Internet
• See www.iana.org/assignments/as-numbers
191
Configuring BGP in Cisco IOS
• This command enables BGP in Cisco IOS:
router bgp 100
192
BGP Basics
Peering
A C
AS 100 AS 101
B D
E
• Runs over TCP – port 179
• Path vector protocol AS 102
• Incremental updates
• “Internal” & “External” BGP
193
Demarcation Zone (DMZ)
A C
DMZ
AS 100 Network AS 101
B D
AS 102
195
Constructing the Forwarding Table
• BGP “in” process
– receives path information from peers
– results of BGP path selection placed in the BGP table
– “best path” flagged
196
Constructing the Forwarding Table
discarded
BGP in
in
process accepted
everything
best paths
BGP out forwarding
out table
process
197
eBGP & iBGP
• BGP used internally (iBGP) and externally (eBGP)
• iBGP used to carry
– Some/all Internet prefixes across ISP backbone
– ISP’s customer prefixes
• eBGP used to
– Exchange prefixes with other ASes
– Implement routing policy
198
BGP/IGP model used in ISP networks
• Model representation
199
External BGP Peering (eBGP)
AS 100 AS 101
C
200
Configuring External BGP
ip address on
ethernet interface
Router A in AS100
ip address on
ethernet interface
Router C in AS101
203
Internal BGP Peering (iBGP)
AS 100
B
A
C
• Topology independent
• Each iBGP speaker must peer with every other
iBGP speaker in the AS
204
Peering between Loopback Interfaces
AS 100
C
A
ip address on
loopback interface
Router A in AS100
interface loopback 0
ip address 105.3.7.1 255.255.255.255
!
router bgp 100 Local ASN
network 100.100.1.0
neighbor 105.3.7.2 remote-as 100 Local ASN
neighbor 105.3.7.2 update-source loopback0
neighbor 105.3.7.3 remote-as 100
neighbor 105.3.7.3 update-source loopback0
!
ip address of Router
B loopback interface
206
Configuring Internal BGP
ip address on
loopback interface
Router B in AS100
interface loopback 0
ip address 105.3.7.2 255.255.255.255
!
router bgp 100 Local ASN
network 100.100.1.0
neighbor 105.3.7.1 remote-as 100 Local ASN
neighbor 105.3.7.1 update-source loopback0
neighbor 105.3.7.3 remote-as 100
neighbor 105.3.7.3 update-source loopback0
!
ip address of Router
A loopback interface
207
Inserting prefixes into BGP
• Two ways to insert prefixes into BGP
– redistribute static
– network command
208
Inserting prefixes into BGP –
redistribute static
• Configuration Example:
router bgp 100
redistribute static
ip route 102.10.32.0 255.255.254.0 serial0
209
Inserting prefixes into BGP –
redistribute static
• Care required with redistribute!
– redistribute <routing-protocol> means everything in
the <routing-protocol> will be transferred into the current
routing protocol
– Will not scale if uncontrolled
– Best avoided if at all possible
– redistribute normally used with “route-maps” and under
tight administrative control
210
Inserting prefixes into BGP –
network command
• Configuration Example
router bgp 100
network 102.10.32.0 mask 255.255.254.0
ip route 102.10.32.0 255.255.254.0 serial0
211
Configuring Aggregation
• Three ways to configure route aggregation
– redistribute static
– aggregate-address
– network command
212
Configuring Aggregation
• Configuration Example:
router bgp 100
redistribute static
ip route 102.10.0.0 255.255.0.0 null0 250
213
Configuring Aggregation –
Network Command
• Configuration Example
router bgp 100
network 102.10.0.0 mask 255.255.0.0
ip route 102.10.0.0 255.255.0.0 null0 250
214
Configuring Aggregation –
aggregate-address command
• Configuration Example:
router bgp 100
network 102.10.32.0 mask 255.255.252.0
aggregate-address 102.10.0.0 255.255.0.0 [summary-only]
10.0.15.241 4 10 9 8 16 0 0 00:04:47 2!
10.0.15.242 4 10 6 5 16 0 0 00:01:43 2!
10.0.15.243 4 10 9 8 16 0 0 00:04:49 2!
...!
217
Summary
• BGP4 – path vector protocol
• iBGP versus eBGP
• stable iBGP – peer with loopbacks
• announcing prefixes & aggregates
218
Thank you!
End of Session