How to animate perpendicular strips moving along a cable? (visualizing DC electric current)
If you don't mind some stretching and compression - that happens when the segments of the curve don't have all the same length - then you can just bevel a curve and add a procedural bi-color shader that is driven by the frame rate for the animation.

If you don't like the stretching and compression then you can do what moonboot suggested: create a cylinder, apply an Array and Curve modifier. Last but not least, use a procedural shader for the animation. The drawback of this method is that you need one cylinder for each cable. But it can be a linked duplicate, so no biggy.
Shader for animation

Enter #frame + 12 in the purple value field to create the driver. 6 is the speed, and the +12 (=2x6) is needed for a continuous loop over all frames. 2 because it's bi-color. Switch the Add math node to Substract to reverse the direction.