SDN-TAP: An SDN-based traffic aware protocol for wireless sensor networks