In Write scenario:
DFSClient can Compress the data when transmitting it over the network, Data Nodes can forward the same compressed data to other Data Nodes in pipeline and as well as it can decompress that data and write on to their local disks.
In Read Scenario:
Data Node can compress the data when transmitting it over the network. DFSClient can decompress it and write on to the local stream.