Right before Frodo and company head into the Old Forest, Frodo has this dream.
Eventually he fell into a vague dream, in which he seemed to be looking out of a high window over a dark sea of tangled trees. Down below among the roots there was the sound of creatures crawling and snuffling. He felt sure they would smell him out sooner or later. Then he heard a noise in the distance. At first he thought it was a great wind coming over the leaves of the forest. Then he knew that it was not leaves, but the sound of the Sea far-off; a sound he had never heard in waking life, though it had often troubled his dreams. Suddenly he found he was out in the open. There were no trees after all. He was on a dark heath, and there was a strange salt smell in the air. Looking up he saw before him a tall white tower, standing alone on a high ridge. A great desire came over him to climb the tower and see the Sea. He started to struggle up the ridge towards the tower: but suddenly a light came in the sky, and there was a noise of thunder.
Was this dream supposed to be in some way prophetic, foretelling his future sailing to the Undying Lands? Or was there another reason/outcome for this dream?