A sensory neuron has its cell body in the dorsal root ganglion. One end of the neuron travels out to the periphery through the peripheral nerve (dorsal and ventral ramus), while the other end travels into the spinal cord through the dorsal root. Inside the spinal cord, sensory neurons carrying pain signals (nociceptors) typically have a synapse just past the dorsal root entry zone where they pass their electrical signal on to another neuron. Other sensory neurons may continue up to the base of the brain before arriving at their first synapse. Motor neuron cell bodies are in the ventral horn of the spinal cord. The axons of these neurons travel outward through the ventral root..
In vertebrates, each spinal nerve arises from the spinal cord by two roots: a dorsal (posterior in human anatomy) and a ventral (anterior in human anatomy) which join to form the spinal nerve as they pass through the wall of the vertebral column. The dorsal roots contain all the sensory nerve fibers, their cell bodies being in a ganglion on the course of each root; in some vertebrates they may also contain a few motor fibers. Through the ventral roots pass the motor fibers, their cell bodies being in the spinal cord.
Cranial nerves can also be classified into dorsal and ventral roots, which however do not join, remaining separate nerves. Cranial dorsal roots have ganglia and contain, besides sensory, numerous motor fibers running to the face, jaw, and (in fish) gill muscles, and motor fibers of the parasympathetic system. Cranial ventral roots contain some sensory (proprioceptor) fibers.