The rule on a traffic stop is that you can only be pulled over and stopped for as long as it takes the officer to write the ticket.
Now that's also assuming that they don't develop any probable cause during the situation.
So if they pull you over and you smell like booze now they have probable cause to continue the traffic stop.
But if none of that happens they have to write you your ticket and let you go about your business.
That's where the trooper two-step comes into play.
What the trooper two-step is that after a traffic stop the officer gives you your license, gives you your insurance back and says you're free to leave.
Then what they do is they take two steps to the rear of the car.
Then they turn around and come back to your window and say
"Hey by the way. You don't mind if, you know we've got a lot of problems here with guns, drugs. You don't have any rocket launchers or drugs in the car, do you? you don't mind if we search?"
Okay, so let me pause right there what has happened here is because since the officers giving you back your license and told you that you're free to leave.
A line has been crossed now this is no longer a traffic stop because they told you you're free to leave.
Now, this is a voluntary encounter. Before they gave you your license back they needed to have some kind of reasonable suspicion some sort of evidence to believe you'd committed a crime to ask you to search your car. Now this is a voluntary encounter and so now they don't need any reasonable suspicion, now they don't need probable cause.
So what do you do if you're in a situation like that and you feel like they've done the trooper two-step to you, easy just ask "am I free to leave?"