improvements of an xmpp api for the use in distributed ... · pdf filexmpp server socks5 saros...

21
Improvements of an XMPP API for the use in distributed pair programming Diploma Thesis by Henning Staib Tutor: Karl Beecher and Stephan Salinger

Upload: dangkhanh

Post on 07-Feb-2018

225 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Improvements of an XMPP API for the use in distributed ... · PDF fileXMPP Server SOCKS5 Saros (Bob) Smack XMPP Message IBB XMPP Message SOCKS5 SOCKS5 IBB Jingle XMPP Server ... •

Improvements of an XMPP API for the use in distributed pair programming

Diploma Thesis

by

Henning Staib

Tutor: Karl Beecher and Stephan Salinger

Page 2: Improvements of an XMPP API for the use in distributed ... · PDF fileXMPP Server SOCKS5 Saros (Bob) Smack XMPP Message IBB XMPP Message SOCKS5 SOCKS5 IBB Jingle XMPP Server ... •

Institute for Computer Science, 2009-11-05

Overview

• What is Smack?• How is Smack used in Saros?• Problems with Smack• Smack Community• Reactivating the Smack Community• Work Units (Smack)• Work Units (Saros)• Timetable

2

Page 3: Improvements of an XMPP API for the use in distributed ... · PDF fileXMPP Server SOCKS5 Saros (Bob) Smack XMPP Message IBB XMPP Message SOCKS5 SOCKS5 IBB Jingle XMPP Server ... •

Institute for Computer Science, 2009-11-05

What is Smack?

• Open Source Extensible Messaging and Presence Protocol (XMPP) Client API for Java

• developed by Jive Software• other projects:

• Openfire (XMPP Server)• Spark (XMPP GUI Client)• SparkWeb (XMPP Web Client)

• implements the XMPP Core Stack and many XMPP Extension Protocols (XEP) as defined by the XMPP Standards Foundation (XSF)

• file transfers• SOCKS5 bytestreams• In-Band bytestreams (IBB)• Jingle (peer-to-peer media sessions)• In-Band registration

• latest official release of Smack 3.1.0 beta 1 in October 2008

3

Page 4: Improvements of an XMPP API for the use in distributed ... · PDF fileXMPP Server SOCKS5 Saros (Bob) Smack XMPP Message IBB XMPP Message SOCKS5 SOCKS5 IBB Jingle XMPP Server ... •

Institute for Computer Science, 2009-11-05

How is Smack used in Saros?

• every Saros Client is connected to a XMPP Server• Contact Management (Contacts, Presence changes)• Activities are transmitted via DataTransferManager (more than 16kib) and

XMPP Messages (less than 16kib and fallback)• Invitation process uses DataTransferManager to exchange project information

and files• DataTransferManager

• P2P Streams via TCP (preferred) or UDP (XEP-0166 Jingle)• fallback FileTransfer (XEP-0052)

• SOCKS5 ByteStream (XEP-0065)• In-Band Bytestreams (XEP-0047)

4

Page 5: Improvements of an XMPP API for the use in distributed ... · PDF fileXMPP Server SOCKS5 Saros (Bob) Smack XMPP Message IBB XMPP Message SOCKS5 SOCKS5 IBB Jingle XMPP Server ... •

Institute for Computer Science, 2009-11-05

How is Smack used in Saros?

5

Saros(Alice)

Smack

XMPP Server

SOCKS5

Saros(Bob)

Smack

XMPP

Mes

sage

IBB

XMPP M

essage

IBB

SOCK

S5SOCKS5

Jingle

Page 6: Improvements of an XMPP API for the use in distributed ... · PDF fileXMPP Server SOCKS5 Saros (Bob) Smack XMPP Message IBB XMPP Message SOCKS5 SOCKS5 IBB Jingle XMPP Server ... •

Institute for Computer Science, 2009-11-05

How is Smack used in Saros?

6

Saros(Alice)

Smack

XMPP Server

SOCKS5

Saros(Bob)

Smack

XMPP

Mes

sage

IBB

XMPP

Mes

sage

IBB

SOCK

S5SOCKS5

Jingle

XMPP Server

XMPP Server

Page 7: Improvements of an XMPP API for the use in distributed ... · PDF fileXMPP Server SOCKS5 Saros (Bob) Smack XMPP Message IBB XMPP Message SOCKS5 SOCKS5 IBB Jingle XMPP Server ... •

