Warda Ruheen Asked: 2019-11-17 06:05:53 +0800 CST2019-11-17 06:05:53 +0800 CST 2019-11-17 06:05:53 +0800 CST Why is MESSAGE_PORT always 42? 772 I am new to NS2. In any tcl file where flooding is done, MESSAGE_PORT is always set to 42. What is the reason behind this? ns2 1 Answers Voted Best Answer Knud Larsen 2019-11-18T03:26:02+08:002019-11-18T03:26:02+08:00 $ cd ns-2.35/ $ grep -Rin "PORT 42" * tcl/edu/chan-interference/chanInterference.tcl:35:set MESSAGE_PORT 42 tcl/edu/hidden-terminal/sht.tcl:35:set MESSAGE_PORT 42 tcl/edu/rts-cts/rts-cts-data-ack.tcl:35:set MESSAGE_PORT 42 tcl/ex/flooding.tcl:46:set MESSAGE_PORT 42 tcl/ex/wireless-flooding.tcl:46:set MESSAGE_PORT 42 tcl/test/test-suite-message.tcl:46:set MESSAGE_PORT 42 Please read the files. Some of the code is just a reuse from one file to the others. The port number may be your choice. There seems to be no difference with e.g. MESSAGE_PORT 1, 2, 40, 41, 42, 43, 44, 101. "Agent/Message" : See common/message.cc ( Or use $ grep -Rin message * ... to know all message code.
Please read the files. Some of the code is just a reuse from one file to the others.
The port number may be your choice. There seems to be no difference with e.g. MESSAGE_PORT 1, 2, 40, 41, 42, 43, 44, 101.
"Agent/Message" : See
common/message.cc
( Or use$ grep -Rin message *
... to know all message code.