A Critique of JCSP Networking Kevin Chalmers, Jon Kerridge and Imed - - PowerPoint PPT Presentation

a critique of jcsp networking
SMART_READER_LITE
LIVE PREVIEW

A Critique of JCSP Networking Kevin Chalmers, Jon Kerridge and Imed - - PowerPoint PPT Presentation

A Critique of JCSP Networking Kevin Chalmers, Jon Kerridge and Imed Romdhani School of Computing Napier University Breakdown Introduction Object Serialization in Java Current JCSP Implementation Problems Towards a


slide-1
SLIDE 1

A Critique of JCSP Networking

Kevin Chalmers, Jon Kerridge and Imed Romdhani

School of Computing Napier University

slide-2
SLIDE 2

Breakdown

  • Introduction
  • Object Serialization in Java
  • Current JCSP Implementation
  • Problems
  • Towards a Better Solution
  • Conclusion
slide-3
SLIDE 3

Introduction

  • Numerous network aware CSP inspired frameworks

– JCSP, pony, CSP.NET, C++CSP, PyCSP

  • Majority based on T9000 virtual channel model

– Links and channels multiplexing over one another

  • None interact

– No reason why not

  • Performance usually judged on task parallelisation

– I’m interested in the communication abstraction

slide-4
SLIDE 4

Introduction

  • Mobile devices
  • Mobile processes

(agents)

  • Ubiquitous computing

– Environment of autonomous interacting devices – Complex

slide-5
SLIDE 5

Object Serialization in Java

  • Functionality
  • Example – Integer object
slide-6
SLIDE 6

Object Serialization in Java

  • Java object ↭ bytes
  • Requirements

– Serializable or Externalizable interface – ObjectInputStream and ObjectOutputStream

  • Class description and object data sent

– Class description includes inheritance information

  • Control signals
  • Use of references in the stream

– Aliasing is a problem

slide-7
SLIDE 7

Object Serialization in Java

  • Integer object

– Extends Number – Wraps 32-bit value in an object

1 2 3 4 5 6 7 8 9 0 TC_OBJECT TC_CLASSDESC Name length (17) j a v a . l 10 a n g . I n t e g e 20 r Class Serialization Identifier (1360826667806853064) Flags 30 Variable count (1) I(nteger) Name length (5) v a l u e 40 TC_ENDBLOCKDATA TC_CLASSDESC Name length (16) j a v a . l 50 a n g . N u m b e r 60 Class Serialization Identifier (-8742448824652078987) Flags Variable count (0) 70 TC_ENDBLOCKDATA TC_BASE value

slide-8
SLIDE 8

Current JCSP Implementation

  • High level architecture
  • Virtual channel
  • Message hierarchy
slide-9
SLIDE 9

Current JCSP Implementation

slide-10
SLIDE 10

Current JCSP Implementation

  • Virtual channel

– NetChannelOutput to NetChannelInput (via the LinkTx

and LinkRx) – At least five processes required

slide-11
SLIDE 11

Current JCSP Implementation

slide-12
SLIDE 12

Problems

  • Resource usage
  • Complexity
  • Message cost
  • (Java) objects only
  • Performance
  • High priority Link processes
  • Exception handling
  • Lack of protocol
slide-13
SLIDE 13

Problem – Resource Usage

  • Numerous processes in operation
  • Start up

– LoopbackLink (2), LinkServer, LinkManager, EventProcess

  • Extra set up

– First NetChannelOutput creates handler (CNS requires one)

– CNSService process

  • Five processes created and destroyed during Link creation
  • Subsequent operations

– Each Link to a Node requires two processes (CNS Link) – Each NetChannelInput requires one process (one to CNS)

  • PDA limited to 400 threads

– Standard initialised Node uses 11 (including main)

slide-14
SLIDE 14

Problem - Complexity

  • Subjective
  • Difficult to extend functionality
  • Difficult to extract functionality
  • Difficult to modify functionality
  • Premise is simple

– Crossbar between Links and channel ends

  • Implementation complicated
slide-15
SLIDE 15

Problem - Complexity

0..* 0..* 0..* 0..* ServiceSettings
  • addresses:Hashtable
  • settings:Hashtable
  • nam
e:String +Serv iceSettings +addAddress:v
  • id
+getAddresses:NodeAddressID[] +addSetting:v
  • id
+getSetting:String serv iceNam e:String addressNam es:String[] settingNam es:String[] F ilter DeserializeChannelFilter DeserializeChannelFilter +filter:Object ChannelM essage Data Ack W riteRejected settings +Settings +Mem
  • ry
