| |
|
Objectives
"Wake-On-LAN" is AMD's term for a cross-network power-on capability that
is supported on their newer Ethernet cards, with certain motherboards. It
allows a PC to be nominally turned off and to be turned on automatically for a
scheduled management procedure, e.g. in the middle of the night. AMD have
coined the term "Magic Packet" to describe the special network packet
that can be sent to sleeping network cards to wake them up. Intel also support
a similar feature with some of their cards/motherboards ("Wired for
|
|
Management" is their term). Intel's network packet is a slightly different
format.
In terms of the project, it was necessary to design a 32-bit application for MS
Windows 9x/Me/NT4/2k/XP/2003 without GUI that would provide functionalities to:
|
detect if a PC, that has the network interface with the specified
IP-address, is turned on;
|
|
detect the MAC-address of the network interface corresponding to
the specified IP-address;
|
|
wake a PC up remotely.
|
|
| |
|
Results
The application is developed to be included into the network management suite.
It was assumed that the application would mainly be used for remote PC wake-up
by the schedule in order to perform the hardware and software inventory
operations and remotely install the software. To form the "Magic Packet",
|
|
it is necessary to know the MAC-address of the network interface. It is assumed
that the utility will allow to detect if the OS core of the PC, that has the
network interface with the specified IP-address, is loaded. If it is, then the
utility should get and save the MAC-address for the following PC Wake-On-LAN.
|
| |
|
Developer's comments
Q: How does this work?
KB_Soft: Let's examine every function individually. To detect if the PC, that
has the network interface with the specified IP-address, is turned on, the
application generates the UDP-datagram that contains the echo message (a ping
message) in its ICMP (Internet Control Message Protocol) packet. One of the
complicated moments was to get the MAC-address of the remote network interface
by its IP-address. For this task, a simple but effective solution was found.
The application sends the echo message to the specified IP-address. Then, if
the reply follows, it extracts the target MAC-address from the ARP table of the
local PC. It is assumed that the target machine is located in the same
subnetwork and, therefore, in order to send an IP-packet to the target PC, the
system will execute the ARP request and put the MAC-address
|
|
of the specified network interface into the ARP table. Now let us pass on to
the issue of the Wake-On-LAN. It is rather simple.
The MAC-address is being extracted by the specified IP-address (the MAC-address
is being searched among the saved ones). Later on, the "Magic Packet" is being
formed and sent to the network in the form of a broadcast datagram.
Q: What was the most complicated issue in this project?
KB_Soft: Well, the most complicated task was to implement the function getting
the MAC-address of the remote network interface. We had the strictly limited
period of time to implement the project. We examined several versions of its
implementation, which resulted in the simplest and most effective solution.
|