Middleware for the receive pipeline. NextHopRouter is pass-through on receive — if the packet reached us, it should be delivered. Route learning happens via ACK handling in ReliableRouter, not here.
Determine the next hop for a destination. Returns empty string if no learned route (flood).
Record a failed delivery — clear the learned route.
Record a successful delivery to update the routing table.
Uses learned routes for efficient delivery; falls back to flooding when no route is known. Sits above FloodingRouter in the middleware pipeline.
The NextHopRouter doesn't actually re-route packets in the middleware — it provides the send-side path determination. On the receive side it simply passes through (all messages should be delivered locally if they reached this node).
Spec ref: SPEC-004