Cloud Gaming enables users to play games using a thin-client, regardless of their location or what platform they use (PCs, laptops, tablets, smartphones). Since the major computational parts of game processing are performed in datacenters, effectively assigning the resources (e.g. memory, bandwidth) to gaming sessions plays a key role in providing a high quality gaming experience to end-users. In this paper, we propose a traffic policing and shaping method using the Software Defined Networking (SDN) paradigm to solve the bandwidth allocation problem in cloud gaming datacenter networks. Our proposed method considers the current status of the datacenter paths in terms of remaining bandwidth and delay to achieve fair bandwidth allocation. The proposed scheme optimizes bandwidth utilization while ensuring compliance with the threshold of tolerable delay in cloud gaming systems. Our experimental results show that the proposed method improves bandwidth utilization and reduces end-to-end delay and delay variation (jitter) by almost 12% and 9%, respectively, without engendering additional packet loss compared to a representative conventional method: Equal Cost Multi-path (ECMP). These reductions lead to improvements in players' gaming experience.