This is exactly what "ping" does.
I would bet a hundred dollars your system already has ping installed!
Note that most versions of ping in modern releases have a flag that lets you set a "data pattern" for detecting specific bit errors.
The following is from the ping man-page:
-p pattern
You may specify up to 16 â?~â?~padâ?Tâ?T bytes to fill out the packet
you send. This is useful for diagnosing data-dependent problems
in a network. For example, -p ff will cause the sent packet to
be filled with all ones.
Generally, sending all ones or all zeros will flesh out a hardware problem that has to do with the dropping of bits.
RT