When network coding and dirty paper coding cooperate