Quality of Service (QoS) can be guaranteed in any network, a priori from the used technology, only if the used admission control algorithm wisely shares the network's resources among the users. Any admission control algorithm on its turn can do so, only if every user respects the negotiated traffic parameters. Since any user could, maliciously or not, send at a higher rate than negotiated, i.e. use a higher share of resources than the negotiated one, in every network in which admission control is performed, a policing algorithm is used. An ideal policer should guarantee to reject no packet of a well-behaved user and police contract violation as rigidly as possible. All this independently of the characteristics of the monitored stream and of the background traffic. All this can be applied to IP networks based on Integrated Services (IntServ). In these networks two rates are negotiated between user and service provider: peak and average rate. In this paper we present the solution to the peak rate policing issue and provide the deriving worst case packet clusters that the policer could let into the network. Such knowledge could on its turn be used for the admission control algorithms. We adapt the Generic Cell Rate Algorithm (GCRA), well-known policer used in ATM networks, to police the peak rate of flows of packets with variable length. We intuitively call this algorithm Generic Packet Rate Algorithm (GPRA). We present an analytic dimensioning of the GPRA parameters which transforms it into an ideal peak rate policer. Independently of the characteristics of the policed flow and of the background traffic, the GPRA rejects no packets of a well-behaved user and rigidly polices any misbehaving user. With our results we lay the foundations of QoS in packet-switching networks that use packets of variable length.