Institute for Computer Science, 2009-11-05

Problems with Smack

• problems when connecting to the XMPP Server• SASL Plain Authentication does not work• no support for authentication with proxy• Listeners can only be added after login (so messages stored on the server get lost if

the client receives them before the listener can be registered)

• problems with FileTransfer• SOCKS5 sometimes does not work• SOCKS5 is neither configurable nor can it be switched off• OutgoingFileTransfer#getProgress does not work• early cancellation of connection attempt if try timed out

• problems with Jingle• JingleFileTransferManager starts very slow (up to 20 seconds)• Jingle determines „bad“ IPs• little support for connection-oriented protocols• outdated version of JStun

7

Page 8: Improvements of an XMPP API for the use in distributed ... · PDF fileXMPP Server SOCKS5 Saros (Bob) Smack XMPP Message IBB XMPP Message SOCKS5 SOCKS5 IBB Jingle XMPP Server ... •

Institute for Computer Science, 2009-11-05

Problems with Smack

• general problems• fault tolerance

• some exceptions cause a disconnect (invalid XML, well formatted but otherwise erroneous XML)

• exceptions while disconnecting from server• error messages

• all exceptions are wrapped in XMPPException so it is hard and in some cases impossible to get the real cause of the exception for further error handling

• API is not standard compliant anymore (specification changed)• code inconsistencies

• some settings are configurable via xml config file• some settings can be changed programmatically• some settings are constants• some settings are only in code

• almost no active development from Jive Software since a year

8

Page 9: Improvements of an XMPP API for the use in distributed ... · PDF fileXMPP Server SOCKS5 Saros (Bob) Smack XMPP Message IBB XMPP Message SOCKS5 SOCKS5 IBB Jingle XMPP Server ... •

Institute for Computer Science, 2009-11-05

Smack Community

• currently 57 open bugs in the bug tracker• 10 of these bugs have community patches attached or linked in the bug

tracker• some more patches in the message board• message board with about 2600 posts since 2003• none of the patches committed to source repository

9

Page 10: Improvements of an XMPP API for the use in distributed ... · PDF fileXMPP Server SOCKS5 Saros (Bob) Smack XMPP Message IBB XMPP Message SOCKS5 SOCKS5 IBB Jingle XMPP Server ... •

Institute for Computer Science, 2009-11-05

Smack Community

10

0

12

23

35

47

58

70

2003-01 2003-09 2004-05 2005-01 2005-09 2006-05 2007-01 2007-09 2008-05 2009-01 2009-09

new posts per month

Page 11: Improvements of an XMPP API for the use in distributed ... · PDF fileXMPP Server SOCKS5 Saros (Bob) Smack XMPP Message IBB XMPP Message SOCKS5 SOCKS5 IBB Jingle XMPP Server ... •

Institute for Computer Science, 2009-11-05 11

LOC and Commit History of Smack SVN Repository

Page 12: Improvements of an XMPP API for the use in distributed ... · PDF fileXMPP Server SOCKS5 Saros (Bob) Smack XMPP Message IBB XMPP Message SOCKS5 SOCKS5 IBB Jingle XMPP Server ... •

Institute for Computer Science, 2009-11-05

Smack Community

possible reasons why Jive Software does not apply the patches• patches do not come with test

• Smack has about 230 unit tests• writing the patch is only half of the work

• Smack is used in Spark• parts of the code of Smack is included in Openfire• a patch must work in all this projects• Smack should be a small library that also works on mobile devices

• patches with dependencies to other big libraries are problematic

• Jive Software is more focused on Openfire and Spark

12

Page 13: Improvements of an XMPP API for the use in distributed ... · PDF fileXMPP Server SOCKS5 Saros (Bob) Smack XMPP Message IBB XMPP Message SOCKS5 SOCKS5 IBB Jingle XMPP Server ... •

Institute for Computer Science, 2009-11-05

Reactivating the Smack Community

• gain access to a branch of Jive Softwares Smack SVN repository• by creating new well tested patches• direct contact with Jive Software people

• improve existing patches• create documentation of the Smack architecture for easier access to smack

development• define code rules and testing rules• message board for smack developers (not for developers using the Smack

API)• active participation in the Smack community

What if all attempts to cooperate with Jive Software fail?• fork project (on github or sourceforge)• convince developers of the smack community to work on the fork

13

