Optical fibre works on the principle of