A very thorough and well written paper describing raw socket programming entitled “An overview of raw socket programming with FreeBSD – Chapter I: Transport Control Protocol”.
You can download it from the following link: https://packetstormsecurity.com/files/download/31403/raw_tcp.tgz
Source: https://packetstormsecurity.com/files/31403/An-Overview-of-Raw-Socket-Programming-with-FreeBSD.html

