Control plane optimization in Software Defined Networking and task allocation for Fog Computing