We have modelled the process of reionization of the intergalactic medium ( IGM ) by photoionization by galaxies , in order to learn what galaxy formation in the framework of the CDM model predicts for the epoch of reionization . We use a sophisticated semi-analytic model of galaxy formation to track the formation of these galaxies , their influence on the IGM , and the back-reaction of the state of the IGM on further galaxy formation . Our study represents a much more complete and physically consistent modelling of reionization than has been conducted in the past . In particular , compared to previous work by ourselves and others , our new calculations contain significant improvements in the modelling of the effects of reionization of the IGM on the collapse of baryons into dark matter halos ( this is now computed self-consistently from the properties of model galaxies ) , and in the model for the cooling and condensation of gas within halos ( our new model includes photoheating from a self-consistently computed ionizing background and also includes cooling due to molecular hydrogen ) . We find that reionization can be achieved by z \sim 10 – 20 in a \Lambda CDM cosmological model with \sigma _ { 8 } \approx 0.9 . However , a cosmological model with a running spectral index is only able to achieve reionization before z \approx 9 , and thus be consistent with an optical depth of 0.1 , if very extreme assumptions are made about the physics of feedback at high redshifts . We also consider the specific galaxy formation model recently discussed by Baugh et al. , which includes a top-heavy IMF in starbursts , and find that it is able to reionize the Universe by z \approx 12 . The previous results assume that all of the ionizing photons produced by stars in galaxies are able to escape and ionize the IGM . If this is not the case , then the redshift of reionization could be substantially reduced . We find that extended periods of partial reionization and double reionizations can occur in models in which the first stars formed via cooling by H _ { 2 } molecules , are very massive , and in which the escape fraction of ionizing photons \sim 10–30 % . Such models do not fully reionize until z \approx 6–7 , but predict an electron scattering optical depth as large as 0.15 . Models with lower \sigma _ { 8 } = 0.7 - -0.8 as suggested by the recent Wilkinson Microwave Anisotropy Probe ( WMAP ) three year data have reduced redshifts of reionization , but can be consistent with the lower optical depth also suggested by the WMAP three year data .