<div dir="ltr"><div>Hi Yasuhiro/Santhosh,</div><div><br></div><div>The commit has introduced the RFC compliance feature to handle premature aging of the LSAs via sending MAXAGEd LSAs. One of the prominent occurrences is router reboot (OSPF6d restart). <br></div><div><br></div><div></div><div><br></div><div>Narrative: <br></div><div>The feature was extensively tested back then and found that there could be an instance where MAX_AGEd LSA lingered in routing domain and received post processing of most recent lower aged LSA (with the same originated router-id).</div><div><br></div><div>So there is a case where database copy is recent and the received MAXAGEd LSA should not overwrite it.  How do you want to handle this?  Santhos pointed to a snippet of the code which purges old MAX_AGEd LSA but it can <b>only</b> executed</div><div>if <b><i>ismore_recent</i></b> is greater than 0. <br></div><div><br></div><div><a class="gmail_plusreply" id="plusReplyChip-3">@yasu</a><br></div><div>In your case where OSPF_MAXAGEd LSA is genuine and should not be dropped. <b>What is the output of the debug where <i>ismore_recent</i> value is printed</b>?</div><div><br></div><div> If the value of <i><b>ismore_recent </b></i>is greater than 0 then it is safe to put that as part of the if statement rather than @yasu suggestion to remove the code snippet. <br></div><div><br></div><div>@sapk the action should be taken accordingly as mentioned above "narrative" case where MAXAGEd LSA could overwrite our recent copy of the LSA and flushes out the ospf6 routes. <br></div><div><br></div><div>My take away: <br></div><div>I do not think MAXAGE LSA will flush out immediately from routing domain so corrective action needs to be taken. <br></div><div><br></div><div><br></div><div>Regards,</div><div>Chirag<br></div><div><br></div><div><br></div><div>P.S. It has been roughly more than two years back the ospf6 improvements were handled (specially this feature) so my memory is faded about the full context of the testing of the scenario. I am beginning to restore the context. <br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Dec 4, 2019 at 8:55 AM Santosh P K via dev <<a href="mailto:dev@lists.frrouting.org">dev@lists.frrouting.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br><br><br>---------- Forwarded message ----------<br>From: Santosh P K <<a href="mailto:sapk@vmware.com" target="_blank">sapk@vmware.com</a>><br>To: Yasuhiro Ohara <<a href="mailto:yasu@nttv6.jp" target="_blank">yasu@nttv6.jp</a>>, "<a href="mailto:dev@lists.frrouting.org" target="_blank">dev@lists.frrouting.org</a>" <<a href="mailto:dev@lists.frrouting.org" target="_blank">dev@lists.frrouting.org</a>><br>Cc: <br>Bcc: <br>Date: Wed, 4 Dec 2019 16:54:46 +0000<br>Subject: Re: [dev] bug fix: ospf6d self orig MaxAge LSA<br>Hello Yasu,<br>
    You are right that your network will be back-holed until the old MAXAGE is flushed out from neighbors. MAXAGE self originated should be accepted for flushing out old instance from network faster and then generate the new version. By accepting maxaged self originated LSA we trigger event to refresh LSA as part of that we originate new LSA. With early return that is getting short circuited which is causing issue. <br>
<br>
<br>
With the same commit I saw the below code changes too. <br>
<br>
                        /* Neighbor router sent recent age for LSA,<br>
                         * Router could be restarted while current copy is<br>
                         * MAXAGEd and not removed.*/<br>
                        if (OSPF6_LSA_IS_MAXAGE(old) &&<br>
                            !OSPF6_LSA_IS_MAXAGE(new)) {<br>
<br>
                                if (is_debug)<br>
                                        zlog_debug("%s: Current copy of LSA %s is MAXAGE, but new has recent Age.",<br>
                                                   old->name,<br>
                                           __PRETTY_FUNCTION__);<br>
<br>
                                ospf6_lsa_purge(old);<br>
                                if (new->header->adv_router<br>
                                                != from->ospf6_if->area-><br>
                                                        ospf6->router_id)<br>
                                        ospf6_flood(from, new);<br>
<br>
                                ospf6_install_lsa(new);<br>
                                return;<br>
                        }<br>
<br>
I am not sure if this is right as if there is a MAXAGE copy in local database then we should not be accepting new instance of the same as router wishes to FLUSH it from the network. Not sure why this is done. Chirag who did this changes can help with some background. <br>
<br>
Thanks<br>
Santosh P K <br>
<br>
On 04/12/19, 5:05 PM, "dev on behalf of Yasuhiro Ohara" <<a href="mailto:dev-bounces@lists.frrouting.org" target="_blank">dev-bounces@lists.frrouting.org</a> on behalf of <a href="mailto:yasu@nttv6.jp" target="_blank">yasu@nttv6.jp</a>> wrote:<br>
<br>
<br>
    Hi,<br>
<br>
    Today I fixed a bug in ospf6d.<br>
    The bug seems to be introduced in the following commit.<br>