+NodeProfile +Addresses +NodeProfiles +OtherSpec +ConfigReader +Plugins +MinMem
  • ry
+W ireless +ReqProtocol +Setting +JCSPConfig +ConnectionOriented + Spec +Serv ices +Max Speed +MinSpeed +Reliable +AddressSetting +Address + XM LC
  • nfigC
  • nstants
OtherReq +Protocols +Protocol +Max Ping +Specs +Link Profiles +Serv ice +Plugin +Link Profile + R eq +JCSPConfig StandardNetConnectionFactory +StandardNetConnectionFactory +createNet2One:NetAltingConnectionServ er +createNet2Any :NetSharedConnectionServ er +createOne2Net:NetAltingConnectionClient +createAny 2Net:NetSharedAltingConnectionClient SharedConnectionClient interface NetSharedConnectionClient Externalizable SerializedObject +SerializedObject SerializedObject +get:Object +get:Object +w riteEx ternal:v
  • id
+readEx ternal:v
  • id
+w riteReplace:Object
  • AccesibleBy
teArray OutputStream + InputStream F actory
  • BasicInputStream
Factory
  • Ex
tClass serializedData:by te[]
  • bjectToString:String
Utils +array ToString:String
  • stuffString:String
+stringToArray :String[]
  • deStuffString:String
interface Networked channelLocation:NetChannelLocation interface NetConnectionFactory + createN et2O ne:N etAltingC
  • nnectionServer
+ createN et2Any:N etSharedC
  • nnectionServer
+ createO ne2N et:N etAltingC
  • nnectionC
lient + createAny2N et:N etSharedAltingC
  • nnectionC
lient LinkServer
  • protocolID:ProtocolID
  • link
Serv erAddressID:NodeAddressID #Link Serv er #create:Link Serv er #stop:boolean #getProtocolID:ProtocolID #getLink Serv erAddressID:NodeAddressID Runtim eEx ception LinkLostException +Link LostEx ception +Link LostEx ception source:Object SharedAltingConnectionClient NetSharedA ltingConnectionClient
  • sy
nchChan:Any 2OneChannel
  • from
Serv er:NetAltingChannelInput
  • openToServ
er:NetChannelOutput
  • reqToServ
er:NetChannelOutput
  • back
ToClient:NetChannelOutput
  • serv
erLocation:NetConnectionLocation create:NetSharedAltingConnectionClient #NetSharedAltingConnectionClient +getChannelLocation:NetChannelLocation +duplicate:SharedConnectionClient +destroy Client:v
  • id
NetChannelEnd
  • factory
:StandardNetChannelEndFactory
  • NetChannelEnd
+createNet2One:NetAltingChannelInput +createNet2One:NetAltingChannelInput +createNet2One:NetAltingChannelInput +createNet2One:NetAltingChannelInput +createNet2Any :NetSharedChannelInput +createNet2Any :NetSharedChannelInput +createNet2Any :NetSharedChannelInput +createNet2Any :NetSharedChannelInput +createOne2Net:NetChannelOutput +createAny 2Net:NetSharedChannelOutput AltingChannelInputW rapper NetAltingChannelInput #NetAltingChannelInput #NetAltingChannelInput LinkLost tx Channel:ChannelOutput address:NodeID Link Lost Serializable ChannelID
  • STRING_FORM_PREFIX:String
+ChannelID ChannelID createFrom StringForm :ChannelID +equals:boolean +toString:String stringForm :String nodeID:NodeID index :long interface NetBufferedChannelEndFactory + createN et2O ne:N etAltingC hannelInput + createN et2Any:N etSharedC hannelInput NodeUIImpl
  • tim
e:long
  • m
em :long
  • hashCode:int
#NodeUIIm pl +NodeUIIm pl +check Equal:boolean +hashCode:int im plStringForm :String com parisonString:String SharedConnectionServ er interface NetSharedConnectionServer ConnectionM essage Open Ping Pong Close IndexManager
  • instance:Index
Manager
  • channels:ChannelIndex
Map
  • index
Value:long
  • labelToIndex
Map:Hashtable
  • index
ToLabelMap:Hashtable
  • reply
Channels:Hashtable +CNS_CHANNEL_INDEX:long
  • POISON_FILTER:PoisonFilter
Index Manager +getInstance:Index Manager getNew Channel:ChannelAndIndex getNew Reply Channel:ChannelAndIndex rem
  • v
