Method and apparatus for layer 2 route calculation in a route reflector network device
A network device (ND) receives a first media access control (MAC)/Internet Protocol (IP) route for a customer ND. The ND installs the first MAC/IP route in a MAC/IP routing table and transmits the first MAC/IP route to a first subset of NDs causing the NDs to install the first route. The ND receives a second MAC/IP route for the customer ND and a sequence number indicative of an order of advertisement of the second MAC/IP route. The ND determines, based on the sequence number, that the second MAC/IP route is a best route for the customer ND. The ND installs the second MAC/IP route as the best route for the customer ND; and transmits the second MAC/IP route to a second subset of NDs including a first ND from which the first MAC/IP route originated, causing the first ND to request withdrawal of the first MAC/IP route.
1. A method in a network device that is communicatively coupled with a plurality of network devices and the network device is operative to act as a route reflector for the plurality of network devices, the method comprising:
receiving a first media access control (MAC)/Internet Protocol (IP) route for a customer network device;
installing the first MAC/IP route in a MAC/IP routing table as a best route for reaching the customer network device;
transmitting the first MAC/IP route to a first subset of the plurality of network devices causing each one of the first subset of the plurality of network devices to install the route as a best route for the customer network device;
receiving a second MAC/IP route for the customer network device and a sequence number for the second MAC/IP route, the second MAC/IP route being different than the first MAC/IP route, and the sequence number being indicative of an order of advertisement of the second MAC/IP route for the customer network device when compared with advertisement of other MAC/IP routes for the customer network device, the sequence number indicating that the second MAC/IP route is advertised by a network device that has a MAC/IP route already installed for the customer network device;
determining, based on the sequence number, that the second MAC/IP route is a best route for the customer network device;
installing the second MAC/IP route as the best route for the customer network device; and
transmitting the second MAC/IP route to a second subset of the plurality of network devices including a first network device from which the first MAC/IP route originated, causing the first network device to request withdrawal of the first MAC/IP route, requesting withdrawal of the first MAC/IP route including transmitting a withdraw MAC/IP route advertisement for the first MAC/IP route causing each one of the first subset of the plurality of network devices to remove the first MAC/IP route from a respective MAC/IP routing table.
2. The method of claim 1 , wherein the determining, based on the sequence number that the second MAC/IP route is the best route for the customer network device includes:
determining whether the first MAC/IP route is associated with a first sequence number that is indicative of an order of advertisement of the first MAC/IP route for the customer network device when compared with advertisements of other routes for the customer network device; and
responsive to determining that the first MAC/IP route is not associated with the first sequence number, selecting the second MAC/IP route as the best route for the customer network device.
3. The method of claim 2 , wherein the sequence number is a second sequence number, and wherein the determining, based on the sequence number that the second MAC/IP route is the best route for the customer network device further includes:
responsive to determining that the first MAC/IP route is associated with the first sequence number, performing the following:
determining whether the second sequence number is greater than the first sequence number; and
responsive to determining that the second sequence number is greater than the first sequence number, selecting the second MAC/IP route as the best route for the customer network device.
4. The method of claim 1 further comprising: receiving the withdraw MAC/IP route advertisement for the first MAC/IP route; and responsive to receiving the withdraw MAC/IP route advertisement for the first MAC/IP route, removing the first MAC/IP route from the MAC/IP routing table.
5. The method of claim 1 , wherein the receiving the first MAC/IP route includes receiving, from the first network device, a first border gateway protocol (BGP) MAC/IP route advertisement including the first MAC/IP route, and the receiving the second MAC/IP route includes receiving from a second network device that is different from the first network device, a second BGP MAC/IP route advertisement including the second MAC/IP route.
6. The method of claim 5 , wherein the sequence number is included in a BGP MAC mobility extended community attribute of the second BGP MAC/IP route advertisement.
7. A machine-readable medium comprising computer program code which when executed by a computer carries out the method steps of claim 1 .
8. A network device that is to be communicatively coupled with a plurality of network devices and the network device is operative to act as a route reflector for the plurality of network devices, the network device comprising:
one or more processors; and
a non-transitory machine-readable storage medium that provides instructions that, when executed by the one or more processors, will cause the network device to:
receive a first media access control (MAC)/Internet Protocol (IP) route for a customer network device,
install the first MAC/IP route in a MAC/IP routing table as a best route for reaching the customer network device,
transmit the first MAC/IP route to a first subset of the plurality of network devices causing each one of the first subset of the plurality of network devices to install the route as a best route for the customer network device,
receive a second MAC/IP route for the customer network device and a sequence number for the second MAC/IP route, the second MAC/IP route being different than the first MAC/IP route, and the sequence number being indicative of an order of advertisement of the second MAC/IP route for the customer network device when compared with advertisement of other MAC/IP routes for the customer network device,
determine based on the sequence number, that the second MAC/IP route is a best route for the customer network device, the sequence number indicating that the second MAC/IP route is advertised by a network device that has a MAC/IP route already installed for the customer network device,
install the second MAC/IP route as the best route for the customer network device, and
transmit the second MAC/IP route to a second subset of the plurality of network devices including a first network device from which the first MAC/IP route originated, causing the first network device to request withdrawal of the first MAC/IP route, requesting withdrawal of the first MAC/IP route including transmitting a withdraw MAC/IP route advertisement for the first MAC/IP route causing each one of the first subset of the plurality of network devices to remove the first MAC/IP route from a respective MAC/IP routing table.
9. The network device of claim 8 , wherein the sequence number is a second sequence number, and wherein to determine, based on the sequence number that the second MAC/IP route is the best route for the customer network device includes to:
determine whether the first MAC/IP route is associated with a first sequence number that is indicative of an order of advertisement of the first MAC/IP route for the customer network device when compared with advertisements of other routes for the customer network device; and
responsive to determining that the first MAC/IP route is not associated with the first sequence number, select the second MAC/IP route as the best route for the customer network device.
10. The network device of claim 9 , wherein to determine, based on the sequence number that the second MAC/IP route is the best route for the customer network device further includes to:
responsive to determining that the first MAC/IP route is associated with the first sequence number, perform the following:
determine whether the second sequence number is greater than the first sequence number; and
responsive to determining that the second sequence number is greater than the first sequence number, select the second MAC/IP route as the best route for the customer network device.
11. The network device of claim 8 , wherein the instructions when executed by the one or more processors, will further cause the network device to:
receive the withdraw MAC/IP route advertisement for the first MAC/IP route; and
responsive to receiving the withdraw MAC/IP route advertisement for the first MAC/IP route, remove the first MAC/IP route from the MAC/IP routing table.
12. The network device of claim 8 , wherein to receive the first MAC/IP route includes to receive, from the first network device, a first border gateway protocol (BGP) MAC/IP route advertisement including the first MAC/IP route, and to receive the second MAC/IP route includes to receive from a second network device that is different from the first network device, a second BGP MAC/IP route advertisement including the second MAC/IP route.
13. The network device of claim 12 , wherein the sequence number is included in a BGP MAC mobility extended community attribute of the second BGP MAC/IP route advertisement.