If I am using raw sockets to send a UDP packet of size 3000bytes, do I need to handle packet fragmentation myself in the code, or should the raw socket handle fragmentation
The underlying protocol, IP, still handles fragmentation. As long as you're not setting the DF (don't fragment) bit you should be fine, I think.