Controller and switch for traffic engineering in a software defined network