The main function of the respiratory system is to allow the exchange of gases between the atmosphere and the lungs. Hence,the only structure that carries out this function is the alveoli as other structures such as the nose,trachea and pharynx transport gases to the alveoli just so that it can can out its function.