RAW Sockets aren't a difficult thing, but you'll need deep knowledge of TCP/IP stack protocols, and practice with socket programming.
I recommend you to read a very short book named "
TCP/IP Sockets in C: Practical Guide for Programmers - Michael J. Donahoo, Kenneth L. Calvert", it's not about raw sockets, but TCP/IP sockets.
Then, when you feel comfortable with the socket calls, options, and types, here is a GREAT text about raw socket programming with examples and source code, which talks about TCP/UDP/IP/ICMP, and how to calculate headers checksums:
http://packetstormsecurity.nl/progra...raw_socket.txt
Oh, right, for the TCP/IP "theory" part, i recommend you the following books:
The TCP/IP Guide: A comprehensive, illustrated Internet Protocols Reference - Charles M. Kozierok
TCP/IP Clearly explained 4th edition - Pete Loshin
TCP/IP Illustrated, Volume 2: The Implementation - Gary R. Wright, W. Richard Stevens
And of course,
UNIX® Network Programming Volume 1, Third Edition: The Sockets Networking API - W. Richard Stevens, Bill Fenner, Andrew M. Rudoff
Best regards.