Virtualized clocks
A method of virtualizing a clock is executed by a network controller comprising a processor and computer-readable instructions for creating one or more virtual network elements comprising one or more virtual clocks. The method comprises retrieving, at a first virtual network element of the one or more virtual network elements, a first time of day value and a second time of day value. The method further comprises adjusting the amount of time elapsed based, in part, on a frequency adjustment value and incrementing a clock value based on the amount of time elapsed.
1. A method of virtualizing a clock, the method executed by a network controller comprising a processor and computer-readable instructions for creating one or more virtual network elements comprising one or more virtual clocks, the method comprising:
retrieving, at a first virtual network element of the one or more virtual network elements, a first time of day value;
retrieving, at the first virtual network element of the one or more virtual network elements, a second time of day value;
calculating an amount of time elapsed between the first time of day value and the second time of day value;
adjusting the amount of time elapsed based at least in part on a frequency adjustment value, the amount of time elapsed, and a frequency value; and
incrementing a clock value based on the adjusted amount of time elapsed.
2. The method of claim 1 , wherein the virtual network element comprises a virtual network protocol stack that provides the first time of day value and the second time of day value.
3. The method of claim 1 , wherein the virtual network protocol stack fully replicates the behavior of a network element.
4. The method of claim 1 , further comprising:
retrieving an adjustment value; and
calculating a frequency adjustment value based on the adjustment value.
5. The method of claim 3 , wherein the frequency adjustment value is stored as a multi-bit fractional value.
6. The method of claim 1 , further comprising executing the method of claim 1 on at least one thousand virtual network elements.
7. The method of claim 1 , further comprising repeating the method of claim 1 at a fixed time period.
8. The method of claim 7 , wherein the fixed time period is a one second interval.
9. A system for virtualizing a clock, the system comprising:
a network controller comprising a processor and computer-readable instructions executed by the processor for creating one or more virtual network elements, each virtual network element comprising a virtual clock adapted to;
retrieve a first time of day value;
retrieve a second time of day value;
calculate an amount of time elapsed between the first time of day value and the second time of day value;
adjust the amount of time elapsed based at least in part on a frequency adjustment value, the amount of time elapsed, and a frequency value; and
increment a clock value based on the adjusted amount of time elapsed.
10. The system of claim 9 , wherein the virtual network element further comprises a virtual network protocol stack adapted to provide the first time of day value and the second time of day value to the virtual clock.
11. The method of claim 10 , wherein the virtual network protocol stack fully replicates the behavior of a network element.
12. The system of claim 9 , wherein the virtual clock is further adapted to:
retrieve an adjustment value; and
calculate a frequency adjustment value based on the adjustment value.
13. The system of claim 12 , wherein the frequency adjustment value is a fractional value.
14. The method of claim 1 , wherein the network controller is adapted to instantiate at least one thousand virtual network elements.