Have a look at these pics
periscope
Snorkel

The snorkel allows a U-boat to run its diesel engines when submerged. The observation scope is seen on the left, the attack periscope in the middle and snorkel on the right. It is fitted with a shutoff valve to prevent sea water from seeping in when the U-boat runs too deep.