Measurements of the diffractive deep inelastic scattering processes ep → eXY and ep → eXp at HERA are presented. Events with a measured leading proton, as well as events with a large rapidity gap (LRG) between X and the outgoing proton were analysed. Moreover, the difference in the shape of the MX distribution of diffractive and non-diffractive events was utilised to extract the diffractive component. Diffractive parton distribution functions and their uncertainties were determined from a next-to-leading order DGLAP QCD analysis. The results are presented in terms of the diffractive structure functions, F2D(3) and F2D(4), and the diffractive reduced cross sections, σrD(3) and σrD(4).