Skip to contentSkip to conversation

How To Temporarily Suspend Network Traffic

DISCUSSION Volkan YAZICI 3 participants 6 messages Feb 1, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi,

I want to temporarily suspend the network traffic on a particular interface -- if possible, in microsecond granularity. For this purpose, ifup/ifdown ioctl() calls doesn't work. That is, for wireless interfaces, connection isn't get recovered; for wired interfaces, it takes at least 2 seconds to recover. I tried using tc, but it doesn't accept "rate 0" parameter. Neither "iwconfig wlan0 rate 0" has any effect. (Moreover, in iwconfig manual it is told that values below 1000 are card specific and are usually an index in the bit-rate list.) Do you have any suggestions? Can you recommend me to check any code piece in the kernel or some other tool?

Regards.

#1 lore raw
Quoted 12 lines · Volkan YAZICI

Hi,

I want to temporarily suspend the network traffic on a particular interface -- if possible, in microsecond granularity. For this purpose, ifup/ifdown ioctl() calls doesn't work. That is, for wireless interfaces, connection isn't get recovered; for wired interfaces, it takes at least 2 seconds to recover. I tried using tc, but it doesn't accept "rate 0" parameter. Neither "iwconfig wlan0 rate 0" has any effect. (Moreover, in iwconfig manual it is told that values below 1000 are card specific and are usually an index in the bit-rate list.) Do you have any suggestions? Can you recommend me to check any code piece in the kernel or some other tool?

Out of not quite idle curiousity, what are you trying to accomplish?

Instead of using tc to set a zero rate, you could perhaps try using tc to set a delay? If it doesn't offer microseconds of delay, pehaps setting a delay and then eliminating it after your own pause will do what you want - depends of course on what it is you really want. Your saying you wanted microsecond granularity suggests you don't want to suspend traffic for very long?

rick jones

Quoted 6 lines

Regards.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 16 lines · On Tue, 01 Feb 2011 09:32:32 -0800 Rick Jones <[email protected]> wrote:
Quoted 12 lines · Volkan YAZICI

Hi,

I want to temporarily suspend the network traffic on a particular interface -- if possible, in microsecond granularity. For this purpose, ifup/ifdown ioctl() calls doesn't work. That is, for wireless interfaces, connection isn't get recovered; for wired interfaces, it takes at least 2 seconds to recover. I tried using tc, but it doesn't accept "rate 0" parameter. Neither "iwconfig wlan0 rate 0" has any effect. (Moreover, in iwconfig manual it is told that values below 1000 are card specific and are usually an index in the bit-rate list.) Do you have any suggestions? Can you recommend me to check any code piece in the kernel or some other tool?

Out of not quite idle curiousity, what are you trying to accomplish?

Quoted 7 lines

Instead of using tc to set a zero rate, you could perhaps try using tc to set a delay? If it doesn't offer microseconds of delay, pehaps setting a delay and then eliminating it after your own pause will do what you want - depends of course on what it is you really want. Your saying you wanted microsecond granularity suggests you don't want to suspend traffic for very long?

rick jones

What about using tc mired to redirect to dummy device? or use netem drop

#3 lore raw
Quoted 1 line · Stephen Hemminger

What about using tc mired to redirect to dummy device? or use netem drop

Ohh! I have just heard about netem. I'll definitely give it a try. Thanks!

Regards.

P.S. I will ofcourse google and read the documentation that I can find
about these stuff. OTOH, I'd be really appreciated if you can point me some relevant material. Kind of material, that is, which might not be able to easily reachable via searching and following links.

#4 lore raw
In reply to Rick Jones
Quoted 1 line · Rick Jones

Out of not quite idle curiousity, what are you trying to accomplish?

I'm trying to implement a coarse-grained soft-TDMA (Time Division Multiple Access) among devices in a Wi-Fi network. (Coarse-grained, that is, compared to a hardware implementation.) Assuming that device clocks are in sync via NTP, I will figure out the granularity I can achieve with soft-TDMA.

Quoted 4 lines

Instead of using tc to set a zero rate, you could perhaps try using tc to set a delay? If it doesn't offer microseconds of delay, pehaps setting a delay and then eliminating it after your own pause will do what you want - depends of course on what it is you really want.

Thanks for the advice. I'll check this out and see what I can do.

Quoted 2 lines

Your saying you wanted microsecond granularity suggests you don't want to suspend traffic for very long?

I want to figure out the smallest delay that I can achieve in a periodic manner. (E.g., freeze the traffic for 200us, continue without interruption for 800us, and freeze the traffic again for another 200us, etc.) Pay attention that, an undeterministic delay somewhere in between 1000us is not something I prefer, I must be able to determine the point in time where delay will appear -- ofcourse, with some error margin.

Regards.

#5 lore raw
Quoted 9 lines · Volkan YAZICI
Quoted 1 line · Rick Jones

Out of not quite idle curiousity, what are you trying to accomplish?

I'm trying to implement a coarse-grained soft-TDMA (Time Division Multiple Access) among devices in a Wi-Fi network. (Coarse-grained, that is, compared to a hardware implementation.) Assuming that device clocks are in sync via NTP, I will figure out the granularity I can achieve with soft-TDMA.

As in Fred gets to transmit from 0 to N, Ethel gets to transmit from N+1 to 2N and so on, based on absolute time?

Getting small number of microsecond synchronization between multiple systems via NTP (particularly if they are synchronized via a wireless network) may prove challenging. At least that is my take as a member of the peanut gallery reading over the shoulders of the discussions that take place in comp.protocols.time.ntp

Quoted 10 lines
Quoted 4 lines

Instead of using tc to set a zero rate, you could perhaps try using tc to set a delay? If it doesn't offer microseconds of delay, pehaps setting a delay and then eliminating it after your own pause will do what you want - depends of course on what it is you really want.

Thanks for the advice. I'll check this out and see what I can do.

Quoted 2 lines

Your saying you wanted microsecond granularity suggests you don't want to suspend traffic for very long?

Quoted 6 lines

I want to figure out the smallest delay that I can achieve in a periodic manner. (E.g., freeze the traffic for 200us, continue without interruption for 800us, and freeze the traffic again for another 200us, etc.) Pay attention that, an undeterministic delay somewhere in between 1000us is not something I prefer, I must be able to determine the point in time where delay will appear -- ofcourse, with some error margin.

Sounds, well, challenging :) The determining the point in time part in particular. One thing I've learned is that the cell towers in a cell network sync their time directly to GPS with some kit that is non-trivially expensive.

rick jones

Quoted 7 lines

Regards.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html