 |
Background
What is Tapestry?
      
      
      
|
I'll begin by giving a brief introduction to the
Tapestry
project, and some information about this particular release of the Tapestry
code. First, Tapestry is a peer to peer, wide-area decentralized routing
and location network infrastructure developed at University of California
at Berkeley by Zhao et al. To be more specific, Tapestry is an overlay
network that sits at the application layer (on top of an Operating System).
Deployed as a network connecting a set of machines, Tapestry allows any
member node to route messages to any other node in the network, given a location
and network independent name. Furthermore, Tapestry functions as a
decentralized directory service for any objects residing on nodes in the
network. A node in a Tapestry network can advertise or "publish" location
information about an object it possesses. Any other Tapestry node can then
act as a client, and send messages to this object, as long as it knew the
object's unique identifier. These messages route through the overlay from
node to node until they arrive at the node where the object is stored, such
that the path taken is a small factor longer than the shortest path from the
client node to the object's location.
Tapestry forms individual machines into a true peer to peer network, without
any points of centralization which might become points of failure or
attack. Along with other recent research efforts such as Chord, Pastry, Kademlia, Tapestry
is an example of a structured peer-to-peer network. More information on
structured peer-to-peer networks can be found in a recent paper by Dabek,
Zhao, Druschel, Kubiatowicz and Stoica, found here.
So what does Tapestry do for application writers? Well, Tapestry
provides an efficient way for nodes to communicate across an overlay network,
without regard to the underlying IP network topology. Nodes send
messages to each other based on an unique name, generated from a secure
one-way hash of some unique string (such as your email address, your PGP
public key, or your work address). Once a Globally Unique IDentifier
(GUID) is chosen for your node, messages are delivered to you in a fault-resilient
fashion (see the Tapestry TR for details) regardless of where you are, provided
you have inserted yourself into the Tapestry network. The other key
functionality of Tapestry, effcient object location, allows Tapestry nodes
to find a nearby copy of any object in the network, given the object's
unique ID. Furthermore, object location is lightweight, making it easy
to leverage it for application functionality.
The Tapestry network is extremely resilient to changes in the network.
It quickly recovers from large scale membership changes, such as large groups
of nodes joining or leaving the Tapestry overlay. In addition,
the basic Tapestry interface contains the following operations:
- PublishObject(O_GUID): publish, or make available, object
O on the local node. This call is best effort, and receives no
confirmation.
- UnpublishObject(O_GUID): Best-effort attempt to remove
location mappings for O.
- RouteToObject(O_GUID): Routes message to location of an object
with GUID O_GUID
- RouteToNode(N_ID, Exact): Route message to node N.
"Exact" specifies whether destination ID needs to be matched exactly to
deliver payload.
Tapestry offers fault-resilient mechanisms for both object location and point
to point message delivery. For object location, Tapestry generates a
small number of deterministic and independent GUIDs for each object. An
object server publishes an object's availability on all of its GUIDs, and a
client issues Tapestry locate requests for all of the object GUIDs in
parallel. This greatly increases availability under fault conditions,
while improving general performance and reducing performance variability.
For point to point message delivery, Tapestry provides pre-calculated
backup routes at each overlay hop. UDP soft-state beacons measure
up-to-date link conditions. Tapestry uses such information and simple
fault-avoidance protocols to route messages around failures, providing
successful delivery with high probability if a path between the endpoints
exists.
An illustrative example application
|
I will now give an example of how Tapestry location and routing can be
combined to providing an interesting network application. One of
the current applications we are developing on top of Tapestry is Shuttle,
a fault-resilient decentralized instant messaging application. I'll
give a quick run through of some Shuttle operations, and show how it leverages
Tapestry functionality to provide an interesting network service.
Shuttle is a fault-resilient, decentralized chat service. When a
new user logs on, the local Shuttle client authenticates the user against
a password entry stored in the distributed network via OceanStore or a similar
file system. After authentication, Tapestry retrieves the user preferences
and contact list, from either an encrypted local store or a distributed service
such as OceanStore. Users signing on publish themselves as available
objects on the local Tapestry node, and locate other available users by doing
object location via Tapestry. Finally, users can use Tapestry to choose
and distribute replicas of encrypted offline messages which can be found
and retrieved the next time a user logs on.
What's new in Tapestry 2.0?
|
Tapestry Version 2.0 contains the following new functionality:
- Algorithms for adapting to changing network conditions
- API messages allowing the application to tell the local
node to enter or leave a Tapestry overlay
- Recovery algorithms to large scale failures in the network
- A resilient parallel insertion algorithm that supported large flash
crowds adding themselves to the overlay
- Patchwork: a soft-state network monitoring component that uses
soft-state beacons to monitor link quality to a node's neighbors. As link
qualities change, nodes can be replaced by backups in the routing table in
order to reduce packet loss in overlay routing.
- A distributed testing framework: nodes can set themselves to be configured as FullTestMember nodes, and await explicit control instructions from a central FullTestDriver node. Instructions are sent via FullTestMsg messages, and include join, leave, publish, routeToObject and routeToNode operations. The results and resulting latencies are returned to the FullTestDriver.
- An event-driven simulation engine with real code: multiple Tapestry
nodes (up to 300-400 nodes/machine) can be configured and run as virtual
node instances on a single machine. Node instances are Java processes
which can be killed to simulate hard failures. Our simulation framework
(written by Jeremy Stribling) utilizes the Simple OceanStore Simulator
(SOSS) (written by Sean Rhea). More detailed information on how to
reproduce our experimental results and run your own simulation tests is
here
- Interweave: a simple file sharing application
- Shuttle: a decentralized instant messaging protocol
The Tapestry 1.0 release included the following:
- Basic Tapestry Java code running on the SEDA stage-driven event model
- Tapestry node insertion
- Using a static configuration built from configuration files
- Using the dynamic iterative insertion of single nodes to existing
Tapestry networks
- Support for multiple backup links per route entry
- Object location
- Object publication with optional tags
- Object location with optional tags
- TapestryFailure messages returned upon the failure of a TapestryLocateMsg
- Message routing
- Routing messages to an exact GUID match
- Routing messages to the node closest in ID to a given GUID
- An initial self-optimizing component that monitors link conditions
to decide when to use backup routes
Ben Y. Zhao
July 2, 2003