The concept of a resource bound is provided as a solution to this problem. Each packet has associated with it a certain amount of ``resources''. The packet can only access this value through the getRB () service routine; it can specify the amount of resource bound it wants to give out of its own bank to an outgoing packet through the third argument of OnRemote and OnNeighbor.
Each hop that a packet traverses decreases its resource bound by one. Additionally, whenever a packet causes a new packet to be sent out into the network (through OnRemote or OnNeighbor) its resource bound is decremented by the amount it allocated to the outgoing packet.
If at any point the packet does not have enough resource bound left, either to traverse the next hop or to give out to an outgoing packet, the ``NotEnoughRB'' exception is raised, which can be handled by the program. No more packets may be sent when the resource bound reaches 0.