The formation of ion acoustic shocks