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

More Related Content

Opentalk at Large - StS 2005

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

Editor's Notes

  1. sender can be receiver
  2. OT constraints =&gt; wrapped Chat instance in a Proxy OT weakness =&gt; have to hold onto the proxies strongly, otherwise they get GCed
  3. range &lt;Integer&gt; starting point of a key range size &lt;Integer&gt; size of the key range (constant) ct &lt;ByteArray&gt; encrypted text arc &lt;ARC4&gt; instance of ARC4 (preconfigured for reuse) dt &lt;ByteArray&gt; decrypted text
  4. 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
  5. 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
  6. 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
  7. 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