The reticular formation is a dense network of neurons and fibers located in the core of the brainstem that consists of nuclear masses and long connecting fibers. It receives sensory input from throughout the body and brain and sends output to the thalamus and cortex to regulate states of arousal and consciousness through the reticular activating system. The reticular formation also controls autonomic functions like respiration and heart rate as well as muscle tone and plays a role in attention, learning, and pain modulation through various neurotransmitters.