We propose a framework that allows dual-layer cooperative error control in a nanoscale network-on-chip (NoC), to simultaneously improve reliability, performance and energy efficiency. The framework combines a configurable routing algorithm in the network layer and an adaptive error control coding scheme in the datalink layer. When the network layer detects an increase in network congestion, either the routing algorithm is switched from deterministic to partially adaptive routing or the error controls schemes is adjusted to a powerful mode. In high noise conditions, the adaptive error control in the datalink layer is switched to a more powerful error control mode, cooperating with the configurable routing algorithm. The resulting dual-layer framework allows reliability and network congestion to be managed dynamically. Simulation results show that the proposed method improves the average latency up to 24% and the average energy up to 27% compared to the single layer error control, with ...