Lecture13 Addressing BGP
Lecture13 Addressing BGP
Computer Networks:
Architecture and Protocols
Lecture 13
Distance-vector, Internet,
Addressing, Path-Vector (BGP)
Rachit Agarwal
Announcements
• Prelim: 28th March, In-class (Confirmed)
• Nobody should be in conflict
• Internet Addressing
3
Recap from last lecture
Recap: Three flavors of protocols for producing valid routing state
• Initially each switch X initializes its routing table to (X,0,-) and distance
infinity to all other destinations
• Switches announce their entire distance vectors (routing table w/0 next hops)
• Upon receiving a routing table from a node (say X), each node does:
• For each destination Y in the announcement (distance(X, Y) = d):
• If current_distance_to_Y > d + cost of link to X:
• update current_distance_to_Y = d
• update next_hop_to_destination = X
6
Recap: Lets run the Protocol again on this example
(with distance vectors)
1
2 1
2 3
7
Round 1
distance next-hop
1 0 -
2 infinity
3 infinity
1
2 1
2 3
7
1
2 1
2 3
7
1
2 1
2 3
7
1
2 1
2 3
7
• Protocol
• Nodes exchange distance vectors
• Update their own routing tables
• And exchange again…
• Details: when to exchange, what to exchange, etc….
Other Aspects of Protocol
• When do you send messages?
• When any of your distances d(u,v) change
• What about when c(u,v) changes?
• Periodically, to ensure consistency between neighbors
1
2 1
2 3
7
distance next-hop
1 1 1
2 3 1
3 0 -
Three node network
distance next-hop
1 0 -
2 infinity
3 1 3
1
2 1
2 3
7
distance next-hop
1 1 1
2 3 1
3 0 -
Round 1
distance next-hop
1 0 -
2 4 3
3 1 3
1
2 1
2 3
7
distance next-hop
1 1 1
2 3 1
3 0 -
Round 2
distance next-hop
1 0 -
2 4 3
3 1 3
1
2 1
2 3
7
distance next-hop
1 1 1
2 5 1
3 0 -
Round 3
distance next-hop
1 0 -
2 6 3
3 1 3
1
2 1
2 3
7
distance next-hop
1 1 1
2 5 1
3 0 -
Round 4
distance next-hop
1 0 -
2 6 3
3 1 3
1
2 1
2 3
7
distance next-hop
COUNT-TO-INFINITY 1 1 1
problem!!!! 2 7 1
3 0 -
Count-to-infinity problem
distance next-hop
1 0 -
2 6 3
3 1 3
1
2 1
2 3
7
distance next-hop
Not just due to failures: 1 1 1
Can happen with changes in cost! 2 7 1
3 0 -
How Can You Fix This?
• Do not advertise a path back to the node that is the next hop on the path
• Called “split horizon”
• Telling them about your entry going through them
• Doesn’t tell them anything new
• Perhaps misleads them that you have an independent path
• Distance Vector:
• Send longer vector (#dest) just to neighbors
• But might end up triggering their updates
• Send it every time DV changes (which can be often)
• Tradeoff:
• LS: Send it everywhere and be done in predictable time
• DV: Send locally, and perhaps iterate until convergence
End of Distance-vector Routing
Now you know just as much as my PhD students :-)
Internet Addressing
Addressing so far
• Each node has a “name”
• We have so far worked only with names
• Assumed that forwarding/routing etc. done on names
• Today:
• Why do we need addresses?
• Why do we assign addresses the way we assign addresses?
Three requirements for addressing
• Scalable routing
• How must state must be stored to forward packets?
• How much state needs to be updated upon host arrival/departure?
• Efficient forwarding
• How quickly can one locate items in routing table?
• Efficient forwarding
• Exact match lookup on MAC addresses (exact match is easy!)
• Destination is able to recognize the packet is for them using second part
of the address
Layer 3: Hierarchical addressing
• Routing tables cannot have entry for each switch in the Internet
• Forwarding:
• Routers ignore host part of the address
• When the packet reaches the right network
• Packet forwarded using Host part of the address
• Using Layer 2
• Example:
• In our scalable L2 solution: aggregate was switch
• In our scalable L3 solution: aggregate was network
• Advantages:
• Fewer entries and more stable
• Change of hosts do not change tables
• Don’t need to keep state on individual hosts
Hierarchical Structure
• The Internet is an “inter-network”
• Used to connect networks together, not hosts
128 84 139 5
Network Host
Original Addressing mechanism
• First eight bits: network address (/8)
• Slash notation indicates network address
• Problem?
• Fewer bits for host names
• What if some networks need more hosts?
Today’s Addressing: CIDR
• Classless Inter-domain Routing
• Example:
• 128.84.139.5/23 is a 23 bit prefix with:
• First 23 bits for network address
• Next 9 bits for host addresses: maximum 2^9 hosts
• Fake example:
• ICANN -> ARIN -> AT&T -> Cornell -> CS -> Me
Allocating addresses: Fake example
• ICANN gives ARIN several /8s
“Border Routers”
An “end-to-end” route
“Interior Routers”
What does a computer network look like?
“Border Routers”
An “end-to-end” route
“Interior Routers”
Autonomous Systems (AS)
• An AS is a network under a single administrative control
• Currently over 30,000
• Example: AT&T, France Telecom, Cornell, IBM, etc.
• A collection of routers interconnecting multiple switched Ethernets
• And interconnections to neighboring ASes
LBL
Cornell
a.b.0.0/16 a.c.0.0/16
IP addressing -> Scalable Routing?
LBL
Cornell
a.b.0.0/16 a.c.0.0/16
IP addressing -> Scalable Routing?
AT&T
ESNet
a.0.0.0/8
LBL
Cornell
a.b.0.0/16 a.c.0.0/16
Administrative Structure Shapes Inter-domain Routing
● ASes want freedom to pick routes based on policy
● “My traffic can’t be carried over my competitor’s network!”
● “I don’t want to carry A’s traffic through my network!”
● Cannot be expressed as Internet-wide “least cost”
● Business implications
● Customer pays provider
● Peers don’t pay each other
● Exchange roughly equal traffic
Business Relationships
A
E.g., D and E
talk a lot
B C
Peering saves
B and C money
D E
Pr Cu
Q Peer Peer
A B C
D E F
Pr Cu
Q Peer Peer
A B C
D E F
Sound familiar?
BGP Inspired by Distance Vector
● Per-destination route advertisements
2 3
● Benefits
● Loop avoidance is easy
● Flexible policies based on entire path
BGP vs. DV
(3) Selective Route Advertisement
AS 1 AS 3
AT&T
a.0.0.0/8
foo.com
a.d.0.0/16
LBL
Cornell
a.b.0.0/16 a.c.0.0/16
BGP Outline
● BGP Policy
● Typical policies and implementation
P
B
Can reach
128.3/16
A blah blah
Q
C
Destination prefix
Export route to…
advertised by…
Everyone
Customer (providers, peers,
other customers)
Peer Customers
Provider Customers