Skip to main content

Specifying and Analyzing the Kademlia Protocol in Maude

Part of the Lecture Notes in Computer Science book series (LNTCS,volume 9399)

Abstract

Kademlia is the most popular peer-to-peer distributed hash table (DHT) currently in use. It offers a number of desirable features that result from the use of a notion of distance between objects based on the bitwise exclusive or of n-bit quantities that represent both nodes and files. Nodes keep information about files close or near to them in the key space and the search algorithm is based on looking for the closest node to the file key. The structure of the routing table defined in each peer guarantees that the lookup algorithm takes no longer than O(log(n)) steps, where n is the number of nodes in the network.

This paper presents a formal specification of a P2P network that uses the Kademlia DHT in the Maude language. We use sockets to connect different Maude instances and create a P2P network where the Kademlia protocol can be used, hence providing an implementation of the protocol which is correct by design. Then, we show how to abstract this system in order to analyze it by using Real-Time Maude. The model is fully parameterized regarding the time taken by the different actions to facilitate the analysis of various scenarios. Finally, we use time-bounded model-checking and exhaustive search to prove properties of the protocol over different scenarios.

Keywords

  • Kademlia
  • Distributed specification
  • Formal analysis
  • Maude
  • Real-Time Maude

Research supported by MICINN Spanish project StrongSoft (TIN2012-39391-C04-04) and Comunidad de Madrid program N-GREENS Software-CM (S2013/ICE-2731).

This is a preview of subscription content, access via your institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • DOI: 10.1007/978-3-319-25150-9_30
  • Chapter length: 18 pages
  • Instant PDF download
  • Readable on all devices
  • Own it forever
  • Exclusive offer for individuals only
  • Tax calculation will be finalised during checkout
eBook
USD   69.99
Price excludes VAT (USA)
  • ISBN: 978-3-319-25150-9
  • Instant PDF download
  • Readable on all devices
  • Own it forever
  • Exclusive offer for individuals only
  • Tax calculation will be finalised during checkout
Softcover Book
USD   89.99
Price excludes VAT (USA)
Fig. 1.
Fig. 2.

Notes

  1. 1.

    In the standard implementation, tick! messages are introduced into the configuration each second. However, the time can be customized to get these messages in the time span defined by the user.

  2. 2.

    We will use the word location to denote the different Maude instances appearing in the distributed system.

