An embodiment of the present invention includes a technique to provide
anti-replay protection with QoS queues. A single global anti-replay
window is maintained to have global lowest and highest sequence numbers
for an Internet protocol security (IPSec) security association (SA). The
single global anti-replay window is associated with individual
differentiated services code point (DSCP) or DSCP group, the individual
DSCP or DSCP group corresponding to individual per-DSCP anti-replay
windows. A received packet having a sequence number is pre-processed
before packet processing using the single global anti-replay window. The
received packet is post-processed after packet processing using the
individual per-DSCP anti-replay windows.