COT 4600 Operating Systems Fall 2009Lecture 12Peer-to-peer systemsRemote procedure call (RPC)StubSlide 6RPCs differ from ordinary procdure callsRPC semanticsIntermediariesStrategies for name resolutionDomain Name ServiceHow DNS worksSlide 13COT 4600 Operating Systems Fall 2009Dan C. MarinescuOffice: HEC 439 BOffice hours: Tu-Th 3:00-4:00 PM2222Lecture 12Last time: Discussion of homework 2Client/Service organizationTrusted IntermediariesToday:Peer-to-peer systemsRemote Procedure Call (RPC)Domain Name Service (DNS)Next Time:Domain Name Service (DNS)Network File System (NFS)3Peer-to-peer systemsDecentralized architecture without a trusted intermediary. Peers are both suppliers and consumers of resources, in contrast to the traditional client-server model where servers supply, and clients consume. Peer-to-peer systems often implement an Application Layer overlay network on top of the native or physical network topology. Such overlays are used for indexing and peer discovery. Content is typically exchanged directly over the underlying IP network. Anonymous peer-to-peer systems implement extra routing layers to obscure the identity of the source or destination of queries.In structured peer-to-peer networks, connections in the overlay are fixed. They typically use distributed hash table-based (DHT) indexing, such as in the Chord system developed at MITUnstructured peer-to-peer networks do not provide any algorithm for organization or optimization of network connections.Advantages use of spare resources at many sites difficult to censor contentDisadvantageFinding information in a large peer-to-peer network is hard.4Remote procedure call (RPC)Support inter-process communication of remotely located processes and allows implementation of client-server systems (RFC 1831)Preserve the semantics of a local procedure call.To use an RPC a process may use a special service: PORTMAP or RPCBIND available at port 111. A new RPC service uses the portmapper to register. The portmapper also allows a service lookup.If the process knows the port number of the RPC it may call directly.RPC/TCP and also RPC/UDPMessages must be well-structured; contain the identification of the specific RPCare addressed to an RPC demon listening at an RPC port.A machine independent representation of data external data representation standard (XDR).5StubUnburdens a user from implementation details of the RPC; it hides:the marshalling of the argumentsthe communication detailsThe client calls the client stub which:1. marshals the arguments of the call into messages2. sends the message3. waits for the responds4. when the response arrives it un-marshals the results5. returns to the client67RPCs differ from ordinary procdure callsRPCs reduce the so called fate sharing between caller and calleehave a different semantics (see next slide)take longerglobal variables and RPC do not mix well8RPC semanticsAt least once the client stub resends a message up to a given number of times until it receives a message from the server; is no guarantee of a responsethe server may end up executing the a request more than oncesuitable for side-effect free operationsAt most once a message is acted upon at most once.If the timeout set for receiving the response expires then an error code is delivered to the client.The server must keep a history of the time-stamps of all messages. Messages may arrive out of order…..suitable for operations which have side effectsExactly once implement the at most once and request an acknowledgment from the server.9IntermediariesWhat if the sender and the receiver of a message are not active at the same time?Intermediaries support buffered communication and allow more flexibility the intermediary may decide how to sort messagesThe sender and the receiver may:Push a message Pull a messageExample: the mail service:The sender pushes a message into his/her outboxThe outbox pushes it to the inbox of the recipientThe recipient pulls it whenever s(he) wantsThe publish/subscribe paradigm the sender notifies an event service when it produced a message. Recipients subscribe to the events and when the events occur the messages are deliveredStrategies for name resolution1. Distribute to all parties a copy of the directory mapping names to physical /logical addresses. The strategy does not scale well:1. when the population is very large, e.g., the directory size is very large and the network traffic to distribute it would be horrendous 2. the number of updates is proportional to the population and would add to the traffic2. Central directory easy to update but it does not scale well, “hot spot” contention.3. Distributed directory more sophisticated to implement but used successfully for DNSLecture 12 1011Domain Name ServiceGeneral-purpose name management systemHierarchically structuredMaps user-friendly host names to IP addressesA database editor generates tables of bindings and these bindings and then these tables are distributed to DNS serversPropagation takes time, hours.Supports both relative and absolute paths.Each server has: name records for several domains and referral records Referral record binds a hierarchical region of the DNS name space to another server that could help resolve the nameReferral architecture somewhat complicated due to need to optimize.Authoritative name server a name server that holds either the name record or a referral record for the name. Recursive name servicea DNS server takes upon itself to resolve a nameHow DNS worksA client sends a request to resolve a name to a Domain Name serverThe server examines the collection of the domains it is responsible forIf it finds the name record it returns the recordElse it searches a set of referral recordsStarts with the most significant component of the requested domain name for the one that matches the most components andIf found it returns the name recordElse retuns “not found”Example: the system ginger.cs.pedantic.edu tries to resolve the name ginger.Scholarly.eduLecture 12
View Full Document