week14 lec1
DESCRIPTION
Computer NetworksTRANSCRIPT
Chapter 4Network Layer
Computer Networking: A Top Down Approach 4th edition. Jim Kurose, Keith RossAddison-Wesley, July
2007.
Hierarchical Routing
Scale: With millions of destinations:
Can’t store all destinations in routing tables
Exchange of Routing updates would swamp links!
Administrative Autonomy
Internet = network of networks
Each network administrator may want to control routing in its own network
All routers run the same routing Algorithm?
… not true in practice
Hierarchical Routing Routers are organized
into “Autonomous Systems” (ASs). Routers in same
administrative domain Routers in same AS
run same routing protocol The routing algorithm
within an autonomous system is called an “intra-AS” routing protocol
Routers in different AS can run different intra-AS routing protocol
Gateway Routers One or more of the
routers in an AS will have the added task of forwarding packets to destinations outside the AS.
1d
1c
AS11a 1b
3b
1d
3a
1c
2aAS3
AS1
AS21a
2c
2b
1b
3c
Interconnected ASs
1b, 1c, 2a and 3a are Gateway Routers
Inter-AS tasks Suppose router in AS1
receives datagram destined outside of AS1: Router should forward
packet to gateway router, but which one?
AS1 must:1. Learn which destinations are
reachable through AS2, which through AS3
2. Propagate this reachability information to all routers in AS1. Configure
Forwarding tableJob of inter-AS routing protocol!
3b
1d
3a1c
2aAS3
AS1AS2
1a
2c2b
1b
Intra-ASRouting algorithm
Inter-ASRouting algorithm
Forwardingtable
3c
Example: Setting forwarding table in router 1d
Suppose AS1 learns (via inter-AS protocol) that network x reachable via AS3 (gateway 1c) but not via AS2.
Inter-AS protocol propagates reachability info to all internal routers.
Router 1d determines from intra-AS routing info that its interface I is on the least cost path to 1c. installs forwarding table entry (x,I)
3b
1d
3a
1c2aAS3
AS1
AS21a
2c2b
1b
3c
x…
Example: Choosing among multiple ASs Now suppose AS1 learns from inter-AS protocol
that a network x is reachable from AS3 and from AS2.
To configure forwarding table, router 1d must determine towards which gateway it should forward packets for dest x.
Hot Potato Routing: Send packet towards closest of two routers.
3b
1d
3a
1c2aAS3
AS1
AS21a
2c2b
1b
3cx… …
Learn from inter-AS protocol that network
x is reachable via multiple gateways
Use routing infofrom intra-AS
protocol to determine
costs of least-cost paths to each
of the gateways
Hot potato routing:
Choose the gateway
that has the smallest least
cost
Determine the interface I that leads to least-cost gateway.
Enter (x,I) in forwarding table
Example: Choosing among multiple ASs
Steps in adding an outside AS destination in a routers forwarding Table
Routing Protocols
Path Vector Routing
Path Vector RoutingLoop Prevention
If a router receives a message, checks to see if its autonomous system is in the path list to the destination.
If it is, looping is involved and the message is ignored.
Policy RoutingIf one of the path in the path vector
is against the policy it can ignore that path and does not update its routing table.
Inter-AS Routing in Internet: BGP BGP (Border Gateway Protocol)
BGP provides each AS a means to:1. Obtain subnet reachability information from
neighboring ASs.2. Propagate reachability information to all AS-
internal routers.3. Determine “good” routes to subnets based
on reachability information and policy. Allows subnet to advertise its existence
to rest of Internet: “I am here”
BGP Basics Pairs of routers (BGP peers) exchange routing info over
TCP connections using port 179. For each TCP connection, the two routers at the end of
the connection are called BGP Peers The TCP connection along with all the BGP messages
sent over the connection is called a BGP Session Internal (IBGP) neighbours
A pair of BGP speakers within the same AS External (EBGP) neighbours
Two BGP speakers from two different AS
3b
1d
3a
1c2aAS3
AS1
AS21a
2c
2b
1b
3ceBGP session
iBGP session
BGP Basics BGP allows each AS to learn which
destinations are reachable via its neighboring ASs.
Destinations are not hosts but instead are CIDRized prefixes. E.g. AS1 has four subnets attached to it
It will aggregate the prefixes of these four and will advertise the single prefix
AS1 and AS2 send reachability information trough their gateway routers 1b and 2a.
When a gateway router receives e-BGP learned prefixes, the gateway router uses iBGP sessions to distribute the prefixes to other routers in the AS.
Distributing Reachability info Using eBGP session between 3a and 1c, AS3
sends prefix reachability info to AS1. 1c can then use iBGP do distribute new
prefix info to all routers in AS1 1b can then re-advertise new reachability
info to AS2 over 1b-to-2a eBGP session When router learns of new prefix, it creates
entry for prefix in its forwarding table.
3b
1d
3a
1c2aAS3
AS1
AS21a
2c
2b
1b
3ceBGP session
iBGP session
Path Attributes & BGP Routes
In BGP an AS is recognized by its globally unique Autonomous System Number (ASN).Assigned by ICANN Regional
Registries.Advertised prefix includes BGP
attributes. prefix + attributes = “route”
Two important attributes:AS-PATH and NEXT-HOP
Path Attributes & BGP Routes
AS-PATHContains ASs through which prefix
advertisement has passed.When a prefix is passed into an AS, the
As adds its ASN to the AS-PATH attribute.E.g suppose that the prefix
138.16.64.0/24 is first advertised from AS2 to AS1.
If AS1 then advertises the prefix to AS3, AS-PATH would be AS2 AS1.
Detect and prevent looping advertisements
Routing Loop Prevention
AS1
AS2
AS3
AS4
Net1
[Net1, (AS4)]
[ Net1, (AS3,AS4) ]
[ Net1, (AS1,AS2,AS3,AS4)]
[ Net1, (AS2,AS3,AS4)]
AS3 won’t forward this further