summaryrefslogtreecommitdiff
path: root/opendc-simulator/opendc-simulator-compute/src/jmh
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-06-22 15:00:11 +0200
committerGitHub <noreply@github.com>2021-06-22 15:00:11 +0200
commit8a2b475f082572033438eb5b8703d211323f1b52 (patch)
tree76179cf3802a34d65829f4d8b9aa708c9a41eec1 /opendc-simulator/opendc-simulator-compute/src/jmh
parent147951f39de8f93eba6c7b0b7e6e5c9d2bce32e7 (diff)
parentdcd1bc82b9126b8122c671102d4d22843b73c847 (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-simulator/opendc-simulator-compute/src/jmh')
-rw-r--r--opendc-simulator/opendc-simulator-compute/src/jmh/kotlin/org/opendc/simulator/compute/SimMachineBenchmarks.kt7
1 files changed, 5 insertions, 2 deletions
diff --git a/opendc-simulator/opendc-simulator-compute/src/jmh/kotlin/org/opendc/simulator/compute/SimMachineBenchmarks.kt b/opendc-simulator/opendc-simulator-compute/src/jmh/kotlin/org/opendc/simulator/compute/SimMachineBenchmarks.kt
index fb753de2..8f60bf05 100644
--- a/opendc-simulator/opendc-simulator-compute/src/jmh/kotlin/org/opendc/simulator/compute/SimMachineBenchmarks.kt
+++ b/opendc-simulator/opendc-simulator-compute/src/jmh/kotlin/org/opendc/simulator/compute/SimMachineBenchmarks.kt
@@ -25,6 +25,9 @@ package org.opendc.simulator.compute
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.launch
+import org.opendc.simulator.compute.kernel.SimFairShareHypervisor
+import org.opendc.simulator.compute.kernel.SimSpaceSharedHypervisor
+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
@@ -45,7 +48,7 @@ import java.util.concurrent.TimeUnit
class SimMachineBenchmarks {
private lateinit var scope: SimulationCoroutineScope
private lateinit var interpreter: SimResourceInterpreter
- private lateinit var machineModel: SimMachineModel
+ private lateinit var machineModel: MachineModel
@Setup
fun setUp() {
@@ -54,7 +57,7 @@ class SimMachineBenchmarks {
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) }
)