II have a protocol built by my own, so i need to create some scenarios to test it, and prove its performance and some metrics others. To Achieve this, of course, is necessary to have a failures module for networking.
1. If you want to simulate errors in a logical way, i mean, you just want is running simulations without OMNeT interface, you can try with a simple stack to store all nodes in the network.
2. In other way, if you want simulate errors adding of course, the visual effects the idea is the following:
The shorcut to built this module, i think, is to have a stack for storing all nodes from the network using a external header with an user defined data types.
I try to explain better, what i mean.
a. Define the header [failures.h]
#include <string>
#include <vector>
struct NodeFailurePrototype
{
int id; //Identifier
std::string name; //node name
int address; //node address.
bool failure; //node fails?
}
typedef NodeFailurePrototype NodeFailureType;
typedef std::vector<NodeFailureType> NodeFailureStack;
NodeFailureStack hNetworkingStack;
NodeFailureType hNetworkingElement;
b. Create a simple module
id++;
hNetworkingElement.identifier = id++;
hNetworkingElement.name = "node a";
hNetworkingElement.address = getAncestorPar("address");
hNetworkingElement.fail = false; til this moment all nodes work correctly.
hNetworkingStack.push_back(hNetworkingElement); //to add elements in the stack.
b. In the simple module created, you must scheduled a self message to choose some node in network, the way you will choose in the node depends that you need, i mean, if you need to provoke an error in all nodes you must use a uniform distribution, or whatever probability distribution to do this.
i.e. Supose you have 20 nodes and you need to pick up some node, with schedule message you call uniform distribution routine to do this, imagine the choosen node is 10, then you find it inside the stack and disable it and that's it, you are provoking an error in the network, i mean, in a node.
for each element in stack
{
if (stack.Element = choosen node)
{
disable it.
hNetworkingElement.fail = false;
}
}
To reflect the errors in the network using the gui you have to use getDisplayString().
I hope this information can help you.
Best Regards.
On Thu, Dec 27, 2012 at 3:15 AM, Jack
<saad.a...@gmail.com> wrote:
Hello Guys,I built a computer network with a certain number of nodes that are working under my private protocol. Each of them sending messages to each other, now I need to simulate a link or a node failure during the simulation running.
Please can tell me how I can do that? or what are the proper commands for that?
Regards,
Saad
--
--
Sent from the OMNeT++ mailing list. To configure your membership,
visit http://groups.google.com/group/omnetpp