CS 514: Computer Networks Lecture 9: Global Routing Xiaowei Yang - - PowerPoint PPT Presentation
CS 514: Computer Networks Lecture 9: Global Routing Xiaowei Yang - - PowerPoint PPT Presentation
CS 514: Computer Networks Lecture 9: Global Routing Xiaowei Yang xwy@cs.duke.edu Overview Continue our discussion on resource allocation Introduction to global routing Another important and fundamental problem in networking
Overview
- Continue our discussion on resource allocation
- Introduction to global routing
– Another important and fundamental problem in networking
Review
- A fundamental question of networking: who
gets to send at what speed?
Design Space for resource allocation
- Router-based vs. Host-based
- Reservation-based vs. Feedback-based
- Window-based vs. Rate-based
An example
- Two flows, unit link speed 1 bit per second
- R(t) may be flat if there is no flow in the
system
P=3 P=5 t=0 t=4 P=4 P=2 t=1 t=6 t R(t) P=6 t=12
Design space for resource allocation
- Router+host joint control
– Router: Early signaling of congestion – Host: react to congestion signals – Case studies: DECbit, Random Early Detection
DECbit
- Add a congestion bit to a packet header
- A router sets the bit if its average queue length is non-zero
– Queue length is measured over a busy+idle interval
- If less than 50% of packets in one window do not have the bit set
– A host increases its congest window by 1 packet
- Otherwise
– Decreases by 0.875
- AIMD
Random Early Detection
- Random early detection (Floyd93)
– Goal: operate at the “knee” – Problem: very hard to tune (why)
- RED is generalized by Active Queue Managment (AQM)
- A router measures average queue length using
exponential weighted averaging algorithm:
– AvgLen = (1-Weight) * AvgLen + Weight * SampleQueueLen
RED algorithm
- If AvgLen ≤ MinThreshold
– Enqueue packet
- If MinThreshold < AvgLen < MaxThreshold
– Calculate dropping probability P – Drop the arriving packet with probability P
- If MaxThreshold ≤ AvgLen
– Drop the arriving packet
avg_qlen p min_thresh 1 max_thresh
Even out packet drops
- TempP = MaxP x (AvgLen – Min)/(Max-Min)
- P = TempP / (1 – count * TempP)
- Count
– keeps track of how many newly arriving packets have been queued when min < Avglen < max
- It keeps drop evenly distributed over time, even if
packets arrive in burst
avg_qlen TempP min_thresh 1 max_thresh
An example
- MaxP = 0.02
- AvgLen is half way between min and max thresholds
- TempP = 0.01
- A burst of 1000 packets arrive
- With TempP, 10 packets may be discarded uniformly
randomly among the 1000 packets
- With P, they are likely to be more evently spaced out,
as P gradually increases if previous packets are not discarded
Explicit Congestion Notification
- A new IETF standard
- Two bits in IP header
– 00: No ECN support – 01/10: ECN enabled transport – 11: Congestion experienced
- Two TCP flags
– ECE: congestion experienced – CWR: cwnd reduced
X CE=1 ECE=1 CWR=1
DiffServ with RED
- DiffServ
– Treating different flows with different priorities
15
Red with In or Out (RIO)
- Similar to RED, but with two separate probability
curves
- Has two classes, In and Out (of profile)
- Out class has lower Minthresh, so packets are
dropped from this class first
– Based on queue length of all packets
- As avg queue length increases, in packets are also
dropped
– Based on queue length of only “in” packets
16
RIO Drop Probabilities
P (drop in) P (drop out)
min_in max_in avg_in P max_in P max_out min_out max_out avg_total
17
Edge Router Input Functionality
Packet classifier Traffic Conditioner 1 Traffic Conditioner N Forwarding engine
Arriving packet
Best effort
Flow 1 Flow N
Classify packets based on packet header
18
Traffic Conditioning
Wait for token
Set EF bit
Packet input Packet
- utput
Test if token
Set AF in bit
token No token
Packet input Packet
- utput
Drop on overflow
Router Output Processing
- Two queues: EF packets on higher priority queue
- Lower priority queue implements RED In or Out
scheme (RIO)
19
What DSCP? If in set incr in_cnt High-priority Q Low-priority Q If in set decr in_cnt RIO queue management
Packets out EF AF
20
Edge Router Policing
Arriving packet
Is packet marked? Token available? Token available? Clear in bit Drop packet
Forwarding engine AF in set EF set
Not marked no no
Summary
- The problem of network resource allocation
– Case studies
- TCP congestion control
- Fair queuing
- Active queue management
– Random Early Detection
Global Routing
What is routing?
End-hosts Routers
The Internet: Zooming In
- ASes: Independently owned & operated
commercial entities
Duke Comcast Abilene AT&T Cogent Autonomous Systems (ASes) BGP IGPs (OSPF, etc)
ASes (or domains)
- Autonomously administered
- Economically motivated
- All must cooperate to ensure reachability
- Routing between: BGP
- Routing inside: Up to the AS
– OSPF, E-IGRP, ISIS (You may have heard of RIP; almost nobody uses it)
- Inside an AS: Independent policies about nearly
everything.
Transit ASes vs Stub ASes
Duke Comcast Abilene AT&T Cogent BGP All ASes are not equal
AS relationships
- Very complex economic landscape.
- Simplifying a bit:
– Transit: “I pay you to carry my packets to everywhere” (provider-customer) – Peering: “For free, I carry your packets to my customers
- nly.” (peer-peer)
- Technical definition of tier-1 ISP: In the default-
free zone. No transit.
– Note that other “tiers” are marketing, but convenient. “Tier 3” may connect to tier-1.
Zooming in 4
Tier 1 ISP Tier 2 Regional Tier 2 Tier 1 ISP Tier 2 Tier 3 (local) Tier 2: Regional/National Tier 3: Local $$ $$ $$
Default free, Has information on every prefix Default: provider
Who pays whom?
- Transit: Customer pays the provider
– Who is who? Usually, the one who can “live without” the other. AT&T does not need Duke, but Duke needs some ISP.
- What if both need each other? Free
Peering.
– Instead of sending packets over $$ transit, set up a direct connection and exchange traffic for free!
- Tier 1s must all peer with each other by definition
– Tier 1s form a full mesh Internet core
- Peering can give:
– Better performance – Lower cost – More “efficient” routing (keeps packets local)
- But negotiating can be very tricky!
Business and peering
- Cooperative competition
- Much more desirable to have your peers customers
– Much nicer to get paid for transit
- Peering tiffs are relatively common
31 Jul 2005: Level 3 Notifies Cogent of intent to disconnect. 16 Aug 2005: Cogent begins massive sales effort and mentions a 15 Sept. expected depeering date. 31 Aug 2005: Level 3 Notifies Cogent again of intent to disconnect (according to Level 3) 5 Oct 2005 9:50 UTC: Level 3 disconnects Cogent. Mass hysteria ensues up to, and including policymakers in Washington, D.C. 7 Oct 2005: Level 3 reconnects Cogent
During the outage, Level 3 and Cogents singly homed customers could not reach each other. (~ 4% of the Internets prefixes were isolated from each other)
Terms
- Route: a network prefix plus path attributes
- Customer/provider/peer routes: route
advertisements heard from customers/providers/peers.
- Transit service: If A advertises a route to B, it
implies that A will forward packets coming from B to any destination in the advertised prefix
Duke NC RegNet UNC 152.3/16 152.3/16
152.3.137.179 152.2.3.4
BGP version 4
- Design goals:
– Scalability as more networks connect – Policy: ASes should be able to enforce business/routing policies
- Result: Flexible attribute structure, filtering
– Cooperation under competition:
- ASes should have great autonomy for routing and
internal architecture
- But BGP should provide global reachability
BGP
Route Advertisement Autonomous Systems (ASes) Session (over TCP) Traffic BGP peers
- BGP messages
– OPEN – UPDATE
- Announcements
– Dest Next-hop AS Path … other attributes … – 128.2.0.0/16 196.7.106.245 2905 701 1239 5050 9
- Withdrawals
– KEEPALIVE
- Keepalive timer / hold timer
- Key thing: The Next Hop attribute
Path Vector
- ASPATH Attribute
– Records what ASes a route went through – Loop avoidance: Immediately discard – Short path heuristics
- Like distance vector, but fixes the count-to-
infinity problem
An example of BGP advertisement
- BGP routing table entry for 152.3.0.0/16, version 1009002
- Paths: (36 available, best #10, table default)
- Not advertised to any peer
- Refresh Epoch 1
- 54728 20130 6939 11164 81 13371
- 140.192.8.16 from 140.192.8.16 (140.192.8.16)
- Origin IGP, localpref 100, valid, external
- rx pathid: 0, tx pathid: 0
- Refresh Epoch 1
- 58901 51167 3356 209 81 13371
- 93.104.209.174 from 93.104.209.174 (93.104.209.174)
- Origin IGP, localpref 100, valid, external
- rx pathid: 0, tx pathid: 0
- Refresh Epoch 1
Two Flavors of BGP
- External BGP (eBGP): exchanging routes between ASes
– External peers typically directly connected
- Internal BGP (iBGP): disseminating routes to external destinations
among the routers within an AS
– Internal peers are not – Require IGP to find routes eBGP iBGP
Why iBGP?
- Most ASes have more than one border router that
talks to other peers
- Must disseminate information inside the AS and
through the AS.
– Must be loop-free. – Must have complete visibility.
- AS is a monolithic entity, so routers must be consistent
- For every external destination, each router picks the same route that
it would have picked had it seen the best routes from each eBGP router in the AS.
BGP
Route Advertisement Autonomous Systems (ASes) Session (over TCP) Traffic A B
iBGP
- iBGP is not an IGP
– Does not set up forwarding state internally! – Requires that you have an IGP so that all routers can talk to all other routers
- Original: Full mesh iBGP
– Simple! All routers see all routes – But, causes scaling problems.
- If e border routes, e(e-1)/2 iBGP sessions
- Route Reflectors and Confederations
BGP Decision Engine
Best Route Selection Apply Import Policies Best Route Table Apply Export Policies Install forwarding Entries for best Routes. Receive BGP Updates Best Routes Transmit BGP Updates Based on Attribute Values IP Forwarding Table
Best path selection
- Comparison of a list attributes
1. Weight (don’t worry about it, proprietary) 2. Local Preference
- Used to express peer/provider/cust, etc., and outbound load
balancing
3. AS Path length 4. Origin (iGP> eBGP > iBGP) 5. MED – Multi-exit discriminator
- Set by the route sender as an inbound load balancing / locality
suggestion
6. If all the above are the same, prefer the route that can be reached via the closest IGP neighbor. 7. If the IGP costs are the same, prefer the router with lowest router id.
Enforcing business relationships
- Two mechanisms:
- Route export filters
– Control what routes you send to neighbors
- Route import ranking
– Controls which route you prefer of those you hear. – “LOCALPREF” – Local Preference. More later.
Export Policies
- Provider à Customer
– All routes so as to provide transit service
- Customer à Provider
– Only customer routes – Why? – Only transit for those that pay
- Peer à Peer
– Only customer routes
Import policies
- Same routes heard from providers, customers,
and peers, whom to choose?
– customer > peer > provider – Why? – Choose the most economic routes!
- Customer route: charge $$ J
- Peer route: free
- Provider route: pay $$ L
9/27/18
Forwarding Table Forwarding Table
Joining BGP with IGP Information
AS 7018 AS 88
192.0.2.1 128.112.0.0/16 10.10.10.10
BGP
192.0.2.1 128.112.0.0/16 destination next hop 10.10.10.10 192.0.2.0/30 destination next hop
128.112.0.0/16 Next Hop = 192.0.2.1
128.112.0.0/16 destination next hop 10.10.10.10
+
192.0.2.0/30 10.10.10.10
Load balancing
- Same route from two providers
- Outbound is easy (you have control)
– Set localpref according to goals
- Inbound is tough (nobody has to listen)
– AS path prepending – MEDs
- Hot and Cold Potato Routing (picture)
- Often ignored unless contracts involved
- Practical use: tier-1 peering with a content provider
9/27/18
Hot-Potato Routing (early exit)
NYC SF SF NYC AT&T Sprint
Cold-Potato Routing (MED)
NYC SF SF NYC Med=100 Med=200 Akamai Sprint
Summary
- Internet is a set of federated independent networks
- They must play nicely for everybody to be connected
to everybody else
- Routing is done using BGP