When the Oculus Rift DK2's tracking camera and the headset itself are properly synchronized, the LEDs on the headset identify themselves by blinking a repeating 10-bit binary pattern corresponding to a unique number. By tracking visible LED "blobs" in the video stream, it is possible to decode these numbers and create a fixed association between LEDs in 3D space and LED blobs in image space, which significantly simplifies the 3D pose estimation problem that it the backbone of optical tracking.
More information: http://doc-ok.org/?p=1124