diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-06-22 15:00:11 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-22 15:00:11 +0200 |
| commit | 8a2b475f082572033438eb5b8703d211323f1b52 (patch) | |
| tree | 76179cf3802a34d65829f4d8b9aa708c9a41eec1 /opendc-faas | |
| parent | 147951f39de8f93eba6c7b0b7e6e5c9d2bce32e7 (diff) | |
| parent | dcd1bc82b9126b8122c671102d4d22843b73c847 (diff) | |
simulator: Add support for networking (v1)
This change adds support for networking in the simulator.
As outlined in #84, the network model doesn't model individual packets,
but instead considers dynamic flows between network devices.
This pull request adds the bare-minimum implementation necessary to model network traffic.
In the future, we will add advanced functionality such as routing and other L3 concepts.
* Add core model for network simulation
* Add model for network adapter that attaches to machine
* Add virtual network switch to bridge traffic between hosts.
Diffstat (limited to 'opendc-faas')
2 files changed, 5 insertions, 5 deletions
diff --git a/opendc-faas/opendc-faas-simulator/src/main/kotlin/org/opendc/faas/simulator/SimFunctionDeployer.kt b/opendc-faas/opendc-faas-simulator/src/main/kotlin/org/opendc/faas/simulator/SimFunctionDeployer.kt index 602f1678..68bdc337 100644 --- a/opendc-faas/opendc-faas-simulator/src/main/kotlin/org/opendc/faas/simulator/SimFunctionDeployer.kt +++ b/opendc-faas/opendc-faas-simulator/src/main/kotlin/org/opendc/faas/simulator/SimFunctionDeployer.kt @@ -33,7 +33,7 @@ import org.opendc.faas.simulator.delay.DelayInjector import org.opendc.faas.simulator.workload.SimFaaSWorkloadMapper import org.opendc.simulator.compute.SimBareMetalMachine import org.opendc.simulator.compute.SimMachine -import org.opendc.simulator.compute.SimMachineModel +import org.opendc.simulator.compute.model.MachineModel import org.opendc.simulator.compute.power.ConstantPowerModel import org.opendc.simulator.compute.power.SimplePowerDriver import org.opendc.simulator.resources.SimResourceInterpreter @@ -49,7 +49,7 @@ import kotlin.coroutines.resumeWithException public class SimFunctionDeployer( private val clock: Clock, private val scope: CoroutineScope, - private val model: SimMachineModel, + private val model: MachineModel, private val delayInjector: DelayInjector, private val mapper: SimFaaSWorkloadMapper ) : FunctionDeployer { diff --git a/opendc-faas/opendc-faas-simulator/src/test/kotlin/org/opendc/faas/simulator/SimFaaSServiceTest.kt b/opendc-faas/opendc-faas-simulator/src/test/kotlin/org/opendc/faas/simulator/SimFaaSServiceTest.kt index ceb91e75..64f2551b 100644 --- a/opendc-faas/opendc-faas-simulator/src/test/kotlin/org/opendc/faas/simulator/SimFaaSServiceTest.kt +++ b/opendc-faas/opendc-faas-simulator/src/test/kotlin/org/opendc/faas/simulator/SimFaaSServiceTest.kt @@ -36,7 +36,7 @@ import org.opendc.faas.service.autoscaler.FunctionTerminationPolicyFixed import org.opendc.faas.service.router.RandomRoutingPolicy import org.opendc.faas.simulator.delay.ZeroDelayInjector import org.opendc.faas.simulator.workload.SimFaaSWorkload -import org.opendc.simulator.compute.SimMachineModel +import org.opendc.simulator.compute.model.MachineModel import org.opendc.simulator.compute.model.MemoryUnit import org.opendc.simulator.compute.model.ProcessingNode import org.opendc.simulator.compute.model.ProcessingUnit @@ -50,13 +50,13 @@ import org.opendc.simulator.core.runBlockingSimulation @OptIn(ExperimentalCoroutinesApi::class) internal class SimFaaSServiceTest { - private lateinit var machineModel: SimMachineModel + private lateinit var machineModel: MachineModel @BeforeEach fun setUp() { val cpuNode = ProcessingNode("Intel", "Xeon", "amd64", 2) - machineModel = SimMachineModel( + machineModel = MachineModel( cpus = List(cpuNode.coreCount) { ProcessingUnit(cpuNode, it, 1000.0) }, memory = List(4) { MemoryUnit("Crucial", "MTA18ASF4G72AZ-3G2B1", 3200.0, 32_000) } ) |
