-
Notifications
You must be signed in to change notification settings - Fork 486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add LEACH routing protocol #929
base: master
Are you sure you want to change the base?
Conversation
Adds the LEACH routing protocol functionality
To showcase how protocol can be implemented in simulation setup
4ce7cf3
to
2b66b60
Compare
Fingerprint values seem to be changing with each subsequent Github Actions run. |
1st. Thanks a lot for the PR. We are busy with other topics right now, but we will review this for the next INET release. Until then: As other fingerprints are stable, this indicates that the code execution is not repeatable. In my experience this might be caused by:
It is very easy to create a hashed map or set and forget about the fact that its iteration order may depend on memory layout. We had some similar issues in early versions of INET and OMNeT++. |
I just had a quick look into the code (not a proper review, but some comments).
|
Noted @rhornig, thank you! Can those changes be committed separately beyond this point (with detailed commit messages), or should I squash them to the earlier commits? |
just go on with new commits. Once we decide to merge, we will squash it. |
@rhornig I looked into the use of unordered collections in the |
Regarding the failing fingerprint tests: If there is no obviously visible parts where unordered collections are used then I would check also for memory issues. Running valgrind memcheck may provide some tips. I would also check whether release and debug versions produce the same fingerprint. If they do, I would try to somehow reproduce the different fingerprints reliably locally (having a different fingerprint only during the github ci test makes catching this bug very hard). Once you can reproduce the fingerprints, you can write out an event log file for both runs and compare those and see where the first difference happens. That would at least give some hints what is happening. These are the ugliest type of errors one can find in a simulation. That's the main reason we have implemented fingerprinting, to at least catch them early. |
We will need some documentation about the routing protocol implementation in the Leach.ned file.:
|
For the interface name parameter: We have similar code patterns (i.e. for selecting the name of the interface to be used) in Dymo and GPSR. The parameter is called https://github.com/inet-framework/inet/blob/master/src/inet/routing/dymo/Dymo.cc#L1294 |
Will look into this @rhornig
Noted, will add that.
Noted, will study them and see how the code can be modified. inet/src/inet/routing/dsdv/Dsdv.cc Lines 72 to 83 in 3a44054
Once this is merged, I can work on updating that to match Dymo and Gpsr if its ok. |
Documentation: keep it short. Refer to the original specification and mention only differences / limitations compared to that and parameters and behavior specific to this current implementation (i.e. mention possible statistics gathered, limitation (like only a single wireless interface supported etc). Think about a NEW user who is otherwise already familiar with the leach protocol (by reading the spec). |
Causing inconsistent simulation fingerprints
In Base Station module
@rhornig, I'm currently working on this and need a bit of clarification. Is it required that all packet types (control, acknowledgment, etc.) used in LEACH be UDP packets or just the packets with sensed data? I feel like the former (all packets UDP) is the way to go because otherwise, it's going to get confusing when filtering packets in the |
For control packet broadcast from CH to NCH.
@rhornig, I implemented UDP packets in 6008a9a. inet/src/inet/routing/leach/Leach.cc Line 282 in 6008a9a
inet/src/inet/routing/leach/Leach.cc Line 358 in 6008a9a
|
The radio receiver sensitivity and energy detection values were updated to -110dBm for both the host and base station modules.
Hi @rhornig, I would really appreciate some feedback on this so I can quickly finalize the rest of the protocol. |
Hi @rhornig
I made multiple attempts to solve the simulation issue based on the showcases, tutorials and examples in INET but had no luck. I set debug points and identified that the CH election in the protocol works as expected, reaching the packet transmission point without any exceptions or issues: But the issue is that the Non-CH nodes seem to be receiving the sent packets, and the debug points set within the Would greatly appreciate some feedback on this because this is a major blocker preventing me from finalizing the protocol. |
@rhornig, happy to inform that the issue is resolved with commit 162a92b! |
Register wireless interface for multicast group
Added to radioMedium in omnetpp.ini
The code changes add the necessary code to create a UDP packet and LeachAckPkt to send an acknowledgement to the CH (Cluster Head) from non-CH nodes.
Adds the necessary code to create a UDP packet and LeachBSPkt to send data from the Cluster Head (CH) to the Base Station (BS).
In sending CH data to BS
374c448
to
6723bbf
Compare
0ba3d0f
to
18d01b4
Compare
Adds the LEACH protocol to existing routing protocol selection.
Addresses issue #928