The entire Earth spins. No layer has a rotation rate the differs significantly from the rest of the planet. If any layer did the results would be catastrophic. The magnetic field is the result of convection currents in the outer core.
The earth's outer core produces the magnetic field.
The Outer Core
The OUTER CORE
inner core
The outer liquid core produces the strong magnetic field of the Earth, through the dynamo effect.
In the Dynamo Theory, the magnetic field of the earth is created in the outer core. The fluid contained in the outer core creates and maintains the magnetic field during rotation.
core
core
core
The Ozone layer of the earth protects the earth from the harmful UV radiations of the sun.
bob
Actually neither. Geophysicists still debate this question, but it is believed that earth's magnetic field is created by the movement of the liquid nickel/iron outer core.