Start

Version 99 (achristian, 07/01/2011 09:51 pm)

1 75 achristian
SIMON Main Wiki Page
2 75 achristian
3 2 admin
{{>toc}}
4 2 admin
5 1 admin
h1. Welcome to SIMON
6 1 admin
7 80 achristian
Welcome to the SIMON developer wiki. Here you will find all important information and files to get your project - powered by SIMON - running. 
8 1 admin
9 15 admin
I always recommend to read all from top to bottom. But If you are in a hurry: Select the topic you're interested in from the _table of contents_ on the top right. 
10 1 admin
11 1 admin
h2. What is SIMON?
12 1 admin
13 73 achristian
SIMON is a dual licensed Java(tm) API, that performs the object-oriented equivalent of "remote procedure call":http://en.wikipedia.org/wiki/Remote_Procedure_Call. With SIMON you are able to use Java objects, which are located in another "JVM":http://en.wikipedia.org/wiki/JVM on the current machine, on another machine in the local network or even on a servermachine somewhere on the internet. 
14 3 admin
15 88 achristian
h2. Who uses SIMON?
16 88 achristian
17 93 achristian
* GLP systems GmbH, http://systems.glp-med.com
18 89 achristian
* Archimedon Software und Consulting GmbH & Co. KG, http://www.archimedon.de
19 89 achristian
* Advolux GmbH, http://www.advolux.de
20 89 achristian
> Wir entwickeln eine plattformunabhängige Kanzleisoftware für Rechtanwälte. Um die Performance im Netzwerk zu erhöhen haben wir alle clientseitigen Zugriffe über ein Interface abgekoppelt und einen ApplicationServer entwickelt, der einen Teil der Geschäftslogik auf dem Server belässt (dafür benötigen wir SIMON).
21 89 achristian
* "Hochschule Bremen":http://hs-bremen.de, Medieninformatik, Projekt "Minerva", http://code.google.com/p/minerva-game/
22 90 achristian
> ... In einem ersten Schritt haben wir eine so genannte HotSeat-Version implementiert, welche das Spielen an einem Rechner ermöglichte. Für die spätere Client-/Server-Trennung haben wir einige Testszenarien mit RMI entwickelt, die wir allerdings frustriert verwerfen mussten. Mit SIMON war das anders! Wir haben innerhalb von einer halben Stunde einen Prototypen entwickelt, an welchem wir die SIMON-API kennenlernen und im Anschluss diese Erfahrung in das eigentliche Projekt übernehmen konnten. Mit Hilfe von SIMON war es uns möglich die gesamte Client-/Server-Trennung des Spiels innerhalb von zwei Tagen umzusetzen.
23 88 achristian
24 94 achristian
If you want to be added to the list (or removed), please drop me a mail: info[at]root1.de  
25 94 achristian
26 91 achristian
h2. Targets
27 1 admin
28 44 achristian
Sun's JRE/JDK already contains a technique for using remote objects. It's called "RMI (Remote Method Invocation)":http://en.wikipedia.org/wiki/Java_remote_method_invocation. Today, this implementation is really old but widely used in many (enterprise)applications. It works quite well, but it has some disadvantages that (partly) where not present in the early days of RMI: It's not that easy to use as it could be, and you run into troubles if you use it in a non LAN environment (say: the Internet ;-) ). So the intention of SIMON development was to provide an API wich is small, flexible, really easy to use and integrates seamless into more complex network environments. You'd say that SIMON is _the_ RMI alternative for communicating via internet.
29 1 admin
30 1 admin
h3. Comparison to RMI
31 1 admin
32 79 achristian
SIMON solves most of the issues RMI users complain about. Here is a comparison that shows the top most issues comparing Sun's RMI and SIMON.
33 1 admin
34 25 achristian
|_.|_.RMI|_.SIMON|  
35 10 admin
|*I/O technology*|=.Old Java IO implementation.|=.Apache MINA Framework which uses Java N(ew)IO.|
36 11 admin
|*Transparent network socket usage?*|=.No|=.Yes|
37 46 achristian
|*No. of used socket connections between client and server?*|=.At *least* one|=.At *most* one|
38 11 admin
|*No. of used threads on server side?*|=.Unknown. It depends among other things on the number of connected clients. It's not under your control.|=.A few. It depends on the used thread pool settings in the filter chain. You can serve, i.e. 1000 clients with only 50 threads. It's totally up to you.|
39 11 admin
|*Firewall/Router friendly?*|=.Yes, as far as no callbacks are used.|=.Yes|
40 11 admin
|*Connection via web proxy possible?*|=.Only via HTTP tunneling. This results in a very slow connection|=.Yes, if proxy supports the "CONNECT" command. For security, "basic authentication" is supported|
41 11 admin
|*Secure communication with SSL?*|=.Yes, with some extra effort|=.Yes|
42 11 admin
|*Protocol replaceable with own implementation?*|=.No|=.Yes|
43 11 admin
|*Performant file/data transfers*|=.No|=.Yes|
44 1 admin
45 1 admin
46 1 admin
h3. Features
47 1 admin
48 1 admin
  * Remote Procedure Call: client can call methods on server, server can call methods on client (callback)
