In a mesoscopic conductor electric resistance is detected even if the device
is defect-free. We engineer and study a cold-atom analog of a mesoscopic
conductor. It consists of a narrow channel connecting two macroscopic
reservoirs of fermions that can be switched from ballistic to diffusive. We
induce a current through the channel and find ohmic conduction, even for a
ballistic channel. An analysis of in-situ density distributions shows that in
the ballistic case the chemical potential drop occurs at the entrance and exit
of the channel, revealing the presence of contact resistance. In contrast, a
diffusive channel with disorder displays a chemical potential drop spread over
the whole channel. Our approach opens the way towards quantum simulation of
mesoscopic devices with quantum gases