Ultrasonic waves are introduced into a material where they travel in a straight line and at a constant speed until they encounter a surface.
At surface interfaces some of the wave energy is reflected and some is transmitted.
The amount of reflected or transmitted energy can be detected and provides information about the size of the reflector.
The travel time of the sound can be measured and this provides information on the distance that the sound has traveled.