I am trying to build a simple simulation using omnet++. I'd like to avoid using things like ned. Instead I want to allocate the modules set up the simulation topology entirely under program control. (i.e. I'll configure my simulation and set up connections etc. in main() instead of using ned)
How do I go about doing this ? (any examples you can point me to?)
thanks
Create a top level network in NED and drop a single simple module called builder or something like that. Then create/connect the necessary modules in that module's initialize method (or schedule a message at t=0s and do the network buildup there).
There is an example in OMNeT++ that does exactly like this, in samples/routing. Choose the NetBuilder configuration. That example is reading the network topology from an external file, but you can change it to create any topology you would like to have.
The actual code for the network generation is in samples/routing/builder/netbuilder.cc in NetBuilder::buildNetwork
Related
I am building off the XO game from the sawtooth SDK and am running into several issues. First, I am able to sucessfully modify the XOHandler to modify the type of data I am uploading to the network. I have been working with the shell default so I am a little unfamiliar with how the other containers work. I am running some tests and need to run a network with 100, 500 and, 1000 nodes respectivly. I am using a docker enviorment and the yaml file that specifies 5 total validators. For my network I am doing a quorum based consensus so I only want maybe 10 validators that are tcp enabled. Is their a good way of simulating this scenario? I thought I would just need to add a bunch of validators directly in the yaml file but I found this in the Sawtooth documentation. https://sawtooth.hyperledger.org/docs/1.2/sysadmin_guide/pbft_adding_removing_node.html#adding-a-pbft-node-label
This is confusing to me because it sounds like these are the steps taken for the Ubuntu Sawtooth install. I just copied the sawtooth core off of github so I am not sure which steps I should be following. I also have the issue of the yoml file. I found some stuff mentioning that this file stored some information about the validators however when I go the ./etc/sawtooth/ directory inside the docker their is no yoml file. Am I in the wrong place? That is the first question.
Second question concerns the Dependencies array in the transaction header. My network is designed in a way that I will need dependencies set between different blocks. I am also doing a one block per batch network. Whenever I would add dependencies however I run a RepeatGossip error and it says the block has already been added. My input and output fields are the same. Any feedback on this message? Of course the parent has already been added but specifying the parents in dependencies shouldn't block the block upload.
I am new to Omnetpp, and I am trying to send messages from one node to another wirelessly.
Basically, I would like to do something as in the tictoc example of Omnetpp (https://docs.omnetpp.org/tutorials/tictoc/) but then wirelessly.
I have installed INET already, and I have seen the wireless example, which uses the UdpBasicAPP. However, I do not know how to change the data of the message send while using the UdPBasicAPP. In my case, what I am sending (i.e. the data) is very important because it is part of a bigger project. Eventually, the idea is to use the 802.11p standard (which exists in VEINS) and multiple nodes, but I thought this was a good place to start.
I hope someone can help me out.
Kind regards
just to be aware: 802.11p is also supported directly in INET. Just set the opMode parameter on the network interface.
You will need to create your own application module. Take a look/copy UdpBasicApp and modify it according to your needs. Check the sendPacket() function which creates an ApplicationPacket. ApplicationPacket contains only a single sequence number, but you can create your own application level data structure and use that for sending.
In Golang how you guys manage to write logs into multiple file base on the package name.
For example in my current app, I am trying to collect multiple hardware stats from different packages called Netapp, IBM etc but under the same application. So, I would like to write logs from those package in separate folder like /var/log/myapp/netapp.log and /var/log/myapp/ibm.log?
Any pointer or clue would be very helpful ?
Thanks James
One approach you could take is to implement the Observer pattern. It's a great approach when you need to make several things happen with the same input/event. In your case, logging the same input to different logs. You can find more information here.
In a situation you described and following this example, you can do following things:
Your different logging implementations (with different logging destination folders) can implement the Observer interface by putting your logging code for each logging implementation in OnNotify method.
Create an instance of eventNotifier and register all your logging implementations with eventNotifier.Register method. Something like:
notifier := eventNotifier{
observers: map[Observer]struct{}{},
}
notifier.Register(netAppLogger)
notifier.Register(ibmLogger)
Use eventNotifier.Notify whenever and wherever you need to do logging and it will use all registered logging implementations.
I'm very new to OMNeT++ and I'm writing my first simulation with it. What I'm trying to do is to retrieve the complete topology of the network at execution time from a node.
Basically, I have a router node that needs to know the entire topology (which node is connect to who) but I don't want to statically change the C++ code according to the Network selected. Instead, the idea is that the router is able in its initialization function to discover all the connections between nodes.
How can I do that?
Thanks in advance.
What you need is the omnetpp::cTopology class from the OMNeT++ API: https://omnetpp.org/doc/omnetpp/api/classomnetpp_1_1cTopology.html
If you are using INET, there is a slightly enhanced version of this class in inet::common::Topology
I am trying to see how I could instantiate i2c-mux-gpio driver at run time from user-space.
Basically, the intent is to use a default version of the distribution but at run time determine based on certain parameters to instantiate the i2c-mux-gpio so that it can add more buses.
Example, something like
modprobe i2c-mux-gpio <"gpio0=1,gpio2=0">
The existing i2c-mux-gpio seems to take the required information via standard structure which happens to be populated via a device-tree/acpi etc.
Exploring if someone has already attempted to pass this information at run time.
Thanks
Sriaknth
If you're using the Device Tree on your platform, you should have a look at the recent Device Tree Overlay mechanism which was merged. It also to load additional fragments of Device Tree at runtime.