Deploying IP Anycast: Carnegie Mellon Network Group
Deploying IP Anycast: Carnegie Mellon Network Group
Kevin Miller
Carnegie Mellon Network Group
[email protected]
NANOG 29 October 2003
Overview
Why anycast?
Agenda
What is Anycast?
Deploying IPv4 anycast services
Anycast usage case studies
Advanced Topics
Not Unicast
Unicast: Single host receives all traffic
Not Multicast
Multicast: Many hosts receive (all) traffic
to multicast group
Anycast
Multiple nodes configured to accept
traffic on single IP address
Usually, one node receives each
packet
Packet could be dropped like any other
Preferably only one node receives
packet, but no absolute guarantee
Anycast
Three nodes configured with
anycast address (10.5.0.1)
Anycast
Potentially equal-cost multi-path
Anycast
Sequential packets may be
delivered to different anycast
nodes
Anycast
Traffic from different nodes may
follow separate paths
10
Anycast
Server receiving a packet is
determined by unicast routing
Sequential packets from a client to
an anycast address may be
delivered to different servers
Best used for single
request/response type protocols
11
Anycast
Clients, servers, and routers
require no special
software/firmware
Does not negatively interfere with
existing networks
Just leveraging existing
infrastructure
12
Anycast Documented
Concept discussed in RFC1546
(11/93)
Current practices have evolved from
operational experience
CIDR eliminated a hurdle from 1546
Anycast Documented
IPv6 anycast different, will discuss later
Agenda
Deploying IPv4 anycast
services
15
Address selection
Host configuration
Service configuration
Network configuration
Monitoring and using anycasted
service
Address Selection
Current practice is to assign anycast
addresses from unicast IP space
Designate small subnet(s) for anycast
use
Consider best practices of inter-domain
routing announcements
/24 is a popular selection
Subnet may not be attached to any
interface
16
Host Configuration
Hosts need to be configured to
accept traffic to anycast address
Want to maintain a unique
management address on each host
Typically, anycast addresses are
configured as additional loopbacks
Make sure ingress filters are
updated!
17
Configuring Addresses
Linux
# ifconfig lo:1 10.5.0.1 netmask 255.255.255.255 up
# ifconfig lo:1
lo:1
Link encap:Local Loopback
inet addr:10.5.0.1 Mask:255.255.255.255
UP LOOPBACK RUNNING MTU:16436 Metric:1
OpenBSD
# ifconfig lo0 alias 10.5.0.1 netmask 255.255.255.255
# ifconfig lo0
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 33224
inet 127.0.0.1 netmask 0xff000000
inet 10.5.0.1 netmask 0xffffffff
18
Configuring Addresses
Solaris
# ifconfig lo0 addif 10.5.0.1/32 up
Created new logical interface lo0:1
# ifconfig lo0:1
lo0:1: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4>
inet 10.5.0.1 netmask ffffffff
19
Network Configuration
Correctly configuring the network
may be the trickiest aspect of
anycast
Intra-domain vs. inter-domain
configuration
20
Intra-Domain
Configuration
If the anycasted service is entirely
within your routing domain, only
intra-domain consideration is
needed
All anycast nodes are within domain
Or multiple intra-domain locations
22
23
25
Inter-Domain
Configuration
Follow traditional BGP operating
rules
Announce from a consistent origin AS
Advertise the service/anycast
supernet
Limit route flapping
Provider-independent IP space
27
Inter-Domain
Configuration
Intra-domain routing must be
correct
Servers can be iBGP peered; network
style announcement on the host
Can use IGP with redistribution
28
Inter-Domain
Configuration
Some deployments distinguish global
nodes from local nodes
Global nodes are announced without limitation;
upstream provides transit
Local nodes add no-export community to
limit the clients that will use the node
Why?
Money (global/local imply different
relationships)
Node stability, capabilities (due to service
area)
29
Inter-Domain
Configuration
AS6551
AS6551
55
End
End
Site
Site
Global 1
10.5.0.1/24
AS65500
AS65510
AS65510
Transit
Transit
Peer
Peer
AS65530
AS65530
NoExport
NoExport
Peer
Peer
30
AS6553
AS6553
55
End
End
Site
Site
AS6550
AS6550
55
End
End
Site
Site
AS6550
AS6550
11
Transit
Transit
AS6552
AS6552
00
NoExpor
NoExpor
Local
tt 1
10.5.0.1/24
AS65500
AS6552
AS6552
55
End
End
Site
Site
Service Configuration
Obviously depends on implementation
Configure service to listen on anycast IP
Most require no special configuration
Verify that service responds from anycast
address when queried
May want to limit service to listen only on
anycast IP address
Monitoring
Monitoring is more complicated
Could monitor the unique (nonanycast) IPs, but doesnt verify the
actual service
Monitoring the anycast (service) IP
cant be done centrally
Distributed monitoring needed for
distributed service
Also want to monitor routes
34
Agenda
What is Anycast?
Deploying IPv4 anycast services
Anycast usage case studies
Advanced Topics
35
Anycast in Action
Authoritative DNS
AS 112
Root Servers: F, I, K, others
.ORG Top Level Domain
Caching DNS
Anycast for Multicast RP
Anycast Sink Holes
6to4 routers (RFC3068)
36
AS112 Project
Problem: Many clients try queries and
updates for/to RFC1918/link local
reverse zones
Goal: Reduce unnecessary root server
load from these queries/updates
Solution: Delegate reverse zones to
anycasted black-hole servers.
www.as112.net
37
AS112 Project
Black-hole servers use IPs in
192.175.48.0/24
38
Configuring BGP
One Vendor..
router bgp 112
bgp router-id 192.175.48.254
network 192.175.48.0
neighbor PEER_IP remote-as PEER_AS
neighbor PEER_IP ebgp-multihop
neighbor PEER_IP next-hop-self
[http://www.chagreslabs.net/jmbrown/research/as
112/]
Another Vendor..
policy-statement advertise-aggregate {
term first-term {
from protocol aggregate;
then accept;
}
term second-term {
from route-filter 192.175.48.0/24 longer;
then reject;
}
}
[continued]
39
Configuring BGP
Another Vendor..
# set routing-options aggregate route 192.175.48.0/24
[edit
# set
# set
# set
# set
40
AS112 Project
BIND Configuration
zone 10.in-addr.arpa { type master; file db.RFC-1918; };
zone 254.169.in-addr.arpa { type master; file db.RFC-1918; };
...
41
Root Servers
Problems:
Low concentration of root servers outside
the US (high latency, higher cost links)
DoS attacks hurt the root servers and
infrastructure in between
Cant just add more NS records to root zone
Root Servers
F root server (ISC) anycasted
First cloned node announced Nov.
2002
Now have 12 locations
Common origin AS3557
Second hop AS for local nodes also
assigned to the ISC
43
45
Caching DNS
Problems:
Hosts respond poorly when caching
nameserver is unreachable
Caching NS is hard to re-IP (static
configs)
Caching DNS
We designated 128.2.1.0/26 for intradomain anycast use (from our IP
space)
Two caching server IPs: 128.2.1.10,
128.2.1.11
Using BIND9
Configured on 4 servers; 6 interfaces
Addresses assigned by DHCP, PPP
47
Caching DNS
Each server runs host-based
routing daemon (Quagga) to join
OSPF cloud
Using OSPF NSSA areas to hosts
Minimizes the number of routes on the
servers
Enables multiple interfaces on servers
in separate NSSA areas but no
forwarding through server
48
49
50
51
Host-Based Router
Config
quagga.conf
ospfd.conf
interface eth0
ip address 128.2.4.21/26
!
interface lo:1
ip address 128.2.1.10/32
!
interface lo:2
ip address 128.2.1.11/32
interface eth0
ip ospf authentication message-digest
ip ospf message-digest-key 1 md5 [key]
!
router ospf
ospf router-id 128.2.4.21
ospf abr-type cisco
compatible rfc1583
area 128.2.4.0 authentication message
area 128.2.4.0 nssa
network 128.2.4.21/26 area 128.2.4.0
redistribute connected
distribute-list 50 out connected
!
access-list 50 permit host 128.2.1.10
access-list 50 permit host 128.2.1.11
52
Multicast RP
Problem:
PIM-SM specifies one active RP per multicast
group at a time
A routing domain may be too large for this to be
feasible (RP on the other coast)
Slow failover if RP fails
Not directly possible for shared-tree load
balancing
Multicast RP
Designate more than one RP
Assign anycast address as loopback
on each RP
Configure all other routers to use
anycast address as RP for all groups
Setup MSDP mesh among all RPs
(using unique addresses)
RP address cannot be used in SA
messages
54
Multicast RP
RP Routers
interface Loopback0
description Router Management
ip address 10.2.4.249 255.255.255.255
ip pim sparse-mode
interface Loopback1
description Anycast RP Interface
ip address 10.2.1.130 255.255.255.255
ip pim sparse-mode
!
ip msdp peer 10.2.4.248 connect-source Loopback0
ip msdp peer 10.2.4.250 connect-source Loopback0
ip msdp mesh-group CMU-MSDP 10.2.4.248
ip msdp mesh-group CMU-MSDP 10.2.4.250
ip msdp cache-sa-state
ip msdp originator-id Loopback0
Non-RP Routers
ip pim rp-address 10.2.1.130 override
ip pim accept-rp 10.2.1.130
55
Multicast RP
56
RP Routers
Non-RP Routers
Multicast RP
Non-Anycast RP
Single RP for
Group(s)
Source
RP
RP might be
inconvenient
for shared
tree
Receiver
57
eBGP,
MBGP
Speaking
Routers
Multicast RP
Anycast RP
MSDP
Mesh,
Unique
Addresses
RP
Receiver
58
RP
Multiple RPs
for same
group(s)
Can optimize
RP placement
for locality
Source
RP
eBGP,
MBGP
Speaking
Routers
Anycast Sinkholes
Problem: Homeless network traffic (e.g.
turbo worms, backscatter, etc) can cause
problems for core routers to sink;
sinkholes help but also dont want to
send traffic across large network to sink
Goal: Want to be able to forward traffic to
multiple sinkhole points for analysis
Solution: Use anycast to enable
distributed sinkholes throughout a large
network
59
Anycast Sinkholes
Traffic can be directed to sinkhole via:
default route
pieces of unused IP space
BGP next-hop triggering, ex: for DoS victims
60
6to4 Routers
Problem: Connecting islands of v6
across existing v4 infrastructure
involves 6to4 relay routers
Goal: Provide an easy way for end
sites to locate relays into the native
v6 world
Solution: Use a well-known IPv4
anycast prefix for 6to4 relay routers
61
6to4 Routers
Native IPv6 Site
Using 6to4
Prefix
6to4
R
IPv4 Backbone
Advertise
0::/0
internally
6to4
RR
Advertise
anycast v4 6to4
prefix
192.88.99.0/24
IPv6 Backbone
62
6to4
RR
Advertise
2002::/16
to
v6
backbone
TCP-Based Services
Unwise to use anycast for long-term
TCP services, due to route changes
Experience shows that routes are
generally stable, though
Especially inter-domain, due to routing
protocols
Equal cost load balancing would cause
problems
But, routers often do flow path caching
63
TCP-Based Services
Very few knobs to direct traffic in
response to server load, as well
as long as you don't make silly assumptions about client
locality based on "which anycasted server heard it", such that
you give back incoherent answers in hopes that they will be
somehow client-optimal, bgp-anycast isn't even
controversial at this point in time.
- Paul Vixie, 4/03
64
65
Agenda
What is Anycast?
Deploying IPv4 anycast services
Anycast usage case studies
Advanced Topics
Multi-homed hosts
IPv6
66
Multi-Homed Hosts
Multi-homing at the host physical
interface
Can be used with anycast addressing
Special case: single multi-homed host
configured with anycast address
67
IPv6 Anycast
IPv6 Anycast, per RFC3513, is different
from shared-unicast addressing (what
were calling anycast)
3513: Eliminate constraints on routing
infrastructure, upper-layer protocols
Decouple Anycast from any thought about
TCP/UDP (and still make it work)
Shared Unicast IPv6 would generally map
from v4 experiences
69
RFC3513
Anycast
Shared Unicast
Identifying
anycast
dest.
Deterministi
c
packet
delivery
Anycast
host
addresses
Disallowed; routers
only
No restriction
Anycast as
Disallowed
source addr.
IPsec
70
RFC3513
Anycast
Shared Unicast
Why?
Questions
hostsformat
Same address
format about
Samehow
address
into domain.
as unicast announce routes
as unicast
Shared-unicast solutions apply.
Deterministi
c
packet
delivery
Anycast
host
addresses
Disallowed; routers
only
No restriction
Anycast as
Disallowed
source addr.
IPsec
Anycast
host
addresses
71
RFC3513
Anycast
Anycast as
Disallowed
source addr.
IPsec
Shared Unicast
No restriction
IPv6 Anycast
Improvements
Allow hosts to have 3513 Anycast addresses
Just need to define mechanism(s) for announcing
routes into domain
74
128-n bits
subnet prefix
0000000000000
n bits
subnet prefix
64 bits
subnet prefix
121-n bits
7 bits
11111111111
anycast ID
57 bits
7 bits
111111011..11 anycast ID
Summary
Anycast is relatively simple to
deploy in existing networks
Operators are finding new uses for
it in different areas
Look for some changes as v6
comes around
76
Questions?
Presentation resources:
http://www.net.cmu.edu/pres/anyca
st
Kevin Miller: [email protected]
77
Identifying Specific
Node
F Root Server
dig hostname.bind @f.root-servers.net chaos txt
K Root Server
dig id.server @k.root-servers.net chaos txt
83