You're driving down the road, on your way to work, when you get pulled over for failing to signal a lane change. The police officer approaches your vehicle, asks for your driver's license and vehicle registration and runs a background check. So far, this process is probably exactly what you'd expect.
But then the officer returns to your vehicle with a dog trained to detect the scent of drugs. Although you're sober, you have an ounce of marijuana in your trunk--and the dog immediately finds it. Now, instead of getting your traffic citation and being on your way, you're arrested for drug possession.
The question is, was it legal for the officer to use a drug-sniffing dog at a routine traffic stop? What about your Fourth Amendment protection against unreasonable search and seizure?
In the case of Illinois v. Caballes, the U.S. Supreme Court found that it is acceptable for the police to walk a drug-sniffing dog around a car during a routine traffic stop--even if the officer does not have reasonable suspicion. The court held that doing so is not a violation of the Fourth Amendment because in a vehicle, there is no reasonable expectation to privacy.
However, in a later case (Rodriguez v. United States), the same court created an important caveat to the rule: If the officer does not have reasonable suspicion of a crime, they may not use a drug-sniffing dog to examine a car during a traffic stop if doing so would additionally delay the length of the traffic stop.
Therefore, the question of whether an officer's use of a drug-sniffing dog was legal depends largely on when during the detainment the dog was introduced. In the above example, if the officer had no reason to suspect criminal activity, and the dog was brought to the car after the traffic citation had been issued, then the drugs found in the trunk would be inadmissible in court.