49 1 admin
  * Extremely scalable thanks to Java NIO and the use of thread pooling mechanism
50 1 admin
  * Proxy support: Let a client connect f.i. via a company proxy to your SIMON server
51 1 admin
  * SSL support: strong communication encryption with SSL
52 26 achristian
  * Transparency: SIMON uses only one bi-directional socket connection between server and client, even if you use more than one remote object and callbacks
53 26 achristian
  * Exchangeable protocol: You are not happy with the protocol SIMON uses? Then go ahead and create your own...
54 1 admin
  * Connection loss detection: Detect a broken connection in less time
55 1 admin
  * Connection statistics: Know at any time how many messages/bytes are sent/received
56 1 admin
  * RawDataChannel: Transfer raw data from client to server (and vice versa) without time consuming reflection and serialization overhead
57 1 admin
  * PublishService: Find SIMON servers automatically on a local LAN 
58 1 admin
59 1 admin
h3. Why SIMON is better than ....
60 1 admin
61 1 admin
... RMI for internet applications??? 
62 1 admin
63 58 achristian
As already mentioned above, RMI has problems in modern applications that communicate not only via LAN, but also via internet. On the internet we have obstacles like firewalls and routers. And it turned out that RMI has problems with that. Let me explain why. Have at look at the following figure:
64 1 admin
65 12 admin
!1_rmi_vs_simon_schema.png!
66 1 admin
67 76 achristian
As you can see, RMI uses more than one connection to call methods on both sides. The bad thing is that RMI by default opens an anonymous port on the client side which is used by the server to call methods on the client. With a "Custom Socket Factory":http://java.sun.com/j2se/1.4.2/docs/guide/rmi/socketfactory/index.html you can specify a port for this kind of callbacks. But then you still have the problem that the server's outgoing connection must pass the client's firewall or router.
68 1 admin
69 1 admin
A workaround would be, not to use callbacks and use a polling mechanism at the client side. But think of hundrets of clients polling all the time. Not a "good" solution. 
70 1 admin
71 1 admin
Another solution would be a kind of blocking listener: The client calls a "listen" method und the server. The server blocks this call until there is some data to poll for the "listener".
72 26 achristian
This works, but is also not a simple and good solution. You need to have additional threads handling the listener and the blocking mechanism etc.
73 1 admin
74 1 admin
So let's have a look at how SIMON works:
75 1 admin
76 12 admin
!2_rmi_vs_simon_schema.png!
77 1 admin
78 26 achristian
There is only one connection between client and server which is established by the client. It is used for bi-directional method calling. You only have to allow the SIMON server port on the server's firewall or enable portforwarding on the server's router. That's all.
79 1 admin
80 41 achristian
h3. How it works
81 41 achristian
82 41 achristian
SIMON ist not just a copy of RMI. SIMON is doing many things different. At least internal. This is to give you an idea on what's going on internally...
83 41 achristian
84 42 achristian
* SIMON uses TCP to establish the connection between the client and the server
85 41 achristian
* This TCP connection is a statefull, permanent connection
86 41 achristian
* A client "opens" a connection to a server using the "lookup()" methods
87 41 achristian
* A client must "close" the connection by calling "release()" after it has finished using the remoteobject
88 1 admin
* SIMON reuses existing connections. Let's say you want to use two remote objects from one and the same server. Instead of opening two connections, one for each remote object, SIMON opens the first connection with the first object, and reuses the already existing connection for the second object. This does not have any negative impact on the performance. It's the other way around: You save the time that is required to open the connection as well as the additional socket-resource. Also on server side there does not need to be an additional socket and thus there is no additional effort for the socket selector.
89 43 achristian
* The connection from client to server actually get's closed, when the last remoteobject that used this connection is released.
90 43 achristian
* There is no automatic reconnect that brings a client back online after a connection interruption. This is due to the fact, that SIMON does not know anything about the context that exists between the client and the server. So reconnection and bringing back the last context has to be done on application level. 
91 43 achristian
92 41 achristian
93 41 achristian
94 1 admin
h2. Performance
95 1 admin
96 68 achristian
*Test-Case 1 ("Stress"):*
97 1 admin
98 67 achristian
  * Servermachine: Intel Core i7 4x2,8Ghz, 8GB RAM, Windows 7 Ultimate 64bit
