The custody transfer mechanism is the main component of the Delay Tolerant Networking (DTN) architecture, where the responsibility of the data transfer to the destination end node from the source node is handled by a custody node. This mechanism is proposed by DTN for the challenged networks with limited bandwidth, large propagation delays and high error rate. The custody-based data transfer mechanism proposed by DTN is modeled using ns-2 in this thesis. The simulation of the custody transfer mechanism is carried out in wired and IEEE 802.11 wireless network environments in ns-2 with TCP as the Transport mechanism. With the existing capability of ns-2, the environments are simulated with limited bandwidth and moderate delays. The end-to-end transfer mechanism with data transfer from the source node to the destination node is also modeled to compare the performance of the transfer mechanisms. The simulated transfer mechanisms in ns-2 show that the custody transfer mechanism works better than end-to-end transfer mechanism in some circumstances, and shows similar performance to end-to-end in other situations studied.