We have studied the algorithm for the automatic chromatic dispersion compensation using bit error rate (BER) and Q-factor optimization for realization of dynamically reconflgurable all-optical network. We have made sure good performance using the compensation system by laboratory experiments.