主权项 |
1. In a first virtual machine running on a processor in a server that is one of a plurality of servers making up a data center network, a method comprising:
sending, by the first virtual machine, an address resolution protocol (“ARP”) request message to a top-of-rack (“TOR”) switch to which the server is directly connected, to identify a media access control (“MAC”) address of a physical port of the TOR switch; receiving, by the first virtual machine, a first message from the TOR switch in response to the ARP request message containing the MAC address of the physical port of the TOR switch; sending, by the first virtual machine, a packet to the TOR switch with a pre-selected un-routable Internet protocol (“IP”) address using the MAC address of the physical port; receiving, by the first virtual machine, a second message from the TOR switch providing a TOR IP address in response to the packet; employing, by the first virtual machine, the TOR IP address to determine a rack identification (ID) of a rack that the server and TOR switch are on; employing, by the first virtual machine, the TOR IP address and a list of MAC addresses of physical machines in the rack to determine a machine ID of the server; identifying, by the first virtual machine, the first virtual machine's physical location in accordance with a first tuple of the rack ID and the machine ID; and determining, by the first virtual machine, a network proximity of the first virtual machine and a second virtual machine by comparing the first tuple with a second tuple of the second virtual machine. |