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-experiments/opendc-experiments-tf20 | |
| 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-experiments/opendc-experiments-tf20')
2 files changed, 4 insertions, 4 deletions
diff --git a/opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/core/SimTFDevice.kt b/opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/core/SimTFDevice.kt index 92e7080a..d8f92155 100644 --- a/opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/core/SimTFDevice.kt +++ b/opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/core/SimTFDevice.kt @@ -28,7 +28,7 @@ import kotlinx.coroutines.* import org.opendc.simulator.compute.SimBareMetalMachine import org.opendc.simulator.compute.SimMachine import org.opendc.simulator.compute.SimMachineContext -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.ProcessingUnit import org.opendc.simulator.compute.power.PowerModel @@ -63,7 +63,7 @@ public class SimTFDevice( * The [SimMachine] representing the device. */ private val machine = SimBareMetalMachine( - SimResourceInterpreter(scope.coroutineContext, clock), SimMachineModel(listOf(pu), listOf(memory)), + SimResourceInterpreter(scope.coroutineContext, clock), MachineModel(listOf(pu), listOf(memory)), SimplePowerDriver(powerModel) ) diff --git a/opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/util/MLEnvironmentReader.kt b/opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/util/MLEnvironmentReader.kt index eea079fb..3e61f508 100644 --- a/opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/util/MLEnvironmentReader.kt +++ b/opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/util/MLEnvironmentReader.kt @@ -27,7 +27,7 @@ import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper import com.fasterxml.jackson.module.kotlin.readValue import org.opendc.format.environment.EnvironmentReader import org.opendc.format.environment.MachineDef -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 @@ -100,7 +100,7 @@ public class MLEnvironmentReader(input: InputStream, mapper: ObjectMapper = jack UUID(0, counter.toLong()), "node-${counter++}", mapOf("gpu" to isGpuFlag), - SimMachineModel(cores, memories), + MachineModel(cores, memories), LinearPowerModel(maxPower, minPower) ) } |
