## 4 System Design and Goals
### Modification to Message Intervals and New Message Variables
#### 4.4.5 DRI Function  
The DRI_Module function is designed to process incoming proposed routing protocol packets, specifically focusing on identifying and handling Topology Control (TC) messages. Algorithm 5 extracts relevant address information from these messages and stores them in various routing-related records for future use. Nodes are expected to spend some part of the DRI period processing incoming TC messages and building links from such messages before committing them to tables. The algorithm begins by initializing an empty AddressArray and setting an index i to zero. A variable HelloHeard is initialized to zero to track whether any TC messages have been heard during the execution. The StartTime is recorded to limit the execution time of the main loop to 4 s. The DRI_Module processes packets, focusing on TC messages to update routing records. By running within a set time limit and handling potential errors gracefully, the algorithm ensures that critical routing information is accurately recorded and available for future network operations. ```
1. Function DRI_Module( )
2. AddressArray \(\leftarrow\) [ ] [ ], \(i\gets 0\), \(\mathit{HelloHeard}\gets 0\), \(\mathit{StartTime}\leftarrow\mathit{Time.Now}()\)
3. While Time.Now( ) - StartTime \(<\) 4 do:
4. Packets \(\leftarrow\)\({}^{\mathit{\mathit{\mathit{\mathit{\mathit{\mathit{\mathit{\mathit{\mathit{ \mathit{\mathit{\mathit{\mathit{\mathit{\mathit{\mathit{\mathit{\mathit{   \mathit{  }}}}}}}}}}}}}}\), Address \(\leftarrow\)\({}^{\mathit{\mathit{\mathit{\mathit{\mathit{\mathit{\mathit{\mathit{ \mathit{\mathit{\mathit{\mathit{\mathit{\mathit{\mathit{\mathit{\mathit{\mathit{\mathit{\mathit{  \mathit{   \mathit{    }}}}}}}}}}}}}}}\)
5. Try:
6. Address \(\leftarrow\) getOLSRHost()
7. Socket\(\leftarrow\) (Address, 269)
8. Packets \(\leftarrow\) GetPacketStream(Socket)
9. Close Socket
10. For \(\forall\) CurrentPacket \(\in\) Packets, do
11. Address \(\leftarrow\) getOLSRHost()
12. Socket \(\leftarrow\) (Address, 269)
13. Packet \(\leftarrow\) getPacketStream(Socket)
14. Socket.Close()
15. Catch all exceptions and discard silently:
16. For \(\forall\) CurrentPacket \(\in\) Packetsdo:
17. MType \(\leftarrow\) GetMessType(CurrentPacket)
18. VTime \(\leftarrow\) GetVTime(CurrentPacket
19. Address\(|\)\(\leftarrow\) GetAddr(CurrentPacket)
20. End For
21. IF MType \(\leftarrow\) \"TC\"&VTime \(\leq\) HeHiHoldTime then:
22. AddressArray[i][i] \(\leftarrow\) Addresses
23. MTypeArray[ArrayCounter] \(\leftarrow\) MTypeThe LMI_Module algorithm is not presented since it is essentially a copy of the LI_Module, but with a lower LISTEN duration. The following are suggested as deployment scenarios for the LMI_Module:

* Where the number of nodes is known, the listening period can be as small as possible. * Where the number of one-hop nodes can be dynamically determined during the longer LI_Module (by counting the number of detected message types), the implementation can switch to the LMI_Module or reduce the LI value if the number of messages from one-hop nodes is small. The proposed entry point of the OLSRv2 modification is the main function. Thereafter, each algorithm is executed as shown until control is returned to Algorithm 1. In general terms, the algorithms discussed provide robust mechanisms for our proposed routing protocol by effectively managing various states, intervals, and message processing functions. By dynamically adjusting state durations like the LISTEN and DB_NEIGHBORS_BOTH intervals, the algorithms ensure that nodes can adapt to changing network conditions, thereby improving the accuracy of routing decisions and conserving resources in both dynamic and stable environments. The DRI_Module algorithm demonstrates a focused approach to processing our proposed protocol packets, especially Topology Control (TC) messages. By extracting and storing crucial address information within a time-bound window, it enhances the efficiency and reliability of the network's routing functions.