Forwarding Database
A system includes a network interface configured to receive a message comprising a routing address, and forward the message in accord with a route. The system further includes logic, operatively connected to the network interface. The logic is configured to apply a mask to the routing address to determine a masked address, and perform an exact match on the masked address.
1 . A method, comprising:
receiving, at a router, a message comprising a routing address;
determining a mask length for a mask;
applying the mask in accord with the mask length to the routing address to determine a masked address; and
performing an exact match on the masked address.
2 . The method of claim 1 , further comprising, routing the message in accordance with the exact match on the masked address.
3 . The method of claim 1 , further comprising:
comparing the mask length and a longest prefix length; and
in response to the comparison, routing the message in accordance with a longest prefix match.
4 . The method of claim 1 , further comprising comparing the address to a local prefix for the router.
5 . The method of claim 4 , where the local routing prefix is associated with a determined routing action listed in a local route table.
6 . The method of claim 5 , where the local route table includes listings for multiple protocols.
7 . The method of claim 1 , further comprising storing a route for the exact match of the masked address.
8 . The method of claim 7 , where storing the route comprises storing the route with an exact match key for the exact match of the masked address.
9 . The method of claim 1 , further comprising determining a source of the message in accordance with the exact match on the masked address.
10 . The method of claim 1 , further comprising classifying the address via a routing classifier, to determine a routing type.
11 . The method of claim 10 , where performing the exact match on the masked address comprises, responsive to the classification:
performing the exact match on a first bit of the address; and
applying a wildcard to a most significant bit different from the first bit.
12 . An apparatus, comprising:
a network interface configured to:
receive a message comprising a routing address; and
forward the message in accord with a route; and
logic, operatively connected to the network interface, the logic configured to:
apply a mask to the routing address to determine a masked address; and
perform an exact match on the masked address.
13 . The apparatus of claim 12 , where the logic is further configured to:
determine an exact match length for the exact match;
perform a longest prefix match on the routing address to determine a longest prefix length;
when the longest prefix length is longer than the exact match length, determine the route in accord with the longest prefix match; and
when the longest prefix length is shorter than the exact match length, determine the route in accord with the exact match.
14 . The apparatus of claim 12 , where:
the routing address comprises a first bit and a second bit; and
the logic is further configured to:
apply a wildcard to the first bit to apply the mask; and
perform the exact match on the second bit.
15 . The apparatus of claim 14 , where:
the first bit comprises a most significant bit; and
the second bit is different from the first.
16 . The apparatus of claim 14 , where:
the second bit comprises a most significant bit; and
the second bit is different from the first.
17 . The apparatus of claim 12 , further comprising a local route table; and
where the logic is further configured to compare the routing address to a local route prefix associated with an entry in the local route table.
18 . A method, comprising:
receiving, at a router, a message comprising a routing address;
performing a longest prefix match on the routing address to determine a longest prefix length;
applying a mask to the routing address to determine a masked address;
performing an exact match on the masked address;
determining a mask length for the mask; and
comparing the mask length and the longest prefix length.
19 . The method of claim 18 , where performing the exact match on the masked address comprises determining an exact match key associated with a stored exact match route.
20 . The method of claim 19 , further comprising forwarding the message in accord with the stored exact match route responsive to the comparison.