Hello, I am trying to implement a simulation of wormholes in a wireless sensor network. I have a network of nodes running custom routing and MAC protocols within ns-2.31; I want to create wired links between certain pairs of nodes and have these nodes forward messages through the wires, rather than re-broadcasting them.
To illustrate, consider the following diagram. For simplicity, assume that nodes are arranged in a static grid, in which each node can only communicate with its neighbours to the left, right, up, and down. * * * * * * * * * * * *\ * * * * * \* * * * * * * * * * * * * Normally, a message traveling from the node at (4, 5) to (0, 0) would take a route similar to the following: (4, 5) -> (4, 4) -> (3, 4) -> (3, 3) -> (2, 3) -> (2, 2) -> (1, 2) -> (1, 1) -> (0, 1) -> (0, 0) However, the wired link between (1, 1) and (2, 4) creates a shorter path: (4, 5) -> (3, 5) -> (3, 4) -> (2, 4) -> (1, 1) -> (0, 1) -> (0, 0) To implement this, I need (1, 1) and (2, 4) to send messages that they decide to forward through the wired link rather than broadcasting them, and for them to broadcast messages that they receive over the wired link, if they decide to forward them. Currently, I have this implemented by giving the routing agents on (1, 1) and (2, 4) taps into each other's MAC layers. However, this is not a good solution, since it causes *all* messages received at one end to traverse the wormhole, rather than only the ones that the entry point's routing agent chooses to forward, it doesn't allow the entry point's routing agent to make modifications to messages before forwarding them, and it doesn't simulate the latency of the wired link. I suppose that I could hack the Agent API to allow messages to be send directly to other Agents, but that could be ugly and still wouldn't simulate the wired link. Any suggestions on the best way to implement this? Thanks, Rennie deGraaf, University of Calgary