eChannel:v
  • id
addReserv edChannel:v
  • id
getRx Channel:ChannelOutput getRx Channel:ChannelOutput broadcast:int broadcastLink Lost:int check Index IsValid:boolean getInv alidVCN:long ChannelAndIndex Error NetChannelError +NetChannelError +NetChannelError cns +CNSNetChannelLocation +CNSServ ice C N SM essage +CNSChannelEndManager + LocationN
  • tC
N SR egisterable + N am edC hannelEndM anager + C N SU ser +ChannelNam eKey +CNS +W rongFactory Ex ception + N am edC hannelEndF actory +Nam eAccessLev elEx ception +Nam eAccessLev el +ChannelNam eEx ception C hannelD ataStore Serializable A cknow ledgementsBuffer
  • DEFAULT_SIZE:int
  • initialSize:int
  • buffer:Object[]
  • counter:int
  • firstIndex
:int
  • lastIndex
:int
  • ack
s:Ack s Ack now ledgem entsBuffer Ack now ledgem entsBuffer +get:Object +startGet:Object +endGet:v
  • id
+put:v
  • id
+getState:int +clone:Object +rem
  • v
eAll:v
  • id
Ack s Serializable M essage PING_MESSAGE:PingMessage PING_REPLY_MESSAGE:PingReply Message destIndex :long destVCNLabel:String sourceIndex :long sourceID:NodeID tx Reply Channel:ChannelOutput +Message +bounce:v
  • id
+BounceMessage +PingMessage +PingReply Message Serializable C
  • m
parable DomainID
  • nullDom
:boolean
  • nam
e:String
  • NullDom
ainStringForm :String
  • Dom
ainStringForm Prefix :String Dom ainID +Dom ainID createFrom StringForm :Dom ainID +equals:boolean +hashCode:int +com pareTo:int
  • nSam
eBranch:boolean +toString:String nullDom ain:boolean nullDom ainID:Dom ainID dom ainNam e:String stringForm :String parentID:AbstractID Net2OneChannel
  • label:String
  • netChannelInputProcess:NetChannelInputProcess
create:Net2OneChannel create:Net2OneChannel create:Net2OneChannel create:Net2OneChannel
  • Net2OneChannel
  • Net2OneChannel
+getChannelLocation:NetChannelLocation +destroy Reader:v
  • id
#getChannel:AltingChannelInput getChannelIndex :long +getFactory Class:Class +poison:v
  • id
+check Poison:v
  • id
C SProcess LinkManager
  • instance:Link
Manager
  • link
Holders:Hashtable
  • loopback
Link :Loopback Link
  • registerConn:Any
2OneConnection
  • requestLink
:Any 2OneChannel
  • lostLink
Chan:Any 2OneChannel
  • link
FailureChan:Any 2OneChannel
  • check
ForLink :Any 2OneChannel
  • getNodeIDChan:Any
2OneChannel
  • registerEv
entChannel:Any 2OneChannel
  • ALT_LOST_LINK:int
  • ALT_LINK_FAIL:int
  • ALT_REG_CHAN:int
  • ALT_REQ_LINK:int
  • ALT_CHECK_FOR_LINK:int
Link Manager +run:v
  • id
+start:v
  • id
getInstance:Link Manager registerLink :boolean registerFailure:v
  • id
getTx Channel:ChannelOutput getTx Channel:ChannelOutput getTx Channel:ChannelOutput
  • getLink
:Link lostLink :int link Ex ists:boolean getLink LostEv entChannel:AltingChannelInput
  • Link
sToNodeHolder
  • ProfileMatchFailureEx
ception +Link Establishm entEx ception
  • Link
Request
  • Link
Check StandardNetChannelEndFact...
  • instance:StandardNetChannelEndFactory
  • link
Profile:Profile +StandardNetChannelEndFactory +StandardNetChannelEndFactory +createNet2One:NetAltingChannelInput +createNet2One:NetAltingChannelInput +createNet2One:NetAltingChannelInput +createNet2One:NetAltingChannelInput +createNet2Any :NetSharedChannelInput +createNet2Any :NetSharedChannelInput +createNet2Any :NetSharedChannelInput +createNet2Any :NetSharedChannelInput +createOne2Net:NetChannelOutput +createAny 2Net:NetSharedChannelOutput defaultInstance:StandardNetChannelEndFactory Unacknow ledgedNetChannelEn... +Unack now ledgedNetChannelEndFactory +createOne2Net:NetChannelOutput +createAny 2Net:NetSharedChannelOutput Net2A ny Channel
  • label:String
  • ch:RejectableChannel
  • netChannelInputProcess:NetChannelInputProcess
