# Signalhouse Route Lookup & Packet Path Simulator (longest prefix match) > Which route wins? Longest prefix match, distances, ECMP — or a hop-by-hop packet walk. Paste a routing table (connected, static, null, OSPF, BGP … routes with next hops, administrative distances and metrics) and destination addresses: the simulator builds the forwarding table like a router — best distance, then metric, equal-cost paths, recursive next hops, interfaces that are down — and explains for every destination which route wins by longest prefix match and why the others lose. With a Signalhouse Network lab topology it walks a packet hop by hop and finds blackholes, forwarding loops, MTU drops and asymmetric return paths. Part of usefulweb.app (https://usefulweb.app/). Part of [Signalhouse](https://signalhouse.usefulweb.app/) (ownerApp: signalhouse). Results are deterministic calculations from the inputs and the listed assumptions; the API returns exactly what the web page shows. ## Use it - Human interface: https://signalhouseroutelookup.usefulweb.app/ (interactive tool at https://signalhouseroutelookup.usefulweb.app/tool) - JSON API: POST https://signalhouseroutelookup.usefulweb.app/api/v1/calculate with a JSON object of inputs (schema: https://signalhouseroutelookup.usefulweb.app/api/v1/tool) - OpenAPI: https://signalhouseroutelookup.usefulweb.app/openapi.json - MCP (Streamable HTTP): https://signalhouseroutelookup.usefulweb.app/mcp - tool `signalhouse_route_lookup` ## Inputs - routes (table): Routing table - One route per row. Protocol: connected, local, static, blackhole (null route), ospf, rip, eigrp, isis, ebgp or ibgp. Leave distance empty for the default (connected 0, static 1, eBGP 20, OSPF 110, RIP 120, iBGP 200). - destinations (textarea): Destinations (one per line) - interfacesDown (text): Interfaces that are down (optional) - Comma-separated, e.g. eth1. Their connected routes disappear and routes through them stop working. - topology (textarea): Network lab topology JSON (optional) - Instead of a table: a topology exported from the Signalhouse Network lab ({ nodes, links }). Then name the start device and the destination below. - from (text): Packet from (device id or name) - to (text): Packet to (address or device) - size (integer): Packet size - df (boolean): “Don’t Fragment” set (IPv4) ## Method - Each route is first checked for usability: its interface must be up, a next hop without an interface must resolve through another route (recursively, at most 8 levels, never through its own prefix) and a distance of 255 means unusable. - Per prefix the router installs the usable route with the lowest administrative distance, then the lowest metric; several routes with the same best distance and metric are installed together as equal-cost paths (ECMP). The others stay as backups — a static route with a higher distance is a “floating” backup. - A lookup takes the longest installed prefix that contains the destination (RFC 1812, RFC 4632). Connected prefixes are delivered with ARP or Neighbor Discovery, local addresses are received, discard routes drop the packet, no match means ICMP destination unreachable. - Default distances follow Cisco IOS (connected 0, static 1, eBGP 20, EIGRP 90, OSPF 110, IS-IS 115, RIP 120, iBGP 200). Other vendors use other defaults — set the distance column to match your platform. - Topology mode repeats the lookup on every router of the path, decrements the TTL, resolves the next hop on the egress segment (through switches), checks the MTU (DF set: drop with “fragmentation needed”; IPv6: “Packet Too Big”), detects loops by a second visit of the same router and compares the return path link by link. ## Limits - A teaching and planning simulation: it does not model policy routing, VRFs, route maps, NAT, ACLs or dynamic protocol timers. The link-state protocol of topology mode is a simplified single-area SPF.