Bandwidth allocation is an important and influential factor in enhancing the performance of the data centers' nodes. In this paper we propose bwSlicer, a framework for bandwidth slicing in cloud data centers, that sheds light on the virtues of effective dynamic bandwidth allocation on improving the system performance and energy efficiency. Three algorithms are investigated to deal with this issue. In the first algorithm, called Fair Bandwidth Reallocation (FBR), two virtual machines co-hosted on the same node conditionally exchange bandwidth slices based on their requirements. The second algorithm, called Required Bandwidth Allocation (RBA), periodically monitors the co-hosted virtual machines and adds/removes bandwidth slices for each of them based on their bandwidth utilization. The third algorithm, called Divide Bandwidth Reallocation (DBR), divides the bandwidth of the virtual machine into slices once it finishes its execution, and distributes the slices among the co-hosted running virtual machines according to a specific policy. The proposed bandwidth slicing algorithms are emulated in a virtualized networking environment using the Mininet network emulator. The emulation results demonstrated a promising improvement ratio in execution time and energy consumption reaching up to 30%. These results present a call for action for further research into bandwidth slicing and reallocation as a viable complement to other energy-saving techniques for enhancing the energy consumption in cloud data centers.