+Net2Any Channel +Net2Any Channel +Net2Any Channel +Net2Any Channel +read:Object +startRead:Object +endRead:v
  • id
+poison:v
  • id
+destroy Reader:v
  • id
channelLocation:NetChannelLocation factory Class:Class NodeKey NodeKey Serializable C
  • m
parable NodeUI +createFrom StringForm :NodeUI +equals:boolean +com pareTo:int #checkEqual:boolean + hashC
  • de:int
stringForm :String im plStringForm :String com parisonString:String dy namic +ChannelEndNotMov eableEx ception MigratableChannelOutputIm pl +MigratableChannelEndFactory +ChannelEndContructionEx ception + M igratableC hannelInput + InputR econnectionM anager +Nam edMigratableChannelEndFactory Im pl +MigratableChannelEnd + N am edM igratableC hannelEndF actory DataSerializationFilter +Dy nam icClassLoader + O utputR econnectionM anager NodeClassLoader SerializedData Dy nam icClassLoaderMessage JFTP MigratableAltingChannelInputIm pl DeserializeChannelFilter InputReconnectionManagerCNSIm pl + M igratableAltingC hannelInput OutputReconnectionManagerCNSIm pl + M igratableC hannelO utput NotNam eableNetChannelLocation ClassManager ChannelInput interface NetChannelInput + destroyR eader:void factory Class:Class C loneable Serializable NetChannelLocation
  • v
cn:long
  • channelNode:NodeID
+NetChannelLocation +NetChannelLocation NetChannelLocation #NetChannelLocation +refresh:boolean +clone:Object +equals:boolean +hashCode:int #refreshFrom :v
  • id
#check Equal:boolean setLocationDetails:v
  • id
channelLabel:String channelAddress:NodeAddressID channelNodeID:NodeID stringID:String VCN:long security + SecurityAuthority +Sim pleSecurity Authority + C hallenge + U serID +AccessDeniedEx ception + U serT
  • ken
+ R esponse + SecurityService + SecurityAuthority AltingConnectionServ erIm pl NetA ltingConnectionServer
  • chan:NetAltingChannelInput
create:NetAltingConnectionServ er
  • NetAltingConnectionServ
er +getChannelLocation:NetChannelLocation +destroy Serv er:v
  • id
Serializable A pplicationID
  • nodeID:NodeID
  • appID:int
ApplicationID +toString:String +equals:boolean +hashCode:int
  • nSam
eBranch:boolean +getParentID:AbstractID ChannelIndexMap
  • threshold:int
  • count:int
  • loadFactor:float
  • size:int
  • data:Entry
[]
  • entry
Pool:Entry +ChannelIndex Map +get:ChannelOutput +put:boolean +rem
  • v
e:boolean
  • rehash:v
  • id
+em pty Pool:v
  • id
  • Entry
channels:Enum eration Serializable AbstractID AbstractID + getParentID :AbstractID
  • nSam
eBranch:boolean UIFactory UIForThisJVM:NodeUI Runtim eEx ception ServiceInstallationException +Serv iceInstallationEx ception +Serv iceInstallationEx ception Serializable A ny 2NetChannel
  • im
pl:One2NetChannel +Any 2NetChannel +Any 2NetChannel +Any 2NetChannel +Any 2NetChannel +w rite:v
  • id
+recreate:v
  • id
+recreate:v
  • id
+destroy W riter:v
  • id
+poison:v
  • id
channelLocation:NetChannelLocation factory Class:Class tcpip +TCPIPCNSServ erNT +TCPIPCNSServ er2 TCPIPLink Serv er TCPIPLink +TCPIPNodeFactory +TCPIPAddressID +TCPIPProtocolID +TCPIPCNSServ er interface NetChannelEndFactory + createN et2O ne:N etAltingC hannelInput + createN et2Any:N etSharedC hannelInput + createO ne2N et:N etC hannelO utput + createAny2N et:N etSharedC hannelO utput NetConnectionLocation
  • reqLoc:NetChannelLocation
+NetConnectionLocation requestChannelLocation:NetChannelLocation Serializable Specification ty pe:Class nam e:String intValue:int strValue:String dblValue:double booValue:boolean Specification Specification Specification Specification +equals:boolean +hashCode:int remote +Rem
  • teProcessFailedEx