99 67 achristian
  * One single clientmachine: Intel Core2Duo 2x2,13Ghz, 4GB RAM, Ubuntu 10.10 AMD64
100 67 achristian
  * 100Mbit network via SOHO desktop-switch 
101 67 achristian
  * Server provides simple remote object with method:
102 67 achristian
  ** @public void testMethod1(String aString, int aInt);@
103 78 achristian
  * One testclient instance runs 50 threads, each calling testMethod1 with arguments @"aString"@ and @Integer.MAX_VALUE@ as fast as possible (forever-loop, no extra delay). SIMON is configured for cached thread pool
104 67 achristian
  * Server implementation simply discards the method arguments and returns
105 67 achristian
106 71 achristian
_Test-Case 1 results:_
107 67 achristian
108 67 achristian
  * ~7950 method invocations per second
109 67 achristian
  * Servermachine: ~20% CPU load over 4 out of 8 (CPU supports HT) cores
110 67 achristian
  * Clientmachine: ~60% CPU load over both cores
111 67 achristian
  * Client-to-Server network performance: ~1MiB/s TX, ~980kiB/s RX
112 67 achristian
113 68 achristian
*Test-Case 2 ("Some more stress"):*
114 67 achristian
115 67 achristian
  * Same setup as in Test-Case 1, but now with 2 testclient instances running on the client machine
116 67 achristian
117 68 achristian
_Test-Case 2 result:_
118 67 achristian
119 67 achristian
  * ~ 11700 method invocations in total on serverside
120 67 achristian
  * Servermachine: ~22% CPU load over 4 out of 8 (CPU supports HT) cores
121 67 achristian
  * Clientmachine: ~68% CPU load over both cores
122 67 achristian
  * Client-to-Server network performance: ~1.5MiB/s TX, ~1.3MiB/s RX
123 67 achristian
124 68 achristian
*Test-Case 3 ("Some more real test ..."):*
125 67 achristian
126 67 achristian
  * Same hardware setup as in Test-Case 1, but now with 20 testclient instances running on the client machine
127 67 achristian
  * Server provides simple remote object with method:
128 67 achristian
  ** @public void testMethod1(String aString, int aInt);@
129 67 achristian
  ** @public Object testMethod2(ArrayList<Object> aList);@
130 67 achristian
  ** @public boolean testMethod3(byte[] aByteArray);@
131 67 achristian
  * Each testclient instance runs 50 threads, each calling one testmethod after another with 1sec delay -> should result in ~50 invocations per second per instance
132 67 achristian
  ** testMethod1 with arguments @"aString"@ and @Integer.MAX_VALUE@
133 67 achristian
  ** testMethod2 with a list of 100 POJOs containing an integer value, a String with length=3 and a long value
134 67 achristian
  ** testMethod3 with a byte array with 512 bytes
135 67 achristian
  * Serverimplementation:
136 67 achristian
  ** testMethod1: discard arguments and simply returns
