1
Lecture 8: Naming
Challenge: how do we efficiently locate wide area resources? Naming: name -> IP address Routing: IP address -> packet delivery
More generic challenge: how do we build wide area services? Cache and replica coherence Computation in the network
2
Domain Name System (DNS)
Design Assumptions Names have global scope -- they mean the
same thing everywhere Names are organized hierarchically
– ex: cnn.com, june.cs.washington.edu– each subtree can be assigned to different org
Caching and replication for performance, availability
Weak consistency to simplify implementation
3
Hierarchical Name Space
Ex: june.cs.washington.edu, june.com OK to reuse names in different parts of tree
root
edumilorg ukcom ca
gwu wustl washington wsu mit
june ward beaver
4
Name Space Delegation
Each organization controls its own name space (“zone” = subtree of global tree) each org has its own name servers
– replicated for availability
name servers translate only org names– client lookup proceeds step-by-step
5
DNS Lookup Example
client local DNS proxy
Root&edu DNS server
washington DNS server
cs DNSserver
cs.washington.edu
washingt
on=IPadd
rcs.w
ashingto
n.edu
cs=IPaddr’june=IPaddr’’
6
Performance and Availability
DNS servers are replicated name service available if >= one replica is up queries load balanced between replicas
DNS queries are cached at local proxy quick response for repeated translations partial name caching (edu, washington.edu,
cs.washington.edu, june.cs.washington.edu)
7
DNS Cache EffectivenessDestination Host Locality
(time since host last accessed)
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
0.1 1 10 100Seconds
Cu
mu
lati
ve
Fra
cti
on
All Flows
Inter-hos t only
8
Replica/Cache Coherence
How do we keep replicas/cached copies up to date?
DNS solution: eventual consistency periodic downloads from master to replicas cached data periodically times out
– proxy must re-query server
ok if old data is provided temporarily?
9
Eventual Consistency Example
Serverreplicas
clients
t+k:x’
x’
t+1:x ok
t+1:reget x
t:x’
t+q:x’
t+q:reget x
10
Coherence Models
Sequential consistency all operations appear as if to a single, shared
memory Causal consistency
concurrent ops can occur in any order Processor consistency
all ops by same host performed in order Eventual consistency
11
Implementing Cache Coherence
User managed cache ex: hit reload to get up-to-date version
Timeouts (NFS, WWW, DNS) client periodically polls server for newest
version Callbacks (AFS, SMPs, transactions)
server notifies client whenever data changes invalidation or update
12
Sequential Consistency Example
Serverreplicas
clients
t+1:x’
x’
t+2:x’ t:x’
t+2:ack
t+1:x’
t+3:ack t+5:ack
t+4:ack
Write doesn’t complete until all copies invalidated or updated
13
DNS Experience?
Single instance of globally distributed database in widespread use
Caching/replication crucial for performance Simple consistency model
easy to implement, crucial for heterogeneity System is difficult to evolve Surprises:
negative caching, ...
14
Active Networks
Motivation Flexibility: can take decades to deploy new
protocols Performance: need to put functionality at most
effective point in network Approaches:
active packets -- programs in IP packets active routers -- programmable routers active services -- put servers in network
15
Active Names Motivation
Services have become complex, distributed programs
Clients have become heterogeneous Implies need for:
Flexibility– client/service should be able to use any protocol
Performance– client/service should be able to move functionality
into network
DNS Server
URL
Host BindingIP Address
Image (1024X768)Proxy Server
•Static name -> IP address binding
•Naming and transport separate
•Names have global scope
DNS Naming Reconsidered
•Not flexible or extensible
17
Adding Flexibility to Naming
Replica management HTTP redirect
– front end replies with server name– client reissues request to server
DNS round robin– rotate order of replicas provided to query
Cisco Local Director/Distributed Director– transparent redirection in routers
load balancing vs. distance, failover?
18
More Naming Flexibility
Customization server customizes content to specific client
– mycnn.com, advertisement rotation
client customizes content– format to display
Deployment of new IP features mobility, larger address space
19
More Naming Flexibility
Location independent objects Universal resource names (URNs)
– URLs that can change servers– proposal: sed scripts to mangle names
Global object systems (e.g., Globe, Legion)– how do you scalably locate mobile objects?
•Context-sensitive naming–User types cnn.com.
–If client is behind a modem, it gets back a b/w image.
–If client is a palm pilot, it gets a distilled image.
–If the client is in Europe, it goes to the European replica.
•Combine naming and transport in one framework.
•Provide flexibility and extensibility in the way wide area resources are accessed.
Active Names Scenario
Active Names: Basic Idea
DataName Programs
•Names resolved to mobile, secure programs Flexibility
•Active Names organized into hierarchical namespaces. A program is associated with each namespace.
•Namespace programs can be changed Extensibility.
•Active Names are connection oriented: better end-to-end semantics and performance.
Programming Model
Location independent programs» Programs may run on any AN node
Stream data model» Each program operates on a data stream
which is the result of the previous program Continuation passing style
» Control does not have to return to the caller
Request Program1 Program2
Client Proxy Server
23
Performance Gains
Client Proxy Server
Server
Client Proxy
•Application customized transport protocols.
•Programs are location independent. Location can be chosen to optimally utilize resources (e.g., distillation).
•Customization can be performed close to client instead of at the server (e.g., to cache dynamic content).
•3 way RPC
Delegation Active names organized in a hierarchy of
namespaces
Namespace programs can delegate to subordinate namespaces
Composing Services
Root-HTTP
cnn yahoo ...
25
Composing Services
After methods Continuation passing style programming Namespace programs bundle remaining work
into “after methods” before passing control – [Customizer|http|reply] -->[prefetch|http|distill|reply]
26
Security
•Protection between active name programs provided by Java’s type safety mechanism.
•Caller passes a certificate to the callee granting it a subset of its rights (e.g., to translate name).
•Transitive closure of the certificates determines the rights of a principal (e.g., to provide service).
•For instance, each caller might grant its callee the right to respond to the client.
Microkernel Architecture
Virtual MachineResolverNW
$Local Resources
NamespacesHttp DNS
Distiller Hit Count
...
Utilities
28
Application 1: Replica Selection
DNS Round-Robin» Randomly choose replica
» Avoid hot-spots
Distributed Director» Route to nearest replica
» Geographic locality
Active Naming» Previous performance, distance
» Adaptive
DNS Round-Robin» Randomly choose replica
» Avoid hot-spots
Distributed Director» Route to nearest replica
» Geographic locality
Active Naming» Previous performance, distance
» Adaptive
BerkeleyReplica
SeattleReplica
BerkeleyClients
29
Replica Selection
0
0.05
0.1
0.15
0.2
0.25
0.3
0 5 10 15
Offered Load
Res
pon
se T
ime
(s)
NearestRandomActive
30
Application 2: Mobile Distillation
Clients name a single object Return object based on client
network connection, screen Current approach [Fox97]
Proxy maintains client profile
Requests object, distills Active naming
Transmit name + applet
Flexible distillation point
Tradeoff computation/bw
Support mobile clients
Client-Specific Naming
Variables: Network Screen
31
Application 2: Mobile Distillation
0
10
20
30
2 3 4 6 8 10 12 15 20
Number of Clients
Dis
tilla
tio
n L
ate
nc
y (
s)
Active
Server
Proxy
Distillation at
•Server: Saves bandwidth
•Proxy: Saves server CPU cycles
•Active: Cost estimate of both approaches
32
Application 3: Customization
•Client customization: distilling the image
•Server customization: ad rotation, server-side includes.
•Composing these customizations using Active Names leads to 2-fold improvement in performance:
-Server customization can take place at proxy.
-Distillation further improves performance.
33
Application 4: Active Caches
Reason Requests Possible Strategy
Dynamic 20.7% Replace CGI w/AN Program
Consistency Polling 9.9% Server driven consistency
“Uncachable” 9.2% AN for hit counting, customization
Compulsory 44.8% Prefetching
Redirect 3.7% AN load balancing
Misc. 11.5% Error handling, prefetching, etc.
How to improve on 50% cache hit rates?