How to simulate a zero-rate point to point link?

43 views
Skip to first unread message

Marco Giordani

unread,
Nov 23, 2017, 11:35:57 AM11/23/17
to ns-3-users
Hi everybody,
how can I simulate a zero-rate point to point link?  The "bigger picture" is that I want to create a link breakout during the simulation, so that the data rate of the channel has to be manually set to 0 bps for a customizable duration before the full (arbitrary) data rate is successfully recovered.

The channel attribute 

pointToPoint.SetDeviceAttribute ("DataRate", DataRateValue (DataRate ("0Mb/s")))

will, by default, set the actual rate to infinity. I am looking for exactly the opposite. Is it possible to do that?
Thanks for your support?

Tommaso Pecorella

unread,
Nov 23, 2017, 4:45:15 PM11/23/17
to ns-3-users
Hi,

actually a zero-rate link is a nonsense (in terms of communication links): a zero-rate link is a broken link, and then it's better to tear down the interface.

The real question is: what should your broken link do ?
The NetDevice should keep buffering packets or not ?
The IP layer should know about the link down ?
These are the real questions.

T.

Marco Giordani

unread,
Nov 23, 2017, 5:03:04 PM11/23/17
to ns-3-users
Thank you Tommaso. Please see my comments inline.


Il giorno giovedì 23 novembre 2017 22:45:15 UTC+1, Tommaso Pecorella ha scritto:
Hi,

actually a zero-rate link is a nonsense (in terms of communication links): a zero-rate link is a broken link, and then it's better to tear down the interface.
I understand it does not make much sense. Nevertheless, a broken link is exactly what I want to simulate (e.g., to evaluate the TCP performance when a radio link failure occurs for a limited period of time).

The real question is: what should your broken link do ?
The NetDevice should keep buffering packets or not ?
The IP layer should know about the link down ?
 
Yes, when the link failure occurs nothing should change (i.e., at the IP level) and the application should continue generating packets that, however, should not be physically sent through the link and, consequently, should be buffered. Therefore, I expect that, as long as a TCP connection is concerned, the RTO will expire and, as soon as the full link rate will be recovered, the packets will start flowing again through the link in slow start.

Now the question is: how to simulate the link breakout?  

Tommaso Pecorella

unread,
Nov 23, 2017, 5:22:41 PM11/23/17
to ns-3-users
The best way is to set to down the IPv[*]Interface, e.g.,
void
Ipv4Interface::SetDown (void)
{
  NS_LOG_FUNCTION
(this);
  m_ifup
= false;
}

There's a similar SetUp function.

You can also set the NetDevice to down. I don't know the effects on buffers tho.

T.

Marco Giordani

unread,
Nov 25, 2017, 10:52:07 AM11/25/17
to ns-3-users
Thank you Tommaso, that's exactly what I was looking for. 
have just one more question though. I am periodically scheduling the link to "break" (i.e., by 
setting down the IP Interface) through the following commands:

Simulator::Schedule (Seconds (0.5),&Ipv4::SetDown,ipv41, ipv4ifIndex1);
Simulator::Schedule (Seconds (7),&Ipv4::SetUp,ipv41, ipv4ifIndex1);

Simulator::Schedule (Seconds (9),&Ipv4::SetDown,ipv41, ipv4ifIndex1);
Simulator::Schedule (Seconds (11),&Ipv4::SetUp,ipv41, ipv4ifIndex1);

However, in the first case, the transmission interrupts at second 1 (i.e., equals to twice the time I originally scheduled the event to happen) while, in the second case, the breakout occurs at time 9.0138.
Am I missing something? It seems to me that the IP interface should set down as soon as the SetDown command is executed. 

Thanks again for your time.


Tommaso Pecorella

unread,
Nov 25, 2017, 3:37:14 PM11/25/17
to ns-3-users
Hi again Marco,

the interface is set as soon as you schedule the event, but any packet that has been already sent to the NetDevice will be transmitted.
Consider that the NetDevice might need some time to process all the queued packets...

T.
Reply all
Reply to author
Forward
0 new messages