Given a stream of incoming data packets, write a function to detect duplicates within a specific time window.