Your brain knows that you have stubbed your toe because

Adopamine transfers that information to the brain.
Bafferent nerves transfer that information to the brain.
Cglial cells transfer that information to the brain.
Dmyelin sheaths transfer that information to the brain.