NFD forwarding pipelines Junxiao Shi, 2015-08-14 1 Overview • Forwarding consists of pipelines and strategies • Pipeline: a series of steps that operate on a packet or a PIT entry • Strategy: a decision maker on whether, when, and where to forward an Interest 2 Pipelines • • • • • • • • • • • incoming Interest ContentStore miss ContentStore hit Interest loop outgoing Interest Interest reject Interest unsatisfied Interest finalize incoming Data Data unsolicited outgoing Data 3 Legend in diagrams pipeline building block strategy tables feature face feature 4 incoming Interest Interest loop ContentStore miss ContentStore hit outgoing Interest Interest reject Interest unsatisfied Interest finalize strategy API broadcast strategy incoming Data Data unsolicited ncc strategy best route strategy outgoing Data access strategy 5 Pipelines Overall Workflow Interest loop incoming Interest after receive Interest Interest reject before expire Interest outgoing Interest ContentStore miss unsatisfy timer Interest unsatisfied ContentStore hit incoming Data before satisfy Interest straggler timer Interest finalize outgoing Data Data unsolicited 6 incoming Interest pipeline receive Interest violates /localhost? Y (drop) Y N Interest loop detect duplicate Nonce PIT insert N cancel unsatisfy & straggler timer Y is pending? N CS lookup Y N ContentStore miss ContentStore hit 7 detect duplicate Nonce • If any InRecord or OutRecord contains the same Nonce as the incoming Interest, or the Name and Nonce of the incoming Interest appear in Dead Nonce List, a duplicate Nonce is detected. • If the duplicate Nonce is found in InRecord only, this is a multi-path arrival, and not a loop. • If the duplicate Nonce is found in OutRecord or Dead Nonce Table, this is either a multi-path arrival or a loop, and these two reasons are indistinguishable. • Nonce is later recorded on an InRecord. 8 Interest loop pipeline • Process an Interest that has been considered looped • This pipeline is currently empty, which means Interest packet is dropped. NACK could be added here 9 ContentStore miss pipeline • This pipeline is entered when an incoming Interest • is pending (so ContentStore lookup is unnecessary), or • is miss from ContentStore • This pipeline will start forwarding the Interest 10 ContentStore miss pipeline insert InRecord Y has Link object? N set PIT unsatisfy timer in producer region? N timer event has Selected Delegation ? Y Y FIB lookup with Interest Name FIB lookup with SelectedDelegation dispatch to strategy Interest unsatisfied N FIB lookup with first Delegation Name N Y in defaultfree zone? choose and set SelectedDelegation 11 set PIT unsatisfy timer • Given PIT entry, set an unsatisfy timer which fires when InterestLifetime expires for all unexpired InRecords • When the unsatisfy timer fires, Interest unsatisfied pipeline is entered 12 determine whether in producer region • Input: • regionNames: the router's region names, from configuration • interest • Algorithm: 1. foreach delegation in Link: 1. foreach regionName in regionNames: 1. if delegation Name is a prefix of regionName, return true and abort these steps 2. return false • Note: • We consider all delegations, not just SelectedDelegation, to maximize flexibility. This is cheap because there's no table lookup. 13 determine whether in default-free zone • Input: • interest, with Link but without SelectedDelegation • FIB lookup result for the first delegation • Algorithm: 1. if FIB lookup result is the root entry (ndn:/), and the entry has at least one nexthop record, return false 2. return true • Note: • FIB lookup will never return "no match", because the FIB always has a root entry, but this entry can have no nexthop record. • We consider only the first delegation, to minimize table lookup cost. Checking all delegations probably gives better results, but it requires too many lookups. 14 choose and set SelectedDelegation • Input: • interest, with Link but without SelectedDelegation • FIB • Algorithm: 1. foreach delegation in Link, sorted by increasing Preference 1. 2. lookup FIB with delegation Name if a match (with non-zero nexthop records) is found, insert SelectedDelegation field with the index of this delegation, return the match, and abort these steps 2. lookup FIB with Interest Name • Note: • This is the only operation that requires multiple table lookups, but it happens only once on an Interest's path at the first default-free router. 15 ContentStore hit pipeline Interest finalize timer event set PIT straggler timer outgoing Data 16 dispatch incoming Interest to strategy • Given FIB entry and incoming Interest, determine which strategy should process this Interest, and trigger that strategy 17 outgoing Interest pipeline (drop) (drop) Y Y violates /localhost? N violates /localhop? pick Interest N insert OutRecord send Interest 18 pick outgoing Interest packet • Given PIT entry and nexthop, decide the guiders on the outgoing Interest • Nonce and InterestLifetime come from an InRecord with longest remaining lifetime, however InRecord with same Face as the nexthop cannot be used • InterestLifetime is carried from the original packet without deducting the time elapsed • Scope is the most relaxed among all unexpired InRecords • The last incoming Interest is picked • This is a simple choice until we understand the effect of guiders better 19 Interest reject pipeline • Process an Interest that has been decided that it has nowhere to go cancel unsatisfy & straggler timer set PIT straggler timer timer event Interest finalize 20 Interest unsatisfied pipeline invoke PIT unsatisfied callback Interest finalize 21 Interest finalize pipeline need Dead Nonce List insert? Y Dead Nonce List insert N PIT delete 22 Dead Nonce List insert • Dead Nonce List insertion is needed if: • Interest is unsatisified, OR • Interest has MustBeFresh=yes and Data FreshnessPeriod is shorter than 6 seconds • Nonces in OutRecords are inserted to Dead Nonce List. 23 incoming Data pipeline receive Data violates /localhost? N PIT match N Data unsolicited Y Y (drop) CS insert invoke PIT satisfy callback foreach cancel unsatisfy PIT entry & straggler timer need Dead Nonce List insert? Y Dead Nonce List insert N mark PIT satisfied set PIT straggler timer outgoing foreach Data pending downstream timer event Interest finalize 24 set PIT straggler timer • Given PIT entry, set a straggler timer which fires after a short time • Tstraggler = 100ms • When the straggler timer fires, PIT entry is deleted • The purpose of retaining PIT entry for a short time is to facilitate loop detection and to collect measurement for non-fastest upstreams 25 Data unsolicited pipeline accept to cache? N Y CS insert 26 outgoing Data pipeline violates /localhost? Y (drop) N traffic manager send Data 27 Pass-through traffic manager • Provide a traffic manager that does nothing and merely passes Data packet to the next step 28