A device supporting Wake-on-LAN keeps it's network port powered up and is listening for a specific pattern that includes 6 bytes of all 1's, followed by the device's MAC address repeated 16 times. Since the device doesn't have an IP address when it is in this state, the typical way to get a wake-up frame delivered is to send a broadcast packet to the subnet that the machine is sitting on. This wake-up frame can be encapsulated in any protocol.
The K1000 appliance implementation encapsulates the wake-up frame in a UDP packet sent to port 7 on a number of broadcast addresses. We use the device's last known IP address and loop over the possible subnets from */16 to */32, sending a packet to the broadcast address for each subnet. A lot of these packets will "miss" because they're not correct. The K1000 appliance does it this way to avoid requiring the user to enter the subnet for each address. Note that when we send to the /32 subnet, we're directly addressing the device.