First, you must have the available protocol that NS-2 can support. Then, on how to add a new protocol, you can refer to this example: http://elmurod.net/en/index.php/archives/157
There are some differences between NS-2.34 and NS-2.35. If you have the patch of 2.34, you can refer to its implementation, and then set up the protocol that 2.35 can support.