[asterisk-dev] Re: TDMoE timing

Tony Mountifield tony at softins.clara.co.uk
Wed Feb 8 07:45:24 MST 2006

Hi Paul,

Thanks for your reply:

Paul Cadach <paul at odt.east.telecom.kz> wrote:
> Tony Mountifield wrote:
> [skipped]
> > When I start up zaptel, with wcfxo, ztd-eth, ztdynamic and zaptel
> > loaded, my monitoring machine initially sees one TDMoE packet per
> > millisecond, as expected. After between 75 and 90 packets, there is
> > suddenly a pause for anything from 80ms to 800ms, after which the next
> > packet in sequence is sent, followed in rapid succession by the next 18
> > packets spaced about 20us apart. Then another big pause followed by
> > another burst of 18 or 19 packets. At the second pause, there is a
> > discontinuity in the TDMoE sequence number, indicating some packets have
> > been lost.
> [skipped]
> Hm-m-m, I'm using TDMoE to pass timing between two Asterisk boxes (one is not
> connected to TDM network) and don't found any problems. Note: The zaptel is very
> old, dated arout January, 25th 2005.
> Looks like the problem lives somewhere around your network card.

I'm beginning to think so too. My suspicion is that for some reason the
ethernet driver (nvnet) is getting a transmit queue full status from the
device and consequently calling netif_stop_queue(dev). After that, packets
will just build up in the queue until a cleanup routing restarts the queue
a short while later.  Because TDMoE is continuously generating 1000 packets
per second, when the queue gets restarted there are enough packets to
overflow the device again. The interface gets stuck in this stop-start

I'll put a printk in the driver to confirm my suspicion, but even if so,
I'm not sure how I will fix it. Perhaps this is why people say TDMoE needs
its own interface.

> I found that TDMoE requires some sort of 'jitter buffer' just because packets
> goes not exactly 1000ns but could be delayed for a little due to network
> activity and zt_transmit() is called without data received from remote side.

I was coming to the same conclusion after some other tests I conducted. Did
you make your own changes to the code to add such a jitter buffer? If so,
are you at liberty to share them?

Tony Mountifield
Work: tony at softins.co.uk - http://www.softins.co.uk
Play: tony at mountifield.org - http://tony.mountifield.org

More information about the asterisk-dev mailing list