A hollow tube called a pitot tube is mounted on the surface of the nose of an aircraft.
As they board, passengers may be able to see this tube on the nose toward the bottom of the plane.
The tube is parallel to the air that comes over the plane, and measures what is called the total pressure of the air.
This increases as the plane moves faster.
Meanwhile, another measure is taken of what is called static pressure, the local thermodynamic pressure of the air, which varies in pressure along with the temperature.
From these two readings, what is called the local air speed is determined.
As air flows over the nose and then over the rest of the plane, the pressure changes, so different figures for each area of the airplane are used to determine the ratio of local velocity to the actual speed of the plane.
Many airplanes also use an inertial guidance system, like that used on the space shuttle or an intercontinental missile.
It measures the acceleration of an airplane on an absolute basis, by keeping exact track of the loads exerted on spinning gyroscopes, with a factor subtracted to account for gravity.
These devices can be set very accurately at takeoff so that they indicate not only speed, but the exact location of the airplane in space with respect to where it took off.
The pitot tube was invented by the French engineer Henri Pitot in the early 1700s.