Data center networks are the backbone of IT infrastructure and cloud services. According to traffic pattern research, a small group of flows transport the vast majority of the bytes and are referred to as elephant flows. Proper management of such traffic flows can enhance overall performance and energy efficiency. Software-defined network (SDN) is a fresh networking model that provides a centralized control plane (i.e., controller). The controller can be utilized for traffic monitoring by collecting the network flows at the controller. In this research, a new mechanism has been provided to detect such flows, which requires continuous polling of all switches. The proposed method depends on passive querying so it does not require additional traffic. The result shows the successful detection of elephant flow and cheetah flow that can be rerouted to improve the quality of service (QoS).