[ndnSIM] Another Question: set priority of a node

Alex Afanasyev alexander.afanasyev at ucla.edu
Tue Feb 11 11:39:22 PST 2014


Hi Aaron,

It is possible, but would require a number of tweakings.  There are several alternatives, but I would do it in the following name:

1. Create a class derived from Object, say "PriorityModel", which will store priority value and have getters/setters for it.
2. Modify AnnotatedTopologyReader class.  In particular, you would need to modify Read field and modify CreateNode methods.  You can actually modify just CreateNode methods, since they already assume that there could be an extra column (this was defined for network partition number to use for distributed simulation, but if you're not using this feature, you can redefine the meaning).

In CreateNode methods you would need to CreateObject<PriorityModel> with you priority and then aggregate the created object to Node object, same way mobility model object is aggregated.


After this, you will be able to use this->GetObject<PriorityModel>()->getPriority()  from anywhere of ForwardinStrategy class to get your priority.

---
Alex

On Feb 11, 2014, at 2:11 AM, aaronishere <aaronishere at qq.com> wrote:

> Hi, Alex
>  
> I want to set nodes with different priority in the topology text so that topologyReader could read it, something like below:
> #node  city     y    x    priority
>     n0     NA     4   5.5      5
>     n1     NA     3   2.5      4
> .....
>  
> link
> # from     to      capacity   metric   delay   queue
>     n0        n1       1Mbps        1       1ms     100
>     n0        n2       1Mbps        1       1ms     100
> ....
>  
> And when the packet is coming (under oninterest/ondata function in the forwardingstrategy.cc), the node could get its priority like node->GetPriority( )
>  
> Is there any possible solutions?
>  
> Thanks in advance!
>  
> Aaron

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20140211/d58b318d/attachment.html>


More information about the ndnSIM mailing list