Rapid Prototyping Via Photopolymerization ISE 767 Rapid Prototyping .
MobiCS: An Environment for Prototyping and Simulating Distributed Protocols for Mobile Networks
description
Transcript of MobiCS: An Environment for Prototyping and Simulating Distributed Protocols for Mobile Networks
MobiCS: MobiCS: An Environment for Prototyping An Environment for Prototyping
and Simulating Distributed and Simulating Distributed Protocols for Mobile NetworksProtocols for Mobile Networks
Ricardo C.A. da Rocha (IME/USP)Ricardo C.A. da Rocha (IME/USP)
[email protected]@ime.usp.br
Markus Endler (PUC-Rio)Markus Endler (PUC-Rio)
[email protected]@inf.puc-rio.br
OutlineOutline
Motivation and Related WorksMotivation and Related Works System Model and Reference ArchitectureSystem Model and Reference Architecture MobiCS OverviewMobiCS Overview Deterministic simulationDeterministic simulation Stochastic simulationStochastic simulation Example Example ConclusionsConclusions
Motivation Motivation
Characteristics of Mobile Computing Characteristics of Mobile Computing EnvironmentsEnvironmentsDynamic Network TopologyDynamic Network Topology Energy is scarce resource Energy is scarce resource Mobile Mobile
Host may enter doze mode or be turned offHost may enter doze mode or be turned off Wireless communication Wireless communication
unreliable connectivity (e.g. intermittent periods of disconnection)
QoS parameters change very fast lower throughput
Motivation Motivation
Distributed Protocols for Mobile Computing Distributed Protocols for Mobile Computing should...should... handle variable number of interacting nodes handle variable number of interacting nodes make efficient use of wireless communicationmake efficient use of wireless communication consider non-availability consider non-availability failure failure maintain consistent distributed state despite maintain consistent distributed state despite
disconnections disconnections be correct and efficient for any number of hosts be correct and efficient for any number of hosts
(scalability) and mobility pattern (mobility (scalability) and mobility pattern (mobility robustness)robustness)
FactFact: Evaluating the protocol´s correctness and : Evaluating the protocol´s correctness and efficiency are difficult tasksefficiency are difficult tasks
MotivationMotivation Our goal:Our goal:
Build a tool for rapid prototyping and evaluation of Build a tool for rapid prototyping and evaluation of distributed protocols (e.g. multicast, reliable message distributed protocols (e.g. multicast, reliable message delivery, notification protocols) delivery, notification protocols)
Approach:Approach: Protocol evaluation (correctness & Protocol evaluation (correctness & efficiency) through simulation.efficiency) through simulation.
The tool should support:The tool should support:definition of appropriate abstractions for programming definition of appropriate abstractions for programming
the protocol (e.g. message, request-reply, transaction)the protocol (e.g. message, request-reply, transaction)design of network elements with arbitrarydesign of network elements with arbitrary behaviors.behaviors.programming of appropriate simulation models, programming of appropriate simulation models,
specially specially mobility modelsmobility models..
Other Simulators Other Simulators
Protocol developer has also to deal with Protocol developer has also to deal with low-level details.low-level details.
Form of simulation (e.g. parallel) is not Form of simulation (e.g. parallel) is not fully transparent.fully transparent.
Limited extensibility.Limited extensibility. Lack of Lack of integrated supportintegrated support for protocol for protocol
validation and testing.validation and testing. Limited programmabilty of mobility Limited programmabilty of mobility
models.models.
Common LimitationsCommon Limitations
System Model for Protocols in System Model for Protocols in Mobile ComputingMobile Computing
We assume a We assume a structured mobile networkstructured mobile network composed of composed of Mobile Hosts (MHs), Mobility Support Stations (MSSs)Mobile Hosts (MHs), Mobility Support Stations (MSSs)
We adopt the We adopt the Indirect ModelIndirect Model [Badrinath94], where all [Badrinath94], where all communications are split into a communications are split into a wiredwired and a and a wireless partwireless part
Basic unit of interaction in a protocol Basic unit of interaction in a protocol messagemessage If mobile host is reachable, wireless message is delivered. If mobile host is reachable, wireless message is delivered.
But MH may be disconnected or migrating.But MH may be disconnected or migrating. QoS of the wireless connection is modeled as its effective QoS of the wireless connection is modeled as its effective
transmission rate.transmission rate. Hand-Off is initiated by the MHHand-Off is initiated by the MH At any time, every MH is associated with exactly one MSSAt any time, every MH is associated with exactly one MSS
Reference Architecture for Reference Architecture for SimulationSimulation
Application makes service Application makes service requests (user or requests (user or automatically generated)automatically generated)
Distributed Protocols are Distributed Protocols are programmed and tested programmed and tested
Network Elements implement Network Elements implement HWHW and and basic SWbasic SW functionality (OS, low-level functionality (OS, low-level Netw. Protocols) Netw. Protocols)
Simulation Engine:Simulation Engine: schedules event processing orderschedules event processing order may implement several may implement several
simulation modes. simulation modes.
Simulation Simulation EngineEngine
Network ElementsNetwork Elements
ApplicationApplication
Distributed Distributed ProtocolsProtocols
MobiCSMobiCSMobiMobile CComputing SSimulator MobiCSMobiCS is a java class library implementing the is a java class library implementing the
Reference ArchitectureReference Architecture Main Advantages:Main Advantages:
Single tool Single tool for prototyping, validating and analysing for prototyping, validating and analysing distributed protocols.distributed protocols.
A generic Simulation Engine API offers completeA generic Simulation Engine API offers complete transparency of simulation modestransparency of simulation modes..
ProgrammableProgrammable and and customizable simulation modelscustomizable simulation models (e.g. mobility, connectivity, etc.)(e.g. mobility, connectivity, etc.)
Supports the Supports the creation of abstractionscreation of abstractions for protocol for protocol implementation.implementation.
Comes with a Comes with a deterministicdeterministic and a and a stochasticstochastic simulation simulation modemode (others may be added). (others may be added).
MobiCS:MobiCS:Protocol Programming Protocol Programming
Object-oriented protocol design Object-oriented protocol design Protocols are composed of Protocols are composed of micro-protocolsmicro-protocols, which , which
interact through interact through eventsevents (mainly, messages and (mainly, messages and timers)timers)
Main Protocol Components:Main Protocol Components:
Micro-protocols are Java interfaces whose Micro-protocols are Java interfaces whose methods are handlers for the events.methods are handlers for the events.
Protocol
WiredWired WirelessWireless HandoffHandoff
MobiCS:MobiCS:Deterministic Simulation Deterministic Simulation Used for debugging/testing the correctness of the Used for debugging/testing the correctness of the
protocol.protocol. A user creates a simulation A user creates a simulation scriptscript, which is executed by , which is executed by
the simulator. the simulator. This script describes a specific scenario (i.e. pattern of This script describes a specific scenario (i.e. pattern of
protocol-external eventsprotocol-external events) ) Events may be application requests, MH migrations, Events may be application requests, MH migrations,
MH disconnections, etc.MH disconnections, etc. Global synchronization points Global synchronization points end_step()end_step() in the script in the script
define the causal order relationship among the events.define the causal order relationship among the events. Message acceptance can be toggled on/off to simulate Message acceptance can be toggled on/off to simulate
message transmission delays: message transmission delays: Accept(msgTypeAccept(msgType)) and and AcceptTurnOn(bool)AcceptTurnOn(bool)..
MobiCS:MobiCS:Deterministic Simulation Deterministic Simulation
Example:Example:
The simulation executes in steps (i.e. there is no notion The simulation executes in steps (i.e. there is no notion of simulated time)of simulated time)
Scripts should reflect Scripts should reflect critical situationscritical situations in which the in which the protocol behaviour is to be tested.protocol behaviour is to be tested.
Since only a minimal fraction of all possible situations Since only a minimal fraction of all possible situations can be described, this method gives can be described, this method gives no guarantee of the no guarantee of the protocol´s correctness protocol´s correctness testing testing
Mh1.moveTo(cell1); // Mh1 at cell of Mss3Mh1.send(new Req);Mss3.accept(Req);end_step();
Mh2.unavailable();
Mh1.moveTo(cell1); // Mh1 at cell of Mss3Mh1.send(new Req);Mss3.accept(Req);end_step();
Mh2.unavailable();
MobiCS:MobiCS:Deterministic Simulation Deterministic Simulation
server
Home agent (ha)
MSSo
MSSn
mh
req
req
res
res
res
C
ScriptScript{ha,MSSo,MSSn}.acceptO
n()mh.send(new Req());mh.moveTo(MSSn);end_step(); // cut Cserver.accept(Req);mh.accept(Res);
ScriptScript{ha,MSSo,MSSn}.acceptO
n()mh.send(new Req());mh.moveTo(MSSn);end_step(); // cut Cserver.accept(Req);mh.accept(Res);
Independent events
MobiCS:MobiCS:Deterministic Simulation Deterministic Simulation
OutputOutput
Programmer may add printout of messages in Programmer may add printout of messages in specific event handlersspecific event handlers
User-configurableUser-configurable Event Log Event Log generated by generated by MobiCS´ simulation engine.MobiCS´ simulation engine.
Exceptions raised during execution of either Exceptions raised during execution of either the script or the protocol code.the script or the protocol code.
MobiCS:MobiCS:Stochastic Simulation Stochastic Simulation
Allows “performance analysis” of a protocol (i.e. message Allows “performance analysis” of a protocol (i.e. message complexity) complexity)
Conists of a continuous test with randomly generated events. Conists of a continuous test with randomly generated events. User creates a User creates a simulation modelsimulation model::
Defines the behavior of all network elements concerning Defines the behavior of all network elements concerning mobilitymobility and and connectivityconnectivity..
Simulation Model can be:Simulation Model can be: programmedprogrammed (extending classes) or (extending classes) or configuredconfigured (instantiation of pre-defined objects). (instantiation of pre-defined objects).
A simulationObject (for each network element) determines A simulationObject (for each network element) determines whether an event of certain type will be generated at each whether an event of certain type will be generated at each simulated time unitsimulated time unit..
Using MobiCSUsing MobiCS
Protocol Implementation Protocol Implementation extend basic extend basic classes classes ProtocolProtocol and and MessageMessage
Implement the Network Elements and Implement the Network Elements and configure the network to be simulated configure the network to be simulated extend basic classes extend basic classes MssMss, , MhMh, ..., ...
Build the simulation scenarios:Build the simulation scenarios:Choose the deterministic scenarios Choose the deterministic scenarios program program
deterministic script deterministic script run simulation run simulation compare compare expected and real resultexpected and real result
Choose stochastic simulation model Choose stochastic simulation model create create corresponding simulation objects corresponding simulation objects run simulations run simulations analyse event log analyse event log
Hand-off
server
proxy
MSSpMh
MSSo
MSSn
ExampleExampleRDP RDP
Req
ReqRes
Greet
DeRegPList
UpCurLoc
ForwardRes
?
Greet
DeReg PList
UpCurLoc
ForwardRes
FRes
Ack
Ack
Ack
Proxy created
RDP Structuring: RDP Structuring: Protocol Interactions Protocol Interactions
wirelesswireless
wiredwired
handoffhandoff
Mss
wirelesswireless
wiredwired
handoffhandoff
Mss
wirelesswireless
Mh
ForwardRes
Ack
RemPListForwardResPList
UpdCurrLoc
DeReg
Req,Ack
ForwardRes
• Protocol structured as 3 micro-protocols wired, wireless e handoff
RDP Structuring:RDP Structuring:Protocols Protocols
Since there are 3 types of network elements, Since there are 3 types of network elements, Server, Mh and Mss Server, Mh and Mss ......
we need to declare following we need to declare following Protocol interfaces: Protocol interfaces:
Define 3 protocol instances (subclasses of Define 3 protocol instances (subclasses of Protocol): Protocol): RDPServer, RDPMh, RDPMssRDPServer, RDPMh, RDPMss,, that that implement the corresponding implement the corresponding ProtocolsProtocols
RDPHandOffModuleRDPMssWiredRDPMssWirelessRDPMhWirelessRDPServerWired
Example:Example:Network Configuration Network Configuration
mh = mh = newnew MyMh( MyMh(“Mh 1"“Mh 1",sim);,sim);cell1 = cell1 = newnew Cell(); Cell();cell2 = cell2 = newnew Cell(); Cell();cell3 = cell3 = newnew Cell(); Cell();mss1 = mss1 = newnew MyMss( MyMss(“Mss 1"“Mss 1",sim,cell1);,sim,cell1);mss2 = mss2 = newnew MyMss( MyMss(“Mss 2"“Mss 2",sim,cell2);,sim,cell2);mss3 = mss3 = newnew MyMss( MyMss("Mss 3""Mss 3",sim,cell3);,sim,cell3);wr = wr = new new WiredLink(mss2.getAddress(),WiredLink(mss2.getAddress(), mss1.getAddress());mss1.getAddress());wr2 = wr2 = newnew WiredLink(mss1.getAddress(), WiredLink(mss1.getAddress(), mss3.getAddress());mss3.getAddress());
mh = mh = newnew MyMh( MyMh(“Mh 1"“Mh 1",sim);,sim);cell1 = cell1 = newnew Cell(); Cell();cell2 = cell2 = newnew Cell(); Cell();cell3 = cell3 = newnew Cell(); Cell();mss1 = mss1 = newnew MyMss( MyMss(“Mss 1"“Mss 1",sim,cell1);,sim,cell1);mss2 = mss2 = newnew MyMss( MyMss(“Mss 2"“Mss 2",sim,cell2);,sim,cell2);mss3 = mss3 = newnew MyMss( MyMss("Mss 3""Mss 3",sim,cell3);,sim,cell3);wr = wr = new new WiredLink(mss2.getAddress(),WiredLink(mss2.getAddress(), mss1.getAddress());mss1.getAddress());wr2 = wr2 = newnew WiredLink(mss1.getAddress(), WiredLink(mss1.getAddress(), mss3.getAddress());mss3.getAddress());
Example: Choosing a Example: Choosing a Deterministic Scenario Deterministic Scenario
Goal: Test protocol when ForwardRes Goal: Test protocol when ForwardRes arrives at a MSS while a Mh is migrating to arrives at a MSS while a Mh is migrating to another cellanother cell
server
proxy
MSSpMh
MSSo
MSSn
?
Greet
DeReg PList
UpCurLoc
ForwardRes
FRes
Ack
Ack
Ack
Req
ReqRes
Greet
DeRegPListUpCurLoc
ForwardRes
Proxy created
MSSo receives ForwardRes beforehandoff of Mh is completed
MSSo receives ForwardRes beforehandoff of Mh is completed
Example: Example: Scripting the Scenario Scripting the Scenario
server
proxy
MSSpMh
MSSo
MSSn
?
Greet
DeReg PList
UpCurLoc
ForwardRes
FRes
Ack
Ack
Ack
Req
ReqRes
Greet
DeRegPListUpCurLoc
ForwardRes
Proxy created
Server.acceptTurnOn(false);MSSn.acceptTurnOn(false);Mh.send(new Req());Mh.moveTo(MSSo);end_step();Mh.moveTo(MSSn);end_step();Server.acceptTurnOn(true);end_step();MSSn.acceptTurnOn(true);
Server.acceptTurnOn(false);MSSn.acceptTurnOn(false);Mh.send(new Req());Mh.moveTo(MSSo);end_step();Mh.moveTo(MSSn);end_step();Server.acceptTurnOn(true);end_step();MSSn.acceptTurnOn(true);
Example:Example:Stochastic Simulation Stochastic Simulation
Example of a Simulation ModelExample of a Simulation ModelMH ActivityMH Activity and and Cell AttractionCell Attraction
Activity: probability that a MH is active (reachable) Cell Atraction: probability that a migrating MH chooses the
cell as its target cell MobilidadeMigration Willingness: probability that a MH moves to another
cell
Network TopologyNetwork Topology: neighbourhood relation among : neighbourhood relation among cellscells
Wireless QoSWireless QoS: Effective wireless transmission rate : Effective wireless transmission rate Application requestsApplication requests: probability that a service is : probability that a service is
requested from the protocol (e.g. RDP request)requested from the protocol (e.g. RDP request)
Stochastic Simulation: Some Stochastic Simulation: Some Results Results We measured how the number of re-transmissions We measured how the number of re-transmissions
(ForwardResult) per Requests is affected by the Mobility Factor (ForwardResult) per Requests is affected by the Mobility Factor Mobility factor = probability that a migration event is generated Mobility factor = probability that a migration event is generated
every n simulated time units every n simulated time units
Other tests: size of proxyList with growing Request/Migration Other tests: size of proxyList with growing Request/Migration RatioRatio
ConclusionConclusion: RDP´s message overhead grows quickly with : RDP´s message overhead grows quickly with increasing migration and request rates. increasing migration and request rates.
0
0.5
1
1.5
2
0 0.2 0.4 0.6 0.8 1
Migration Factor
Forw
ardR
esul
t /
Req
uest
s
ConclusionsConclusions
MobiCSMobiCS Flexible simulation environment that Flexible simulation environment that integrates protocol testing (correctness) and integrates protocol testing (correctness) and performance analysisperformance analysis
Supports modular and extensible prototyping of Supports modular and extensible prototyping of distributed protocols distributed protocols OO and OO and micro-protocolsmicro-protocols
Provides deterministic and stochastic simulation Provides deterministic and stochastic simulation modes, and allows for other modes (e.g. parallel) to modes, and allows for other modes (e.g. parallel) to be programmed.be programmed.
Protocol implementation is totally independent of Protocol implementation is totally independent of
the chosen simulation mode.the chosen simulation mode.
ConclusionsConclusions Main Contributions:Main Contributions:
Implementation of a tool for prototyping and analysis of Implementation of a tool for prototyping and analysis of distributed protocols distributed protocols MobiCSMobiCS
Proof of concept of:Proof of concept of:Reference ArchitectureReference Architecture for flexible and extensible for flexible and extensible
simulators for Mobile Computing.simulators for Mobile Computing.Framework for the implementation of MC simulation Framework for the implementation of MC simulation
models and integration in a simulatormodels and integration in a simulator
Usability Usability MobiCS has been used in a graduate courses at IME/USP MobiCS has been used in a graduate courses at IME/USP
to implement a multicast protocol MCAST [Acharya93]to implement a multicast protocol MCAST [Acharya93]
Conclusions Conclusions
Future Works: Future Works: Define “Network Emulation API” Define “Network Emulation API” MobiCS as a MobiCS as a
testbed for MC applicationstestbed for MC applicationsBuild library of mobility and wireless QoS models.Build library of mobility and wireless QoS models.Implement parallel simulation mode.Implement parallel simulation mode.Create Graphic User Interfaces Create Graphic User Interfaces script creation, script creation,
log-based animation, protocol debugginglog-based animation, protocol debugging
MobiCS is freely availableMobiCS is freely availableURL URL http://www.ime.usp.br/~rcarocha/mobicshttp://www.ime.usp.br/~rcarocha/mobics