The dynamics and upstream distributions of ions reflected at the Earth's bow shock