On-line routing in all-optical networks