No books, I think.
The most common way is, example :
$ cd ns-allinone-2.34/
$ patch -p0 < [new-protocol]_ns234.patch
.. Or, if you have a "patch package" that contains a folder 'ns-2.34':
.. And, it is again an example :
$ tar xvf [new-protocol]_ns234.tar.gz
$ export CC=gcc-4.4 CXX=g++-4.4 && install
Example protocols, see post #3 here, and how to search those at LQ :
http://www.linuxquestions.org/questi...s2-4175479853/
If you have made up your own changes to some files.cc, .h in ns-2.34:
$ cd ns-allinone-2.34/ns-2.34/ && make clean
$ cd ../ && export CC=gcc-4.4 CXX=g++-4.4 && install (example.)
-