137 67 achristian
  ** testMethod2: return the first item in the list provided by client
138 67 achristian
  ** testMethod3: return true if argument is not null and size>0, otherwise return false
139 67 achristian
140 68 achristian
_Test-Case 3 results:_
141 67 achristian
142 67 achristian
  * ~1000 method invocations in total on serverside, 50 on each testclient instance
143 69 achristian
  * Servermachine: ~5% CPU load (yes, only _five_) over 4 out of 8 (CPU supports HT) cores
144 67 achristian
  * Clientmachine: ~30% CPU load over both cores
145 1 admin
  * Client-to-Server network performance: ~1.1MiB/s TX, ~150kiB/s RX
146 70 achristian
147 70 achristian
148 70 achristian
*Test-Case 4 ("Extreme load ..."):*
149 70 achristian
150 70 achristian
  * Servermachine: Intel Core i7 4x2,8Ghz, 8GB RAM, Windows 7 Ultimate 64bit
151 70 achristian
  * 4 different client machines, running multiple testclient instances. In total, there are 13 testclient instances connected to server.
152 70 achristian
  * 100Mbit network via multiple switches (SOHO desktop-switchs + managed cisco switches)
153 70 achristian
  * Server provides simple remote object with method:
154 70 achristian
  ** @public void testMethod1(String aString, int aInt);@
155 78 achristian
  * Each testclient instance runs 50 threads, each calling testMethod1 with arguments @"aString"@ and @Integer.MAX_VALUE@ as fast as possible (forever-loop, no extra delay). So in total we have 650 (!!!) threads (13*50) distributed over 4 machines calling methods on the server. *SIMON is configured for thread pool with 10 worker threads*
156 70 achristian
  * Server implementation simply discards the method arguments and returns
157 70 achristian
158 71 achristian
_Test-Case 4 results:_
159 70 achristian
160 70 achristian
  * *~37.900 (!!!)* method invocations in total on serverside
161 70 achristian
  * Servermachine: ~60% CPU load in total
162 72 achristian
  * server side network performance: ~1.2MiB/s TX, ~3MiB/s RX
163 1 admin
164 1 admin
h2. License
165 1 admin
166 32 achristian
SIMON is dual-licensed and offers licenses for two distinct purposes - closed source and open source development.
167 1 admin
168 1 admin
If you want to use the GPL version, you'll have to put your own program under the GPL as well. This means you'll also have to release your source code along with your binary version, which may in turn be altered and re-released. If you choose the Commercial License instead, you're allowed to release your software without making the source public.
169 1 admin
170 64 achristian
  * [[license_root1de_1.1|root1.de Commercial License 1.1]]
171 16 admin
  * [[license_gplv3|GPL v3 Open Source License]]
172 1 admin
173 36 achristian
h3. Prices for Commercial License
174 34 achristian
175 62 achristian
I don't ask for millions, but SIMON is not free of charge for GPL incompatible use. The following price table applies to _root1.de Commercial License_ as described above:
176 33 achristian
177 38 achristian
  * Developer License (1 developer): 49.- EUR
178 37 achristian
  * Team License (5 developers): 229.- EUR
179 37 achristian
  * Workgrop License (25 developers): 999.- EUR
180 37 achristian
  * Enterprise License (100 developers): 3499.- EUR