ception +ChildProcess +Spaw nerServ ice Spaw nerMessage +Spaw nerServ iceNT +Rem
  • teSpaw
nEx ception +Rem
  • teProcess
ProcessSpaw ner AltingConnectionClientIm pl NetA ltingConnectionClient
  • from
Serv er:NetAltingChannelInput
  • location:NetConnectionLocation
create:NetAltingConnectionClient NetAltingConnectionClient +getChannelLocation:NetChannelLocation +destroy Client:v
  • id
Serializable C loneable NodeAddressID + equals:boolean + hashC
  • de:int
+clone:Object #getAddressIDFrom String:NodeAddressID protocolID:ProtocolID globally Unique:boolean stringForm :String Serializable One2NetChannel
  • channelID:ChannelID
  • channelIndex
:long
  • from
NetIn:AltingChannelInput
  • from
NetOut:SharedChannelOutput
  • toNet:ChannelOutput
  • brok
en:boolean
  • connected:boolean
  • m
essageA:ChannelMessage.Data
  • m
essageB:ChannelMessage.Data
  • sendMessageA:boolean
  • link
Profile:Profile
  • m
ax Unack now ledged:int
  • num
Unack now ledged:int
  • ack
now ledged:boolean failedLink s:Any 2OneChannel +One2NetChannel +One2NetChannel +One2NetChannel +One2NetChannel +w rite:v
  • id
link Failed:v
  • id
+destroy W riter:v
  • id
+recreate:v
  • id
+recreate:v
  • id
+poison:v
  • id
  • readObject:v
  • id
channelLocation:NetChannelLocation factory Class:Class Logger +MAX_LOGGING:int +DEFAULT_LOGGING_LEVEL:int +DEFAULT_CLASS_NAME:String
  • nam
e:String
  • output:PrintStream
  • lastClass:String
  • lev
els:Hashtable
  • lev
elsCached:boolean
  • all:Hashtable
+Logger +getLogger:Logger +setLev el:v
  • id
+log:v
  • id
+log:v
  • id
  • logIm
pl:v
  • id
+log:v
  • id
  • findMax
Lev el:int +log:v
  • id
+log:v
  • id
+log:v
  • id
+log:v
  • id
+log:v
  • id
  • Inv
alidLoggerEx ception dev ice:String Ex ception NodeInitFailedException NodeInitFailedEx ception NodeInitFailedEx ception Serializable C loneable C
  • m
parable NodeID
  • addressIDs:NodeAddressID[]
  • unrecognisedAddressIDs:HashSet
  • dom
ainID:Dom ainID
  • nodeUI:NodeUI
  • nam
e:String NodeID NodeID NodeID
  • NodeID
+clone:Object +equals:boolean +hashCode:int +com pareTo:int +com pareToLocalNode:int
  • nSam
eBranch:boolean +getAddresses:NodeAddressID[] addAddress:v
  • id
rem
  • v
eAddress:v
  • id
createFrom StringForm :NodeID getStringForm :String setDom ainID:v
  • id
+getParentID:AbstractID +getDom ainID:Dom ainID +getNam e:String +toString:String setNam e:v
  • id
  • readObject:v
  • id
  • w
riteObject:v
  • id
Runtim eEx ception DuplicateChannelLabelException DuplicateChannelLabelEx ception DuplicateChannelLabelEx ception LoopbackLink
  • loopBack
:FilteredOne2OneChannel Loopback Link #runTx Rx Loop:v
  • id
#getRem
  • teNodeID:NodeID
  • Tx
Loop
  • Rx
Loop
  • Tx
LoopPoison
  • Loopback
SerializationFilter LinkFactory
  • instance:Link
Factory
  • builders:Hashtable
  • Link
Factory getInstance:Link Factory m ak eLink :Link m ak eLink :Link installBuilder:boolean rem
  • v
eBuilder:boolean getTx Protocols:ProtocolID[] + Builder
  • ProtocolCom
parator
  • ProtocolPerform
anceCom parator Runtim eEx ception ReaderIndexException Node
  • nodeID:NodeID
  • specifications:Specification[]
  • uiFactory
:UIFactory
  • initialized:boolean
  • protocolManager:ProtocolManager
  • serv
iceManager:Serv iceManager
  • nodeKey
:NodeKey
  • appIDCounter:int
  • instance:Node
  • factory
:NodeFactory +info:Logger +err:Logger
  • Node
