=Paper= {{Paper |id=None |storemode=property |title=Description of the Self-Chord P2P Application |pdfUrl=https://ceur-ws.org/Vol-741/DEM03_ForestieroMastroianni.pdf |volume=Vol-741 |dblpUrl=https://dblp.org/rec/conf/woa/ForestieroM11 }} ==Description of the Self-Chord P2P Application== https://ceur-ws.org/Vol-741/DEM03_ForestieroMastroianni.pdf
                                                                                                                                                       1




                  Description of the Self-Chord P2P Application
                                                   Agostino Forestiero, Carlo Mastroianni
                                                       ICAR-CNR, Rende(CS), Italy
                                                    {forestiero,mastroianni}@icar.cnr.it



   Abstract—This paper presents the implementation of the “Self-Chord”      in Figure 1. In this example, keys are assigned integer values in
P2P system. Self-Chord inherits the ability of Chord-like structured        the range [0..63], and the key space is toroidal, so that key 0 is
systems for the construction and maintenance of an overlay of peers, but
                                                                            the successor of key 63. Each peer computes its centroid as the key
features enhanced functionalities deriving from ant-inspired algorithms,
such as autonomy behavior, self-organization and capacity to adapt to       value that minimizes the sum of the distances between itself and
a changing environment. Self-Chord has three main advantages with           the keys stored in the local area. In the example, an ant arrives at
respect to classical structured P2P systems, especially in the context of   the peer with centroid C=24, and picks key 55, because its value is
Grid and Cloud Computing: (i) it is possible execute range queries effi-    dissimilar to the centroid. Actually, the pick operation is subject to a
ciently; (ii) the load balance among peers is improved; (iii) maintenance
load is reduced because resources are spontaneously redistributed when      Bernoulli trial, whose success probability is inversely proportional to
peers disconnect or reconnect to the systems, or when resources are         the distance between key and centroid. The agent, carrying the picked
added/modified. In this paper, we summarize the main functionalities        key, exploits the long distance links of the underlying Chord structure,
of the Self-Chord application, and illustrate the configuration and         hops to a region of the ring where peers are supposed to have centroid
parameter settings, with the help of an example.
                                                                            values close to the key, and then tries to drop the key in this new
   Index Terms—Bio-inspired systems, multi-agent systems, peer-to-peer,     region. Notice that these operations assume that keys and centroids
self-organization.                                                          are already sorted in the ring. The power of the ant algorithm is that,
                                                                            by making this assumption, the keys will actually be ordered, even
                          I. I NTRODUCTION                                  starting from a completely disordered network. In stable condition,
                                                                            the sorting of keys guarantees their logarithmic discovery. The base
   This paper presents and describes the implementation of Self-
                                                                            principles for this behavior are the self-organizing nature and the
Chord. Self-Chord is a P2P system, previously introduced in [1] and
                                                                            positive feedback mechanism of ant algorithms.
[2] – and published on http://self-chord.icar.cnr.it
                                                                               Figure 2 shows a snapshot of Self-Chord in a stable condition, in
– which inherits from Chord the ability to construct and maintain
                                                                            which both keys and centroid are ordered. In this sample scenario
a structured ring of peers, but features enhanced functionalities
                                                                            with 16 peers, peer indexes are defined over 7 bits, while values of
achieved through the activity of ant-inspired mobile agents.
                                                                            resource keys are between 0 and 63. At the interior of the ring, the
   As opposed to Chord [3], Self-Chord decouples the naming of
                                                                            figure specifies the indexes of the peers, whereas at the exterior it
resources and peers, resulting in two sets of keys/indices that can have
                                                                            reports, for every peer, the keys stored by the peer (only the first
different cardinalities. Keys can be assigned to resources depending
                                                                            three keys are shown for simplicity) and the peer centroid c. It can
on the requirements of every specific application domain and on
                                                                            be noted that both the values of centroids and peer indexes are sorted
the desired granularity of resource categorization, with also the
                                                                            in clockwise direction, but they are not related to one another. Indeed,
possibility to give them a semantic meaning. Moreover, Self-Chord
                                                                            different approaches are used to sort them: the peer indexes are sorted
does not place resource keys to specified hosts, as Chord does:
                                                                            by the Chord management operations, whereas the resource keys are
this feature is actually unnecessary and limits the system flexibility.
                                                                            sorted by the self-organizing operations of the Self-Chord agents.
Conversely, Self-Chord focuses on the real objective, which is the
reordering of keys over the ring, and their fair distribution to the
peers.
   The technique adopted in Self-Chord is based on statistical oper-
ations of mobile agents whose behavior is inspired by ant colonies
[4]. Ants hop from peer to peer, pick/drop resource keys, and sort
them on the underlying P2P structure. Sorting of keys ensures their
fast discovery. Moreover, the keys of similar resources are assigned
to the same or neighbor peers, which enables the efficient execution
of range queries.
   This kind of approach is inherited from recent proposals that aim
to use bio-inspired algorithms and swarm intelligence techniques to
enhance the self-organizing properties of distributed systems [5], [6],
in particular of P2P networks.
   After summarizing the key functionalities of Self-Chord, by means        Fig. 1. Example of Self-Chord operation. A mobile agent arrives at a peer
of a graphical example, this paper presents the Self-Chord application,     with centroid C=24, picks key 55, and then hops to a region of the ring where
developed at the ICAR-CNR institute.                                        peers are supposed to have centroids close to 55.

                                                                               Self-Chord features the following benefits with respect to Chord:
                 II. K EY P OINTS OF S ELF -C HORD                             (i) In Self-Chord, peer indexes and resource keys are defined
   Self-Chord uses the ring-shaped overlay of Chord, the forefather         independently and there is no obligation to assign a key to a well
of structured P2P systems, to establish P2P interconnections, but           specified peer. This feature enables the definition of “classes” of
distributes resource keys among peers using the operations of ant-          resources; a class being defined as a set of resources that share
inspired mobile agents. The principle of the mechanism is illustrated       common characteristics, and are mapped to the same key value by
                                                                                                                                                     2




Fig. 2. Sample sorting of resource keys in the peers of Self-Chord. For each   Fig. 3.   The GUI Welcome Panel of Self-Chord.
peer, its index, a number of stored keys and the centroid are reported.

                                                                               logarithmic is the default mode and guarantees a faster reordering of
a hash function. A user can issue “class” queries, i.e., explore the           keys. The linear mode is slower but assures a better load balancing.
network to find a number of resources belonging to the same class                 kt and kl These are the parameters used in the take and leave
and then select the most appropriate for his/her purpose.                      probability functions (see [1] and [2]). They must be set to numerical
                                                                               values between 0 and 1.
   (ii) Structured systems like Chord can produce imbalance problems
                                                                                  range of keys This is the number of classes in which resources
depending on the location of peers and the statistical distribution
                                                                               are categorized. Each resource is assigned a key with value between
of the values of resource keys. In Self-Chord, the keys are fairly
                                                                               0 and rangeo fk eys − 1 by a hash function.
distributed over the peers, irrespective of the location of peers and
                                                                                  sleep time (ms) This is the time that an agent waits before moving
the distribution of key values, thus fostering a better balancing of
                                                                               to the next peer. The velocity of reordering can be scaled through
storage responsibilities.
                                                                               this parameter.
   (iii) In Chord, appropriate operations are necessary when a peer
                                                                                  p gen This is the probability that a new peer generates an agent.
joins the ring or when new resources are published: these resources
                                                                               The default is 1. The number of agents can be tuned through this
must be immediately assigned to the peers whose indexes match
                                                                               parameter.
the resource keys. These operations are not necessary in Self-Chord,
because the mobile agents are always active and will spontaneously
                                                                               B. Executing Self-Chord
reorganize the keys. This assures scalability (keys are continuously
reordered as the network grows) and robustness with respect to                    To run the Self-Chord software a double click on the file run.bat,
environmental changes.                                                         included in downloaded zip file, is sufficient. Figure 3 shows the
                                                                               welcome panel of the prototype.
                                                                                  The main Self-Chord Window, shown in Figure 4, allows the user
                III. T HE S ELF -C HORD A PPLICATION
                                                                               to manage the local peer, publish resources locally and search for
   The Self-Chord software was developed by the Distributed Sys-               remote resources. The Connection Information box can be
tems Group of ICAR-CNR. The software, downloadable from                        used to create a new Self-Chord network or to join an existing
http://self-chord.icar.cnr.it, provides an advanced                            overlay. This peer will be the contact node for the second peer. Each
graphical utility to let the user publish the resource metadata and            subsequent peer can use any existing peer as contact node. The TCP
search resources over the P2P network by name or by key. The current           port can be chosen by the user to match the configuration of the
version of the Self-Chord software (both prototype and simulator)              local firewall. By choosing appropriate ports, it is possible to create
can be downloaded and used under the GNU licence (http://self-                 multiple peers on the same host. This gives the possibility of testing a
chord.icar.cnr.it). The available Self-Chord prototype does not need           Self-Chord network with many peers by using just one or few hosts.
installation procedures, but it is sufficient to download and unzip            To join the network, a new peer must specify the contact information
the package, execute the file compile.bat and then run the file                (IP address and port) of any peer already connected to the network,
run.bat. The following software is required:                                   its own contact information, and finally click the Join button. The
  •   Java 2 Standard Edition 5.0;                                             first peer of the network must specify its IP address and TCP port
  •   log4j. (An Apache package included in the zip file);                     and click the Create button.
                                                                                  The Peer Information box specifies the URL, the ID and the
                                                                               centroid of the current peer and the IDs of the two adjacent peers.
A. Parameter Setting                                                              The Insert Resources box is used to insert the name of a
   The basic parameters of the Self-Chord software can be set in the           new resource that must be published by this peer. The resource key
file selfchord.properties. They are:                                           is calculated by a hash function and shown in the same panel.
   mode This parameter indicates the operation mode of agents. If the             The Resource box shows information about the resource keys
value is ”log”, the mode is logarithmic and the agents move the keys           stored in the local peer. The content of this box is continuously
through the peer finger tables. If the parameter is ”linear”, the mode         updated by the agents that execute take and leave operations to
is linear, and the agents move the keys across adjacent peers. The             reorder the keys on the network.
                                                                                                                                                          3




Fig. 4.   The main Self-Chord Window.


   The Search Resources box is used to specify a resource to                 [3] I. Stoica, R. Morris, D. Karger, M. F. Kaashoek, and H. Balakrishnan,
discover on the network. The target resource can be specified by name            “Chord: A scalable peer-to-peer lookup service for internet applications,”
                                                                                 in Proc. of the Conference on Applications, technologies, architectures,
or by key. The URL field specifies the address of the peer that stores
                                                                                 and protocols for computer communications SIGCOMM’01, San Diego,
the discovered key, whereas the Owner field indicates the address of             CA, USA, 2001.
the peer that stores the actual resource. The number of steps that was       [4] E. Bonabeau, M. Dorigo, and G. Theraulaz, Swarm intelligence: from
necessary to discover the resource key is also indicated. Thanks to              natural to artificial systems. New York, NY, USA: Oxford University
the key sorting, it is logarithmic with respect to the number of peers           Press, 1999.
                                                                             [5] D. C. Erdil, M. J. Lewis, and N. Abu-Ghazaleh, “An adaptive approach
connected to the network.                                                        to information dissemination in self-organizing grids,” in Proc. of the In-
                                                                                 ternational Conference on Autonomic and Autonomous Systems ICAS’06,
                             R EFERENCES                                         Silicon Valley, CA, USA, July 2005.
                                                                             [6] S. Y. Ko, I. Gupta, and Y. Jo, “A new class of nature-inspired algo-
[1] A. Forestiero, C. Mastroianni, and M. Meo, “Self-Chord: a Bio-Inspired       rithms for self-adaptive peer-to-peer computing,” ACM Transactions on
    Algorithm for Structured P2P Systems,” in Proc. of the 9th IEEE/ACM          Autonomous and Adaptive Systems, vol. 3, no. 3, August 2008.
    International Symposium on Cluster, Cloud and Grid Computing (CCGrid
    2009), Shanghai, China, May 2009.
[2] A. Forestiero, E. Leonardi, C. Mastroianni, and M. Meo, “Self-Chord: a
    Bio-Inspired P2P Framework for Self-Organizing Distributed Systems,”
    IEEE/ACM Transactions on Networking, vol. 18, no. 5, pp. 1651–1664,
    October 2010.