Changing the channel datarate in ned file

118 views
Skip to first unread message

Sheri

unread,
May 13, 2013, 10:48:26 AM5/13/13
to omn...@googlegroups.com
Hi

Is there away in Ned file to change the channel datarate? I have this tree topology and i would like to decrease the data rate in the for loop, so the link will be 16*2^height instead of 16Gbps.

channel Link extends ned.DatarateChannel
{
    datarate = 16Gbps; 
    delay = 0us;
}

   connections allowunconnected:
        for i=0..((4^(height-1)-1)/3)-1 {
            router[i].out[1] <--> Link <--> router[4*i+1].in[0];
            router[i].in[1] <--> Link <--> router[4*i+1].out[0];

            router[i].out[2] <--> Link <--> router[4*i+2].in[0];
            router[i].in[2] <--> Link <--> router[4*i+2].out[0];

            router[i].out[3] <--> Link <--> router[4*i+3].in[0];
            router[i].in[3] <--> Link <--> router[4*i+3].out[0];

            router[i].out[4] <--> Link <--> router[4*i+4].in[0];
            router[i].in[4] <--> Link <--> router[4*i+4].out[0];
        }

Sheri

unread,
May 17, 2013, 6:29:18 AM5/17/13
to omn...@googlegroups.com
?

Rudolf Hornig

unread,
May 17, 2013, 10:15:53 AM5/17/13
to omn...@googlegroups.com
I'm not sure where 'height' is coming, but:

        for i=0..((4^(height-1)-1)/3)-1 {
            router[i].out[1] <--> Link { datarate = 16*2^height } <--> router[4*i+1].in[0];

in this case you should not specify the datartate in the Link's definition, or at least specify it using  = default(16Gbps)

Sharifa Al Khanjari

unread,
May 17, 2013, 11:06:51 AM5/17/13
to omn...@googlegroups.com
height is a variable to that can be initialized in the ini file.

Thanks, it worked. 

 for i=0..((4^(height-1)-1)/3)-1 {
            router[i].out[1] <--> Link { datarate = 16*2^height ; } <--> router[4*i+1].in[0];

--
--
Sent from the OMNeT++ mailing list. To configure your membership,
visit http://groups.google.com/group/omnetpp
 
---
You received this message because you are subscribed to a topic in the Google Groups "omnetpp" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/omnetpp/qL8NMSPuaNw/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to omnetpp+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages