When network coding and dirty paper coding meet in a cooperative ad hoc network