Perception

Every organism needs to adapt itself to the changing conditions in its environment, and therefore to receive informations from it, through senses. Sense organs encompass a wide range of signals: touch is a simple perception of close mechanical stimuli, while hearing is a specialized form of touch that perceives the vibrations on long distance; olfaction and taste perceive the chemical makeup of near compounds; sight is the perception of electromagnetic waves (light), while electroception and magnetoception perceive directly electric and magnetic fields, respectively.

Most organisms have one or two highly developed senses more prominent than others. Many small organisms that need to know only their immediate surroundings deal well with "contact senses" such as touch and taste, while larger animals that live in open environment will benefit more from "long-range senses" such as sight and hearing; many mammals have a well-developed olfaction, while birds (and humans) prefer sight; bats and cetaceans have come up with echolocation, a derived form of hearing; and so on.

Touch
Also see here

Tactile senses (perception of mechanical stress) are the most simple and primitive, found in virtually every organism on Earth. They include the perception of pressure, vibrations (see hearing, below) and tension of body tissues. For example, a complex network of nerves allows a fly to adjust the shape of the wings and the frequency of flapping to counter irregular wind, while earthworms and many insects gain most of their sensorial informations from vibrations in the ground. Particularly, social insects such as ants and honeybees communicate mainly through touch.

Fish have two specialized tactile organs: the Weber organ, a group of vertebrae appendages that detect water pressure through changes of shape in the swim bladder, and the lateral line (also present in some amphibians), a system of hair cells than runs along the fish' side perceiving water currents and vortices. The venus flytrap, a carnivorous plant, has extraordinarily sensitive hairs that cause the leaves to close when they detect an insect.

While useful and versatile, touch detects only objects in direct proximity, and it's useless at greater range; besides unicellular and plant-like organisms, it would be developed mostly in dark, noisy and turbulent environments and probably by slow-moving or static organisms, especially in a very dense medium and without large predators. Burrowing organisms would be suited to evolve a good sense of touch, though it wouldn't likely be the main sense. A particular method of tactile communication, found in Xenology, could be found in organisms that can alter their skin texture in shifting corrugations and papillae, as octopi do.

Hearing
Hearing is the perception of sound waves, that is, the vibrations trasmitted through matter (ground, water or air). Like other waves, they can be classified by intensity (the amount of energy carried by the wave) and frequency (the number of cyclical variations that occur per unit of time). They're far slower than light, but they can spread behind corners and through all solid matter (though not in the vacuum). Their speed increases with the medium density (343 m/s through air at 20°C and 1 atm, 1482 m/s through water at 20°C, 5960 m/s through steel).

Frequency is measured in hertz (Hz), where one Hz means one cycle per second. Human beings can hear sounds between 12 and 20 000 Hz; sounds with a lower frequency are called infrasounds, those with a higher frequency ultrasounds. Dogs, mice, dolphins, bats, etc. can hear ultrasounds; as a rule of thumb, the smaller an animal is, the higher are the sounds it can hear (or produce).

Soundwaves are collected by the tympanic membrane or eardrum. In mammals, vibrations are also trasmitted through three bones (the auditory ossicles: malleus, incus and stapes) towards the cochlea, where they activate ciliate cells connected to the auditory nerve. Snakes lack an eardrum, but they can perceive sounds with the vibration of quadrate bone, while elephants can communicate by receiving with their feet low-frequency sounds transmitted in the ground.

Mammals also have a pinna or auricula, a funnel-shaped structures that collects and directs sounds; many can move their pinnae with specialized muscles to direct them towards the source of a sound. Owls have horn-like feathers and a dish-shaped face with the same function. The presence of two (or more) ears allows to detect the direction a sound came from by measuring the difference between the time when it hit the eardrums; an owl can perceive a difference of 0.0002 seconds.

Echolocation
Also see here and here.

An extremely sharp hearing allows to reconstruct three-dimension "images" of the environment, based only on the way solid objects reflect sound. It's less efficient than sight, since it requires the animal to emit sound on its own (unless a constant but not too loud source of sound is already there). It'd be more useful where light is not already available, though it has the advantages of showing the inside of opaque objects, and beyond corners; on the other hand, this makes pinpointing the source more confusing.

The wavelength of the sound is roughly equal (slightly smaller) to the resolution of the echolocation, that is, the size of the smallest recognizable detail. Since sound wavelength is always much larger than light's, echolocation has always a lesser resolution than sight (the smallest detail is larger). This wavelength can be computed, in meters, as l = v/f, where v is the speed (m/s) and f the frequency (Hz). Given than speed, and thus wavelength, increase in denser fluids, echolocation is more precise in a less dense medium (pressure and temperature usually have a negligible impact, though). It's also more effective if the sound has a high frequency.

