svrN. Spring 2002. CS 461. 11. Consistent Hashing (CHash). • Hash server, then
URL. • Closest match. • Only local mapping changes after adding or removing.
Design Space • Caching
Content Distribution Networks
– explicit – transparent (hijacking connections)
Outline
• Replication
Implementation Techniques Hashing Schemes Redirection Strategies
Spring 2002
CS 461
– server farms – geographically dispersed (CDN)
1
Spring 2002
CS 461
2
Denial of Service Attacks (DoS)
Story for CDNs • Traditional: Performance (Response Time) – move content closer to the clients – avoid server bottlenecks
client
client
• New: Flash Crowds & DDoS (System Throughput) – distribute load over massive resources – multiplicatively raise level of resources needed to attack server
attacker Spring 2002
CS 461
3
Spring 2002
CS 461
client 4
Distributed DoS (DDoS)
Redirection Overlay Geographically distributed server clusters
zombie attacker
R
R
client client
R R
Internet Backbone
server R slave attacker zombie
R
R client zombie
Spring 2002
R clients
zombie CS 461
5
Distributed request-redirectors
Spring 2002
CS 461
6
Techniques
CDN Components • DNS aaa.com
bbb.com
ccc.com
– one name maps onto many addresses – works for both servers and reverse proxies
Backend servers Cache
• HTTP – requires an extra round trip
Geographically distributed surrogate servers
• Router – one address, select a server (reverse proxy) – content-based routing (near client)
Redirectors
• URL Rewriting
Cl ients
Spring 2002
CS 461
– embedded links 7
Spring 2002
CS 461
8
Redirection: Which Replica?
Hashing Schemes: Modulo
• Balance Load • Cache Locality • Network Delay
svr0
URL (key)
%
• Easy to compute • Evenly distributed • Good for fixed number of servers • Many mapping changes after a single server change
svrN
Spring 2002
CS 461
9
Spring 2002
CS 461
Highest Random Weight (HRW)
Consistent Hashing (CHash)
high
url-0
• Hash server, then URL • Closest match svr1 • Only local mapping changes after adding or removing servers • Used by State-of-the-art CDNs
URL
weight0
svr0
svrN
url-1 svr2
Unit circle Spring 2002
10
CS 461
11
RH svr0 svr1 svr2 svr svr svrN Spring 2002
sort
• •
weight1 weight2
• •
Hash(url, svrAddr) Deterministic order of access set of servers Different order for different URLs Load evenly distributed after server changes
weight0 weightN
low CS 461
12
Redirection Strategies
Redirection Strategies (cont)
• Random (Rand)
• Coarse Dynamic Replication (CDR)
– Requests randomly sent to cooperating servers – Baseline case, no pathological behavior
– – – –
• Replicated Consistent Hashing (R-CHash) – Each URL hashed to a fixed # of server replicas – For each request, randomly select one replica
• Fine Dynamic Replication (FDR)
• Replicated Highest Random Weight (R-HRW)
– Bookkeeping min # of replicas of URL (popularity) – Let more popular URL use more replicas – Keep less popular URL from extra replication
– Similar to R-CHash, but use HRW hashing – Less likely two URLs have same set of replicas
Spring 2002
CS 461
Using HRW hashing to generate ordered server list Walk through server list to find a lightly loaded one # of replicas for each URL dynamically adjusted Coarse grained server load information
13
Spring 2002
CS 461
C
Network Topology
Simulation
C
C
WA
R
R
R
R
MA
IL
C
C
R
R
PA CA
Models network, application, and OS Built on NS + LARD simulators 100s of servers, 1000s of clients >60,000 req/s using full-TCP transport Measure capacity, latency, and scalability
R
R
S
R
MI C
• End-to-end network simulator prototype – – – – –
C
C
S
– Server overload, network congestion…
S
S
R
• Identifying bottlenecks
14
NE
C
R
CO R
S
DC R
S
R
SD CA
S
S
GA TX
R C
S
R C
R
C C
S – Server, C – Client, R - Router Spring 2002
CS 461
15
Spring 2002
CS 461
16
Capacity: 64 server case
Simulation Setup
Normal Operation 35000
• Workload Throughput req/s
– Static documents from Web Server trace, available at each cooperative server – Attackers from random places, repeat requesting a subset of random files
• Simulation process
30000 25000 20000 15000 10000 5000 0
– Gradually increase offered request load – End when servers very heavily overloaded
Rand CDR
R-CHash FDR
R-HRW FDR-Ideal
A single server can handle ~600 req/s in simulation Spring 2002
CS 461
17
Spring 2002
Under Attack (250 zombies, 10 files, avg 6KB)
Random’s Max: 11.2k req/s R-HRW CDR
40000
R-CHash Rand
R-CHash Max: 19.8k req/s R-HRW FDR
FDR
20000 10000 0 R-CHash FDR
R-HRW FDR-Ideal
CS 461
80 60 40 20
80 60 40 20
0
0 0.1
A single server can handle ~600 req/s in simulation 19
R-CHash CDR
100 CDF of Response
100
30000
CDF of Response
Throughput req/s
50000
Rand CDR
18
Latency: 64 Servers Under Attack
Capacity: 64 server case
Spring 2002
CS 461
1 10 100 Response Time in Logscale (Seconds)
Spring 2002
CS 461
0.1
1 10 100 Response Time in Logscale (Seconds) 20
Latency At CDR’s Max: 35.1k req/s
Normal Operation
CDR Throughput req/s
CDF of Response
100 80 60 40 20 0
45000 40000 35000 30000 25000 20000 15000 10000 5000 0 0
0.1
1 10 100 Response Time in Logscale (Seconds)
Spring 2002
CS 461
16
32 CDR
21
Spring 2002
Various Attacks (32 servers) 1 victim file, 1 KB
Throughput req/s
Throughput req/s
25000 20000 15000 10000 5000 0 400
500
600
700
800
Num of Zombies (slave attackers)
Rand Spring 2002
R-HRW
96 112 128
0
16
32
48
64
80
96 112 128
Num of Servers
Num of Servers R-HRW Rand
CDR CS 461
R-HRW
Rand 22
• Servers join DDoS protection overlay – Same story as Akamai – Get protection and performance
25000 20000 15000
• Clients use DDoS protection service
10000
– Same story as proxy caching – Incrementally deployable – Get faster response and help others
5000 0
300
64 80
Deployment Issues
30000
30000
200
48
50000 45000 40000 35000 30000 25000 20000 15000 10000 5000 0
10 victim files, avg 6KB
35000
100
Under Attack (250 zombies, 10 files)
Throughput req/s
FDR
Capacity Scalability
100
200
300
400
500
600
700
800
Num of Zombies (slave attackers)
CDR
Rand CS 461
R-HRW
CDR 23
Spring 2002
CS 461
24