<br>
    commit 76249532faadfb429f46dd94cf6bbc61d78b3f26<br>
    Date:   Fri Jan 26 14:53:43 2018 -0800<br>
<br>
        ospf6d: Handle Premature Aging of LSAs<br>
<br>
    When ospf6d is restarting, self originated MaxAged LSAs<br>
    may be floating around in the network, and the rebooting ospf6d<br>
    is likely to receive them from the neighbor, probably with the<br>
    higher LS-Seq-Num (which is more recent).<br>
    The code introduced by the above commit in ospf6_flood.c:<br>
    @@ -806,6 +818,17 @@<br>
    was removing the more-recent self-originated MaxAged LSAs<br>
    immediately in the receiving process of the LSA, prevent the<br>
    LSAs from being installed in the local LSDB.<br>
    The just rebooted ospf6d will have the lower LS-Seq-Num, so<br>
    it cannot refresh the higher LS-Seq-Num version of the old LSA.<br>
    So the ospf6d essentially couldn't advertise any information<br>
    when the situation occured.<br>
<br>
    The bug was significant: the LSAs that can't be updated<br>
    in my network included the Router-LSA and the Intra-Area-Prefix-LSA,<br>
    so the address in the loopback I/F was not advertised<br>
    and the BGP session cannot be established at all.<br>
    At some point, the MaxAged LSAs floating in the<br>
    network may vanish (I don't know the reason why yet),<br>
    and sometimes the problem doesn't occur.<br>
<br>
    Commenting out the code by #if 0 immediately solved the problem:<br>
    the self-originated MaxAged LSAs are installed in the local LSDB<br>
    once, and then ospf6d refreshes it with the updated contents,<br>
    and then floods. <br>
<br>
    I will make a pull-request later.<br>
<br>
    ~/frr/ospf6d# git diff<br>
    diff --git a/ospf6d/ospf6_flood.c b/ospf6d/ospf6_flood.c<br>
    index 0828c2beb..67172dd4a 100644<br>
    --- a/ospf6d/ospf6_flood.c<br>
    +++ b/ospf6d/ospf6_flood.c<br>
    @@ -842,6 +842,7 @@ void ospf6_receive_lsa(struct ospf6_neighbor *from,<br>
                                    zlog_debug("Received is duplicated LSA");<br>
                            SET_FLAG(new->flag, OSPF6_LSA_DUPLICATE);<br>
                    }<br>
    +#if 0<br>
                    if (old->header->adv_router<br>
                                == from->ospf6_if->area->ospf6->router_id<br>
                        && OSPF6_LSA_IS_MAXAGE(new)) {<br>
    @@ -854,6 +855,7 @@ void ospf6_receive_lsa(struct ospf6_neighbor *from,<br>
                                            ismore_recent);<br>
                            return;<br>
                    }<br>
    +#endif /*0*/<br>
            }<br>
<br>
            /* if no database copy or received is more recent */<br>
<br>
    Best regards,<br>
    Yasu<br>
<br>
<br>
<br>
    _______________________________________________<br>
    dev mailing list<br>
    <a href="mailto:dev@lists.frrouting.org" target="_blank">dev@lists.frrouting.org</a><br>
    <a href="https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.frrouting.org%2Flistinfo%2Fdev&amp;data=02%7C01%7Csapk%40vmware.com%7C673ea1bf82b34a5e145508d778ae1a0b%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637110561519486562&amp;sdata=aB5iLq7zAIzebA1Ex58gldD95x%2B6yr4oFH0nZkgPUhc%3D&amp;reserved=0" rel="noreferrer" target="_blank">https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.frrouting.org%2Flistinfo%2Fdev&amp;data=02%7C01%7Csapk%40vmware.com%7C673ea1bf82b34a5e145508d778ae1a0b%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637110561519486562&amp;sdata=aB5iLq7zAIzebA1Ex58gldD95x%2B6yr4oFH0nZkgPUhc%3D&amp;reserved=0</a><br>
<br>
<br>
<br><br><br>---------- Forwarded message ----------<br>From: Santosh P K via dev <<a href="mailto:dev@lists.frrouting.org" target="_blank">dev@lists.frrouting.org</a>><br>To: Yasuhiro Ohara <<a href="mailto:yasu@nttv6.jp" target="_blank">yasu@nttv6.jp</a>>, "<a href="mailto:dev@lists.frrouting.org" target="_blank">dev@lists.frrouting.org</a>" <<a href="mailto:dev@lists.frrouting.org" target="_blank">dev@lists.frrouting.org</a>><br>Cc: <br>Bcc: <br>Date: Wed, 04 Dec 2019 08:55:32 -0800 (PST)<br>Subject: Re: [dev] bug fix: ospf6d self orig MaxAge LSA<br>_______________________________________________<br>
dev mailing list<br>
<a href="mailto:dev@lists.frrouting.org" target="_blank">dev@lists.frrouting.org</a><br>
<a href="https://lists.frrouting.org/listinfo/dev" rel="noreferrer" target="_blank">https://lists.frrouting.org/listinfo/dev</a><br>
</blockquote></div>