181 33 achristian
182 62 achristian
For purchasing the commercial license, please get in contact with me -> _info[at]root1.de_ 
183 1 admin
184 57 achristian
If you have the feeling that the price for the above mentioned licenses is inappropriate, please have a look at what "Ohloh":http://www.ohloh.net/p/root1_simon calculates:
185 55 achristian
186 1 admin
!http://www.ohloh.net/p/341384/widgets/project_partner_badge.gif!:http://www.ohloh.net/p/root1_simon
187 1 admin
188 62 achristian
If you then still believe that the price is improper, please drop me a mail -> _info[at]root1.de_  
189 62 achristian
190 62 achristian
h3. How to purchase a commercial license
191 62 achristian
192 62 achristian
Send me an email at _info[at]root1.de_ which answers the following questions:
193 62 achristian
194 62 achristian
# Which License do you want to order?
195 84 achristian
# Which SIMON version you want the license for?
196 62 achristian
# Which address should be noted on invoice?
197 62 achristian
198 62 achristian
If no questions are open from both sides, you will be provided with an invoice plus the current commercial license. As soon as the invoice is paid, the license is valid.
199 62 achristian
200 62 achristian
h3. What about updates for commercial licensed SIMON?
201 62 achristian
202 66 achristian
If, for instance, you order a license for SIMON 1.0.0, you are permitted to use any SIMON 1.0.x version which has been released. Means: You order version 1.0.0 and can update to version 1.0.1, 1.0.2, 1.0.3, ... for free.
203 62 achristian
If you want to upgrade to a later version (i.e. 1.1.x, 1.2.x, 1.3.x, 2.1.x, ...), a paid upgrade is necessary.
204 61 achristian
205 1 admin
h2. Get SIMON
206 1 admin
207 1 admin
h3. Sourcecode
208 1 admin
209 1 admin
Access the source code repository for this project in one of following ways:
210 1 admin
211 85 achristian
    * "Browse source code online":http://dev.root1.de/projects/simon/repository to view this project's directory structure and files.
212 21 admin
    * Check out source code with a Subversion client using the following _svn_ command.<code>svn checkout http://svn.root1.de/svn/simon/trunk simon</code>
213 1 admin
214 13 admin
If you are new to Subversion, you may want to visit the "Subversion Project website":http://subversion.tigris.org and read "Version Control with Subversion":http://svnbook.red-bean.com.
215 1 admin
216 1 admin
h3. Compile from Source
217 1 admin
218 27 achristian
You can easily build the project by using Maven. But first, you have to have a working Maven Environment. If you are new to Maven, you may want to visit the "Maven Project website":http://maven.apache.org for more details.
219 1 admin
220 1 admin
h3. Binaries
221 1 admin
222 27 achristian
If you don't want to build SIMON yourself you can download pre-compiled binaries. You can choose between the latest release and the latest development snapshot.
223 1 admin
224 1 admin
*Release*
225 1 admin
226 1 admin
Visit this link for downloading latest release: 
227 27 achristian
228 27 achristian
Direct Download: http://dev.root1.de/projects/list_files/simon
229 40 achristian
Maven Repository: http://nexus.root1.de/content/repositories/releases/de/root1/simon/
230 1 admin
231 1 admin
*Snapshot*
232 1 admin
233 1 admin
Visit this link for downloading latest snapshot:
234 39 achristian
http://nexus.root1.de/content/repositories/snapshots/de/root1/simon/
235 1 admin
236 28 achristian
h3. Maven Site, JavaDoc, ...
237 28 achristian
238 29 achristian
With each deployment of SIMON to the maven repository, also a project site is generated. The site contains f.i.
239 28 achristian
240 28 achristian
* JavaDoc 
241 28 achristian
* Reports like test coverage
242 28 achristian
* Dependency Information
243 28 achristian
* ...
244 28 achristian
245 28 achristian
Please follow this link:
246 28 achristian
247 30 achristian
http://dev.root1.de/project-sites/simon/
248 1 admin
249 1 admin
h2. Setup your project
250 1 admin
251 1 admin
Depending on your IDE, there are different steps for setup your project to work with SIMON:
252 1 admin
253 17 admin
  * [[setup_eclipse|Eclipse]]
254 17 admin
  * [[setup_eclipsemaven|Eclipse incl. Maven2]]
255 48 achristian
  * [[setup_netbeansmaven|Netbeans incl. Maven2]]
256 1 admin
257 1 admin
258 1 admin
h2. Help
259 1 admin
260 1 admin
You need help on using SIMON? You do not know how to start? In this section you will find a first "hello world" sample and usefile tips on how to do <whatever>, explained with simple codesnippets. And if you have a more complex question, do not hesitate to post in the support forum. Help is provided in english and german language. 
261 1 admin
262 1 admin
h3. Samples/Howtos
263 1 admin
264 95 achristian
  * Simon 1.0.0 - SimonRemote Interface *!! Obsolete - Please use 1.1.0 instead !!*
265 1 admin
  ** [[sample_helloworld|First "Hello World" sample]]
