mc714 sistemas distribu dos
play

MC714: Sistemas Distribu dos Prof. Lucas Wanner Instituto de - PowerPoint PPT Presentation

MC714: Sistemas Distribu dos Prof. Lucas Wanner Instituto de Computac ao, Unicamp Aula 8: Nomeac ao Revis ao: Exerc cios Descreva o processo de conex ao entre cliente e servidor com sockets TCP/IP . 1


  1. MC714: Sistemas Distribu´ ıdos Prof. Lucas Wanner Instituto de Computac ¸ ˜ ao, Unicamp Aula 8: Nomeac ¸ ˜ ao

  2. Revis˜ ao: Exerc´ ıcios Descreva o processo de conex˜ ao entre cliente e servidor com sockets TCP/IP . 1 Diferencie comunicac ¸ ˜ ao s´ ıncrona e ass´ ıncrona, persistente e transiente. Dˆ e 2 exemplos de cada combinac ¸ ˜ ao. Descreva um problema de escalabilidade com comunicac ¸ ˜ ao s´ ıncrona transiente. 3 Qual ´ e o papel de um broker na comunicac ¸ ˜ ao orientada a mensagens? 4 Na Figura 4.31, qual ´ e o fator de stretch da rede de overlay na rota A → C? 5 Explique o princ´ ıpio de anti-entropia usado em protocolos epidˆ emicos. 6 Descreva o problema de remoc ¸ ˜ ao de dados em protocolos epidˆ emicos e apresente 7 uma soluc ¸ ˜ ao. Descreva um algoritmo epidˆ emico que calcule o tamanho de uma rede. 8 2 / 33

  3. Revis˜ ao: Exerc´ ıcios Descreva o funcionamento e implementac ¸ ˜ ao de RPC. 8 Considere um procedimento incr com dois parˆ ametros inteiros. O procedimento 9 adiciona um em cada parˆ ametro. Suponha que este procedimento foi chamado uma vez com a mesma vari´ avel nos dois parˆ ametros, por exemplo incr(i,i) . Se i inicialmente ´ e 0, qual ser´ a o seu valor se incr for chamada por referˆ encia? E se incr usar c´ opia e restaurac ¸ ˜ ao? 10 Uma union em C permite que um campo de uma estrutura guarde uma de v´ arias alternativas poss´ ıveis. Em tempo de execuc ¸ ˜ ao, n˜ ao h´ a como diretamente saber qual tipo a union guarda em algum momento. Unions apresentam alguma dificuldade para implementac ¸ ˜ ao de RPC? 11 O que ´ e implementado em uma biblioteca de runtime para RPC? 3 / 33

  4. Exerc´ ıcios Dˆ e um exemplo em que o enderec ¸o de uma entidade E precisa ser resolvido para 1 outro enderec ¸o antes que E possa ser acessado. Liste as propriedades de um identificador, e dˆ e exemplos de idenficadores. 2 Descreva uma maneira eficiente para criar identificadores globalmente ´ unicos. 3 O n´ o raiz em um sistema de localizac ¸ ˜ ao hierarquica pode ser um bottleneck . Como 4 este problema pode ser evitado? Descreva a resoluc ¸ ˜ ao iterativa e recursiva de nomes com DNS. 5 Porquˆ e os servidores pr´ oximos da ra´ ız DNS tipicamente n˜ ao suportam resoluc ¸ ˜ ao 6 recursiva? Poder´ ıamos esperar melhoras significantes no desempenho se este tupo de resoluc ¸ ˜ ao fosse suportada por estes servidores? 4 / 33

  5. Naming Entities Names, identifiers, and addresses Name resolution Name space implementation Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 5 / 33

  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 from the addresses of the access points offered by E . Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 6 / 33

  7. 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. Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 7 / 33

  8. 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 Hierarchical location service Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 8 / 33

  9. 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 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 Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 9 / 33

  10. Simple Solutions: Broadcasting ARP # arp 192.168.1.100 htpc (192.168.1.100) at f0:de:f1:8e:32:d7 on en0 ifscope [ethernet] # arp -a dd-wrt (192.168.1.1) at 68:7f:74:c5:f2:2c on en0 ifscope [ethernet] htpc (192.168.1.100) at f0:de:f1:8e:32:d7 on en0 ifscope [ethernet] ? (192.168.1.108) at (incomplete) on en0 ifscope [ethernet] chromecast (192.168.1.109) at a4:77:33:2:98:af on en0 ifscope [ethernet] xps (192.168.1.114) at (incomplete) on en0 ifscope [ethernet] lucass-mbp-2 (192.168.1.132) at f4:5c:89:a5:91:bf on en0 ifscope permanent ? (192.168.1.255) at (incomplete) on en0 ifscope [ethernet] ? (224.0.0.251) at 1:0:5e:0:0:fb on en0 ifscope permanent [ethernet] broadcasthost (255.255.255.255) at (incomplete) on en0 ifscope [ethernet] 10 / 33

  11. 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 Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 11 / 33

  12. Home-based approaches Host's home 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 Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 12 / 33

  13. 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? Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 13 / 33

  14. 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 Top-level node dir(T) 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 Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 14 / 33

  15. 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 Location record dom(N) with for E at node M pointer to N M N Location record with only one field, containing an address Domain D1 Domain D2 Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 15 / 33

  16. 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 Node has no record for E, so M that request is forwarded to parent Look-up Domain D request Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 16 / 33

  17. HLS: Insert operation Node�knows Node�has�no about�E,�so�request record�for�E, is�no�longer�forwarded Node�creates�record so�request�is and�stores�pointer forwarded M to�parent M Node�creates record�and stores�address Domain�D Insert request (a) (b) Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 17 / 33

  18. 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 n0 home keys n2: "elke" n3: "max" "/keys" n4: "steen" n1 n5 "/home/steen/keys" elke steen max keys n2 n3 n4 Leaf node .twmrc mbox Directory node "/home/steen/mbox" Note A directory node contains a (directory) table of (edge label, node identifier) pairs. Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 18 / 33

  19. 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. Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 19 / 33

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend