For the Arduino Ethernet Shield:
http://www.airspayce.com/mikem/arduino/EtherRaw/index.html
You can also use older Ethernet Shield with the ENC28J60 Ethernet interface. That chip doesn't implement the IP stack so the older library that goes with it has an IP stack you can use as an example.