You are currently viewing a beta version of our website. If you spot anything unusual, kindly let us know.
Altmetrics
Downloads
98
Views
28
Comments
0
A peer-reviewed article of this preprint also exists.
This version is not peer-reviewed
Algorithm 1: Initialization Phase |
1. DeleteAcknowledgedMessages(buffer, ackedMessagesTable): 2. For each message in buffer: 3. If message.ID is in ackedMessagesTable: 4. Remove message from buffer 5. UpdateMeetingTime(node): 6. If otherNode is in node.hostsTable: 7. UpdateMeetingTime(node, otherNode) 8. Else: 9. AddNodeToHostsTable(node, otherNode) 10. ExchangeAckedMessagesTables(connection): 11. For each node in connection: 12. AddDeliveredMessagesToTable(node) 13. SendAckedMessagesTable(node, connection) 14. UpdateHostsTable(connection): 15. For each node in connection: 16. If node is not in node1.hostsTable: 17. AddNodeToHostsTable(node1, node) 18. AddDeliveredMessagesToTable(node): 19. For each message in node.receivedAckedMessagesTable: 20. If message.ID is not in node.ackedMessagesTable: 21. Add message.ID to node.ackedMessagesTable |
Algorithm 2: Exchange Deliverables |
1. PrioritizeDeliverableMessagesPhase(): 2. AccumulateDeliverableMessages() 3. ExchangeDeliverableMessages() 4. UpdateAckedMessagesTable() 5. If EnergyExceedsThreshold(): 6. MoveToNextPhase() 7. Else: 8. CloseConnectionToPreserveEnergy() 9. AccumulateDeliverableMessages(): 10. For each message in buffer: 11. If message.Destination is connected node: 12. Add message to deliverableMessagesList 13. ExchangeDeliverableMessages(): 14. Send deliverableMessagesList to connected node 15. Receive deliverableMessagesList from connected node 16. UpdateAckedMessagesTable(): 17. For each message in receivedMessagesList: 18. If message not in ackedMessagesTable: 19. Add message to ackedMessagesTable 20. EnergyExceedsThreshold(): 21. If node.energy > thresholdEnergy: 22. Return true 23. Else: 24. Return false 25. MoveToNextPhase(): 26. Proceed to next phase of routing protocol 27. CloseConnectionToPreserveEnergy(): 28. Close connection with connected node 29. Operate as direct delivery node |
Algorithm 3: Non-Deliverable messages |
1. CoreRoutingPhase(): 2. InitializeOutputBuffer() 3. For each message in buffer: 4. DetermineMessageDestination() 5. ProcessMessageForOutputBuffer() 6. InitializeOutputBuffer(): 7. Create an empty temporary output buffer 8. DetermineMessageDestination(): 9. Identify whether message's destination is the connected node or another node in the network 10. ProcessMessageForOutputBuffer(): 11. If message's destination is another node: 12. DetermineNodeMeetingTimes() 13. CopyMessageToOutputBufferBasedOnCriteria() 14. DetermineNodeMeetingTimes(): 15. Calculate time elapsed since current node met destination (x) and since other node met destination (y) 16. CopyMessageToOutputBufferBasedOnCriteria(): 17. If current node didn't meet destination while other node did: 18. Copy message to output buffer 19. Else if current node met destination while other node didn't: 20. Exclude message from output buffer 21. Else: 22. If x < y: 23. Exclude message from output buffer 24. Else: 25. Copy message to output buffer |
Algorithm 4: Messages accepted by the receiver |
1. SynchronizedDataExchangePhase(): 2. SenderSideProcessing() 3. ReceiverSideProcessing() 4. SenderSideProcessing(): 5. GatherMetadataOfMessages() 6. CreateMetadataMessage() 7. TransmitMetadataMessageToReceiver() 8. WaitForResponseFromReceiver() 9. ProcessReceiverResponse() 10. ReceiverSideProcessing(): 11. WaitForMetadataMessage() 12. ExtractMetadataFromMessage() 13. SendResponseForEachMessage() 14. GatherMetadataOfMessages(): 15. For each message in output buffer: 16. Extract message ID and size 17. Store metadata in temporary structure 18. CreateMetadataMessage(): 19. Construct a message containing metadata of all messages in output buffer 20. TransmitMetadataMessageToReceiver(): 21. Send metadata message to receiver 22. WaitForResponseFromReceiver(): 23. Wait for reply from receiver 24. ProcessReceiverResponse(): 25. If response is RCV_OK: 26. SendMessageFromOutputBuffer() 27. Else if response is DENIED_LOW_RESOURCES: 28. CloseConnectionWithReceiver() 29. WaitForMetadataMessage(): 30. Wait for metadata message from sender 31. ExtractMetadataFromMessage(): 32. Extract message IDs and sizes from metadata message 33. SendResponseForEachMessage(): 34. For each message metadata: 35. EvaluateResponseCriteria() 36. Send appropriate response to sender 37. EvaluateResponseCriteria(): 38. If sufficient resources available: 39. Respond with RCV_OK 40. Else: 41. Respond with DENIED_LOW_RESOURCES |
Algorithm 5: Messages acceptance criteria |
1. ReceiverSideProcessing(): 2. ReceiveMetadataFromSender() 3. CheckNodeEnergy() 4. If EnergyBelowThreshold(): 5. SendDenialResponse() 6. Else: 7. ProcessIncomingMessages() 8. ProcessIncomingMessages(): 9. For each message metadata received: 10. CheckMessageAcceptanceCriteria() 11. If MessageAccepted(): 12. AcceptMessageAndSendConfirmation() 13. Else: 14. ContinueToNextMessage() 15. CheckMessageAcceptanceCriteria(): 16. If MessageInBuffer(): 17. Return false 18. If MessageSizeExceedsBufferCapacity(): 19. Return false 20. If FreeBufferSpaceSufficient(): 21. Return true 22. Else: 23. DeleteOldestMessagesUntilSpaceAvailable() 24. Return true 25. DeleteOldestMessagesUntilSpaceAvailable(): 26. While FreeBufferSpaceLessThanMessageSize(): 27. DeleteOldestMessageFromBuffer() 28. AcceptMessageAndSendConfirmation(): 29. SendResponseToSender("RCV_OK", MessageID) 30. ReceiveMetadataFromSender(): 31. Receive metadata message from sender 32. CheckNodeEnergy(): 33. Check energy level of receiver's node 34. EnergyBelowThreshold(): 35. Determine if energy level falls below minimum threshold 36. SendDenialResponse(): 37. Send response to sender indicating insufficient resources ("DENIED_LOW_RESOURCES") |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
Submitted:
03 April 2024
Posted:
04 April 2024
You are already at the latest version
A peer-reviewed article of this preprint also exists.
This version is not peer-reviewed
Submitted:
03 April 2024
Posted:
04 April 2024
You are already at the latest version
Algorithm 1: Initialization Phase |
1. DeleteAcknowledgedMessages(buffer, ackedMessagesTable): 2. For each message in buffer: 3. If message.ID is in ackedMessagesTable: 4. Remove message from buffer 5. UpdateMeetingTime(node): 6. If otherNode is in node.hostsTable: 7. UpdateMeetingTime(node, otherNode) 8. Else: 9. AddNodeToHostsTable(node, otherNode) 10. ExchangeAckedMessagesTables(connection): 11. For each node in connection: 12. AddDeliveredMessagesToTable(node) 13. SendAckedMessagesTable(node, connection) 14. UpdateHostsTable(connection): 15. For each node in connection: 16. If node is not in node1.hostsTable: 17. AddNodeToHostsTable(node1, node) 18. AddDeliveredMessagesToTable(node): 19. For each message in node.receivedAckedMessagesTable: 20. If message.ID is not in node.ackedMessagesTable: 21. Add message.ID to node.ackedMessagesTable |
Algorithm 2: Exchange Deliverables |
1. PrioritizeDeliverableMessagesPhase(): 2. AccumulateDeliverableMessages() 3. ExchangeDeliverableMessages() 4. UpdateAckedMessagesTable() 5. If EnergyExceedsThreshold(): 6. MoveToNextPhase() 7. Else: 8. CloseConnectionToPreserveEnergy() 9. AccumulateDeliverableMessages(): 10. For each message in buffer: 11. If message.Destination is connected node: 12. Add message to deliverableMessagesList 13. ExchangeDeliverableMessages(): 14. Send deliverableMessagesList to connected node 15. Receive deliverableMessagesList from connected node 16. UpdateAckedMessagesTable(): 17. For each message in receivedMessagesList: 18. If message not in ackedMessagesTable: 19. Add message to ackedMessagesTable 20. EnergyExceedsThreshold(): 21. If node.energy > thresholdEnergy: 22. Return true 23. Else: 24. Return false 25. MoveToNextPhase(): 26. Proceed to next phase of routing protocol 27. CloseConnectionToPreserveEnergy(): 28. Close connection with connected node 29. Operate as direct delivery node |
Algorithm 3: Non-Deliverable messages |
1. CoreRoutingPhase(): 2. InitializeOutputBuffer() 3. For each message in buffer: 4. DetermineMessageDestination() 5. ProcessMessageForOutputBuffer() 6. InitializeOutputBuffer(): 7. Create an empty temporary output buffer 8. DetermineMessageDestination(): 9. Identify whether message's destination is the connected node or another node in the network 10. ProcessMessageForOutputBuffer(): 11. If message's destination is another node: 12. DetermineNodeMeetingTimes() 13. CopyMessageToOutputBufferBasedOnCriteria() 14. DetermineNodeMeetingTimes(): 15. Calculate time elapsed since current node met destination (x) and since other node met destination (y) 16. CopyMessageToOutputBufferBasedOnCriteria(): 17. If current node didn't meet destination while other node did: 18. Copy message to output buffer 19. Else if current node met destination while other node didn't: 20. Exclude message from output buffer 21. Else: 22. If x < y: 23. Exclude message from output buffer 24. Else: 25. Copy message to output buffer |
Algorithm 4: Messages accepted by the receiver |
1. SynchronizedDataExchangePhase(): 2. SenderSideProcessing() 3. ReceiverSideProcessing() 4. SenderSideProcessing(): 5. GatherMetadataOfMessages() 6. CreateMetadataMessage() 7. TransmitMetadataMessageToReceiver() 8. WaitForResponseFromReceiver() 9. ProcessReceiverResponse() 10. ReceiverSideProcessing(): 11. WaitForMetadataMessage() 12. ExtractMetadataFromMessage() 13. SendResponseForEachMessage() 14. GatherMetadataOfMessages(): 15. For each message in output buffer: 16. Extract message ID and size 17. Store metadata in temporary structure 18. CreateMetadataMessage(): 19. Construct a message containing metadata of all messages in output buffer 20. TransmitMetadataMessageToReceiver(): 21. Send metadata message to receiver 22. WaitForResponseFromReceiver(): 23. Wait for reply from receiver 24. ProcessReceiverResponse(): 25. If response is RCV_OK: 26. SendMessageFromOutputBuffer() 27. Else if response is DENIED_LOW_RESOURCES: 28. CloseConnectionWithReceiver() 29. WaitForMetadataMessage(): 30. Wait for metadata message from sender 31. ExtractMetadataFromMessage(): 32. Extract message IDs and sizes from metadata message 33. SendResponseForEachMessage(): 34. For each message metadata: 35. EvaluateResponseCriteria() 36. Send appropriate response to sender 37. EvaluateResponseCriteria(): 38. If sufficient resources available: 39. Respond with RCV_OK 40. Else: 41. Respond with DENIED_LOW_RESOURCES |
Algorithm 5: Messages acceptance criteria |
1. ReceiverSideProcessing(): 2. ReceiveMetadataFromSender() 3. CheckNodeEnergy() 4. If EnergyBelowThreshold(): 5. SendDenialResponse() 6. Else: 7. ProcessIncomingMessages() 8. ProcessIncomingMessages(): 9. For each message metadata received: 10. CheckMessageAcceptanceCriteria() 11. If MessageAccepted(): 12. AcceptMessageAndSendConfirmation() 13. Else: 14. ContinueToNextMessage() 15. CheckMessageAcceptanceCriteria(): 16. If MessageInBuffer(): 17. Return false 18. If MessageSizeExceedsBufferCapacity(): 19. Return false 20. If FreeBufferSpaceSufficient(): 21. Return true 22. Else: 23. DeleteOldestMessagesUntilSpaceAvailable() 24. Return true 25. DeleteOldestMessagesUntilSpaceAvailable(): 26. While FreeBufferSpaceLessThanMessageSize(): 27. DeleteOldestMessageFromBuffer() 28. AcceptMessageAndSendConfirmation(): 29. SendResponseToSender("RCV_OK", MessageID) 30. ReceiveMetadataFromSender(): 31. Receive metadata message from sender 32. CheckNodeEnergy(): 33. Check energy level of receiver's node 34. EnergyBelowThreshold(): 35. Determine if energy level falls below minimum threshold 36. SendDenialResponse(): 37. Send response to sender indicating insufficient resources ("DENIED_LOW_RESOURCES") |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
Xingfa Shen
et al.
Sensors,
2021
Jaime Galán-Jiménez
et al.
Sensors,
2019
José Sobral
et al.
Sensors,
2019
© 2024 MDPI (Basel, Switzerland) unless otherwise stated