i've been playing with packet crafters and internet books since 9, so it hasn't been difficult for me.
basically, you just need to know the underlying protocols. in the case of udp, you need udp, ip and ethernet (which, however, is handled by the chip). for tcp things get complicated, since tcp has several states, sequence numbers and moveable windows. i haven't yet dared to implement tcp on an atmega.
you do have to remember that udp is unreliable if you are using a crowded network (or sending packets from ethernet to wifi on your bot, for example).
as jesse says, bsd implementations are great, because they are open source and hardcore tested. you would need some intro in the protocols however. check out wiki for the OSI model and underlying protocols.
if you know the theory there's really nothing to worry about. just take an enc28 chip, make a preformatted packet (i made an udp one), and send it. you'll see it back in your computer. if you don't write a special application to capture the packet, i'd suggest using wireshark and filter the port you use. you can work your way from there, to switch mac addresses, make an ARP table on your chip, change IPs, change packet contents, recompute checksums.
i am interested in writing my own tcp stack (although i know other implementations exist) for use with the enc chip and an atmega. i would enjoy all the features of TCP, but that would require way more memory than any atmega has (fragmentation, buffers, windows). I think it's doable, though. Anyone else interested in this?