the protocol of the present invention ensures that at any moment the amount of power consumed by a pd is not more than the amount of power allocated by the pse for the given pd . the protocol of the present invention also ensures that pds do not consume more than the amount of power configured by an administrator on the pse . the protocol of the present invention assumes that all pses supporting power negotiation with pds are capable of providing a certain minimum amount of power ( referred to herein as minp ). it &# 39 ; s also assumed that pds supporting the negotiation are capable of coming up and running power negotiation at minp . the operation and management of the protocol provided by the present invention are managed by protocol subsystems on respective pses and pds . these protocol subsystems maintain their own copies of data and interact with their respective power managers . a power manager on a pd uses its protocol subsystem to change its power levels . it asks its protocol subsystem for more power by requesting a new power mode and waits for its notification before moving to a higher power mode . similarly , the power manager on the pd notifies its protocol subsystem of reduced power consumption requirements when its consumption requirements decrease . the power manager on pd may just be a simple user interface that users interactively manage or a more complex system that is transparent to a user . the power manager on a pse is responsible for allocating power when a pd asks for it . the power manager on a pse is also responsible for either accepting or denying a pd &# 39 ; s request for new power modes . this may be performed based on the amount of remaining unallocated power and user configuration . a pd inserts the following pieces of information into protocol packets that are sent out during the negotiation process . 1 . consumption — the amount of power consumed by the pd at the time the message was sent . 2 . request sequence number ( generated by pd )— used by the pd and pse to differentiate one pd request from another . 3 . management sequence number ( generated by pse )— used by the pd and pse to differentiate one pse request from another . 4 . request set of power levels — generated by pd to specify the set of power levels , one of which it desires to switch to . used by pse to select one of the levels . 5 . trigger value . a pse inserts the following information in protocol packets that it sends out during the negotiation process . 1 . request sequence number — generated by a pd 2 . management sequence number — generated by a pse 3 . available power — generated by a pse . pse uses this field to specify the amount of power available to the pd . 4 . management power — generated by pse . pse uses this field to specify the maximum amount of power that pd may consume after the receipt of the protocol packet . 5 . trigger value . pds come up in a power mode that consumes not more than the power level specified by minp . after being powered , a pd starts advertising its requests by placing the requested set of power levels in its outgoing protocol packets . the pd may change its consumption after the receipt of packets from pse having a request sequence number matching the number that pd used when it sent the requests out . the amount of power consumed in such case may not be more than the minimum of management and available power levels indicated in pse protocol packets . whenever pd plans to increase its power consumption beyond the current level , it places the requested set of levels in its outgoing packets and increments request sequence number indicating new request . the pd can increase its consumption only after acknowledgement from pse that indicates that enough amount of power has been allocated at the pse . conversely , when a pd plans to decrease its consumption , it can do so immediately without waiting for pses acknowledgement . when pd specifies this in its outgoing packets by adjusting the requested set of levels and request sequence number , the pse can deallocate power beyond the pd &# 39 ; s latest rate of power consumption . the protocol packets from pse also carry management information from pse . the pd obeys the requests from pse and adjusts accordingly . the flowchart for pd handles all combinations of pd power manager requests , pse power manager requests and pse acknowledgements . the protocol requires that a pd maintain the following pieces of information . 1 . last received protocol data from pse ( referred to herein as lastrxpseprotdata ), and , 2 . protocol data last transmitted by the pd ( referred to herein as lasttxpdprotdata ). the state maintained by the pd is be initialized as below : 1 . last received pse protocol data : management sequence number ( referred to herein as mgmtseqnum ) set to 0 . request sequence number ( referred to herein as reqseqnum ) set to 0 . available power ( referred to herein as availpower ) set to minp . management power ( referred to herein as mgmtpower ) set to − 1 . trigger ( trigger ) set to 0 . 2 . protocol data last transmitted by the pd : consumption set to minp . request sequence number ( reqseqnum ) set to a non - zero random value . management sequence number ( mgmtseqnum ) set to 0 . request set of power levels ( referred to herein as reqsetofpowerlevels ) set to list of power modes that pd requests to transition to . trigger set to false . pses discover pds and power them up . once a pd has been powered , the pse waits for messages from pd . these initial messages from pds are requests to transition away from initial minp ( low power ) mode . pses process requests from power managers for controlling pd power level , acknowledgements from pds for pse requests and requests from pds for new power modes in order as described in the flowchart . fig1 a - 1f illustrate in flowchart form how the present invention handles all three cases at once to enable pse implementation do background processing of , requests from power manager and messages from pse . the description below , as well as fig1 a - 1f and fig2 a - 2e , utilize notation conventions found in the c programming language . the pse manages parameters in such a way that the following conditions always holds true : last transmitted protocol data ( lasttxpseprotdata ). last received protocol data from pd ( lastrxpdprotdata ). allocated power ( allocpower )— the amount of power budgeted by the power manager for the pd . user configuration ( userconfig )— the maximum amount of power that can be consumed by the pd powered by the pse . the value for this field is determined by power management . this field is set by the system before pse begins discovering pds for powering them up . also , the value for this field cannot be less than minp , else the pd cannot be powered . management sequence number ( mgmtseqnum ) initially set to a non - zero random number . request sequence number ( reqseqnum ) initially set to 0 . available power ( availpower ) initially set to some power level as determined by power management and in fig1 a - 1f . management power ( mgmtpower ) initially set to − 1 . management sequence number ( mgmtseqnum ) initially set to 0 . request sequence number ( reqseqnum ) initially set to 0 . requested set of power levels ( reqsetofpowerlevels ) initially set to empty - set . power consumption ( consumption ) is initially set to 0 . pse requests pd to change its consumption for either an increase or a decrease of power . power management ( or other application on pse ) can ask pd to reduce its consumption by decreasing the power level indicated by userconfig . the allocated power level is not changed at this time . an increase in the amount of available power is indicated by increasing the power level indicated by userconfig . at this time allocpower is increased by the power management system . a general condition that must be ensured to be true by the power management subsystem for any request is that allocpower & gt ;= max ( userconfig , lasttxpseprotdata . availpower ). fig1 a - 1f illustrate various sequences of acts performed by pses with respect to power negotiation in accordance with the present invention . directing attention to fig1 a , control begins at act 100 , where the pse discovers a pd and the maximum amount of power consumed by the pd can be determined . if a pd is not found or a pd is found but its maximum consumption level cannot be determined , act 100 is repeated until these conditions are satisfied . at act 102 , the pse requests its power manager to allocate power for the pd discovered at act 100 . in response , the power manager sets a value for allocpower . at decision act 104 , a determination is made as to whether allocpower exceeds minp . if the determination has a negative result , control transitions to act 106 , where it is determined that the pd cannot be powered . the pse can choose to come back later to restart the discovery and power up process for the pd . returning to decision act 104 , if the determination has a positive result , control transitions to act 108 , where the pd is powered up . the pse state is initialized as described above , and lasttxpse . protdata . availpower is set to allocpower ( act 110 ). at act 112 , the pse waits for messages from the pd or the pse &# 39 ; s power manager that indicates the pd needs a change in its power consumption . control loops at this act until such a message is received . if a message is received from a pd but not the power manager on the pse , control proceeds to act 114 , where newtxpseprotdata is assigned the value of lasttxpseprotdata . control then transitions to act 116 , where the received message is designated as the current message . control then transitions to act 124 ( fig1 b ). returning to act 112 , if a message is received from the pse &# 39 ; s power manager for a consumption change on a pd ( and optionally a message is also received from a pd for the consumption change ), control transitions to act 118 , where newtxpseprotdata is assigned the value of lasttxpseprotdata . control then transitions to act 120 ( fig1 b ). directing attention to fig1 b , at act 120 , newtxpseprotdata . availpower is assigned the value of allocpower , newtxpseprotdata . mgmtpower is assigned the value of userconfig , and newtxpseprotdata . mgmtseqnum is incremented . this sequence number value may wrap but is not allowed to be a zero value . at decision act 122 , an evaluation is made as to whether any message has been received from the pd that is currently being processed . if decision act 122 has a negative result , control proceeds to act 158 . if decision act 122 has a positive result , control proceeds to decision act 124 , where a comparison is made between lastrxpdprotdata . mgmtseqnum and currrxpdprotdata . mgmtseqnum as well as between currrxpdprotdata . mgmtseqnum and lasttxpdprotdata . mgmtseqnum . if decision act 124 has a negative result , control transitions to act 132 . else , control transitions to act 126 , where newtxpseprotdata . mgmtpower is assigned the value of currrxpdprotdata . consumption and newtxpseprotdata . availpower is assigned the value of currrxpdprotdata . consumption . control then proceeds to decision act 128 , where a comparison is made between lasttxpseprotdata . availpower and newpsetxprotdata . availpower . if decision act 128 has a negative result , control transitions to act 132 , else , control transitions to act 130 . at act 130 , the pse deallocates any power beyond the pd &# 39 ; s consumption value . allocpower is changed accordingly to equal the value of currrxpdprotdata . consumption . directing attention to fig1 c , control transitions to decision act 132 , where currerxpdprotdata . reqseqnum is compared against lastrxpdprotdata . reqseqnum . if decision act 132 has a negative result , control transitions to act 134 , where newrequestfrompd is set to false , and control transitions to act 156 . else , control transitions to act 136 , where newrequestfrompd is set to true . control transitions to act 138 , where the pse selects a power mode from currrxpdprotdata . reqsetofpowerlevels . control transitions to decision act 140 , where a comparison is made between selectedpowerlevel and allocpower . if decision act 140 has a negative evaluation , control proceeds to act 146 , otherwise control transitions to act 142 . at act 142 , power is allocated by the pse such that allocpower is greater or equal to selectedpowerlevel . control then transitions to act 144 . directing attention to fig1 d , at act 144 , newtxpseprotdata . mgtpower is assigned the value of selected powerlevel and newtxpseprotdata . availpower is assigned the value of selectedpowerlevel . control then transitions act 152 . returning to decision act 146 , a comparison is made between lasttxpseprotdata . mgmtseqnum and currrxpdprotdata . mgmtseqnum . if decision act 146 has a positive evaluation , control transitions to act 148 , where newtxpseprotdata . mgmtpower is assigned the value of selectedpowerlevel and newtxpseprotdata . availpower is assigned the value of selectedpowerlevel . control then proceeds to decision act 152 . returning to decision act 146 , if decision act 146 has a negative evaluation , control proceeds to act 150 , where newtxpseprotdata . mgmtpower is assigned the value of selectedpower level and newtxpseprotdata . availpower is assigned the greater of the values of selectedpowerlevel and lasttxpseprotdata . availpower . control then proceeds to decision act 152 . directing attention to fig1 e , at decision act 152 , several conditions are checked . if lasttxpseprotdata . mgmtpower is different from newtxpseprotdata . mgmtpower or lasttxpseprotdata . availpower is different from newtxpseprotdata . availpower or a newrequestfrompd is received , control transitions to act 154 , where newtxpseprotdata . mgmtseqnum is incremented . control transitions to act 156 , where lastrxpdprotdata is assigned the value of currrxpdprotdata . control then transitions to act 158 , where , if lasttxpseprotdata . mgmtseqnum is not equal to newtxpseprotdata . seqnum or lasttxpseprotdata . availseqnum is not equal to newtxpseprotdata . availseqnum , then trigger is set to true ; else trigger is set to false . control then transitions to act 160 . at act 160 , lasttxpseprotdata is assigned the value of newtxpseprotdata . control then transitions to act 162 . directing attention to fig1 f , at act 162 , lasttxpseprotdata . trigger is assigned the value of trigger . control transitions to act 164 . at act 164 , a message is sent if trigger has a true value , the content of the message is defined by the data contained in lasttxpseprotdata . control then proceeds to act 166 . at act 166 , the pse waits for messages from the pd or a request from the pse &# 39 ; s power manager that ask for a change in the pd &# 39 ; s power mode . while in this state , the pse transmits messages regularly with content defined by lasttxpseprotdata . once the pse receives a message from a pd or a request from the pse &# 39 ; s power manager , it stops transmitting messages . the lesser the interval between retransmissions , the quicker the power negotiation will settle . if a request is received from the pse &# 39 ; s power manager ( and optionally a message is also received from a pd ), control proceeds to act 168 , where newpsetxprotdata is assigned the value of lastpsetxprotdata . control then returns to act 120 . if no request is received from the pse &# 39 ; s power manager but a message is received from a pd , control transitions to act 170 , where newpsetxprotdata is assigned the value of lastpsetxprotdata , and control returns to act 124 . fig2 a - 2e illustrate various sequences of acts performed by pds with respect to power negotiation in accordance with the present invention . directing attention to fig2 a , at act 200 , the pd comes up consuming not more than the power consumption level specified by minp . at act 202 , the state of the pd is initialized as described above . at act 204 , messages are sent at intervals by the pd . the contents of the messages are defined by the pd protocol packet data described above . transmission of the messages is performed in parallel with the wait for messages from the pse and a power mode change request from the pd as described below . control proceeds to act 206 , where the pd waits for a message from the pse or a request from the pd &# 39 ; s power manager for a change in the pd &# 39 ; s power consumption . if no message is received from the pse by a request is received from the pd &# 39 ; s power manager , control proceeds to act 208 , where the pd stops transmitting messages . control proceeds from act 208 to act 254 . if messages are received from the pse and optionally a power mode change request is also received from the pd &# 39 ; s power manager , control proceeds to act 210 , where the pd stops transmitting messages and currrxprotdata is assigned the contents of the message received from the pse ( act 212 ). control proceeds to decision act 214 , where a comparison is made between currrxpseprotdata . availpower and a zero value . if decision act 214 has a positive evaluation , control transitions to act 216 . if decision act 214 has a negative evaluation , control transitions to act 232 . directing attention to fig2 b , the negotiating partner is not providing power and the pd is powered inline . assuming a dumb device such as midspan ( which adds power ), the pd can switch to any power mode listed in lasttxpdprotdata . reqsetofpowerlevels . lasttxpdprotdata . copnsumption is assigned the value of new power level consumption level and lastrxpseprotdata is assigned currrxpseprotdata . control then transitions to act 218 . at act 218 , a message is sent right away if currrxpseprotdata . trigger contains a value of true . the contents of the message are defined by lasttxpdprotdata . control then transitions to act 220 , where the pd waits for messages from the pse and power mode change requests from the pd &# 39 ; s power manager . if a power mode change request is received from the pd &# 39 ; s power manager , control transitions to act 276 . if a message is received from the pse , control transitions to act 222 , where currrxpseprotdata is assigned the message received from the pse . control proceeds to decision act 224 , where currrxpseprotdata . availpower is compared to a non - zero value . if decision act 224 has a positive evaluation , this indicates a problem with the pse . the pd can either switch to low power and indicate an error or , in the alternative , power cycle . if decision act 224 has a negative evaluation , control transitions to act 228 , where a message is sent right away to the pse if currrxpseprotdata . trigger is set to true . the contents of this message are defined by lasttxpdprotdata . control then transitions to act 230 , where lastrxpseprotdata is assigned the value of currrxpseprotdata , and control loops back to act 220 . directing attention to fig2 c , at decision act 232 , comparisons are made between lastrxpseprotdata . mgmtseqnum and currrxpseprotdata . mgmtseqnum ; between lastrxpseprotdata . reqseqnum and currrxpseprotdata . reqseqnum as well as lasttxpdprotdata . reqseqnum and currrxpseprotdata . reqseqnum . if decision act 232 has a negative evaluation , control transitions to act 234 , and the power mode of pd is not changed . newpowerlevel is assigned the value of lasttxpdprotdata . consumption and control transitions to act 250 . if decision act 232 has a positive evaluation , control proceeds to decision act 236 , where a comparison is made between currrxpseprotdata . mgmtpower and the value of − 1 . if decision act 236 has a negative evaluation , control proceeds to act 240 , where powerfrompse is assigned the lesser value of currrxpseprotdata . mgmtpower and currrxpseprotdata . availpower . if decision act 236 has a positive evaluation , powerfrompse is assigned currrxpseprotdata . availpower . acts 238 and 240 transition to act 242 , where minpowerlevel is assigned the lesser of powerfrompse and lasttxpdprotdata . consumption . control proceeds to decision act 244 , where a comparison is made between currrxpseprotdata . reqseqnum and lasttxpdprotdata . reqseqnum . if decision act 244 has a positive evaluation , control proceeds to act 246 , where the pd selects and switches to a new power mode ( newpowerlevel ) such that newpowerlevel does not exceed minp . if decision act 244 has a negative evaluation , control proceeds to act 248 , where the pd selects and switches to a new power mode ( newpowerlevel ) such that newpowerlevel does not exceed powerfrompse . control transitions from acts 246 and 248 to act 250 . directing attention to fig2 d , at act 250 , lasttxpdprotdata . consumption is assigned the value of newpowerlevel and lasttxpdprotdata . mgmtseqnum is assigned the value of currrxpseprotdata . mgmtseqnum . control proceeds to decision act 252 , where a check is made to determine whether the pd &# 39 ; s power manager has requested a new power mode . if decision act 252 has a negative evaluation , control proceeds to act 264 . otherwise , control proceeds to decision act 254 , where a comparison is made between newpowermoderequest and lasttxprotdata . consumption . if decision act 254 has a positive evaluation , control proceeds to act 256 , where lasttxpdprotdata . reqsetofpowerlevels is updated to include the new requested power mode and at least one power mode that &# 39 ; s not more than the current pd &# 39 ; s consumption level . control transitions to act 258 , where lasttxpdprotdata . reqseqnum is incremented to the next non - zero value . returning to decision act 254 , if decision act 254 has a negative evaluation , control proceeds to act 260 , where the pd switches to the power level indicated by newpowermoderequest , and lasttxpdprotdata . consumption is assigned the value of newpowermoderequest . control proceeds to act 262 , where lasttxpdprotdata . reqsetofpowerlevels is updated to not include any mode that is more than current consumption . control then proceeds to act 258 , described above . control transitions from act 258 to decision act 264 . directing attention to fig2 e , at decision act 264 , if a message from a pse is being processed , control proceeds to act 266 , where lastrxpseprotdata is assigned the value of currrxpseprotdata . control then proceeds to act 268 . if decision act 264 has a negative evaluation , control skips act 266 and proceeds directly to act 268 . at act 268 , the pd sends a message right away to the pse . the contents of the message are defined by lasttxpdprotdata . control transitions to act 270 , where the pd waits for a message from the pd and / or a power mode change request from the pd &# 39 ; s power manager . if no messages are received from the pse and a power mode change request is received from the pd &# 39 ; s power manager , control returns to act 254 . if messages are received from the pse and optionally a power mode change request is also received from the pd &# 39 ; s power manager , control transitions to act 272 , where currrxpseprotdata is assigned the message received from the pse . control proceeds to decision act 274 , where a comparison is made between currrxpseprotdata . availpower and a zero value . if decision act 274 has a positive evaluation , control returns to act 216 , otherwise control returns to act 232 . directing attention to fig2 f , at act 276 the new requested mode is included in lasttxpdprotdata . reqsetofpowerlevels . control proceeds to act 278 , lasttxpdprotdata . consumption to the new requested mode . at act 280 , lasttxpdprotdata . reqseqnum is incremented . the pd switches to the requested mode at act 282 , and a message is sent to the pse at step 284 . while fig1 a - 1f describe a sequence of acts carried out by a pse in accordance with the present invention , it is to be understood that these acts may be embodied in software instructions encoded on the pse . alternatively , these acts may also be embodied through hardware included in the pse . likewise , while fig2 a - 2f describe a sequence of acts carried out by one or more pds in accordance with the present invention , it is to be understood that these acts may be embodied in software instructions encoded on the pd . alternatively , these acts may also be embodied through hardware included in the pd . while a method and apparatus for negotiating power between pse and pd have been described and illustrated in detail , it is to be understood by those skilled in the art that many modifications and changes can be made to various embodiments of the present invention without departing from the spirit thereof .