Chapter 6
Chapter 6
Chapter 6
Naming
Essence
Names are used to denote entities in a distributed system. To operate on an
entity, we need to access it at an access point. Access points are entities that
are named by means of an address.
Note
A location-independent name for an entity E, is independent of the addresses
of the access points offered by E.
Naming Names, identifiers, and addresses
Identifiers
Pure name
A name that has no meaning at all; it is just a random string. Pure names can
be used for comparison only.
Observation
An identifier need not necessarily be a pure name, i.e., it may have content.
Naming Flat naming
Broadcasting
Broadcast the ID, requesting the entity to return its current address
• Can never scale beyond local-area networks
• Requires all processes to listen to incoming location requests
Simple solutions
Naming Flat naming
Forwarding pointers
When an entity moves, it leaves behind a pointer to its next location
• Dereferencing can be made entirely transparent to clients by simply
following the chain of pointers
• Update a client’s reference when present location is found
• Geographical scalability problems (for which separate chain reduction
mechanisms are needed):
• Long chains are not fault tolerant
• Increased network latency at dereferencing
Simple solutions
Naming Flat naming
Home-based approaches
Single-tiered scheme: Let a home keep track of where the entity is
• Entity’s home address registered at a naming service
• The home registers the foreign address of the entity
• Client contacts the home first, and then continues with foreign location
Home-based approaches
Naming Flat naming
Home-based approaches
Naming Flat naming
Home-based approaches
Problems with home-based approaches
• Home address has to be supported for entity’s lifetime
• Home address is fixed ⇒ unnecessary burden when the entity
permanently moves
• Poor geographical scalability (entity may be next to client)
Note
Permanent moves may be tackled with another level of naming (DNS)
Home-based approaches
Naming Flat naming
Illustrative: Chord
Consider the organization of many nodes into a logical ring
• Each node is assigned a random m-bit identifier.
• Every entity is assigned a unique m-bit key.
• Entity with key k falls under jurisdiction of node with smallest id ≥ k
(called its successor succ(k)).
Nonsolution
Let each node keep track of its neighbor and start linear search along the ring.
Notation
We will speak of node p as the node have identifier p
Note: the i-th entry points to the first node succeeding p by at least 2i−1 .
Note: the i-th entry points to the first node succeeding p by at least 2i−1 .
• To look up a key k , node p forwards the request to node with index j
satisfying
q = FTp [j] ≤ k < FTp [j + 1]
Note: the i-th entry points to the first node succeeding p by at least 2i−1 .
• To look up a key k , node p forwards the request to node with index j
satisfying
q = FTp [j] ≤ k < FTp [j + 1]
• If p < k < FTp [1], the request is also forwarded to FTp [1]
Chord in Python
1 class ChordNode:
2
3 def __succNode(self, key):
4 if (key <= self.nodeSet[0] or
5 key > self.nodeSet[len(self.nodeSet)-1]): # key is in segment for which
6 return self.nodeSet[0] # this node is responsible
7 for i in range(1,len(self.nodeSet)):
8 if (key <= self.nodeSet[i]): # key is in segment for which
9 return self.nodeSet[i] # node (i+1) may be responsible
10
11 def __finger(self, i):
12 return self.__succNode((self.nodeID + pow(2,i-1)) % self.MAXPROC) # succ(p+2ˆ(i-1))
13
14 def __recomputeFingerTable(self):
15 self.FT[0] = self.nodeSet[(self.nodeInd - 1)%len(self.nodeSet)] # Predecessor
16 self.FT[1:] = [self.__finger(i) for i in range(1,self.nBits+1)] # Successors
17 self.FT.append(self.nodeID) # This node
18
19 def __localSuccNode(self, key):
20 if self.__inbetween(key, self.FT[0]+1, self.nodeID+1): # key in (pred,self]
21 return self.nodeID # this node is responsible
22 elif self.__inbetween(key, self.nodeID+1, self.FT[1]): # key in (self,FT[1]]
23 return self.FT[1] # successor responsible
24 for i in range(1, self.nBits+2): # go through rest of FT
25 if self.__inbetween(key, self.FT[i], self.FT[(i+1)]): # key in [FT[i],FT[i+1])
26 return self.FT[i] # FT[i] is responsible
Solutions
Solutions
• Topology-aware node assignment: When assigning an ID to a node,
make sure that nodes close in the ID space are also close in the network.
Can be very difficult.
Solutions
• Topology-aware node assignment: When assigning an ID to a node,
make sure that nodes close in the ID space are also close in the network.
Can be very difficult.
• Proximity routing: Maintain more than one possible successor, and
forward to the closest.
Example: in Chord FTp [i] points to first node in
INT = [p + 2i−1 , p + 2i − 1]. Node p can also store pointers to other nodes
in INT .
Solutions
• Topology-aware node assignment: When assigning an ID to a node,
make sure that nodes close in the ID space are also close in the network.
Can be very difficult.
• Proximity routing: Maintain more than one possible successor, and
forward to the closest.
Example: in Chord FTp [i] points to first node in
INT = [p + 2i−1 , p + 2i − 1]. Node p can also store pointers to other nodes
in INT .
• Proximity neighbor selection: When there is a choice of selecting who
your neighbor will be (not in Chord), pick the closest one.
Principle
Hierarchical approaches
Naming Flat naming
Hierarchical approaches
Naming Flat naming
Looking up a location
Hierarchical approaches
Naming Flat naming
(a) (b)
Hierarchical approaches
Naming Flat naming
Notation
• Assume there are a total of N physical hosts {H1 , H2 , . . . , HN }. Each host
is capable of running one or more location servers.
• Dk (A) denotes the domain at level k that contains address A; k = 0
denotes the root domain.
• LSk (E, A) denotes the unique location server in Dk (A) responsible for
keeping track of entity E.
Hierarchical approaches
Naming Flat naming
Hierarchical approaches
Naming Flat naming
Hierarchical approaches
Naming Flat naming
Self-certifying names
Use a value derived from the associated entity and make it (part of) the flat
name:
• id(entity) = hash(data associated with the entity)
when dealing with read-only entities, otherwise
• id(entity) = public key(entity)
in which case additional data is returned, such as a verifiable digital signature.
Name space
Naming graph
A graph in which a leaf node represents a (named) entity. A directory node is
an entity that refers to other nodes.
Note
A directory node contains a table of (node identifier, edge label) pairs.
Name spaces
Naming Structured naming
Name space
We can easily store all kinds of attributes in a node
• Type of the entity
• An identifier for that entity
• Address of the entity’s location
• Nicknames
• ...
Name spaces
Naming Structured naming
Name space
We can easily store all kinds of attributes in a node
• Type of the entity
• An identifier for that entity
• Address of the entity’s location
• Nicknames
• ...
Note
Directory nodes can also have attributes, besides just storing a directory table
with (identifier, label) pairs.
Name spaces
Naming Structured naming
Name resolution
Problem
To resolve a name, we need a directory node. How do we actually find that
(initial) node?
Name resolution
Naming Structured naming
Name resolution
Problem
To resolve a name, we need a directory node. How do we actually find that
(initial) node?
Name resolution
Naming Structured naming
Name resolution
Problem
To resolve a name, we need a directory node. How do we actually find that
(initial) node?
Note
You cannot have an explicit closure mechanism – how would you start?
Name resolution
Naming Structured naming
Name linking
Hard link
What we have described so far as a path name: a name that is resolved by
following a specific path in a naming graph from one node to another.
Name resolution
Naming Structured naming
Name linking
Hard link
What we have described so far as a path name: a name that is resolved by
following a specific path in a naming graph from one node to another.
Observations
• The name resolution process determines that we read the content of a
node, in particular, the name in the other node that we need to go to.
• One way or the other, we know where and how to start name resolution
given name
Name resolution
Naming Structured naming
Name linking
The concept of a symbolic link explained in a naming graph
Observation
Node n5 has only one name
Name resolution
Naming Structured naming
Mounting
Issue
Name resolution can also be used to merge different name spaces
transparently through mounting: associating a node identifier of another name
space with a node in a current name space.
Terminology
• Foreign name space: the name space that needs to be accessed
• Mount point: the node in the current name space containing the node
identifier of the foreign name space
• Mounting point: the node in the foreign name space where to continue
name resolution
Name resolution
Naming Structured naming
Name resolution
Naming Structured naming
Name-space implementation
Basic issue
Distribute the name resolution process as well as name space management
across multiple machines, by distributing nodes of the naming graph.
Name-space implementation
Basic issue
Distribute the name resolution process as well as name space management
across multiple machines, by distributing nodes of the naming graph.
Name-space implementation
Basic issue
Distribute the name resolution process as well as name space management
across multiple machines, by distributing nodes of the naming graph.
Name-space implementation
Basic issue
Distribute the name resolution process as well as name space management
across multiple machines, by distributing nodes of the naming graph.
Name-space implementation
Basic issue
Distribute the name resolution process as well as name space management
across multiple machines, by distributing nodes of the naming graph.
Name-space implementation
An example partitioning of the DNS name space, including network
files
Name-space implementation
A comparison between name servers for implementing nodes in a
name space
Scalability issues
Size scalability
We need to ensure that servers can handle a large number of requests per
time unit ⇒ high-level servers are in big trouble.
Scalability issues
Size scalability
We need to ensure that servers can handle a large number of requests per
time unit ⇒ high-level servers are in big trouble.
Solution
Assume (at least at global and administrational level) that content of nodes
hardly ever changes. We can then apply extensive replication by mapping
nodes to multiple servers, and start name resolution at the nearest server.
Scalability issues
Size scalability
We need to ensure that servers can handle a large number of requests per
time unit ⇒ high-level servers are in big trouble.
Solution
Assume (at least at global and administrational level) that content of nodes
hardly ever changes. We can then apply extensive replication by mapping
nodes to multiple servers, and start name resolution at the nearest server.
Observation
An important attribute of many nodes is the address where the represented
entity can be contacted. Replicating nodes makes large-scale traditional name
servers unsuitable for locating mobile entities.
Scalability issues
We need to ensure that the name resolution process scales across
large geographical distances
Problem
By mapping nodes to servers that can be located anywhere, we introduce an
implicit location dependency.
DNS
Essence
• Hierarchically organized name space with each node having exactly one
incoming edge ⇒ edge label = node label.
• domain: a subtree
• domain name: a path name to a domain’s root node.
Information in a node
Type Refers to Description
SOA Zone Holds info on the represented zone
A Host IP addr. of host this node represents
MX Domain Mail server to handle mail for this node
SRV Domain Server handling a specific service
NS Zone Name server for the represented zone
CNAME Node Symbolic link
PTR Host Canonical name of a host
HINFO Host Info on this host
TXT Any kind Any info considered useful
Modern DNS
Secure DNS
Basic approach
Resource records of the same type are grouped into a signed set, per zone.
Examples:
• A set with all the IPv4 addresses of a zone
• A set with all the IPv6 addresses of a zone
• A set with the name servers of a zone
The public key associated with the secret key used for signing a set of
resource records is added to a zone, called a zone-signing key.
Secure DNS
Naming in NFS
Observation
A server may export (a part of) its filesystem, which can then be imported by
different clients by mounting. Note that different clients will have different
(nonsharable) namespaces!
Attribute-based naming
Observation
In many cases, it is much more convenient to name, and look up entities
through their attributes ⇒ traditional directory services (aka yellow pages).
Directory services
Naming Attribute-based naming
Attribute-based naming
Observation
In many cases, it is much more convenient to name, and look up entities
through their attributes ⇒ traditional directory services (aka yellow pages).
Problem
Lookup operations can be expensive, as they require matching requested
attribute values, against actual attribute values ⇒ inspect all entities (in
principle).
Directory services
Naming Attribute-based naming
LDAP
Essence
• Directory Information Base: collection of all directory entries in an LDAP
service.
• Each record is uniquely named as a sequence of naming attributes
(called Relative Distinguished Name), so that it can be looked up.
• Directory Information Tree: the naming graph of an LDAP directory
service; each node represents a directory entry.
LDAP
Two directory entries having HostName as RDN
Distributed index
Basic idea
• Assume a set of attributes {a1 , . . . , aN }
• Each attribute ak takes values from a set R k
• For each attribute ak associate a set Sk = {S1k , . . . , Snkk } of nk servers
• Global mapping F : F (ak , v ) = Sjk with Sjk ∈ Sk and v ∈ R k
Observation
If L(ak , v ) is set of keys returned by F (ak , v ), then a query can be formulated
as a logical expression, e.g.,
F (a1 , v 1 ) ∧ F (a2 , v 2 ) ∨ F (a3 , v 3 )
Decentralized implementations
Naming Attribute-based naming
Decentralized implementations
Naming Attribute-based naming
(a) (b)
Decentralized implementations
Naming Attribute-based naming
Space-filling curve
Once the curve has been drawn
Consider the two-dimensional case
• a Hilbert curve of order k connects 22k subsquares ⇒ has 22k indices.
• A range query corresponds to a rectangle R in the 2-dimensional case
• R intersects with a number of subsquares, each one corresponding to an
index ⇒ we now have a series of indices associated with R.
Decentralized implementations
Naming Named-data networking
Named-data networking
Basics
• Retrieve an entity from the network by using that entity’s name and not
address.
• The network takes that name as input, and routes a request to a location
where the entity is stored.
• NDN takes over the role of IP in a future architecture of the Internet,
Example name
/distributed -systems.net/books/Distributed Systems/4/01/Naming
Basics
Naming Named-data networking
Routing
Question
Is there really a difference in attempting to route a request such as
distributed -systems.net/books/Distributed Systems/4/01/Naming
Key observation
Theres is no fundamental difference. We decide which part of a name or
address (i.e., a prefix) should be announced within a global routing substrate,
just as with IPv4 addresses with BGP routers.
Routing
Naming Named-data networking
Routing