From 07607bff7c8ff4db3091f8b2f91de174c5f95ceb Mon Sep 17 00:00:00 2001 From: kkrentz Date: Tue, 14 Mar 2023 21:21:16 +0100 Subject: [PATCH 1/2] DirectedGraphMedium.java: Store concurrently transmitting radios as interfered --- .../contikios/cooja/radiomediums/DirectedGraphMedium.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/java/org/contikios/cooja/radiomediums/DirectedGraphMedium.java b/java/org/contikios/cooja/radiomediums/DirectedGraphMedium.java index d2b71c370..44c788b80 100644 --- a/java/org/contikios/cooja/radiomediums/DirectedGraphMedium.java +++ b/java/org/contikios/cooja/radiomediums/DirectedGraphMedium.java @@ -288,7 +288,12 @@ protected RadioConnection createConnections(Radio source) { newConn.addInterfered(dest.radio); continue; } - + + if (dest.radio.isTransmitting()) { + newConn.addInterfered(dest.radio); + continue; + } + if (dest.radio.isReceiving()) { /* Fail: radio is already actively receiving */ /*logger.info(source + ": Fail, receiving");*/ From c852a037039a1411d1bcfa4d8d3321c1fb1aaf96 Mon Sep 17 00:00:00 2001 From: kkrentz Date: Tue, 14 Mar 2023 21:21:16 +0100 Subject: [PATCH 2/2] RadioMediums: Inform transmitting motes of interfering transmissions --- java/org/contikios/cooja/radiomediums/DirectedGraphMedium.java | 1 + java/org/contikios/cooja/radiomediums/LogisticLoss.java | 1 + java/org/contikios/cooja/radiomediums/UDGM.java | 1 + java/org/contikios/mrm/MRM.java | 1 + 4 files changed, 4 insertions(+) diff --git a/java/org/contikios/cooja/radiomediums/DirectedGraphMedium.java b/java/org/contikios/cooja/radiomediums/DirectedGraphMedium.java index 44c788b80..5d19e6251 100644 --- a/java/org/contikios/cooja/radiomediums/DirectedGraphMedium.java +++ b/java/org/contikios/cooja/radiomediums/DirectedGraphMedium.java @@ -291,6 +291,7 @@ protected RadioConnection createConnections(Radio source) { if (dest.radio.isTransmitting()) { newConn.addInterfered(dest.radio); + dest.radio.interfereAnyReception(); continue; } diff --git a/java/org/contikios/cooja/radiomediums/LogisticLoss.java b/java/org/contikios/cooja/radiomediums/LogisticLoss.java index 001f06aa4..1a13a4951 100644 --- a/java/org/contikios/cooja/radiomediums/LogisticLoss.java +++ b/java/org/contikios/cooja/radiomediums/LogisticLoss.java @@ -254,6 +254,7 @@ protected RadioConnection createConnections(Radio sender) { newConnection.addInterfered(recv); } else if (recv.isTransmitting()) { newConnection.addInterfered(recv); + recv.interfereAnyReception(); } else { boolean receiveNewOk = random.nextDouble() < getRxSuccessProbability(sender, recv); diff --git a/java/org/contikios/cooja/radiomediums/UDGM.java b/java/org/contikios/cooja/radiomediums/UDGM.java index 83318bdb6..b209012a6 100644 --- a/java/org/contikios/cooja/radiomediums/UDGM.java +++ b/java/org/contikios/cooja/radiomediums/UDGM.java @@ -219,6 +219,7 @@ protected RadioConnection createConnections(Radio sender) { newConnection.addInterfered(recv); } else if (recv.isTransmitting()) { newConnection.addInterfered(recv); + recv.interfereAnyReception(); } else if (recv.isReceiving() || (random.nextDouble() > getRxSuccessProbability(sender, recv))) { /* Was receiving, or reception failed: start interfering */ diff --git a/java/org/contikios/mrm/MRM.java b/java/org/contikios/mrm/MRM.java index 4c69da53c..100e97693 100644 --- a/java/org/contikios/mrm/MRM.java +++ b/java/org/contikios/mrm/MRM.java @@ -200,6 +200,7 @@ public Radio getToRadio() { } } else if (recv.isTransmitting()) { newConnection.addInterfered(recv, recvSignalStrength); + recv.interfereAnyReception(); } else if (recv.isReceiving()) { /* Was already receiving: start interfering. * Assuming no continuous preambles checking */