1 / 65

Distributed Systems

Distributed Systems. Principles and Paradigms. Minqi Zhou. mqzhou@sei.ecnu.edu.cn. Chapter 05: Naming. Naming things. User names Login, email Machine names rlogin, email, web Files Devices Variables in programs Network services. Naming Service. Allows you to look up names

Download Presentation

Distributed Systems

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Distributed Systems Principles and Paradigms Minqi Zhou mqzhou@sei.ecnu.edu.cn Chapter 05: Naming

  2. Naming things • User names • Login, email • Machine names • rlogin, email, web • Files • Devices • Variables in programs • Network services

  3. Naming Service Allows you to look up names • Often returns an address as a response Might be implemented as • Search through file • Client-server program • Database query • …

  4. What’s a name? Name: identifies what you want Address: identifies where it is Route: identifies how to get there Binding: associates a name with an address • “choose a lower-level-implementation for a higher-level semantic construct” RFC 1498: Inter-network Naming, addresses, routing

  5. Names Need names for: • Services: e.g., time of day • Nodes: computer that can run services • Paths: route • Objects within service: e.g. files on a file server Naming convention can take any format • Ideally one that will suit application and user • E.g., human readable names for humans, binary identifiers for machines

  6. Uniqueness of names Easy on a small scale Problematic on a large scale Hierarchy allows uniqueness to be maintained compound name: set of atomic names connected with a name separator

  7. Terms: Naming convention Naming system determines syntax for a name • Unix file names: Parse components from left to right separated by //home/paul/src/gps/gui.c • Internet domain names: Ordered right to left and delimited by .www.cs.rutgers.edu • LDAP names Attribute/value pairs ordered right to left, delimited by ,cn=Paul Krzyzanowski, o=Rutgers, c=US

  8. Terms: Context • A particular set of name  object bindings • Each context has an associated naming convention • A name is always interpreted relative to some context • E.g., directory /usr in the UNIX file system

  9. Terms: Naming System Connected set of contexts of the same type (same naming convention) along with a common set of operations For example: • System that implements DNS • System that implements LDAP

  10. Terms: Name space Set of names in the naming system For example, • Names of all files and directories in a UNIX file system

  11. Terms: Resolution Name lookup • Return the underlying representation of the name For example, • www.rutgers.edu  128.6.4.5

  12. Naming 5.1 Naming Entities Naming Entities Names, identifiers, and addresses Name resolution Name space implementation 3 / 38

  13. Naming 5.1 Naming Entities 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 from the addresses of the access points offered by E. 4 / 38

  14. Naming 5.1 Naming Entities 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. Identifier A name having the following properties: P1: Each identifier refers to at most one entity P2: Each entity is referred to by at most one identifier P3: An identifier always refers to the same entity (prohibits reusing an identifier) Observation An identifier need not necessarily be a pure name, i.e., it may have content. 5 / 38

  15. Naming 5.2 Flat Naming Flat naming Problem Given an essentially unstructured name (e.g., an identifier), how can we locate its associated access point? Simple solutions (broadcasting) Home-based approaches Distributed Hash Tables (structured P2P) Hierarchical location service 6 / 38

  16. Naming 5.2 Flat Naming Simple solutions 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 Forwarding pointers When an entity moves, it leaves behind a pointer to 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 7 / 38

  17. Naming 5.2 Flat Naming Simple solutions 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 Forwarding pointers When an entity moves, it leaves behind a pointer to 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 7 / 38

  18. Naming 5.2 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 8 / 38

  19. Naming Home-based approaches Host's home 5.2 Flat Naming location 1. Send packet to host at its home 2. Return address of current location Client's location 3. Tunnel packet to current location 4. Send successive packets to current location Host's present location 9 / 38

  20. Naming 5.2 Flat Naming Home-based approaches Two-tiered scheme Keep track of visiting entities: Check local visitor register first Fall back to home location if local lookup fails 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) Question How can we solve the “permanent move” problem? 10 / 38

  21. Naming 5.2 Flat Naming Home-based approaches Two-tiered scheme Keep track of visiting entities: Check local visitor register first Fall back to home location if local lookup fails 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) Question How can we solve the “permanent move” problem? 10 / 38

  22. Naming 5.2 Flat Naming Home-based approaches Two-tiered scheme Keep track of visiting entities: Check local visitor register first Fall back to home location if local lookup fails 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) Question How can we solve the “permanent move” problem? 10 / 38

  23. Naming 5.2 Flat Naming Distributed Hash Tables (DHT) 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). Nonsolution Let node id keep track of succ(id) and start linear search along the ring. 11 / 38

  24. Naming 5.2 Flat Naming DHTs: Finger tables Principle Each node p maintains a finger table FTp [] with at most m entries: FTp [i] = succ(p + 2i−1 ) Note: FTp [i] 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] 12 / 38

  25. Naming 5.2 Flat Naming DHTs: Finger tables 4 Finger table 4 1 2 i-1 ) 2 3 4 5 2 9 9 18 + (p cc Actual node su 9 0 i 1 31 1 30 29 Resolve k = 12 3 2 3 4 5 9 9 14 20 1 2 3 4 5 1 1 1 4 14 28 4 27 5 from node 28 26 25 6 7 8 24 1 2 11 11 3 4 5 14 18 28 23 9 Resolve k = 26 from node 1 22 10 1 28 2 3 4 5 28 28 1 9 21 21 28 28 11 1 2 3 4 5 14 14 18 20 28 20 12 18 13 1 19 1 2 3 18 14 15 17 16 4 28 2 18 3 4 5 5 4 1 2 3 20 20 28 18 28 1 4 5 28 4 13 / 38

  26. Naming 5.2 Flat Naming Exploiting network proximity Problem The logical organization of nodes in the overlay may lead to erratic message transfers in the underlying Internet: node k and node succ(k + 1) may be very far apart. 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. 14 / 38

  27. Naming 5.2 Flat Naming Exploiting network proximity Problem The logical organization of nodes in the overlay may lead to erratic message transfers in the underlying Internet: node k and node succ(k + 1) may be very far apart. 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. 14 / 38

  28. Naming 5.2 Flat Naming Exploiting network proximity Problem The logical organization of nodes in the overlay may lead to erratic message transfers in the underlying Internet: node k and node succ(k + 1) may be very far apart. 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. 14 / 38

  29. Naming 5.2 Flat Naming Exploiting network proximity Problem The logical organization of nodes in the overlay may lead to erratic message transfers in the underlying Internet: node k and node succ(k + 1) may be very far apart. 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. 14 / 38

  30. Naming 5.2 Flat Naming Hierarchical Location Services (HLS) Basic idea Build a large-scale search tree for which the underlying network is divided into hierarchical domains. Each domain is represented by a separate directory node. The root directory node dir(T) Top-level domain T Directory node dir(S) of domain S A subdomain S of top-level domain T (S is contained in T) A leaf domain, contained in S 15 / 38

  31. Naming 5.2 Flat Naming HLS: Tree organization Invariants Address of entity E is stored in a leaf or intermediate node Intermediate nodes contain a pointer to a child iff the subtree rooted at the child stores an address of the entity The root knows about all entities Field with no data Field for domain dom(N) with pointer to N Location record for E at node M M N Location record with only one field, containing an address Domain D1 Domain D2 16 / 38

  32. Naming 5.2 Flat Naming HLS: Lookup operation Basic principles Start lookup at local leaf node Node knows about E ⇒ follow downward pointer, else go up Upward lookup always stops at root Node knows about E, so request is forwarded to child M Domain D Node has no record for E, so that request is forwarded to parent Look-up request 17 / 38

  33. Naming 5.2 Flat Naming HLS: Insert operation Node knows Node has no about E, so request record for E, so request is forwarded to parent Insert request is no longer forwarded M Domain D (a) Node creates record and stores pointer M Node creates record and stores address (b) 18 / 38

  34. Naming 5.3 Structured Naming Name space Essence A graph in which a leaf node represents a (named) entity. A directory node is an entity that refers to other nodes. Data stored in n1 n2: "elke" n0 home keys n3: "max" n4: "steen" elke "/keys" "/home/steen/keys" n5 n1 max steen keys n2 n3 n4 Leaf node .twmrc mbox "/home/steen/mbox" Directory node Note A directory node contains a (directory) table of (edge label, node identifier) pairs. 19 / 38

  35. Naming 5.3 Structured Naming Name space Observation We can easily store all kinds of attributes in a node, describing aspects of the entity the node represents: 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 (edge label, node identifier) pairs. 20 / 38

  36. Naming 5.3 Structured Naming Name space Observation We can easily store all kinds of attributes in a node, describing aspects of the entity the node represents: 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 (edge label, node identifier) pairs. 20 / 38

  37. Naming 5.3 Structured Naming Name resolution Problem To resolve a name we need a directory node. How do we actually find that (initial) node? Closure mechanism The mechanism to select the implicit context from which to start name resolution: www.cs.vu.nl: start at a DNS name server /home/steen/mbox: start at the local NFS file server (possible recursive search) 0031204447784: dial a phone number 130.37.24.8: route to the VU’s Web server Question Why are closure mechanisms always implicit? 21 / 38

  38. Naming 5.3 Structured Naming Name resolution Problem To resolve a name we need a directory node. How do we actually find that (initial) node? Closure mechanism The mechanism to select the implicit context from which to start name resolution: www.cs.vu.nl: start at a DNS name server /home/steen/mbox: start at the local NFS file server (possible recursive search) 0031204447784: dial a phone number 130.37.24.8: route to the VU’s Web server Question Why are closure mechanisms always implicit? 21 / 38

  39. Naming 5.3 Structured Naming Name resolution Problem To resolve a name we need a directory node. How do we actually find that (initial) node? Closure mechanism The mechanism to select the implicit context from which to start name resolution: www.cs.vu.nl: start at a DNS name server /home/steen/mbox: start at the local NFS file server (possible recursive search) 0031204447784: dial a phone number 130.37.24.8: route to the VU’s Web server Question Why are closure mechanisms always implicit? 21 / 38

  40. Naming 5.3 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. 22 / 38

  41. Naming 5.3 Structured Naming Name linking Soft link Allow a node O to contain a name of another node: First resolve O’s name (leading to O) Read the content of O, yielding name Name resolution continues with name 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 23 / 38

  42. Naming 5.3 Structured Naming Name linking Soft link Allow a node O to contain a name of another node: First resolve O’s name (leading to O) Read the content of O, yielding name Name resolution continues with name 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 23 / 38

  43. Naming 5.3 Structured Naming Name linking Data stored in n1 n2: "elke" n0 home keys n3: "max" n4: "steen" n5 "/keys" n1 elke steen max n2 n3 .twmrc n4 mbox Data stored in n6 "/keys" Leaf node keys Directory node n6 "/home/steen/keys" Observation Node n5 has only one name 24 / 38

  44. Naming 5.3 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. Distinguish three levels Global level: Consists of the high-level directory nodes. Main aspect is that these directory nodes have to be jointly managed by different administrations Administrational level: Contains mid-level directory nodes that can be grouped in such a way that each group can be assigned to a separate administration. Managerial level: Consists of low-level directory nodes within a single administration. Main issue is effectively mapping directory nodes to local name servers. 25 / 38

  45. Naming 5.3 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. Distinguish three levels Global level: Consists of the high-level directory nodes. Main aspect is that these directory nodes have to be jointly managed by different administrations Administrational level: Contains mid-level directory nodes that can be grouped in such a way that each group can be assigned to a separate administration. Managerial level: Consists of low-level directory nodes within a single administration. Main issue is effectively mapping directory nodes to local name servers. 25 / 38

  46. Naming 5.3 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. Distinguish three levels Global level: Consists of the high-level directory nodes. Main aspect is that these directory nodes have to be jointly managed by different administrations Administrational level: Contains mid-level directory nodes that can be grouped in such a way that each group can be assigned to a separate administration. Managerial level: Consists of low-level directory nodes within a single administration. Main issue is effectively mapping directory nodes to local name servers. 25 / 38

  47. Naming 5.3 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. Distinguish three levels Global level: Consists of the high-level directory nodes. Main aspect is that these directory nodes have to be jointly managed by different administrations Administrational level: Contains mid-level directory nodes that can be grouped in such a way that each group can be assigned to a separate administration. Managerial level: Consists of low-level directory nodes within a single administration. Main issue is effectively mapping directory nodes to local name servers. 25 / 38

  48. Naming 5.3 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. Distinguish three levels Global level: Consists of the high-level directory nodes. Main aspect is that these directory nodes have to be jointly managed by different administrations Administrational level: Contains mid-level directory nodes that can be grouped in such a way that each group can be assigned to a separate administration. Managerial level: Consists of low-level directory nodes within a single administration. Main issue is effectively mapping directory nodes to local name servers. 25 / 38

  49. Naming 5.3 Structured Naming Name-space implementation Global layer gov mil acm org net ieee com edu yale jp ac us nl oce sun co vu eng cs eng jack jill keio nec cs Adminis- trational layer ftp www cs csl ai linda pc24 robot pub globe Mana- gerial layer Zone index.txt 26 / 38

  50. Naming 5.3 Structured Naming Name-space implementation Item 2 5 6 Global Worldwide Few Seconds Lazy Many Yes Administrational Organization Many Milliseconds Immediate None or few Yes Managerial Department Vast numbers Immediate Immediate None Sometimes 1 3 4 1: Geographical scale 2: # Nodes 3: Responsiveness 4: Update propagation 5: # Replicas 6: Client-side caching? 27 / 38

More Related