Hi, I am currently implementing an protocol on ip layer in wireless network on ns2. I have the AODV as my routing protocol and 802.11 MAC as my mac layer. Above on the these two protocol, I inherited the Agent class to write my own protocol.
I try to set TTL in my own protocol by set ih->ttl_ = 250. Then I do a simulation and check the trace file. I got the following records: s 181.079289990 _2_ AGT --- 183 rock 21 [0 0 0 0] [energy 99.515511 ei 0.000 es 0.000 et 0.017 er 0.051] ------- [2:0 3:0 *250* 0] r 181.079289990 _2_ RTR --- 183 rock 21 [0 0 0 0] [energy 99.515511 ei 0.000 es 0.000 et 0.017 er 0.051] ------- [2:0 3:0 *250* 0] s 181.079289990 _2_ RTR --- 183 rock 41 [0 0 0 0] [energy 99.515511 ei 0.000 es 0.000 et 0.017 er 0.051] ------- [2:0 3:0 *30* 3] You can find when the packet send from AGT and is received by RTR, the TTL is 250. But when the RTR send it to the lower MAC layer, the ttl has been changed to 30. So, actually the ttl is always set to 30 when the packet logically forwarded from Routing Layer to MAC layer. As a result, a node always sends a packet with TTL 30 to another node. Is there any way to actually set the TTL to 250 when it forwards from RTR to MAC layer and sends out? Or is this problem only specific to AODV routing? Best Regards, Yi Gong [email protected]