References

  1. AlTurki, M., Meseguer, J.: Executable rewriting logic semantics of Orc and formal analysis of Orc programs. J. Logic. Algebraic Meth. Program. 84(4), 505–533 (2015)

    MathSciNet  CrossRef  MATH  Google Scholar 

  2. Bae, K., Escobar, S., Meseguer, J.: Abstract logical model checking of infinite-state systems using narrowing. In: van Raamsdonk, F. (ed.) 24th International Conference on Rewriting Techniques and Applications, RTA 2013, LIPIcs 21, pp. 81–96. Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik (2013)

    Google Scholar 

  3. Bakhshi, R., Gurov, D.: Verification of peer-to-peer algorithms: a case study. In: Combined Proceedings of the 2nd International Workshop on Coordination and Organization, CoOrg 2006, and the Second International Workshop on Methods and Tools for Coordinating Concurrent, Distributed and Mobile Systems, MTCoord 2006, ENTCS, vol. 181, pp. 35–47. Elsevier (2007)

    Google Scholar 

  4. Borgström, J., Nestmann, U., Onana, L., Gurov, D.: Verifying a structured peer-to-peer overlay network: the static case. In: Priami, C., Quaglia, P. (eds.) GC 2004. LNCS, vol. 3267, pp. 250–265. Springer, Heidelberg (2005)

    CrossRef  Google Scholar 

  5. Breitkreuz, H.: The eMule project. http://www.emule-project.net

  6. Clavel, M., Durán, F., Eker, S., Lincoln, P., Martí-Oliet, N., Meseguer, J., Talcott, C.: All About Maude - A High-Performance Logical Framework. LNCS, vol. 4350. Springer, Heidelberg (2007)

    Google Scholar 

  7. Clavel, M., Durán, F., Eker, S., Lincoln, P., Martí-Oliet, N., Meseguer, J., Talcott, C.: Maude Manual, version 2.6. http://maude.cs.uiuc.edu/maude2-manual

  8. Farzan, A., Meseguer, J.: State space reduction of rewrite theories using invisible transitions. In: Johnson, M., Vene, V. (eds.) AMAST 2006. LNCS, vol. 4019, pp. 142–157. Springer, Heidelberg (2006)

    CrossRef  Google Scholar 

  9. Haridi, S.: EU-project PEPITO IST-2001-33234. Project funded by EU IST FET Global Computing (GC) (2002). http://www.sics.se/pepito/

  10. Lu, T.: Formal Verification of the Pastry Protocol. Doctoral dissertation, Universität des Saarlandes, December 2013

    Google Scholar 

  11. Maymounkov, P., Mazières, D.: Kademlia: a peer-to-peer information system based on the XOR metric. In: Druschel, P., Kaashoek, M.F., Rowstron, A. (eds.) IPTPS 2002. LNCS, vol. 2429, pp. 53–65. Springer, Heidelberg (2002)

    CrossRef  Google Scholar 

  12. Lu, T., Merz, S., Weidenbach, C.: Towards verification of the pastry protocol using TLA+. In: Bruni, R., Dingel, J. (eds.) FORTE 2011 and FMOODS 2011. LNCS, vol. 6722, pp. 244–258. Springer, Heidelberg (2011)

    CrossRef  Google Scholar 

  13. Meseguer, J.: Conditional rewriting logic as a unified model of concurrency. Theo. Comput. Sci. 96(1), 73–155 (1992)

    MathSciNet  CrossRef  MATH  Google Scholar 

  14. Meseguer, J., Palomino, M., Martí-Oliet, N.: Equational abstractions. Theo. Comput. Sci. 403(23), 239–264 (2008)

    MathSciNet  CrossRef  MATH  Google Scholar 

  15. Mysicka, D.: eMule attacks and measurements. Master’s thesis, Swiss Federal Institute of Technology (ETH) Zurich (2007)

    Google Scholar 

  16. Ölveczky, P., Meseguer, J., Talcott, C.: Specification and analysis of the AER/NCA active network protocol suite in Real-Time Maude. Form. Meth. Syst. Des. 29, 253–293 (2006)

    CrossRef  MATH  Google Scholar 

  17. Ölveczky, P.C.: Formal model engineering for embedded systems using Real-Time Maude. In: Durán, F., Rusu, V., (eds.) Proceedings of the 2nd International Workshop on Algebraic Methods in Model-based Software Engineering, AMMSE 2011, EPTCS, vol. 56, pp. 3–13 (2011)

    Google Scholar 

  18. Ölveczky, P.C., Meseguer, J.: Abstraction and completeness for Real-Time Maude. In: Proceedings of the 6th International Workshop on Rewriting Logic and its Applications, WRLA 2006, ENTCS, vol. 176(4), pp. 5–27 (2007)

    Google Scholar 

  19. Ölveczky, P.C., Meseguer, J.: Semantics and pragmatics of Real-Time Maude. High. Ord. Symbolic Comput. 20, 161–196 (2007)

    CrossRef  MATH  Google Scholar 

  20. Pita, I., Fernández-Camacho, M.I.: Formal specification of the Kademlia and the Kad routing tables in Maude. In: Martí-Oliet, N., Palomino, M. (eds.) WADT 2012. LNCS, vol. 7841, pp. 231–247. Springer, Heidelberg (2013)

    CrossRef  Google Scholar 

  21. Ratnasamy, S., Francis, P., Handley, M., Karp, R., Shenker, S.: A scalable content-addressable network. In: ACM SIGCOMM Computer Communication Review - Proceedings of the 2001 SIGCOMM Conference, vol. 31, pp. 161–172, October 2001

    Google Scholar 

  22. Riesco, A., Verdejo, A.: Implementing and analyzing in Maude the enhanced interior gateway routing protocol. In: Rosu, G. (ed.) Proceedings of the 7th International Workshop on Rewriting Logic and its Applications, WRLA 2008. ENTCS, vol. 238(3), pp. 249–266. Elsevier (2009)

    Google Scholar 

  23. Rocha, C., Meseguer, J., Muñoz, C.: Rewriting modulo SMT and open system analysis. In: Escobar, S. (ed.) WRLA 2014. LNCS, vol. 8663, pp. 247–262. Springer, Heidelberg (2014)

    Google Scholar 

  24. Rowstron, A., Druschel, P.: Pastry: scalable, decentralized object location, and routing for large-scale peer-to-peer systems. In: Guerraoui, R. (ed.) Middleware 2001. LNCS, vol. 2218, pp. 329–350. Springer, Heidelberg (2001)

    CrossRef  Google Scholar 

  25. Stoica, I., Morris, R., Karger, D., Kaashoek, M.F., Balakrishnan, H.: Chord: a scalable peer-to-peer lookup service for internet applications. ACM SIGCOMM Comput. Commun. Rev. 31, 149–160 (2001)

    CrossRef  Google Scholar 

  26. Sun, M., Meseguer, J.: Distributed real-time emulation of formally-defined patterns for safe medical device control. In: Ölveczky, P.C. (ed.) Proceedings of the 1st International Workshop on Rewriting Techniques for Real-Time Systems, RTRTS 2010, EPTCS, vol. 36, pp. 158–177 (2010)

    Google Scholar 

  27. Zave, P.: Using lightweight modeling to understand Chord. SIGCOMM Comput. Commun. Rev. 42(2), 49–57 (2012)

    CrossRef  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Isabel Pita .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and Permissions

Copyright information

© 2015 Springer International Publishing Switzerland

About this paper

Cite this paper

Pita, I., Riesco, A. (2015). Specifying and Analyzing the Kademlia Protocol in Maude. In: Leucker, M., Rueda, C., Valencia, F. (eds) Theoretical Aspects of Computing - ICTAC 2015. ICTAC 2015. Lecture Notes in Computer Science(), vol 9399. Springer, Cham. https://doi.org/10.1007/978-3-319-25150-9_30

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-25150-9_30

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-25149-3

  • Online ISBN: 978-3-319-25150-9

  • eBook Packages: Computer ScienceComputer Science (R0)