Dynamics of magnetic monopoles in artificial spin ice