+getInstance:Node +setNodeFactory :v
  • id
+init:NodeKey +init:NodeKey +init:NodeKey +init:NodeKey +init:NodeKey +isThisNode:boolean check Initialized:v
  • id
+isInitialized:boolean +getNodeID:NodeID getActualNode:NodeID +getNew ApplicationID:ApplicationID +getProtocolManager:ProtocolManager +getServ iceManager:Serv iceManager getServ iceManager:Serv iceManager +getServ iceUserObject:Serv iceUserObject +v erify Key :boolean +getNodeSpecifications:Specification[] +link Ex ists:boolean +getLink LostEv entChannel:AltingChannelInput + Attributes
  • AttributesAccess
Requirement ty pe:Class nam e:String specNam e:String com parator:String intValue:int strValue:String dblValue:double booValue:boolean
  • COMPARATOR_EQUALS:String
  • COMPARATOR_LESS_THAN:String
  • COMPARATOR_GREATER_THAN:String
Requirem ent Requirem ent Requirem ent Requirem ent +m atches:boolean
  • BooleanCom
parable interface NetLabelledBufferedChannelEn... + createN et2O ne:N etAltingC hannelInput + createN et2Any:N etSharedC hannelInput interface ServiceUserObject ServiceManager
  • serv
ices:Hashtable +installServ ice:boolean +installServ ice:boolean +startServ ice:boolean +uninstallServ ice:boolean +getServ ice:Serv ice serv iceNam es:String[] ProtocolManager
  • instance:ProtocolManager
  • link
Serv ers:Hashtable
  • protocolClients:Hashtable
  • addressSpecifications:Hashtable
  • protocolSpecifications:Hashtable
  • ProtocolManager
getInstance:ProtocolManager +getProtocolSpecifications:Specification[] +getAddressSpecifications:Specification[] +installProtocolServ er:boolean +stopProtocolServ er:boolean +installProtocolClient:boolean +rem
  • v
eProtocolClient:boolean C SProcess Link
  • HS_ERROR:int
  • HS_TEMPORARY:int
  • HS_OK:int
  • connected:boolean
  • client:boolean
  • im
:Index Manager #tx Channel:FilteredAny 2OneChannel #sendNodeID:boolean
  • perform
edPingTest:boolean
  • pingReply
Chan:One2OneChannel
  • security
Authority :Security Authority +Link #connect:boolean #createResources:boolean #destroy Resources:v
  • id
#ex changeNodeIDs:boolean #runTx Rx Loop:v
  • id
#w aitForReplies:v
  • id
#w riteTestObject:v
  • id
#readTestObject:Object #w riteLink Decision:v
  • id
#readLink Decision:boolean addTx Filter:v
  • id
rem
  • v
eTx Filter:v
  • id
#deliv erReceiv edObject:v
  • id
+ping:long +perform edPingTest:boolean #getReadSequence:boolean[]
  • runTestProcess:v
  • id
  • registerLink
:boolean
  • registerFailure:v
  • id
  • lostLink
:int +equals:boolean +hashCode:int +run:v
  • id
  • handshak
e:int +obtainNodeID:NodeID
  • Link
Test tx FilterCount:int rem
  • teNodeID:NodeID
protocolID:ProtocolID profile:Profile tx Channel:ChannelOutput specifications:Specification[] pingTim e:long C SProcess NetChannelInputProcess
  • channelIndex
:long
  • channelID:ChannelID
  • nam
e:String
  • from
NetIn:AltingChannelInput
  • from
NetOut:SharedChannelOutput
  • out:RejectableChannel
  • stopChannel:Any
2OneChannel
  • alt:Alternativ
e
  • ack
A:ChannelMessage.Ack
  • ack
B:ChannelMessage.Ack
  • sendAck
A:boolean NetChannelInputProcess break Channel:v
  • id
getChannelIndex :long
  • readFrom
NetChannel:Object +run:v
  • id
ChannelOutput interface NetChannelOutput + recreate:void + recreate:void + destroyW riter:void factory Class:Class NetConnection
  • factory
:StandardNetConnectionFactory +createNet2One:NetAltingConnectionServ er +createNet2Any :NetSharedConnectionServ er +createOne2Net:NetAltingConnectionClient +createAny 2Net:NetSharedAltingConnectionClient Profile
  • alw
ay sMatchProfile:Profile
  • link
Profiles:Hashtable
  • nodeProfiles:Hashtable
  • nam
e:String
  • ex
act:boolean
  • sy
