The Delay Tolerant Networking Architecture (DTN) has been proposed for use in challenged networks that suffer from intermittent connectivity or high delay. The DTN architecture and the bundle protocol presents a standard method to interconnect heterogeneous challenged networks using asynchronous message switching. It provides a framework for dynamic routing, contact scheduling, naming, reliability and transmission status reports. Wireless Sensor Networks (WSNs) are often viewed as challenged networks as nodes operate at low power, often with weak or intermittent radio communication. WSNs are an important application area for DTN. In this work I present ContikiDTN, a TCP/IP based prototype implementation of the DTN architecture and bundle protocol. ContikiDTN aims to evaluate the suitability of the DTN bundle protocol as a solution for messaging inside a TCP/IP WSN and as a way of connecting the WSN to the Internet. I discuss the design and implementation of ContikiDTN using the Contiki operating system. I highlight the issues in implementing the bundle protocol with TCP and Contiki. I show that the event-driven Contiki kernel is very suitable for an asynchronous message forwarding application. I use ContikiDTN to communicate with a full PC platform implementation of DTN and show that it can be used as a gateway to the Internet. I present a simulation and experimental results showing the performance of multi-hop TCP based DTN as compared to only TCP. I show that the core propositions of the DTN architecture hold in a WSN and that it is feasible to implement DTN on resource constrained devices using TCP/IP and Contiki.