Opentalk at Large - StS 2005

Preview:

DESCRIPTION

Multicasting and grid computing with OpentalkSmalltalk Solutions 2005

Citation preview

Opentalk at LargeOpentalk at Large

Martin Kobetic

Cincom Smalltalk Development

Smalltalk Solutions 2005

OverviewOverview

Multicasting– IP Multicasting– Opentalk-Groups

Grid Computing– Introduction– Framework

Join the GRID Demo !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: IntroIP Multicasting: Intro

IP range: 224.0.0.0-239.255.255.255API: datagram sockets (UDP)join/drop multicast grouploopback: on/offmulticast routing, IGMP, ttl

IP Multicasting: SenderIP Multicasting: Sender

( SocketAccessorfamily: SocketAccessor AF_INETtype: SocketAccessor

SOCK_DGRAM) bindTo: IPSocketAddress

thisHostAnyPort

IP Multicasting: SendingIP Multicasting: Sending

group := IPSocketAddresshostAddress: #[224 5 6 7]port: 4242.

(sender writeWaitWithTimeoutMs: 100)ifFalse: [

sendersendTo: groupbuffer: ‘Hello’ asByteArray ]

IP Multicasting: ReceiverIP Multicasting: Receiver

( SocketAccessorfamily: SocketAccessor AF_INETtype: SocketAccessor SOCK_DGRAM

) soReuseAddr: true;bindTo: (IPSocketAddress

hostAddress: #[0 0 0 0]port: 4242);

join: (IPMulticastRequesttoAddress: #[224 5 6 7])

IP Multicasting: ReceivingIP Multicasting: Receiving

sa := IPSocketAddress new.buf := ByteArray new: 5.(receiver readWaitWithTimeoutMs: 100)

ifFalse: [size := receiver

receiveFrom: sabuffer: buf

(buffer copyFrom: 1 to: size) asString ]

Opentalk-Groups: IntroOpentalk-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: BrokerOpentalk-Groups: Broker

(BrokerConfiguration standardadaptor: (AdaptorConfiguration objectGroupstransport: (TransportConfiguration mcastmcastAddresses: #([224 5 6 7]);marshaler: MarshalerConfiguration stst

))) newAtPort: 4242

Opentalk-Groups: ReceiverOpentalk-Groups: Receiver

receivers exported under the same OID

broker1 objectAdaptorexport: Transcript oid: #group.

broker2 objectAdaptorexport: Transcript oid: #group.

Opentalk-Groups: SenderOpentalk-Groups: Sender

group proxy #(mcast-address, port, OID)

group := broker groupById: #group.group show: ‘Hello World!’

Opentalk-Groups: SenderOpentalk-Groups: Sender

multiple mcast addresses

group := brokergroupAt: (IPSocketAddress

hostAddress: #[224 5 6 7]

port: 4242)id: #group.

group show: ‘Hello World!’

OpenChat: UnicastOpenChat: 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: MulticastOpenChat: 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-GroupsOpentalk-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: IntroGrid: Intro

complex task & distributed resourcesSETI@home

resource discoveryresource configurationtask distributionresult collection

Grid: DemoGrid: Demo

code breaking: RC4_40_MD5brute force but

– randomly selected ranges– ranges searched sequentially– looking for a known pattern

‘GET /’

Grid: Demo SetupGrid: Demo Setup

http://192.168.1.3/pubgrid.im, grid.cha, VM

start the image (chmod u+x VM)launcher menu: Tools / Open Grid Droneset #id inst varinst var menu: ConnectIf asked for IP => 192.168.1.2:7777

Grid: FrameworkGrid: 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: TaskGrid: 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: ConfigurationGrid: Configuration

task: <String>prerequisites: #(('ARC4' ''))imports: 'private Security.*'defaults: #(nil 2**task ct)bindings: #(#arc -> ‘ARC4 new’)

Grid: ExecutionGrid: Execution

task parameters: chosen rangecallback selector: #reply:from:in: (default)callback recipient: controller (default)

Grid: ExecutionGrid: 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 CollectionGrid: Result Collection

reply: anObject from: aDrone in: ms

count := count + 1anObject ifNotNil: [

key := anObject.winner := aDrone ].

self return: aDrone

Grid: ChallengesGrid: Challenges

code in Strings– task– binding initializers

concurrency– control thread– working threads

Thank You!Thank You!

mkobetic@cincom.comirc.parcplace.net

– /join #smalltalk (mk)

public Store repository bundles– OpentalkBase– OpenChat– Grid

Recommended