Opentalk at Large - StS 2005

754 views

Published on

Multicasting and grid computing with Opentalk

Smalltalk Solutions 2005

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
754
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • sender can be receiver
  • OT constraints => wrapped Chat instance in a Proxy OT weakness => have to hold onto the proxies strongly, otherwise they get GCed
  • range <Integer> starting point of a key range size <Integer> size of the key range (constant) ct <ByteArray> encrypted text arc <ARC4> instance of ARC4 (preconfigured for reuse) dt <ByteArray> decrypted text
  • task: code from previous slide as a String (will be compiled on the Drone) prerequistes: parcel names and versions that need to be loaded in order to run the task imports: namespaces to import into the private namespace of the drone defauts: default values for task parameters bindings: private, task specific, variables of the drone (from its private namespace) can be used either for constant values or to carry state between the task runs
  • parameters: actual parameters for given task run callback: used by drone to report results of a task run each task run is executed in its own worker process
  • get a drone out of the pool (wait if there is none) was the key found yet ? if not, find the next unchecked key range, get the drone search it
  • was the key found ? if yes, set the ‘key’ to allow the control thread to break out of the loop return the drone to the pool, so that its available for another task
  • Opentalk at Large - StS 2005

    1. 1. Opentalk at Large Martin Kobetic Cincom Smalltalk Development Smalltalk Solutions 2005
    2. 2. Overview <ul><li>Multicasting </li></ul><ul><ul><li>IP Multicasting </li></ul></ul><ul><ul><li>Opentalk-Groups </li></ul></ul><ul><li>Grid Computing </li></ul><ul><ul><li>Introduction </li></ul></ul><ul><ul><li>Framework </li></ul></ul>
    3. 3. Join the GRID Demo ! <ul><li>Wireless AP </li></ul><ul><ul><li>SSID: Blitzz </li></ul></ul><ul><ul><li>DHCP </li></ul></ul><ul><li>Browse: http://192.168.1.3/pub </li></ul><ul><li>Dowload: </li></ul><ul><ul><li>grid.im </li></ul></ul><ul><ul><li>grid.cha </li></ul></ul><ul><ul><li>VM </li></ul></ul><ul><ul><li>otminstaller.exe </li></ul></ul>
    4. 4. IP Multicasting: Intro <ul><li>IP range: 224.0.0.0-239.255.255.255 </li></ul><ul><li>API: datagram sockets (UDP) </li></ul><ul><li>join/drop multicast group </li></ul><ul><li>loopback: on/off </li></ul><ul><li>multicast routing, IGMP, ttl </li></ul>
    5. 5. IP Multicasting: Sender <ul><li>( SocketAccessor </li></ul><ul><li>family: SocketAccessor AF_INET </li></ul><ul><li>type: SocketAccessor SOCK_DGRAM </li></ul><ul><li>) bindTo: IPSocketAddress thisHostAnyPort </li></ul>
    6. 6. IP Multicasting: Sending <ul><li>group := IPSocketAddress </li></ul><ul><li>hostAddress: #[224 5 6 7] </li></ul><ul><li>port: 4242. </li></ul><ul><li>(sender writeWaitWithTimeoutMs: 100) </li></ul><ul><li>ifFalse: [ </li></ul><ul><li>sender </li></ul><ul><li>sendTo: group </li></ul><ul><li>buffer: ‘Hello’ asByteArray ] </li></ul>
    7. 7. IP Multicasting: Receiver <ul><li>( SocketAccessor </li></ul><ul><li>family: SocketAccessor AF_INET </li></ul><ul><li>type: SocketAccessor SOCK_DGRAM </li></ul><ul><li>) soReuseAddr: true; </li></ul><ul><li>bindTo: (IPSocketAddress </li></ul><ul><li>hostAddress: #[0 0 0 0] </li></ul><ul><li>port: 4242); </li></ul><ul><li>join: (IPMulticastRequest </li></ul><ul><li>toAddress: #[224 5 6 7]) </li></ul>
    8. 8. IP Multicasting: Receiving <ul><li>sa := IPSocketAddress new. </li></ul><ul><li>buf := ByteArray new: 5. </li></ul><ul><li>(receiver readWaitWithTimeoutMs: 100) </li></ul><ul><li>ifFalse: [ </li></ul><ul><li>size := receiver </li></ul><ul><li>receiveFrom: sa </li></ul><ul><li>buffer: buf </li></ul><ul><li>(buffer copyFrom: 1 to: size) asString ] </li></ul>
    9. 9. Opentalk-Groups: Intro <ul><li>Object Group </li></ul><ul><ul><li>brokers running on the same port </li></ul></ul><ul><ul><li>brokers join the same mcast address </li></ul></ul><ul><ul><li>receivers exported under the same OID </li></ul></ul><ul><ul><li>group proxy #(mcast-address, port, OID) </li></ul></ul><ul><li>Remote Group Request </li></ul><ul><ul><li>STSTOnewayRequest </li></ul></ul>
    10. 10. Opentalk-Groups: Broker <ul><li>(BrokerConfiguration standard </li></ul><ul><li>adaptor: (AdaptorConfiguration objectGroups </li></ul><ul><li>transport: (TransportConfiguration mcast </li></ul><ul><li>mcastAddresses: #([224 5 6 7]); </li></ul><ul><li>marshaler: MarshalerConfiguration stst </li></ul><ul><li>))) newAtPort: 4242 </li></ul>
    11. 11. Opentalk-Groups: Receiver <ul><li>receivers exported under the same OID </li></ul><ul><li>broker1 objectAdaptor </li></ul><ul><li>export: Transcript oid: #group. </li></ul><ul><li>broker2 objectAdaptor </li></ul><ul><li>export: Transcript oid: #group. </li></ul><ul><li>… </li></ul>
    12. 12. Opentalk-Groups: Sender <ul><li>group proxy #(mcast-address, port, OID) </li></ul><ul><li>group := broker groupById: #group. </li></ul><ul><li>group show: ‘Hello World!’ </li></ul>
    13. 13. Opentalk-Groups: Sender <ul><li>multiple mcast addresses </li></ul><ul><li>group := broker </li></ul><ul><li>groupAt: (IPSocketAddress </li></ul><ul><li>hostAddress: #[224 5 6 7] </li></ul><ul><li>port: 4242) </li></ul><ul><li>id: #group. </li></ul><ul><li>group show: ‘Hello World!’ </li></ul>
    14. 14. OpenChat: Unicast <ul><li>server: parties, sessions </li></ul><ul><ul><li>add/remove parties </li></ul></ul><ul><ul><li>session management (invite/accept/decline…) </li></ul></ul><ul><li>client: server, parties, session </li></ul><ul><ul><li>messages (send/receive – via session) </li></ul></ul><ul><li>session: server, parties </li></ul><ul><ul><li>message broadcasting </li></ul></ul><ul><ul><li>party management (joining/leaving session) </li></ul></ul>
    15. 15. OpenChat: Multicast <ul><li>group #all </li></ul><ul><ul><li>joining:, alreadyIn:, leaving: </li></ul></ul><ul><ul><li>startSession: id for: originator with: party on: topic </li></ul></ul><ul><li>session groups </li></ul><ul><ul><li>accepting: id / declining: id </li></ul></ul><ul><ul><li>displayMessage: aString from: id </li></ul></ul><ul><ul><li>leavingSession: id </li></ul></ul>
    16. 16. Opentalk-Groups <ul><li>one-way messages </li></ul><ul><ul><li>Group Refs => multicasted messages </li></ul></ul><ul><ul><li>ObjRefs => unicasted messages </li></ul></ul><ul><li>groups tied to the object table </li></ul><ul><ul><li>constraints (only one export per object) </li></ul></ul><ul><ul><li>weakness (exported objects may get GCed) </li></ul></ul><ul><li>packet size / fragmentation (UDP) </li></ul>
    17. 17. Grid: Intro <ul><li>complex task & distributed resources [email_address] </li></ul><ul><li>resource discovery </li></ul><ul><li>resource configuration </li></ul><ul><li>task distribution </li></ul><ul><li>result collection </li></ul>
    18. 18. Grid: Demo <ul><li>code breaking: RC4_40_MD5 </li></ul><ul><li>brute force but </li></ul><ul><ul><li>randomly selected ranges </li></ul></ul><ul><ul><li>ranges searched sequentially </li></ul></ul><ul><ul><li>looking for a known pattern ‘GET /’ </li></ul></ul>
    19. 19. Grid: Demo Setup <ul><li>http://192.168.1. 3/pub grid.im, grid.cha, VM </li></ul><ul><li>start the image (chmod u+x VM) </li></ul><ul><li>launcher menu: Tools / Open Grid Drone </li></ul><ul><li>set #id inst var </li></ul><ul><li>inst var menu: Connect </li></ul><ul><li>If asked for IP => 192.168.1.2:7777 </li></ul>
    20. 20. Grid: Framework <ul><li>Controller </li></ul><ul><ul><li>task specific </li></ul></ul><ul><ul><li>maintains the grid </li></ul></ul><ul><ul><li>configures drones </li></ul></ul><ul><ul><li>distributes tasks </li></ul></ul><ul><ul><li>collects results </li></ul></ul><ul><li>Drones </li></ul><ul><ul><li>generic </li></ul></ul><ul><ul><li>looks for controller </li></ul></ul><ul><ul><li>joins/leaves grid </li></ul></ul><ul><ul><li>gets configured </li></ul></ul><ul><ul><li>executes tasks </li></ul></ul>
    21. 21. Grid: Task <ul><li>[ :range :size :ct | </li></ul><ul><li>(range to: range + size - 1) </li></ul><ul><li>detect: [ :i || dt | </li></ul><ul><li>arc setKey: i asByteArray. </li></ul><ul><li>dt := arc decrypt: ct. </li></ul><ul><li>dt “starts with ‘GET /’ ?” ] </li></ul><ul><li>ifNone: [nil] ] </li></ul>
    22. 22. Grid: Configuration <ul><li>task: <String> </li></ul><ul><li>prerequisites: #(('ARC4' '')) </li></ul><ul><li>imports: 'private Security.*' </li></ul><ul><li>defaults: #(nil 2**task ct) </li></ul><ul><li>bindings: #(#arc -> ‘ARC4 new’) </li></ul>
    23. 23. Grid: Execution <ul><li>task parameters: chosen range </li></ul><ul><li>callback selector: #reply:from:in: (default) </li></ul><ul><li>callback recipient: controller (default) </li></ul>
    24. 24. Grid: Execution <ul><li>[ | drone | </li></ul><ul><li>drone := self next. </li></ul><ul><li>key ifNil: [ | range | </li></ul><ul><li>range := “random unchecked range” </li></ul><ul><li>drone goWith: range. </li></ul><ul><li>count < tasks </li></ul><ul><li>ifNotNil: [ false ] </li></ul><ul><li>] whileTrue. </li></ul><ul><li>^((ARC4 key: key) decrypt: ct) asString. </li></ul>
    25. 25. Grid: Result Collection <ul><li>reply: anObject from: aDrone in: ms </li></ul><ul><li>count := count + 1 </li></ul><ul><li>anObject ifNotNil: [ </li></ul><ul><li>key := anObject. </li></ul><ul><li>winner := aDrone ]. </li></ul><ul><li>self return: aDrone </li></ul>
    26. 26. Grid: Challenges <ul><li>code in Strings </li></ul><ul><ul><li>task </li></ul></ul><ul><ul><li>binding initializers </li></ul></ul><ul><li>concurrency </li></ul><ul><ul><li>control thread </li></ul></ul><ul><ul><li>working threads </li></ul></ul>
    27. 27. Thank You! <ul><li>[email_address] com </li></ul><ul><li>irc.parcplace.net </li></ul><ul><ul><li>/join #smalltalk (mk) </li></ul></ul><ul><li>public Store repository bundles </li></ul><ul><ul><li>OpentalkBase </li></ul></ul><ul><ul><li>OpenChat </li></ul></ul><ul><ul><li>Grid </li></ul></ul>

    ×