290 likes | 420 Views
XMPP messaging in a peer to peer manner. ShortTalk - http://shorttalk.sourceforge.net/. Instructed by: Edward Bortnikov Supervisor: Dr. Ilana David Developed by: Michael Gartsbein.
E N D
XMPP messaging in a peer to peer manner ShortTalk - http://shorttalk.sourceforge.net/ Instructed by: Edward Bortnikov Supervisor: Dr. Ilana David Developed by: Michael Gartsbein
Create a package that uses the XMPP protocol as the transport but distributes the server functionality among the participating nodes • Create a lightweight XMPP server than can be embedded to each node in system • Develop a demo messaging application Project goal
Motivation To have fun Explore the filed of distributed systems Experience with the newest open source development tools Experience … Experience is what one gets when he doesn’t get what he wanted
Constraints OS independence Use only open source modules The whole system should be small and understandable by a single person The whole system should be delivered as a homogenous python package
Client server: There are client nodes and one or (a much smaller) set of servers There are limitations on scalability New users consume resources from servers Easier to monitor/control access • Distributed p2p: • Many same or almost same nodes • New participating nodes can contribute resources • Harder to make secure • Can be very scalable • Can be very fault tolerant Why distribute?
Example of distributed system File sharing (torrents) Distributed hash tables Distributed file system Messaging (skype) http://en.wikipedia.org/wiki/List_of_distributed_computing_projects
Peer to peer • Natural to use p2p in distributed systems • Bandwidth and other resources sharing • Symmetric design • Scalable • Many DS are p2p
Xml based messaging protocol also known as jabber • Open protocol and internet standard • Used by google in google-talk and in many other messaging systems What is XMPP? *
XMPP uses a servers based scheme to deliver messages. • Sender’s server delivers the message to the recipient’s server, and the last to the recipient XMPP (cont. 1)
Why python? Developing with python is fun! A free and 100% open source platform OS independent and extra flexible language linux+unix/mac/win32/winCE+mobile Millions of packages If its good for google, NASA and nokia– it should be good enough for me
Why python? (cont.) Experiencing with new programming paradigm Learning new language and new set of tools
Architecture Use an open dht system (bamboo open-dht) for the signaling Use the xmpp protocol at the transport between nodes The dht application will use a small dht-handler, xmpp client and server to communicate
ShortTalk application instance ShortTalk application instance DHT node User agent User agent DHT handler DHT handler XMPP client XMPP client GUI GUI XMPP server XMPP server Block scheme P2p session
The technology The project is built as a composition of python packages XMPP – client and server according to the XMPP standard RFC 3920 DHT – free publicly open DHT service – based on the bamboo project Tkinter – a “standard” python GUI
Main technical milestones Creating a smart and reliable DHT handler Assembling a lightweight XMPP sever engine that will run on both linux and windows Most of the existing available XMPP servers are pretty heavy and complicated, and contain features I don't need.
Main technical milestones (cont 1) • Embedding XMPP client to the project • Assembling the whole system together in a demo messaging application • Must do GUI
User agent DHT handler XMPP client Step by step workflow • Start the application • Creating the DHT handler and choosing a closet DHT node to work with • When a the connection breaks, a new one is transparently established
ShortTalk application instance Step by step workflow (cont 1) • Starting the XMPP server • Starting the XMPP client and logging to the server • Callbacks to GUI are set User agent DHT handler XMPP client XMPP server GUI
Step by step workflow (cont 2) • Subscribing • User can subscribe to DHT handler for event -> other users go online
ShortTalk application instance Step by step workflow (cont 3) • Logging to the DHT • This will create an entry in the DHT with name-ip and will refresh it • The user agent will get notifications on when users will get online User agent DHT handler XMPP client XMPP server GUI
User agent DHT handler XMPP client 1 2 User agent XMPP server DHT handler GUI XMPP client XMPP server GUI Step by step workflow (cont 4) • Chatting • User can send a message to another online user • The message will go from user’s XMPP client directly to remote user XMPP server 3
Special thanks • To Eddie Bortnikov for the whole project concept and support • To the lab for the infrastructure • XMPP community and specially Alexey "Snake" Nezhdanov for python’s XMPP support • Open bamboo team for the free DHT • To sourceforge for hosting and technological support • To Guido van Rossum for the language
Future development Embedding the DHT with the application Adding authentication Changing the polling of the DHT to a event driven pub/sub Using DHT to implement “offline messaging” and saving user list in the grid Through NAT support ???
Future Development (cont.) • Contact information • srvrules@t2.technion.ac.il • Project developer’s page • http://sourceforge.net/projects/shorttalk/
News from the world XEP-0174: Serverless Messaging A new standard from October 2008http://xmpp.org/extensions/xep-0174.html Python 3.0 A new significant release in December 2008