Documentation for Communicationattack Module¶
CommunicationAttack
¶
Bases: Attack
Source code in nebula/addons/attacks/communications/communicationattack.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
|
attack()
async
¶
Perform the attack logic based on the current round.
Source code in nebula/addons/attacks/communications/communicationattack.py
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
|
decorator(*args)
abstractmethod
¶
Decorator that adds malicious behavior to the execution of the original method.
Source code in nebula/addons/attacks/communications/communicationattack.py
41 42 43 44 |
|
select_targets()
async
¶
Selects a subset of neighboring nodes as attack targets based on the configured selectivity percentage.
This method determines which neighboring nodes should be targeted in the current round of attack.
If the selectivity percentage is less than 100%, it samples a subset of the currently connected direct neighbors.
The selection behavior can be influenced by a selection_interval
:
- If selection_interval
is set, target selection occurs only at rounds that are multiples of this interval.
- If no interval is defined but no targets have been selected yet, targets are selected once.
If the selectivity is 100%, all direct neighbors are selected as targets.
Target addresses are retrieved from the CommunicationsManager (only direct connections). The number of selected targets is at least 1.
Logs are emitted at each selection event to indicate which targets were chosen.
Increments the internal last_selection_round
counter after execution.
Notes
- The
self.targets
attribute is updated in-place. - The
self.last_selection_round
attribute tracks when the selection was last performed.
Source code in nebula/addons/attacks/communications/communicationattack.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
|