However, denser fluids carry soundwaves faster and more faithfully: while these images are blurrier in liquids than in air, they're also recognisable at a greater distance. In fact, it has been especially developed in cetaceans (whales and dolphins): pulses of high-pitched sounds are emitted by air passing through the phonic lips, then they're reflected by the concave skull and modulated by the melon (a fatty organ full of oils and waxes), that acts as a lens for soundwaves. Echoed sound is received through the lower jaw; it has been hypothized than the slight asimmetry in the bottlenose dolphins's dentition helps to pinpoint the sound sources.

Night bats use echolocation to hunt in total darkness, emitting short pulses up to 100 000 Hz. A simpler form has also appeared in cave-dwelling birds, the oilbird (Steatornis) and the swiftlet Aerodramus, tenrecs and the shrews Sorex and Blarina.

Aquatic insects such as gyrinidae beetles use a particular form of two-dimensional echolocation, producing vibrations on the water surface; many scorpions do the same thing on sand, and spiders perceive the trapped preys through the vibrations on the web. 2-D hearing is much more persistent than 3-D hearing.

To an echolocation organism, soft tissues would be almost transparent, especially in water (since they have roughly the same effect on sound), while hard parts (bones, teeth, etc.), air bubbles and hollow cavities would be clearly "visible" even from the outside. The echo could be fractioned into "colours" just as light, according to its frequency, but the Doppler effect would raise the frequency for incoming object and lower it for parting ones, while the equivalent effect for light occurs only on enormous speed and distance.

Olfaction
Also see here.

Olfaction, or smell, is the perception of highly dispersed chemicals found in a fluid. It's not a good way to carry informations on a long range - molecules don't travel at great speed, except in strong wind, they don't travel in a specific direction as waves do and don't move at all through a solid medium, and they disperse quickly at greater distance from the source. In compensation, they quickly fill a small space and diffuse beyond corners and through fissures. They have a tendence to linger in time, which can be both an asset and an impairment (as they leave durable traces, but they can confound later smells).

Smell diffusion isn't costly: a microgram of chemicals can persist for hours or days over several square kilometers. Male silkworms (Bombyx mori) can recognise the smell of a female 20 km away, thanks to an array of 17 000 cilia on their antennae, and start actively searching for her when the concentration reaches just 14 000 molecules/cm3 (2.3·10-17 mol/L). Humans have about 5 cm2 of olfactive epithelium, covered in 5 millions of chemosensitive cells. Rabbits have 100 millions, terriers 150 millions, and a german shepherd reaches 225 millions over a surface of nearly 170 cm2.

Many different animals (insects such as ants, mammals such as rats and dogs) can effectively communicate by releasing or transporting chemicals; it has been estimated that osmic messages over 10 m, with a steady 14 km/h wind, can carry an infomation flux of 100 bit/s for each chemical, the rough equivalent of four 5-letter english words. Olfactive communication doesn't have a precise temporal sequence as speech does, and it lacks a spatial resolution (unless it's perceived by organs very far apart, or while moving); also, smells cannot be converted to electric signals as with light and soundwaves, therefore harming telecommunication. Still, it could evolve as the main form of communication inside hot, thin and possibly opaque atmospheres, which would distort images and weaken sounds, but would ease the travel of molecules.

Taste
Taste is closely related to olfaction: many reptiles "smell" the air with their tongue, and so do dolphins in water, while all land vertebrates have choanae, apertures between the throat and the nasal cavity that allow the passage of air and olfactive chemicals. In fact, smell makes up part of the flavor of most foods, along with temperature, touch and chemesthesis, the taste-like perception of fatty acids and calcium, the tingling of carbon dioxide in carbonated drinks, the astringency of tannin in tea and unripe fruit, the coolness of menthol, the piquancy of pepper, etc.