Page 14: Improvements of an XMPP API for the use in distributed ... · PDF fileXMPP Server SOCKS5 Saros (Bob) Smack XMPP Message IBB XMPP Message SOCKS5 SOCKS5 IBB Jingle XMPP Server ... •

Institute for Computer Science, 2009-11-05

Work Units (Smack)

Work Unit 1• FileTransfer

• Bugfixing• SOCKS5 sometimes does not work• OutgoingFileTransfer#getProgress does not work

• make SOCKS5 FileTransfer configurable (switch on/off, port, etc...)• Timeout problems

• related bugs: SMACK-263, SMACK-239, SMACK-169, SMACK-137

14

Page 15: Improvements of an XMPP API for the use in distributed ... · PDF fileXMPP Server SOCKS5 Saros (Bob) Smack XMPP Message IBB XMPP Message SOCKS5 SOCKS5 IBB Jingle XMPP Server ... •

Institute for Computer Science, 2009-11-05

Work Units (Smack)

Work Unit 2• Jingle

• JingleFiletransferManager starts slowly• finding „bad“ IP addresses• improve support for connection oriented protocols• check why UDP is so slow• update JSTUN

• related bugs: SMACK-283, SMACK-267, SMACK-248, SMACK-139

15

Page 16: Improvements of an XMPP API for the use in distributed ... · PDF fileXMPP Server SOCKS5 Saros (Bob) Smack XMPP Message IBB XMPP Message SOCKS5 SOCKS5 IBB Jingle XMPP Server ... •

Institute for Computer Science, 2009-11-05

Work Units (Smack)

Work Unit 3• PacketListeners

• exceptions in PacketListener cause a connection loss• RosterListener can‘t be registered before login to XMPP Server

• causes messages to get lost• related bugs: SMACK-156

Work Unit 4• Connection to XMPP Server

• SASL Plain Authentication does not work• no authentication with proxy• exceptions are thrown if server disconnects

• related bugs: SMACK-243, SMACK-157

16

Page 17: Improvements of an XMPP API for the use in distributed ... · PDF fileXMPP Server SOCKS5 Saros (Bob) Smack XMPP Message IBB XMPP Message SOCKS5 SOCKS5 IBB Jingle XMPP Server ... •

Institute for Computer Science, 2009-11-05

Work Units (Saros)

• improve exception handling with more meaningful XMPPExceptions• Saros ReconnectionManager• settings dialog for Smack network settings• integrate Smack API changes• improve network layer

17

Page 18: Improvements of an XMPP API for the use in distributed ... · PDF fileXMPP Server SOCKS5 Saros (Bob) Smack XMPP Message IBB XMPP Message SOCKS5 SOCKS5 IBB Jingle XMPP Server ... •

Institute for Computer Science, 2009-11-05

Timetable

18

Month Activities Extra Activities Fork

November work unit 1 (create first patch)contact Jive Software

December work unit 2decide if fork or not

write Smack developer documentation

create new repository for Smack

January work unit 3work unit 4

build Homepagemessage board

advertising

February work unit 6?

March work unit 7?

April write down thesis

ongoing activities:• participation in Smack community• Saros development (reviews, tests, work units for Saros)• write down thesis

Page 19: Improvements of an XMPP API for the use in distributed ... · PDF fileXMPP Server SOCKS5 Saros (Bob) Smack XMPP Message IBB XMPP Message SOCKS5 SOCKS5 IBB Jingle XMPP Server ... •

Institute for Computer Science, 2009-11-05

Summary

Scientific Questions:• „How can an open source project controlled by a company be reactivated?“• („How can an open source project successfully be forked?“)• „How can the quality of contributions of an open source community be

increased?“

Implementation Tasks:• Smack

• XMPP

• FileTransfer• Jingle• Architecture (Interfaces)

• Saros• Test• Patch reviews

• Network Layer

19

Page 20: Improvements of an XMPP API for the use in distributed ... · PDF fileXMPP Server SOCKS5 Saros (Bob) Smack XMPP Message IBB XMPP Message SOCKS5 SOCKS5 IBB Jingle XMPP Server ... •

Institute for Computer Science, 2009-11-05 20

Questions?

Page 21: Improvements of an XMPP API for the use in distributed ... · PDF fileXMPP Server SOCKS5 Saros (Bob) Smack XMPP Message IBB XMPP Message SOCKS5 SOCKS5 IBB Jingle XMPP Server ... •

Institute for Computer Science, 2009-11-05 21

Thanks