Insect have a segmented body, with a rigid external skeleton on the outside of the insect body, is a layer of wax which is impermeable. The respiratory surface of an insect is the trachea which open outside as spiracle with valves. The trachea branches to form tracheoles which are moist for gases to dissolve. The spiracle of insect are located on the thoraces and on the abdomen.
During inspiration, the first four pairs of spiracle on the thoracic cavity opens due to contraction means the last pair closes. Oxygen which has greather concentration diffuses through the spiracle to the trachea then to the tracheoles. In the tracheoles, the diffusion gradient is setup which make oxugen to diffuse in the tissues where concentration is low.
The diffused oxygen move straight to the mitochondria of the cell where food is oxidize to release energy and carbon dioxide. The carbon dioxide formed diffuses out through the last 6 pairs of spiracles because of it greater concentration in the cells, it moves from tissues to tracheoles and the finally the trachea. During this time, the spiracle closes. The last 6 paires of spiracles opens due to contraction in the abdominal cavity and carbon dioxide follows the same route taken by oxygen.