Semi-distributed Traffic Engineering for Elastic Flows in Software Defined Networks