How to trace a process sending data over network?
There are multiple ways to sniff outgoing network traffic. Since Android uses Linux kernel, we can make use of in-kernel reliable firewall: netfilter which is controlled using userspace utility iptables. It's the easiest available option for rooted phones.
Through a root commandline:

# iptables -I OUTOUT -j LOG --log-prefix "SNIFFER " --log-uid --log-level 7


This will log all outgoing traffic to kernel log that you can capture and save to text file:

# dmesg -w | grep SNIFFER


This will provide you uid of the all the processes sending out traffic, which can be used to trace the processes.  

AFWall+ app also makes use of iptables owner module to block traffic from certain user/system apps (UIDs) including root.

For further details on capturing packets, see View network traffic requested by app.