After an introduction into diffusive shock acceleration, I discuss recent prospects in theory and observations, in particular the idea of magnetic field amplification by cosmic rays. Then I review the (controversial) status of the transition to extragalactic cosmic rays and the chemical composition at the highest energies. The prospects of identify the source of ultrahigh energy cosmic rays depends crucially on the later and the strength of magnetic fields and I discuss strategies to distinguish sources classes.