stem :boolean
  • requirem
ents:Requirem ent[] createNew Link Profile:v
  • id
createNew NodeProfile:v
  • id
+getLink Profile:Profile +getNodeProfile:Profile getAlw ay sMatchProfile:Profile getProtocolProfile:Profile
  • Profile
m atches:int requiresEx actMatch:boolean +equals:boolean +hashCode:int Serializable ProtocolID +equals:boolean +hashCode:int + requiresU serInteraction:boolean #getLinkBuilder:LinkF actory.Builder #startLinkServer:LinkServer #createAddressID :N
  • deAddressID
activ e:boolean position:int SharedConnectionServ erIm pl NetSharedConnectionServerImpl
  • sy
nchChan:Any 2OneChannel
  • in:NetAltingChannelInput
create:NetSharedConnectionServ erIm pl
  • NetSharedConnectionServ
erIm pl +getChannelLocation:NetChannelLocation +duplicate:SharedConnectionServ er +destroy Serv er:v
  • id
Serializable interface NodeFactory + initN
  • de:N
  • deKey
PingRequirement acceptableDifference:int PingRequirem ent +m atches:boolean XMLNodeFactory
  • config:JCSPConfig
+XMLNodeFactory +XMLNodeFactory +XMLNodeFactory +initNode:NodeKey ConnectionClient interface NetConnectionClient + destroyC lient:void ConnectionServ er interface NetConnectionServer + destroyServer:void SharedChannelInput interface NetSharedChannelInput interface NetLabelledChannelEndFactory + createN et2O ne:N etAltingC hannelInput + createN et2Any:N etSharedC hannelInput SharedChannelOutput interface NetSharedChannelOutput interface Service + start:boolean + stop:boolean + init:boolean running:boolean userObject:Serv iceUserObject Serializable GlobalID +instance:GlobalID +equals:boolean +hashCode:int +toString:String
  • nSam
eBranch:boolean parentID:AbstractID Serializable SerializedMessage
  • serializedObject:SerializedObject
  • isInternalClass:boolean
+SerializedMessage SerializedMessage +get:Object +get:Object
  • AccesibleBy
teArray OutputStream serializedData:by te[]
slide-16
SLIDE 16

Problem – Message Cost

  • Object messages are expensive

– Serialization of message + serialization of sent object

  • Object streams reset after each send

– Internal pool of messages – Aliasing on stream – Class information sent each time

  • Deal of sent information

– Type, destination, source and possibly data

slide-17
SLIDE 17

Problem – Message Cost

1 2 3 4 5 6 7 8 9 0 TC_OBJECT TC_CLASSDESC Name length (32)

  • r

g . j c 10 s p . n e t . C h a 20 n n e l M e s s a g 30 e $ D a t a Class Serialization Identifier 40 Flags Variable count (2) Z (boolean) Name length (12) 50 a c k n

  • w

l e d g 60 e d L (Object) Name length (4) d a t a TC_STRING 70 Name length (18) L j a v a / l a 80 n g / O b j e c t ; 90 TC_ENDBLOCKDATA TC_CLASSDESC Name length (27)

  • r

g . j c 100 s p . n e t . C h a 110 n n e l M e s s a g 120 e Class Serialization Identifier Flags 130 Variable count (0) TC_ENDBLOCKDATA TC_CLASSDESC Name length (20)

  • r

g . 140 j c s p . n e t . M 150 e s s a g e Class Serialization Identifier 160 Flags Variable count (3) J (long) Name length (9) 170 d e s t I n d e x J (long) 180 Name length (11) s

  • u

r c e I n 190 d e x L (Object) Name length (12) d e s t 200 V C N L a b e l TC_STRING Name length (18) 210 L j a v a / l a n 220 g / S t r i n g ; TC_ENDBLOCKDATA 230 TC_BASE destIndex sourceIndex 240 destVCNLabel acknowledged data

slide-18
SLIDE 18

Problem – Message Cost

1 2 3 4 5 6 7 8 9 0 TC_OBJECT TC_CLASSDESC Name length (31)

  • r

g . j c 10 s p . n e t . C h a 20 n n e l M e s s a g 30 e $ A c k Class Serialization Identifier 40 Flags Variable count (0) TC_ENDBLOCKDATA TC_CLASSDES Name length (27) 50 o r g . j c s p . n 60 e t . C h a n n e l 70 M e s s a g e Class Serialization Identifier 80 Flags Variable count (0) TC_ENDBLOCKDATA TC_CLASSDESC 90 Name length (20)

  • r

