Watch the Fretting Hand Physiology online guitar lesson by Brad Carlton from Guitar Lab: Mastering Finger Rolls Pt. 1

There are two sets of joints (except in the thumb): "proximal interphalangeal joints" (PIJ or PIP), those between the first (also called proximal) and second (intermediate) phalanges, and "distal interphalangeal joints" (DIJ or DIP), those between the second and third (distal) phalanges.