We present a network model for investigating the impact on systemic risk of central clearing of over the counter (OTC) credit default swaps (CDS). We model contingent cash flows resulting from CDS and other OTC derivatives by a multi-layered network with a core-periphery structure, which is flexible enough to reproduce the gross and net exposures as well as the heterogeneity of market shares of participating institutions. We analyze illiquidity cascades resulting from liquidity shocks and show that the contagion of illiquidity takes place along a sub-network constituted by links identified as ’critical receivables’. A key role is played by the long intermediation chains inherent to the structure of the OTC network, which may turn into chains of critical receivables. We calibrate our model to data representing net and gross OTC exposures of large dealer banks and use this model to investigate the impact of central clearing on network stability. We find that, when interest rate swaps are cleared, central clearing of credit default swaps through a well-capitalized CCP can reduce the probability and the magnitude of a systemic illiquidity spiral by reducing the length of the chains of critical receivables within the financial network. These benefits are reduced, however, if some large intermediaries are not included as clearing members.