Sliding window protocols number data frames, allow lost frames to be retransmitted, and handle duplicate and out-of-order frames. The sender and receiver each maintain variables to track the oldest unacknowledged frame and next frame number. The difference between the variables is the window size. The algorithm involves transmitting frames within the window, acknowledging received frames to advance the windows, retransmitting on timeouts, and using negative acknowledgments for missing frames. Window sizes are limited by the number of sequence number bits to avoid duplicates.