Defending champion Roger Federer beat David Ferrer for the 14th successive time to reach the semi-finals of the Barclays ATP World Tour Finals.