Chemical physics of D and E layers of the ionosphere