*The sniper was running through the alley, he looked back and shot twice with his blaster. The blasts were answered by 5 shots, he quickly ducked into an alley and threw himself into a door, locking it behind him. He ran up the stairs there until he reached floor 304. He threw the door open and it closed behind him. The building was Ackbar Memorial hospital. He quickly asked the nurse where he could find Deac's room. He quickly ran to the intensive care/special conditions section and found Greer waiting outside the door*
Sniper: Sir, i think you'd better see this *he handed greer a datapad* I found it on a senator's computer.
*Greer took the datapad, looked at the first line, and his blood chilled, it said*
the hunt is going well, if we keep up progress, the leaders should be dead within a week.
Greer: Get the group back here, Price, dominguez, everyone. Tell them they are not to follow any orders from the senate and others in the NRI. Tell them to bring any weapons and equipment they can.
*He headed towards Gilan and gave him/her the datapad.*
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.