# Network traffic: replication versus EC

*HTML: https://book.ceph-s3.ir/en/lab-netbw.html*
*Licence: CC BY-NC-SA 4.0. Author: Ramin Najarbashi.*

[Interactive lab](lab.html)Network traffic: replication versus EC
In the book: [Chapter 13](13-erasure-coding.html#sec-13-5)
LabNetwork traffic: replication versus ECGive the client write and read load, the pool type and the NICs, and see how full the public and cluster networks get, how much data rebuilding a lost OSD moves and how many hours it takes.**17.8%**public network use**11.9%**cluster network use**11.2 TB**read to rebuild one OSD**2.1 h**approximate rebuild time (disk-bound)Public**3000 / 16875 MB/sCluster**2000 / 16875 MB/sPer byte of client dataWrite: client → primary (public)1×Write: primary → others (cluster)2×Written to disks3×Read: chunk gather (cluster)0×Rebuild: read per lost byte1×write: client → primary 1×, primary → 2 replicas × 1 · read: primary only · rebuild: copy 1× · usable ≈ 90% of line rateEC is cheaper in writes and space but its rebuild needs k times the traffic; that is why a separate cluster network or more bandwidth matters more for large EC pools, and mClock sets the recovery share (chapters 7 and 13).Follows:`src/osd/ReplicatedBackend.cc :: ReplicatedBackend::issue_op` Write fan-out with replication`src/osd/ECBackend.cc, src/osd/ECCommon.cc :: write fan-out, read gather, recovery reads` Fan-out, gather and rebuild with EC`doc/rados/configuration/network-config-ref.rst :: public and cluster networks` Public and cluster networksA fixed snapshot of the simulator; the interactive version is in the web edition's lab. [Interactive lab: Network traffic: replication versus EC](lab-netbw.html)The interactive version needs JavaScript; this is a fixed snapshot.