266 1 admin
  ** [[howto_proxy|How to use a proxy]]
267 1 admin
  ** [[howto_rawchannel|How to transfer files]]
268 1 admin
  ** [[howto_publishservice|How to detect server(s) in LAN]]
269 1 admin
  ** [[howto_ssl|How to use SSL]]
270 1 admin
  ** [[howto_statistics|How to get statistics from client and/or server]]
271 1 admin
  * Simon 1.1.0 - SimonRemote Annotation
272 1 admin
  ** [[sample_helloworld110|First "Hello World" sample]]
273 1 admin
  ** [[sample_session_pattern|Session Pattern: Users can log in, and server get's informed when users leave]]
274 1 admin
275 1 admin
h2. Outdated licenses
276 1 admin
277 1 admin
  * [[license_root1de|root1.de Commercial License Version 1.0 (2009/06/15)]]
278 82 achristian
279 82 achristian
h2. History
280 82 achristian
281 82 achristian
|_.Date|_.Log|
282 82 achristian
|2007/12|started SIMON development|
283 82 achristian
|2008/01/18|presented SIMON 0.1 alpha on www.java-forum.org|
284 82 achristian
|2008/02/11|SIMON is able to make use of SimonRemote interface instead of extending a existing SimonRemote class|
285 82 achristian
|2008/02/15|added callback functionality now works without problems|
286 86 achristian
|2008/06/25|started working on a Java NIO implementation to overcome the one-thread-per-client issue with the blocking-io of Java IO|
287 82 achristian
|2008/07/01|First NIO version is ready to be tested|
288 99 achristian
|2008/07/25|release of "SIMON 0.1 beta":http://dev.root1.de/versions/show/1, based on Java NIO with non-blocking-io. SIMON now scales a lot better than with standard Java IO|
289 98 achristian
|2008/08/01|"SIMON 0.2 RC":http://dev.root1.de/versions/show/2 released. Several bugs fixed.|
290 98 achristian
|2008/10/15|"SIMON 0.2 stable":http://dev.root1.de/versions/show/3 released. In the meantime investigated into Apache MINA framework.|
291 98 achristian
|2008/10/26|"SIMON 0.3 alpha":http://dev.root1.de/versions/show/4 released. First MINA powered SIMON version!|
292 98 achristian
|2009/01/12|"SIMON 0.3 beta":http://dev.root1.de/versions/show/5 released. It's getting stable now ...|
293 98 achristian
|2009/05/07|"SIMON 0.3 RC1&2":http://dev.root1.de/versions/show/6 released. There's some light at the end of the tunnel ...|
294 98 achristian
|2009/06/03|SIMON "mavenized". New version number "1.0.0-RC1":http://dev.root1.de/versions/show/8 , based on 0.3 RC2|
295 98 achristian
|2010/02/01|"SIMON 1.0.0 RC2":http://dev.root1.de/versions/show/12 released|
296 98 achristian
|2010/02/01|"SIMON 1.0.0 stable":http://dev.root1.de/versions/show/7 released. First stable SIMON version based on MINA and created by MAVEN2|
297 98 achristian
|2011/01/02|"SIMON 1.1.0":http://dev.root1.de/versions/show/10 stable released.|
298 97 achristian
|2011/03/15|"SIMON 1.1.1":http://dev.root1.de/versions/show/14 released.|
299 97 achristian
|2011/07/01|"SIMON 1.1.2":http://dev.root1.de/versions/show/15 released. |
300 96 achristian
301 1 admin
302 1 admin
h2. Supporter
303 1 admin
304 1 admin
SIMON is supported by:
305 1 admin
306 20 admin
**YourKit Java Profiler**
307 20 admin
YourKit is kindly supporting open source projects with its full-featured Java Profiler.
308 20 admin
YourKit, LLC is creator of innovative and intelligent tools for profiling
309 20 admin
Java and .NET applications. Take a look at YourKit's leading software products:
310 20 admin
"YourKit Java Profiler":http://www.yourkit.com/java/profiler/index.jsp and "YourKit .NET Profiler":http://www.yourkit.com/.net/profiler/index.jsp.