<div dir="auto"><div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">If you want to implement per-conn MRAI timer, you should not do that on<br>
level of *_tx() functions (as they handle all packets), but one level<br>
before that - you could enforce MRAI intervals between update-scheduled<br>
and update-not-scheduled states.</blockquote></div></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Update-scheduled state starts when bgp_rt_notify() calls<br>
bgp_schedule_packet(p->conn, PKT_UPDATE) and ends when<br>
conn->packets_to_send is set to zero in bgp_fire_tx().<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Ok, so i was on the wrong level, i didn't see the level where there is update-scheduled and not scheduled, my mistake.</div><div dir="auto">Tomorrow i will study this parto so in the next days I'll be able to implement it. </div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You could ensure that there is MRAI interval between last update cycle and<br>
new one by postponing bgp_schedule_packet(p->conn, PKT_UPDATE) when<br>
necessary (i.e. if it is not currently sheduled and it is less that MRAI<br>
from last end).<br>
<br>
It is not completely correct (as you can get new route update even before<br>
the cycle in which the previous one was already sent is finished).<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Did you mean that if I develop MRAI on per-conn level there will be this problem? In that case yeah I agree with that. </div><div dir="auto">But my final goal it's to implement it for every route that i learn and i want to shar, like RFC say. </div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
The even better and correct way would be to implement it one more level before<br>
when prefixes (in struct bgp_prefix) are dispatched for struct bgp_bucket.<br>
There could be timestamps in struct bgp_prefix, separate queue for<br>
bgp_buckets that contain only postponed bgp_prefixes, and list of recently<br>
sent but not yet collected bgp_prefixes to keep their timestamps. But that<br>
would be significantly more work.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Ok i this could be the next step, first of all i will develop the simple solution, after the tests that works fine I'll develop the complete solution for that.</div><div dir="auto"><br></div><div dir="auto">Thanks you for the help, if in the next days you have bettere ideas please notify me.</div><div dir="auto"><br></div><div dir="auto">Thanks, </div><div dir="auto">Mattia</div></div>