I don't know if you are looking for something this basic but this should give you a start...

http://www.security-freak.net/raw-sockets/raw-sockets.html