g . j c s p 100 . n e t . M e s s a 110 g e Class Serialization Identifier 120 Flags Variable Count (3) J (Long) Name length (9) d e s t 130 I n d e x J (Long) Name length (11) s

  • 140 u

r c e I n d e x L (Object) 150 Name length (12) d e s t V C N L 160 a b e l TC_STRING Name length (18) L j a 170 v a / l a n g / S t 180 r i n g ; TC_ENDBLOCKDATA TC_BASE destIndex 190 sourceIndex 200 destVCNLabel

slide-19
SLIDE 19

Problem – (Java) Objects Only

  • Channel will only take objects

– ChannelMessage.Data only takes object data

  • Workarounds

– Auto boxing, convert into byte array first

  • Still a Java object

– Serialization overhead – No inter-framework communication

slide-20
SLIDE 20

Problem - Performance

  • Different test classes developed

– Varying in complexity (unique objects to object references) – Internal object arrays (Integer and Double) – Varying in size n (0 to 100)

  • TestObject4

– Large and fairly complex

  • Size

– (n = 0) ⟶ 326 bytes – (n = 1) ⟶ 500 bytes – (n > 1) ⟶ 500 + 68(n – 1) bytes

  • Complexity

– Object references: 10 + 8n – Unique objects: 10 + 4n

  • Roundtrip time – PDA to PC
slide-21
SLIDE 21

Problem - Performance

5000 10000 15000 20000 25000 30000 35000 40000 45000 50000 326 2132 3832 5532 7232 Time ms Size of Sent Object (Bytes) Normal Streams Buffered Streams

slide-22
SLIDE 22

Problem - Performance

1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 326 2132 3832 5532 7232 Time ms Size of Sent Object (Bytes) Buffered Streams Networked Channels

slide-23
SLIDE 23

Problem – High Priority Links

  • Link processes given maximum priority in the JVM

– Depends on JVM implementation

  • Computation must wait for I/O to complete

– Within obvious I/O performance and multi-core properties

  • Adding Links and channels increases I/O

requirements

– And thus reduces computation resources

  • JCSP networking aimed at high computation to low

communication ratio systems

slide-24
SLIDE 24

Problem – High Priority Links

1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 326 2132 3832 5532 7232 Time ms Size of Sent Object (Bytes) Network Channel Receive Unacked Channel Receive

slide-25
SLIDE 25

Problem – High Priority Links

  • CommsTime on PDA

100 1000 10000 100000 Time ms Time

slide-26
SLIDE 26

Problem – Exception Handling

  • Poor exception handling

– write() may block if Link to input end fails

– Exceptions thrown internally but not propagated – If lucky might get a LinkLostException – If luckier might get a ChannelDataRejectedException

  • Rejectable channels now deprecated

– Use LinkLostEventChannel to detect Link failure

  • NetChannelOutput not guarded
slide-27
SLIDE 27

Problem – Lack of Protocol

  • No interaction between frameworks

– Even between different versions of Java

  • Difficult to add new communication primitives

– Can use underlying network channels (extra resources) – Numerous places to add functionality

  • Data should be extracted from communication

message

– Serialization (again)

slide-28
SLIDE 28

Ongoing Work and Conclusions

  • JCSP Networking 2.0

– Features

  • Conclusions
slide-29
SLIDE 29

Towards a Better Solution

  • JCSP Networking 2.0

– See Fringe session

  • Features

– Lower resource usage

  • Input channels are now lightweight

– Reduced message size

  • 9 bytes standard, 13 for data messages

– Better performance and scalability – No reliance on serialization – Data conversion extracted to channel layer

slide-30
SLIDE 30

Towards a Better Solution

  • Features (continued)

– Simpler (layered) model

  • Layers only understand certain

message types

– Easier to extend – Networked barrier – Properties exposed

  • Link priority, buffer size

– Error handling improved – Well defined protocol – Verified model

  • Using Spin (mobile channels)
  • FDR? – mobile channels in CSP
slide-31
SLIDE 31

Conclusions

  • JCSP Networking had some problems

– Resource usage – Performance – serialization – Interoperability – serialization – Configuration and extension – Exception handling – All reflect badly for JCSP outside parallel computing usage

  • These can be overcome

– New JCSP Networking implementation – New protocol

  • Future work – framework interaction?

– JCSP, pony, C++CSP, PyCSP, CSP.NET

slide-32
SLIDE 32

Questions?