Dear qftme, I agree that your question deserves a more expansive answer. The answer, "pions" or "gluons", depends on the accuracy with which you want to describe the strong force.
Historically, people didn't know about quarks and gluons in the 1930s when they began to study the forces in the nuclei for the first time.
In 1935, Hideki Yukawa made the most important early contribution of Japanese science to physics when he proposed that there may be short-range forces otherwise analogous to long-range electromagnetism whose potential is
$$V(r) = K\frac{e^{-\mu r}}{r} $$
The Fourier transform of this potential is simply $1/(p^2+\mu^2)$ which is natural - an inverted propagator of a massless particle. (The exponential was added relatively to the Coulomb potential; and in the Fourier transform, it's equivalent to the addition of $\mu^2$ in the denominator.) The Yukawa particle (a spinless boson) was mediating a force between particles that was only significantly nonzero for short enough distances. The description agreed with the application to protons, neutrons, and the forces among them.
So the mediator of the strong force was thought to be a pion and the model worked pretty well. (In the 1930s, people were also confusing muons and pions in the cosmic rays, using names that sound bizarre to the contemporary physicists' ears - such as a mesotron, a hybrid of pion and muon, but that's another story.)
The pion model was viable even when the nuclear interactions were understood much more quantitatively in the 1960s. The pions are "pseudo-Goldstone bosons". They're spinless (nearly) massless bosons whose existence is guaranteed by the existence of a broken symmetry - in this case, it was the $SU(3)$ symmetry rotating the three flavors we currently know as flavors of the $u,d,s$ light quarks. The symmetry is approximate which is why the pseudo-Goldstone bosons, the pions (and kaons), are not exactly massless. But they're still significantly lighter than the protons and neutrons.
However, the theory with the fundamental pion fields is not renormalizable - it boils down to the Lagrangian's being highly nonlinear and complicated. It inevitably produces absurd predictions at short enough distances or high enough energies - distances that are shorter than the proton radius.
A better theory was needed. Finally, it was found in Quantum Chromodynamics that explains all protons, neutrons, and even pions and kaons (and hundreds of others) as bound states of quarks (and gluons and antiquarks). In that theory, all the hadrons are described as complicated composite particles and all the forces ultimately boil down to the QCD Lagrangian where the force is due to the gluons.
So whenever you study the physics at high enough energy or resolution so that you see "inside" the protons and you see the quarks, you must obviously use gluons as the messengers. Pions as messengers are only good in approximate theories in which the energies are much smaller than the proton mass. This condition also pretty much means that the velocities of the hadrons have to be much smaller than the speed of light.