True taste is organized into five main groups: bitterness, usually unpleasant (since it's associated with toxins) is given by many chemicals such as quinine; saltiness is produced by the presence of sodium ions (and sometimes related ions such as lithium and potassium); sourness is the perception of acidity, that is, the concentration of hydrogen ions; sweetness, generally pleasant as it's associated with energy-rich food, is produced by simple sugars, mainly glucose; umami (generally described as "meaty" or "savory", found in cheese, soy sauce, tomatoes and many fermented foods) is mainly induced by monosodium glutamate (MSG). Saltiness and sourness are identified by ionic channels; bitterness, sweetness and umami by protein receptors.

In most vertebrates, taste receptors are concentrated on the tongue and on the oral mucous membrane, as its main function is to judge the quality of ingested food. Flies and butterflies have taste receptors on their feet, in order to taste the food on which they land, while octopi have them on their tentacles, and catfish are entirely covered in them.

Sight
Sight (or vision) is the perception of moving electromagnetic waves, i. e. light. While light cannot travel around corners or most solid matter, it's extremely fast (nearly 300 000 km/s in every medium) and it usually has a small wavelength that keeps the waves from diffracting in fissures. Most importantly, most environments will have abundant sunlight, so the organisms aren't forced to produce light from themselves as echolocating organisms produce sound (which would be expensive in energy and would reveal one's position to predators). In caves, deep ocean and the surface of planets with opaque atmosphere, though, the need for light production might arise again.

Since sight is so useful, we should expect it to arise wherever there is available light: eyes are estimated to have evolved 40 times on Earth. Squids, chameleons, zebrafish etc. can communicate by changing their colour by expanding or narrowing pigment-bearing cells (chromatophores) ; many organisms, such as fireflies and bacteria hosted by several deep-sea fish, can produce light. Optical communication, though, isn't as effective: complex body motion, colour change and light production are much more expensive than sound production or chemical diffusion.

Eye structure
Being so widespread in the animal kingdom, the eyes exist in a great variety of shapes and functions. Mollusks and arthropods have each every type of eye listed below, and complex eye with one or more lenses have appeared in vertebrates, cephalopods, insects, crustaceans, annelids and cubozoans. The lens(es) can be made out of different materials: aragonite in chitons, calcite in trilobites and water-soluble crystallins in vertebrates. Other solid materials with a high refractive index include rock salt, silicon, diamond, amber and sucrose. The brittle star Ophiocoma wendtii is entirely covered in calcite crystals, connected to nerves, that make the entire body one great compound eye.
 * The simplest eye is called pit eye (also stemma or ocellus). Found in most animal phyla, it's a depression of the body surface, covered in photoreceptor cells, which allows to see the direction light comes from. Wasps, spiders and scorpions have additional ocelli on the top of their head along with the main eyes; rattlesnakes have infrared-sensitive ocelli (see below) on the muzzle to perceive the prey's body heat. The pinhole eye, found in the chambered nautilus, is a pit eye with a narrow aperture that grants a better sense of directionality. The produced images, though, are very blurry.
 * A spherical lensed eye improves the resolution by using a sphere of material with a higher refractive index that focuses the light on the photoreceptor cells, often held in place by muscles; it appeared once in copepods, once in annelids and at least six times in mollusks. Some copepods have a multiple lensed eye, with up to three lenses per eye.
 * Refractive cornea eyes are found in vertebrates, spiders and some insect larvae; here, light is directed by a refracting vitreous fluid (needed only out of water, since it has the same effect on light). A flattened lens corrects spherical aberration, but allows a clear vision only in a restricted field: animals that need a wide field-of-view have a biconvex lens with inhomogeneous refractive index.
 * Reflector eyes focus light without a lens, by reflecting it with mirrors. Rotifers, copepods and flatworms have such eyes, though too small to produce sharp images; scallops have the edge of their shells lined by up to 100 reflector eyes. The only vertebrate that employ reflection is the spookfish, with two arrays of photoreceptors, one of which is located under a mirror of guanine crystals.
 * Compound eyes, common among arthropods, are composed by a large number of small, simple eyes (ommatidia); each ommatidium points in a different direction, granting a wide field-of-view and the effective detection of fast movements. Since the lenses are small, though, the images cannot be very clear; anyway, at a small size the lens of simple eyes couldn't have a better resolution.Compound_eye.png The simplest form of compound eye, the apposition eye, is found in every group of arthropods, and also annelids and bivalves. Typically, the lens focuses light on one side of a tube (rhabdom); each ommatidium forms one small image, which is combined with the others in the field-of-view. In superposition eyes, each ommatidium receives the whole image, combined by the brain with the other slightly different ones.

Other adaptations can be included in the eye: fast-moving and predatory insects have a fovea, a region in their compound eyes with larger and flatter ommatidia, which allow for a better resolution; nocturnal hunters such as cats and abyssal squids have a tapetum lucidum, a layer of reflective guanine crystals that multiply the available light; the four-eyed fish (Anableps) has split eyes that allow it to see both up and down at the same time.

''Note: the resolution is given in a general sense (angular size, in minutes of arc, of the smallest recognisable detail) and then as the actual size of that detail at different distances. The resolution can be estimated through the Rayleigh criterion as q = 70l/A, where q is the resolution in degrees, l the wavelength of light and A the diameter of the ommatidium or pupil (both in the same unit of measure).''

Light and colour
Colour is the perception of the wavelength of light. Of the several bands of light that can reach the atmosphere of a planet, those with higher energy (gamma rays and x-rays), most ultraviolet, microwaves and far infrared are absorbed by gases (the same would happen in most likely atmospheres; also see here). This leaves three main bands: visible light (400-700 nm), near infrared (7-20 µm) and short radio waves (2 cm-10 m). Some organisms, such as bees and several birds, can see in near ultraviolet, which allows them to see otherwise invisible patterns (e.g. on flowers) but isn't very useful for navigation. Also, light of a shorter wavelength can form sharper images, and thus being able to see ultraviolet could allow tiny organisms, such as insects, to keep forming high resolution images.

The eye's light-sensitive layer (retina) contains two kinds of photoreceptor cells: rods perceive the intensity of light, and allow black-and-white vision, while cones perceive the colours. The human eye has three kinds of cones (trichromatic visions), with their pak of activity in the blue, green and red wavelengths. Primates such as human probably developed trichromatic vision to recognise ripe fruit, while most mammals are dichromatic; pinnipeds, cetaceans and owl monkeys are monochromatic. Zebrafish, mantis shrimps and many birds are instead tetrachromatic, with a fourth type of cone that allows them to see ultraviolet light; pigeons, butterflies and lampreys are suspected to be pentachromatic. Usually, nocturnal animals are less sensitive to colours.

Infrared is about half of the radiation incoming from the Sun (more in K and M-class star, less in F-class stars), but since every object produces light in function of its temperature, the whole surface of a planet would shine in infrared light simply because of its thermal energy.

The perception of infrared allows rattlesnakes to sense temperature differences of 0.002°C - useful to hunt warm-blooded preys in the darkness. While the largest wavelength produces blurrier images, using the Rayleigh criterion given above we can estimate that an eye with an aperture of A = 70l/q = 70*10-5/(1/60) = 4200*10-5 = 0.042 m = 4.2 cm is enough to perceive a wavelength of 10 µm with the same resolution of the human eye. The perception of infrared is essentially the perception of heat, which, like scents, can leave traces lingering in time: that makes it a very useful sense for hunters.

As for radio waves, they're not as useful. Stars don't irradiate a large amount of them, and their large wavelength disturbs vision: even for 1 cm waves, an eye 42 m wide is needed to see with human-like resolution. Even large organisms would need to cover their whole body with radio-sensitive cell to form any image. They could be found, perhaps, on cold planets with completely opaque atmospheres, where they'd see only a faint glow from the ground and maybe stronger ones from quasars and galactic cores.

The amount of light entering in the eye can be regulated with light-absorbing pigments, as in Ophiocoma, or physically modifying the width of the eye's aperture (pupil); in many animals, such as cats, it changes shape, going from round to almond-shaped. Since light with a smaller wavelength is refracted more, a multifocal lens can be employed, whose parts have different refractive indices: in this case, the pupil is often a thin fissure, to leave uncovered only the right part of the lens. Even thin pupils can have different shapes: in cetaceans it's a flattened U, in octopi a horizontal fissure, in sheep and goats a horizontal rectangle, in cuttlefish it's W-shaped.

Depth perception
Depth perception is the ability of perceiving a three-dimension environment by measuring the relative distance of objects. There are different methods, such as the linear perspective (the apparent convergence of parallel lines at great distance), the aerial perspective (faraway objects appear blurrier due to the atmosphere) and the motion parallax (distant objects appear to move slower than closer ones). Many birds bob their head when walking to provide always motion parallax, while squirrels move sideways relatively to the observed object.

The most effective method is stereopsis, which requires two eyes pointed at the same object: the image that reaches each eye is slighly different from the other, and by comparing them the brain, with a trigonometric operation, can estimate the distance from the objects. Predators, especially ambushers, usually have two frontal eyes to better perceive their distance from the prey, while herbivores have lateral eyes that grant them a wider field-of-view, sacrificing depth perception. Organisms that live in three-dimension environment, such as tree canopies, aso have frontal eyes (as in apes).

Grassland grazers also tend to have eyes far from the snout tip to keep them always above the grass; in amphibian and semi-aquatic animals, such as hippos and crocodiles, eyes and nostrils are raised to emerge from water without a great exposition of the body (in the extinct hippo H. gorgops they were almost on stalks).

While two eyes are thus much more useful than only one, there seems to be no advantage for three or more. In vertebrates, arthropods and cephalopods, complex image-forming eyes are only two, though smaller accessory eyes are known: the pineal eye found in many reptiles and amphibians (endowed with lens and retina in tuataras), or the three ocelli that many insects have on the top of their head (see image above). Clamworms have four eyes, while scallops have hundreds of simple reflector eyes.

Polarized light
Polarized light is light that has been reflected by materials such as water, ice, or glass (which can be produced in nature by lightnings, volcanic eruptions and meteor impacts); it oscillates with a specific orientation, which is perpendicular to the direction of the Sun. This light can be blinding, so animals that hunt by diving in water (such as herons and kingfishers) have specialized filters in their eyes to block it, allowing in unpolarized light. Bees and other organisms use it for orientation; in a turbulent and opaque medium it could be exploited to recognise up and down, especially near bodies of water or glassy/crystalline geologic formations.

Electroception
Also see here

Most organisms, when immersed in seawater, generate an electric current due to the potential difference, also called voltage or tension, between their body fluids and the water (or between different bodyparts); the perception of currents is thus very useful to detect other living organisms, especially for a predator (wounds greatly increase the current's intensity); besides that, it reveals chemical features of the water, such as acidity and salt concentration, with great precision. Many sharks can perceive 10-8 V/cm2, equivalent to an electric battery distant 1500 km.

Electroception is only known in vertebrates, and appeared several times in fish: electric rays and stargazers in the ocean; knifefish (including the electric eel), paddlefish, elephantfish and electric catfish in freshwater. It's also found in two mammals: the costero dolphin and the platypus, which can measure its distance from preys from the delay between pressure and tension changes.

In conditions of low visibility, several of them use electrolocation, which can be passive (it perceives muscular and nervous activity, and the ion flow through the gills) or active (it includes the production of an electric field, generally with less than one volt of tension). In electrolocation, conductive materials distort the electric field lines by making them converge, while resistive materials make them diverge. In muddy african rivers, Gymnarchus niloticus can perceive currents weaker than 3·10-15 ampere and 1.5·10-7 V/cm2. Elephantfish and electric catfish are also known to communicate through electric pulses, to attract mates or chase competitors away.

This sense might become dominant in a perpetually opaque and turbulent medium, enough to obscure vision, confuse scents and distort sounds: for example, in dense liquid bodies inside the twilight zone of a tidally locked planet. Water's high dielectric constant (see table here), is necessary for electroception to work, though it's useful only at close distance (up to 100 meters for most objects, perhaps a few km for larger ones); in sulfur dioxide, methane, ammonia and hydrogen sulfide it wouldn't work, and neither would in a gaseous atmosphere.

Magnetoception
Magnetoception, that is, the perception of magnetic fields, is still poorly understood. It's common in migratory birds, which follow the force lines of Earth's magnetic field to mantain their orientation, and it's known to exist in bacteria, fungi, fruit flies, bees, lobsters, snails, flatworms, turtles, sharks and stingrays, and possibly rodents and bats. Some birds can perceive magnetic fields of 0.1 µT (the Earth's surface magnetic field ranges from 25 to 65 µT).

Magnetotactic bacteria can orient themselves along magnetic field lines (magnetotaxis) thanks to magnetosomes, crystals of magnetite (Fe3O4) or greigite (Fe3S4) nested in a membrane. The mechanism for magnetoception in animals is unknown, but there are two hypothesis: cryptochrome, a common light-sensing protein, can be affected by a magnetic field, allowing the animal to see it with their eyes (though Earth's magnetic field is perhaps too weak to have a significant effect on cryptochrome); the other model relies on magnetite, a naturally magnetic iron oxide. Hens and pigeon have in their beak magnetite crystals connected to nerves, which may be responsible for this sense.

Magnetoception wouldn't work on a planet without a large molten core, as it'd lack a magnetic field altogether. On the contrary, it would be especially useful on large, metal-rich planets, or on gas giants and their moons.

Thermoception
Thermoception is the perception of temperature: it cannot be considered part of touch as it's the perception of thermal rather than mechanical stimuli. Receptors are specialized in recognising a flow of heat from the body ("cold") or towards the body ("warm"); in dogs, cold receptors are an important part of the olfactive system, as they sense the direction of the wind. The perception of infrared light (see above) can be included in thermoception.

Proprioception
Proprioception is the perception of the position and movement of one's own body in space. The position of limbs is probably inferred from the tension of ligaments and muscle fibres (kinesthetic sense); a large role in proprioception is played by equilibrioception.

Equilibrioception
Equilibrioception is the perception of balance, movement direction and acceleration. In vertebrates, it's a function of the semicircular canals in the inner ear: they're three fluid-filled canals oriented in the three spatial dimensions, perpendicular to each other; the movement of the fluid produced by moving or rotating the head is perceived by hair cells. Two sacs (utricle and saccule) contain otoliths, small calcium carbonate crystals that touch other hair cells, providing information on body acceleration and the direction of gravity.

Many aquatic invertebrates (comb jellies, bivalves, jellyfish, echinoderms, crustaceans) have statocysts, small mineralized masses found in hair-covered sacs similar to the utricle, that touch the sensitive setae when the animal accelerates.

Nociception
Also see here.

Nociception is the perception of damages to the body, that is, pain: it's classified in cutaneous or superficial somatic (sharp, localized, on the skin or other superficial tissues), deep somatic (aching, poorly localized, in bones, muscles, blood vessels and similar structures) and visceral (dull, deep, in internal organs). It's commonly registered by free nerve ends; perceived tissue damages can be mechanical (fractures and lacerations), chemical (strong acids, acrolein, capsaicin), thermal (usually for temperatures above 42°C). Of course, pain is a very important sense to preserve body integrity (insensitivity to pain can be very dangerous even in humans).

Interoceptions
Interoceptions are all the senses concerning the body internal processes, such as the expansion of the lungs, contractions of the esophagus, vasodilation in skin, tension in bladder and rectum or the perception of various hormones and chemicals by the medulla oblongata.

Other
Also see here.

Anything that influences in some way an organism can, in principle, be perceived by it. Bees and Solenopsis ants can sense the concentration of carbon dioxide in the air; many animals can anticipate earthquakes from extremely low-frequency vibrations in the ground; elephants appear to find water up to a meter deep, probably from vibrations; pigeons sense the air pressure, while blowflies can measure the wind velocity; other organisms perceive humidity, salinity, acidity, chemical composition, perhaps radiations, etc.

As Xenology notes, the sense organs can be placed in surprising locations on the body: grasshoppers hear through their abdomen, crickets through their knees, elephants through their feet, mosquitoes through their antennae; bees use instead their antennae to taste, while flies and butterflies use their feet, and octopi the tip of their tentacles; rattlesnakes have infrared-sensitive eyes on their muzzle, tuataras have a third eye on their forehead, many lizards smell with their tongue, and so on.

Nervous system
The nervous system collects and processes the information coming from the environment (which includes the rest of the body) through sense organs, and uses this information to coordinate biological functions. The communication occurs through nerves, cable-like bundles of tissue that transmit electrochemical impulses. Neurons are specialized cells with two kinds of extension: the short dendrites and the long axons, which are encased in the insulating myelin sheath and make up the nerves.

A neurons transmits nervous impulses from its axon to the dendrites of another: in electrical synapes, ions or small molecules pass through a junction, while in chemical synapses specialized receptors accept vesicles full of ions (sodium, calcium, potassium, chloride) or neurotrasmitters. Electrical synapses, bidirectional, are faster, retain their original intensity and allow to a net of neurons to act evenly, while chemical synapses, unidirectional, vary their intensity and allow for a wider range of responses.

Early nervous systems
Also see here.

Unicellular eukaryotes such as amoebas show traces of action potential, a process typical of neuron involving a quick change of electrical charge between the inside and the outside of the membrane, necessary for the transmission of nervous pulses. This allows even a simple organism to react to chemical or optic stimuli. Paremecia (ciliate protozoa) show early traces of memory, allowing it, for example, to correct its path after having met an obstacle.

Among animals, only sponges and placozoans lack nervous tissue and synapses; the colonial hydrozoan Obelia can transmit electrical signals from cell to cell through the common gut epithelium, while sponges can coordinate their hair cells by exchanging calcium ions, though a stimulus on one bodypart remains confined to it. Comb jellies and cnidarians have a diffused nerve net connecting each bodypart, so that a chemical, tactile or optical stimulus provokes a common response of the entire body.

In several groups of "worms" with bilateral symmetry the nervous systems includes a cord with masses of neurons (ganglia) in each segment. Protostomes (ringed worms, mollusks, arthropods) have a ventral cord, deuterostomes (echinoderms, chordates) have a dorsal cord, which in vertebrates becomes the spine. From here, the nervous system evolved in two directions: in most protostomes, ganglia have stayed largely autonomous (see here), while in other lineages a frontal ganglion absorbed most neurons and became the brain (see here).

Gangliar system
In annelid worms, the nervous system is made up by a pair of ganglia in each segment, connected by two ventral nervous cords. Mollusks have a more complex system, with six ganglia around the oesophagus that form a sort of "brain", and three other pairs of ganglia in other parts of the body (see image below); in octopi, two thirds of the neurons are located inside the tentacles.

In insects, the brain is also made up by three fused pairs of ganglia that directly control only eyes, antennae and the labrum. The rest of the mouth is controlled by the subesophageal ganglion; wings and legs by three pairs of thoracic ganglia; abdomen muscles by the abdominal ganglia; spiracles by several segmental ganglia; anus, genitalia and cerci by the caudal ganglion.

One could speculate (see here) that an intelligence based on a gangliar system could consider the workings of its head and limbs with the same detachment with which humans consider the activity of their glands. This sort of structure, though, is very inefficient on large scale, due to the large number of needed interconnections (which would be both bulky and slow) and the scarce capacity of each individual ganglion, which would be able to produce only simple, preprogrammed actions.

Encephalization and nervous hierarchy
Planarians have a sizeable frontal concentration of neurons, closer to the main sense organs. This process is called encephalization: the tendency of neural functions to unite in a single organ, which allows planarians to compare optic and olfactive signals to decide the best course of action. Starfish, whose body has a radial symmetry, have a central ring of neurons connected to the arms; mollusks and arthropods (especially spiders), despite having a mainly gangliar nervous system, have most of their neurons concentrated in few ganglia close to each other; lancelets, probably very close to the ancestral chordate, have a frontal swelling of the nervous cord that forms a simple brain. This allows to make the system more complex by adding functions to the central unit.

The nervous system of vertebrates is divided in this way:
 * The central nervous system (CNS) consists of the encephalon (brain and cerebellum, with a number of glands) and the spinal cord. The encephalon controls directly every biological function of the body, with the only exception of some reflexes (stereotyped and involuntary reactions) that are instead controlled by the spinal cord.
 * The peripheral nervous system (PNS) is the net of nerves controlled by the central nervous system, and it's mainly composed of axons rather than entire neurons (see above).
 * Somatic nervous system: it controls voluntary muscle movements. It includes the nerves in skeletal muscles, in the skin and in sense organs.
 * Autonomic nervous system: it controls involuntary muscles, the heart, glands and other organs.
 * Sympathetic nervous system (SNS): stress reactions: pupil dilatation, acceleration of heartrate and respiration rate, inhibition of digestion and circulation in the skin, etc.; it extends from the thoracic to lumbar vertebrae and its main neurotransmitter is adrenaline.
 * Parasympathetic nervous system (PSNS): relax reactions: pupil contraction, deceleration of heartrate and respiration rate, promotion of circulation in skin and digesting system, sexual arousal, salivation, secretion of gastric acid, etc.; it extends from the sacral vertebrae and its main neurotransmitter is acetylcholine.
 * Enteric nervous system (ENS): the most autonomous from the CNS, it's a net of neurons found inside the surface of the gastrointestinal system. It controls digestion and glandular activity, and can manage local reflexes.

Brain structure
In vertebrates, the encephalon develops from a neural tube that in turn produces three vesicles: the first one, the rhomboencephalon, the most ancient part, probably appeared in the first bilaterians (~570 million years ago), and it's divided in two parts. The mesencephalon connects the rhomboencephalon with the prosencephalon through the midbrain tectum, the cerebral peduncle and similar structures. Besides that, it's involved in the eye movement and sound location.
 * The myelencephalon is the part of rhomboencephalon that forms the medulla oblongata, the first part of the brain stem; it manages basic functions such as respiration, heartrate, blood pressure and peristalsis, and also reflexes such as vomiting, coughing and swallowing. It also forms part of the reticular formation, that control sleep and attention.
 * The metencephalon forms the pons and the cerebellum. The pons, another part of the brain stem, controls the movement of eyes and face and, through 10 of the 12 pairs of cranial nerves, several sensorial functions; the cerebellum is connected to the inner ear and coordinates the precision movements, balance and posture.

The prosencephalon is the most recent part of the brain, and it's also divided in two parts: In the 1960s, the neuroscientist Paul MacLean proposed for the evolution of the encephalon the triune brain model, based on the progressive accumulation of new structures around the older ones at the end of the neural tube. According to him, the human brain is divided in three parts (reptilian, paleomammalian and neomammalian); today, this model has been recognised as a gross semplification, though one that can be useful to understand the structure and the origins of a mind. Today, this classification of cerebral functions is mostly discredited: the reptile brain (including those of birds) lacks a neocortex, and yet can develop advanced abilities such as tool fabrication, complex language and extensive "mammalian" parental care. A similar classification of the pallium, the layers of neurons that forms the surface of the telencephalon, divides it into archipallium (most of the brain in fish, it forms the olfactory cortex in humans), paleopallium (appeared in amphibians, it forms lymbic structures in humans) and neopallium (found in reptiles, birds and mammals, synonymous with the neocortex).
 * The diencephalon is heavily involved in sensorial and visceral functions, through the thalamus (which sends to the cortex all the sensorial informations except for scents), the hypothalamus (which controls hunger, thirst, the sexual drive, pleasure, pain and anger) and the epithalamus (which connects the lymbic system to the rest of the brain). It also includes two important glands: the pituitary gland or hypophysis, which regulates several hormonal functions such as growth and milk secretion, and the pineal gland or epiphysis, which controls the wake/sleep pattern.
 * The telencephalon forms the true brain, with most of the basal ganglia, the cerebral cortex that forms the two hemispheres and the corpus callosum, a bundle of neural fibers that connects them. The basal ganglia control movements and sensation, especially gestures, and contain in turn the amygdala, center of learning, fear and aggression, and the hippocampus, center of long-term memory, of emotions connected to it and spatial orientation. It also contains most of the rhinencephalon, the structure that deals with olfaction. The cortex is, in turn, divided in five lobes on each hemisphere:
 * The lymbic lobe is the innermost one. It's believed to translate the impulses received from the diencephalon through the epithalamus into complex actions; it contains the cingulate gyrus, that helps to regulate psychosomatic reactions such as heartrate and pupil dilatation, and other that partake in the formation of new memories, especially spatial ones.
 * The occipital lobe, found on the back of the brain, contains the visual cortex, that identifies new objects by analyzing their shape, colour and movement, and by comparing them with known objects.
 * The temporal lobe recalls memories (verbal in the left hemisphere and visual in the right one) and through the auditory cortex it recognises intensity and frequency of sounds and the meaning of words.
 * The parietal lobe interprets taste, texture, temperature and pain from all the body through the sensory cortex; besides, it links images and sounds to memories, and has a role in orientation, spatial perception and symbol identification, including the written and spoken language.
 * The frontal lobe is responsible of voluntary movement thanks to the motor cortex, and of emotions, personality, communication, anticipation and pianification thanks to the prefrontal cortex.
 * The cerebral stem (medulla oblongata, pons, tectum) would be the "cerebral framework" common to all vertebrates, managin the basic vital functions, on which the subsequent structures are nested.
 * According to MacLean, the R-complex (reptilian) was added by reptiles around 300 Ma (but today is known to be much more ancient). It comprises the cerebellum and the basal ganglia, and it would be responsible for compelling istinctual behaviours such as aggression, territoriality, rituality and dominance hierarchies.
 * The lymbic system (paleomammalian) appeared 200-150 Ma in the first mammals. It comprises thalamus, hypothalamus and epithalamus, new basal ganglia such as amygdala and hippocampus, and the lymbic cortex, such as the cingulate gyrus; it'd mainly control emotions, particularly the emotive drive for reproduction, food gathering and raising the offspring.
 * The neocortex (neomammalian) would have been added by some mammals, such as carnivores and primates, around 30 Ma. It forms the occipital, temporal, parietal and frontal lobes.

Xenology uses the triune brain model to imagine three different kinds of mind, each one with one of the structures more developed: a "reptilian mind" strongly concerned by hierarchies and rituals, a "lymbic mind" highly emotive and impulsive, susceptible to be distracted by feeding and reproduction, and a "neocortical mind" more abstract, farsighted and rational, less concerned with social rites and political or religious institutions.

Variations
See here the discussion on the forum.

Perhaps because of its complexity, the nervous system hasn't been often object of speculations in the field of speculative biology. Keeping the basic concept (a body-wide net that carries around electrochemical pulses), this thread contains ideas for alien nervous systems: a neuron-based system could have tubules that guide the synapses, allowing a faster and more precise transmission, or a different distribution of the neurons' main bodies, for example completely encased in bone with only the axons projecting in the rest of the body.

Completely forsaking neurons, other means of transmitting signals can be imagined, such as tubes filled with water and electrolytes (such as sodium, potassium, calcium, magnesium, chloride etc. ions). In this system, pulses travel as valves between packets of fluid are opened, allowing ions to flow from one to another; ion channels of different size could allow a specialization of the tubes. Such a system, used by Snaiad's "vertebrates" along with a conventional neuron-based one, would be more resistant to neurotoxins, but would grant a slower flow with a longer time of recovery of the potential, and would probably require a greater volume.

Fibres of conductive polymers (organic polymers able to conduct electricity, such as polypyrroles, polyfluorenes, polyanilines, etc.), maybe insulated by layers of waxy lipids, could form "electric wires" that would allow an extremely fast communication, and thus perhaps advanced intelligence even in very large organisms, and would be immune to neurotoxines. It's unknown, though, how such a structure might arise from pre-existing tissues, and the organic generation of electricity is very energy-intensive.

Another similar proposal is based on the concept of optic fibers: a hollow tube of reflecting material, such as guanine crystals, might convey light produced by a bioluminescent organ towards a photosensitive target, effectively sending pulses at the speed of light. The generation and reception of the light isn't quite as fast, though, so such a system would only be effective in larger organisms, with longer nerves; besides, it isn't known if this system would be able to branch.