Increasing the granularity of internal timers in Bird?
Hey I have been looking at changing the internal timers in Bird to operate at millisecond granularity instead of the current one-second steps. I have two motivations for this: - The Babel protocol specifies time in 10ms increments, and I want to be able to schedule things to match this. - I have some ideas for experimenting with low latency route propagation that are not practical the current granularity. Now, looking at the nest timer code, it seems to be quite straight forward to change bird_time_t to represent milliseconds and adjust the functions that use it accordingly (getting system time with millisecond granularity is another matter; but I figure there can be a fallback with rounding for systems that don't support that). However, before I start hacking, I wanted to ask if (a) there is some fundamental reason why this cannot be done, and if not if (b) you would accept patches to this effect? :) Thanks, -Toke
On Mon, Jun 05, 2017 at 06:53:02PM +0200, Toke Høiland-Jørgensen wrote:
Hey
I have been looking at changing the internal timers in Bird to operate at millisecond granularity instead of the current one-second steps. I have two motivations for this:
Hi Check this: https://gitlab.labs.nic.cz/labs/bird/tree/timers It is a recent branch that replaces current timers with microsecond timers (already used in BFD). You could just swap bird_clock_t, timer and tm_*() functions with btime, timer2 and tm2_*() functions (with updated arguments). Also time constants in config file should be specified by expr_us instead of expr. -- Elen sila lumenn' omentielvo Ondrej 'Santiago' Zajicek (email: santiago@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."
Hello! Sorry for top reply, my phone is too dumb to reply inline. Please check the recent "timers" branch - there should be what you're looking for. MQ Quidquid latine dictum sit, altum videtur. -----Original Message----- From: "Toke Høiland-Jørgensen" <toke@toke.dk> To: bird-users@network.cz Sent: Mon, 05 Jun 2017 8:09 PM Subject: Increasing the granularity of internal timers in Bird? Hey I have been looking at changing the internal timers in Bird to operate at millisecond granularity instead of the current one-second steps. I have two motivations for this: - The Babel protocol specifies time in 10ms increments, and I want to be able to schedule things to match this. - I have some ideas for experimenting with low latency route propagation that are not practical the current granularity. Now, looking at the nest timer code, it seems to be quite straight forward to change bird_time_t to represent milliseconds and adjust the functions that use it accordingly (getting system time with millisecond granularity is another matter; but I figure there can be a fallback with rounding for systems that don't support that). However, before I start hacking, I wanted to ask if (a) there is some fundamental reason why this cannot be done, and if not if (b) you would accept patches to this effect? :) Thanks, -Toke
Il 2017-06-05 18:53 Toke Høiland-Jørgensen ha scritto:
Hey
I have been looking at changing the internal timers in Bird to operate at millisecond granularity instead of the current one-second steps. I have two motivations for this:
- The Babel protocol specifies time in 10ms increments, and I want to be able to schedule things to match this.
- I have some ideas for experimenting with low latency route propagation that are not practical the current granularity.
+1 I'm implementing PopRouting for OSPF (in BIRD obsvly), since it tunes the timers to a very precise value, having these granularity is necessary. Gabriel
participants (4)
-
Gabriel -
jan.matejka@nic.cz -
Ondrej Zajicek -
Toke Høiland-Jørgensen