The solenoid is defined as a cylindrical coil of many tightly wound turns of insulated wire with a general diameter of the coil smaller than its length.
The solenoid has two ends and one end behaves like the north pole while the opposite end behaves like the south pole. As the length of the solenoid increases, the interior field becomes more uniform and the external field becomes weaker which can be seen from the diagram.
As the current flows a magnetic field is produced around and within the solenoid. The magnetic field within the solenoid is uniform and parallel to the axis of the solenoid.