The brainstem is the posterior part of the brain, adjoining and continuous with the spinal cord. The brainstem includes the midbrain, pons, and medulla.
The midbrain is a set of structures associated with alertness, the wake/sleep cycle, temperature regulation, motor control, and relaying vision and hearing signals.
The pons relays signals from the forebrain (cerebrum) to the cerebellum and medulla, as well as carrying sensory signals into the thalamus. The pons is active during dreaming.
The medulla is the lower half of the brainstem. The medulla concerns itself with nominally autonomic functions such as breathing, heart rate, blood pressure, and vomiting.