<div dir="ltr">Hi Sirapop<div><br></div><div>When the incoming Nack pipeline determines that all out-records have Nacked, the PIT entry is scheduled to expire "immediately".</div><div>Here, "immediately" means "right after the strategy has been triggered for after receive Nack procedure".</div><div>The strategy can still access the PIT entry normally before it returns from that procedure.</div><div><br></div><div>If the strategy wishes to forward the Interest to an alternate path right away, it should do so by invoking the send Interest action before returning from the after receive Nack procedure.</div><div>When that happens, the PIT entry expiration is recalculated to accommodate the newly created out-record, and the PIT entry would not be deleted immediately.</div><div><br></div><div>If the strategy wishes to hold onto the PIT entry without immediately sending an outgoing Interest, it may invoke the set expiry timer helper function (Strategy::setExpiryTimer).</div><div>This is usually used together with another timer set by the strategy itself, which allows the strategy to defer the forwarding decision for a short while.</div><div><br></div><div>Yours, Junxiao</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 17, 2023 at 4:48 PM Sirapop Theeranantachai via Nfd-dev <<a href="mailto:nfd-dev@lists.cs.ucla.edu">nfd-dev@lists.cs.ucla.edu</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"><p style="text-align:center"><font color="red"><strong>External Email</strong><br></font></p><div dir="ltr"><div>Hello</div><div>I'm implementing a custom forwarding strategy, and would like to handle the incoming NACK to do the followings:</div><div><br></div><div>1) 
Trigger interest transmission to an eligible face

</div><div>2) If no eligible face, send another NACK to incoming faces from in-records</div><div>* The link type is point-to-point, so interest going back to the incoming face is not an eligible face.<br></div><div><br></div><div>The problem is: forwarder.cpp will expire the PIT entry before passing to the forwarding strategy.</div><div><br></div><div>In <b>NFD/daemon/fw/forwader.cpp</b>, line 479, under <b>onIncomingNack</b><br></div><div><a href="https://github.com/named-data/NFD/blob/6bf94c02f511e3197a4e3dd77f0466d0b25d6844/daemon/fw/forwarder.cpp#L479" target="_blank">https://github.com/named-data/NFD/blob/6bf94c02f511e3197a4e3dd77f0466d0b25d6844/daemon/fw/forwarder.cpp#L479</a></div><div><span style="font-family:monospace"><br></span></div><div>Upon receiving nack, the forwarder.cpp will try to mark the out-record that receives the NACK. If the pit entry has no pending <b>out-records that are not marked</b>, the forwarder.cpp will set the expiry timer to be 0ms, and will be removed by the time it receives the data.<br></div><div><br></div><div>One solution I tried is to reset the PIT timer, but it requires a callback to an inaccessible method <i>onInterestFinalize</i>.</div><div><br></div><div>I discussed with Lixia and Beichuan about whether removing the PIT when all out-record receives NACK should better be handled in the forwarding strategy? I'm considerably new to the NFD code base, so please let me know if I'm wrong about this. Thank you.<br></div><div><br></div><div><div><div><div><span style="font-family:monospace">  // record Nack on out-record<br>  outRecord->setIncomingNack(nack);<br><br>  // set PIT expiry timer to now when all out-record receive Nack<br>  if (!fw::hasPendingOutRecords(*pitEntry)) {<br>    this->setExpiryTimer(pitEntry, 0_ms);<br>  }<br><br>  // trigger strategy: after receive NACK<br>  m_strategyChoice.findEffectiveStrategy(*pitEntry).afterReceiveNack(nack, ingress, pitEntry);</span></div><div><br></div><div>Mark<br></div><div><br></div><div><br></div></div></div></div></div>
_______________________________________________<br>
Nfd-dev mailing list<br>
<a href="mailto:Nfd-dev@lists.cs.ucla.edu" target="_blank">Nfd-dev@lists.cs.ucla.edu</a><br>
<a href="https://www.lists.cs.ucla.edu/mailman/listinfo/nfd-dev" rel="noreferrer" target="_blank">https://www.lists.cs.ucla.edu/mailman/listinfo/nfd-dev</a><br>
</blockquote></div>