Agents represent endpoints where network-layer packets are constructed or consumed, and are used in the implementation of protocols at various layers. The Agent../ns-2/agent.h has an implementation partly in OTcl and partly in C++. The C++ implementation is contained in ~ns/agent.cc and ~ns/agent.h, and the OTcl support is in ~ns/tcl/lib/ns-agent.tcl.