opentalk at large - sts 2005

27
Opentalk at Large Opentalk at Large Martin Kobetic Cincom Smalltalk Development Smalltalk Solutions 2005

Upload: martin-kobetic

Post on 30-Jun-2015

447 views

Category:

Technology


0 download

DESCRIPTION

Multicasting and grid computing with OpentalkSmalltalk Solutions 2005

TRANSCRIPT

Page 1: Opentalk at Large - StS 2005

Opentalk at LargeOpentalk at Large

Martin Kobetic

Cincom Smalltalk Development

Smalltalk Solutions 2005

Page 2: Opentalk at Large - StS 2005

OverviewOverview

Multicasting– IP Multicasting– Opentalk-Groups

Grid Computing– Introduction– Framework

Page 3: Opentalk at Large - StS 2005

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

Page 4: Opentalk at Large - StS 2005

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

Page 5: Opentalk at Large - StS 2005

IP Multicasting: SenderIP Multicasting: Sender

( SocketAccessorfamily: SocketAccessor AF_INETtype: SocketAccessor

SOCK_DGRAM) bindTo: IPSocketAddress

thisHostAnyPort

Page 6: Opentalk at Large - StS 2005

IP Multicasting: SendingIP Multicasting: Sending

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

(sender writeWaitWithTimeoutMs: 100)ifFalse: [

sendersendTo: groupbuffer: ‘Hello’ asByteArray ]

Page 7: Opentalk at Large - StS 2005

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])

Page 8: Opentalk at Large - StS 2005

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 ]

Page 9: Opentalk at Large - StS 2005

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

Page 10: Opentalk at Large - StS 2005

Opentalk-Groups: BrokerOpentalk-Groups: Broker

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

))) newAtPort: 4242

Page 11: Opentalk at Large - StS 2005

Opentalk-Groups: ReceiverOpentalk-Groups: Receiver

receivers exported under the same OID

broker1 objectAdaptorexport: Transcript oid: #group.

broker2 objectAdaptorexport: Transcript oid: #group.

Page 12: Opentalk at Large - StS 2005

Opentalk-Groups: SenderOpentalk-Groups: Sender

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

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

Page 13: Opentalk at Large - StS 2005

Opentalk-Groups: SenderOpentalk-Groups: Sender

multiple mcast addresses

group := brokergroupAt: (IPSocketAddress

hostAddress: #[224 5 6 7]

port: 4242)id: #group.

group show: ‘Hello World!’

Page 14: Opentalk at Large - StS 2005

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)

Page 15: Opentalk at Large - StS 2005

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

Page 16: Opentalk at Large - StS 2005

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)

Page 17: Opentalk at Large - StS 2005

Grid: IntroGrid: Intro

complex task & distributed resourcesSETI@home

resource discoveryresource configurationtask distributionresult collection

Page 18: Opentalk at Large - StS 2005

Grid: DemoGrid: Demo

code breaking: RC4_40_MD5brute force but

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

‘GET /’

Page 19: Opentalk at Large - StS 2005

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

Page 20: Opentalk at Large - StS 2005

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

Page 21: Opentalk at Large - StS 2005

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] ]

Page 22: Opentalk at Large - StS 2005

Grid: ConfigurationGrid: Configuration

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

Page 23: Opentalk at Large - StS 2005

Grid: ExecutionGrid: Execution

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

Page 24: Opentalk at Large - StS 2005

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.

Page 25: Opentalk at Large - StS 2005

Grid: Result CollectionGrid: Result Collection

reply: anObject from: aDrone in: ms

count := count + 1anObject ifNotNil: [

key := anObject.winner := aDrone ].

self return: aDrone

Page 26: Opentalk at Large - StS 2005

Grid: ChallengesGrid: Challenges

code in Strings– task– binding initializers

concurrency– control thread– working threads

Page 27: Opentalk at Large - StS 2005

Thank You!Thank You!

[email protected]

– /join #smalltalk (mk)

public Store repository bundles– OpentalkBase– OpenChat– Grid