Two horses pulling a cart traveled slowly in the forest. The driver looked around, and suddenly found himself with an sword pointed in his face.
"Stop the cart." Growled the owner. The driver did as he was told and the swordsman whistled. Bandits came puring down from the trees.
"GET THE CART BOYS!"
"You won't want to do that." Said the driver.
"Why? What are you going to do about it?"
"Not me. My short,and short-tempered friend."
Meanwhile the bandits opened the cart from the back and a dwarf immediately assaulted them with an axe.
"DAMN THESE BANDITS! I REMEMBER WHEN A DWARF COULD RIDE AROUND FORESTS, AND ONLY HAD TO WORRY ABOUT ELVES!"
The swordsman looked perplexed, and suddenly found an arrow in his gut. The driver had shot it at him from behind his back.
The driver quickly got down from the cart and shot three bandits in the back before unsheathing his sword, he quickly joined the dwarf, both of them fighting back to back. In a few moments all the bandits were dead.
"HA! they get worse every year!" Said the dwarf. "Soon we won't even need to fight, we'll just blow at them and they'll collapse."
"Let's hope it doesn't come to that." Said the man sheathing his sword.
Vader's wife was very pregnant when she died 19 years ago. All of a sudden a 19 year old who is very strong in the force and has a distinct resembalance to him in his younger days rolls in from Vader's home planet with his old Master Obi-Wan (Who was the ONLY other person preset at the time his wife died. And to boot, the kid's last name is Skywalker.
So in answer to your question, he knew Luke was his son because his name is Darth Vader, and not Darth Retard.
-Forum post on why Vader knew Luke was his son.