First find out how to do it in C using the Unix sockets API. Suggested
resource is "Unix Network Programming volume 1" by Richard Stevens,
pub
Addison Wesley. Or you can find existing code which sends raw packets
and reverse-engineer that. Ask questions on a kernel/networking
mailing
list if you have problems.
Once you know this, you can translate easily to Ruby, since ruby's
Socket is a thin layer on top of this.
Google "ruby socket" and the first hit is the socket documentation.
Also
look in the sockets documentation at
http://www.ruby-doc.org/books/ProgrammingRuby (click on "Network and
Web
Libraries")