[ndnSIM] Node adjacency matrix in ndnSIM, how?

Alex Afanasyev aa at CS.UCLA.EDU
Thu Dec 31 17:41:07 PST 2015


Hi Anil,

The format you showed is just one of the ways how to setup network environment for the simulation, so there are no ndnSIM requirements here.

You can try to update util/topology/annotated-topology-reader.cpp to match your needs.  Alternatively, you can define a separate configuration file that defines individual link properties, and apply those properties after the link is created.  You can use something like in the following snippet to find specific PointToPointNetDevice to set parameters, using two node names:


  std::string node1 = ...;
  std::string node2 = ...;

  Ptr<Node> node = Names::Find<Node>(node1);
  Ptr<Node> otherNode = Names::Find<Node>(node2);

  for (uint32_t deviceId = 0; deviceId < node->GetNDevices(); deviceId++) {
    Ptr<PointToPointNetDevice> netDevice =
      DynamicCast<PointToPointNetDevice>(node->GetDevice(deviceId));
    if (netDevice == 0)
      continue;

    Ptr<Channel> channel = netDevice->GetChannel();
    if (channel == 0)
      continue;

    if (channel->GetDevice(0)->GetNode() == otherNode) {
        || channel->GetDevice(1)->GetNode() == otherNode) {

      // apply parameters on channel->GetDevice(0) or channel->GetDevice(1)

      return;
    }
  }

---
Alex

> On Dec 29, 2015, at 11:14 PM, Anil Jangam <anilj.mailing at gmail.com> wrote:
> 
> Hi (Alex, Spyros),
> 
> In all ndnSIM examples, the interconnection links between nodes is specified as:
> 
> # srcNode   dstNode     bandwidth   metric  delay   queue
> Node0    Node1   1Mbps   1  10ms   ns3::RedQueue,MeanPktSize=100
> Node0    Node3   1Mbps   1  10ms   ns3::RedQueue,MeanPktSize=100
> 
> In all these configs, is the adjacency between the two nodes and all the link characteristics defined as bidirectional by default? Is it a ndnSIM requirement to specify the links parameters as defined in all the examples or it is specific to application?
> 
> Can we define the links and their parameters in each direction and how does ndnSIM would behave in such case? For example, how to achieve this:
> 
> # srcNode   dstNode     bandwidth   metric  delay   queue
> Node0    Node1   1Mbps   1  10ms   ns3::RedQueue,MeanPktSize=100
> Node1    Node0   2Mbps   1  20ms   ns3::RedQueue,MeanPktSize=200
> Node0    Node3   1Mbps   1  10ms   ns3::RedQueue,MeanPktSize=100
> Node3    Node0   2Mbps   1  20ms   ns3::RedQueue,MeanPktSize=200
> 
> My application scenario, each node define its own adjacency matrix and link parameters (i.e. application specific configuration), thus takes care of creating and initializing the faces in each direction explicitly. While I believe in real set up it would fine; however, in case of ndnSIM I am not sure how it is going to behave.
> 
> Can you please elaborate?
> 
> /anil.
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20151231/af6d678c/attachment.bin>


More information about the ndnSIM mailing list