“And how did Ned learn of Robert’s Bastard’s?”
He learned of them because Littlefinger nudged him in that direction the second he got to King’s Landing.
As for your implication, Jon Snow gets the dark hair from his dark haired mother, Lyanna. Jon Snow can’t be Robert’s kid, because Robert and Lyanna never bumped uglies.