The proliferation of IoT devices has amplified the challenges for cloud computing, causing bottleneck congestion which affects the delivery of the required quality of service. For some services that are delay sensitive, response time is extremely critical to avoid fatalities. Therefore, Cisco presented fog computing in 2012 to overcome such limitations. In fog computing, data processing happens geographically close to the data origin to reduce response time and decrease network and energy consumption. In this paper, a new fog computing model is presented, in which a management layer is placed between the fog nodes and the cloud data centre to manage and control resources and communication. This layer addresses the heterogeneity nature of fog computing and complex connectivity that are considered challenges for fog computing. Sensitivity analysis using simulation is conducted to determine the efficiency of the proposed model. Different cluster configurations are implemented and evaluated in order to reach the optimal clustering method. The results show that the management layer improves QoS, with less bandwidth consumption and execution time.