1、Publication#20213Rev:A Amendment/0Issue Date:November 1995This document contains information on a product under development at Advanced Micro Devices.The informationis intended to help you evaluate this product.AMD reserves the right to change or discontinue work on this proposedproduct without noti
2、ce.Magic Packet Technology White Paper ABSTRACT This white paper presents a description of the Magic Packet Technology and how it works.It alsocovers some issues involving the sleeping Green PC and how the Magic Packet Technology can be used to put a PC in a low-power state and still be manageable b
3、y a network system administrator.SCOPE The PC market has many forces influencing the designand implementation of PCs,operating systems,andperipheral devices.Most of the time,these forces arecomplementary,such as CPU performance and multi-media uses,or the desire for end users to have theirmachines b
4、acked up each night,and the InformationSystems(IS)departments desire to maintain data in-tegrity throughout the network.However,sometimes the forces working on the PCmarket seem to be in direct conflict.One such exampleis the desire of the IS department to be able to do endnode management(software u
5、pdates,backups,etc.)and the US Governments desire,through the EnergyStar Program,to put PCs to sleep soon after the PC isnot in use.If the PC falls asleep at 5:30 in the evening,how will the IS department manage it?If the user feelsit is more important to have his hard disk backed upthan save power,
6、will he disable the power savings fea-ture of his PC?If so,this action will nullify the EnergyStar Programs intent to save power by PCs puttingthemselves to sleep when not in use.PROPOSAL AMD and Hewlett Packard identified this problem al-most 2 years ago and began working to find a solutionto the p
7、roblem of the networked Green PC(Green being the industry term for a PC that goes into low-power mode upon sensing no activity).This collabora-tion resulted in a proposal for an industry standardmechanism that allows a networked PC to go com-pletely asleep(Deep Green),yet still allows the net-work a
8、dministrator or some kind of networkmanagement software to wake up the PC simply bysending it a specific Ethernet frame.This standardEthernet frame contains a specific data pattern de-tected by the Ethernet controller on the receiving end.The Ethernet controller then alerts the system and thepower m
9、anagement circuitry wakes it up.Below are details on the silicon implementation ofMagic Packet Technology,as well as some of the sys-tem and software implications.Magic Packet Technology Overview The basic technical details of Magic Packet Technologyare simple and easy to understand.There is also a
10、sec-ond set of details,which will be implementation spe-cific.In other words,silicon-or gate-levelimplementations of Magic Packet Technology may dif-fer from AMDs approach and be completely interoper-able,as long as the basic feature set is maintained.Magic Packet Technology is a feature designed to
11、 beincorporated into an Ethernet controller.The basic fea-ture set consists of the following:I Magic Packet Mode Enable I Magic Packet Frame Detection I Magic Packet Mode Disable Magic Packet Mode Enable Assuming the Ethernet controller is running and commu-nicating with the network,there must be a
12、way for thePCs power management hardware or software to putthe Ethernet controller into the Magic Packet mode priorto the system going to sleep.On both the PCnet-ISA IIand PCnet-PCI II devices,this can be accomplished twoways:either by setting a bit in an internal register or bydriving the SLEEP#pin
13、 low.Either one of these actionswill disable normal network activity and enable MagicPacket mode.The device will no longer generate anytransmits and will monitor all incoming frames to deter-mine if any of them is a Magic Packet frame.Magic Packet Frame Detection Once the LAN controller has been put
14、 into the MagicPacket mode,it scans all incoming frames addressedto the node for a specific data sequence,which indi-cates to the controller that this is a Magic Packet frame.A Magic Packet frame must also meet the basic re-quirements for the LAN technology chosen,such as 2Magic Packet Technology SO
15、URCE ADDRESS,DESTINATION ADDRESS(which may be the receiving stations IEEE address ora MULTICAST address which includes the BROAD-CAST address),and CRC.The specific sequence con-sists of 16 duplications of the IEEE address of thisnode,with no breaks or interruptions.This sequence can be located anywh
16、ere within thepacket,but must be preceded by a synchronizationstream.The synchronization stream allows the scan-ning state machine to be much simpler.The synchroni-zation stream is defined as 6 bytes of FFh.The devicewill also accept a MULTICAST frame,as long as the 16duplications of the IEEE addres
17、s match the address ofthe machine to be awakened.If the IEEE address for a particular node on the networkwas 11h 22h 33h 44h 55h 66h,then the LAN controllerwould be scanning for the data sequence(assuming anEthernet Frame):DESTINATION SOURCE MISC FF FF FF FF FFFF 11 22 33 44 55 66 11 22 33 44 55 66
18、11 22 33 4455 66 11 22 33 44 55 66 11 22 33 44 55 66 11 22 3344 55 66 11 22 33 44 55 66 11 22 33 44 55 66 11 2233 44 55 66 11 22 33 44 55 66 11 22 33 44 55 66 1122 33 44 55 66 11 22 33 44 55 66 11 22 33 44 55 6611 22 33 44 55 66 11 22 33 44 55 66 MISC CRC Magic Packet Mode Disable There are two inst
19、ances where the Magic Packetmode must be disabled,and the Ethernet controllerreturned to normal operation mode.Either the systemhas received a Magic Packet frame,possibly from anetwork administrator who wants to do a hard diskbackup,or some other action has caused the systemto leave the low power sl
20、eep state,such as a usertouching the keyboard,moving the mouse,etc.In ei-ther case,the power management hardware or soft-ware must disable the Magic Packet mode and returnthe Ethernet controller to normal operation.On thePCnet-ISA II or the PCnet-PCI II,this may be accom-plished by either resetting
21、the register bit in an internalregister,or de-asserting the SLEEP#pin.SILICON IMPLEMENTATION Implementation details of the Magic Packet Technologymay vary from device to device,as long as the basicfunctionality is maintained.Since an Ethernet controlleralready has built-in address matching circuitry
22、 to recog-nize regular frames addressed to the node,this circuitrymay be re-used in the case of Magic Packet mode.Anew mode of operation must be implemented,which willallow the power management software or hardware toenter and leave Magic Packet mode.A counter must beadded to the address matching ci
23、rcuitry to count up the16 duplications of the IEEE address,with another circuitto reset the counter if the data being processed does notmatch the IEEE address.It should not take much design effort,time,or siliconarea to add the Magic Packet Technology to an existingEthernet controller.This was one o
24、f the primary rea-sons for going with a solution that uses the IEEE ad-dress as the identifier for the Magic Packet frame,sincethe circuitry already exists to match this data stream.SYSTEM IMPLEMENTATION To utilize the Magic Packet Technology in a PC,thereare several modifications which must be done
25、 to en-sure proper operation of the feature.Lets take the caseof a motherboard implementation,where the Ethernetcontroller will be located on the motherboard,with anRJ-45 connector coming out the back of the computer.This implementation is becoming more and more com-mon as Ethernet establishes itsel
26、f as a de facto stan-dard for the desktop LAN.First,lets address the hardware steps necessary toallow the Ethernet controller to wake up the systemwhen it receives a Magic Packet frame.Most desktopPCs these days already have pretty advanced powermanagement circuitry either built into the chipset or
27、as aseparate functional block on the motherboard.In this ex-ample,it is a simple matter to connect one of the LEDpins,such as LED 3,into the power management cir-cuitry.The Magic Packet frame indication becomes justanother possible alert to the power management cir-cuitry that the system needs to wa
28、ke up.The details asto how to connect the LED 3 pin into the systems powermanagement circuitry is obviously system,chipset,anddesign specific,so will not be covered here in detail.The second stage,the enabling and disabling of theMagic Packet mode,can be done in hardware or soft-ware.If done in hard
29、ware,the power management cir-cuitry must drive the SLEEP#pin active before it placesthe machine in the sleep mode.This will stop all normalnetwork activity and place the Ethernet controller intothe Magic Packet mode.Upon receiving a MagicPacket frame or sensing some other activity,such askeyboard o
30、r mouse movement,the hardware must thende-assert the SLEEP#pin to remove the Ethernet con-troller from Magic Packet mode and return the control-ler to normal operation.The second stage can also be done in software,if de-sired.On most systems,the BIOS or other software willbe aware of the state of th
31、e system and will cooperate inthe powering down of the various components of thesystem.In this instance,if the BIOS is involved in thepowering up and down of subsystems,it could,whenpowering down the system to go to sleep,set a bit in theEthernet controller to enable Magic Packet mode.Whenthe system
32、 wakes up,for whatever reason,the BIOSwould then disable Magic Packet mode by de-assertingthe same bit to turn off Magic Packet frame detectionfeature and return the Ethernet controller to the normaloperating mode.Magic Packet Technology3 Driver Implications Network operating system drivers may or m
33、ay not needto be modified to support the Magic Packet mode of op-eration.If the hardware or BIOS is responsible for en-abling and disabling the Magic Packet mode,the drivermay not need to be changed at all.This is because thedriver has no need to know whether the system hasbeen awake or asleep.If th
34、e system goes asleep andthen wakes up for some reason,as long as the Ether-net controller is in the same state as when the driverwas last accessing it,including the registers and bufferpointers,then the driver can continue functioning as ifnothing happened.Of course,if the system was asleepfor an ex
35、tended time,the PC may have been logged offthe network,but it is up to the upper layers,not thedriver,to re-establish the link to the server.However,all that said,the driver may very well be thebest place to put support for Magic Packet Technology.For instance,the driver could monitor all AdvancedPo
36、wer Management(APM)calls,and if told that thesystem is going to sleep,the driver could enable MagicPacket mode.When the APM call indicates the systemis in the process of waking up,the driver could then dis-able Magic Packet mode,verify the state of the Ether-net controller,and continue normal activi
37、ty.NOS Implications The implications of Magic Packet Technology on theNetwork Operating Systems(NOS)is still being deter-mined;however,there are several points which shouldbe highlighted.First and foremost,many current NOSperiodically send a packet to an end node to determineif the PC is still there
38、 and will log off any station thatdoes not respond to this Ping after X number of retries.This has caused notebook users frustration for years,since notebooks are designed to go into a SUSPENDmode after a few minutes of inactivity.This pinging and subsequent logging off of PCs that donot respond wil
39、l have to change,and,in fact,is in theprocess of changing.The most widely used NOS whichdoes this is Novell Interware.There are new options inNovell Netware 4.1 which will allow a network adminis-trator to disable this function.Another problem currently exists with Peer-to-Peer net-working operating
40、 systems,such as Windows for Work-groups.The problem is that a user may attempt to logonto another users computer after hours,when thatcomputer has gone into Magic Packet mode and doesnot respond to normal network traffic.In this case,theuser will not be able to attach to the other computer asa serv
41、er.Infrastructure Implications Since implementing Magic Packet Technology,therehave been many questions concerning the ability of aMagic Packet frame to actually reach and power up aremote PC.These questions usually center around theability of the Magic Packet frame to bridge and route toa remote PC
42、,which may be in the next building oracross the country.Bridges First,lets address the bridge issue.Since the MagicPacket frame is a standard Ethernet frame,there is noreason a bridge would not forward it appropriately.Theonly difference between a Magic Packet frame and astandard Ethernet frame is t
43、he 16 duplications of the 6-byte IEEE address,which is carried in the data portionof the frame.The bridge does not even care what is inthe data portion of a frame,it only cares about the des-tination address.The question has also been asked“what happens if a bridge has deleted the address ofthe end
44、node the Magic Packet frame is destined forfrom the bridge address database?Will the bridge justthrow the frame away?”The answer is no.If a bridgedoes not know on which port a specific address is lo-cated,the bridge must forward the frame to all ports.This will guarantee that the node,which the fram
45、e hasbeen addressed to,will receive it.Routers Next we will focus on the routers in a network.Manynetworks are separated by routers;a router is almostalways used to connect a LAN in one building to a LANin another building.Routers are used to segment theLAN and reduce the number of nodes,as well as
46、thenumber of broadcast messages,on each segment ofthe LAN.Again,as above with the bridge,since theMagic Packet frame is just a simple Ethernet frame witha specific data pattern in the data field,there should beno reason why a router would not route the frame likeany other.And since the Magic Packet
47、frame is protocolindependent,it does not matter what protocol the LANis running,whether it be TCP/IP,IPX,or any other.Aslong as the data portion of the frame arrives intact atthe destination,it will wake up the target machine.Address Aging in Routes A significant problem presented itself while the i
48、nfra-structure discussions were going on.This centers onthe aging of ARP(address resolution protocol)tables inrouters,as opposed to bridges.In a bridge,when anaddress has been eliminated from the database,the in-coming frame would be sent to all ports on the bridge.Again,this is in the definition of
49、 a bridge.In a router,however,when a frame is received whose address isnot in the database,the router will send an ARP outonto the network looking for a response from the nodethat the frame was addressed to.If the machine is inMagic Packet mode,it will not respond to this ARP andthe router will just
50、 throw the frame away.Obviously,thiswould negate the ability to remotely wake up a sleepingPC over a routed network.4Magic Packet Technology However,a method of solving the above problem waspresented by IBM engineers,who had been looking atthe issue and came up with a novel approach to theproblem.In