Documentation for Nebuladiscoveryservice Module¶
NebulaClientProtocol
¶
Bases: DatagramProtocol
Source code in nebula/core/network/externalconnection/nebuladiscoveryservice.py
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 |
|
keep_search()
async
¶
Periodically broadcast search requests to discover other nodes in the federation.
This loop runs a fixed number of times, each time sending a multicast discovery request and waiting for a predefined interval before repeating.
When the loop completes, a synchronization event (search_done
) is set
to indicate that the search phase is finished.
Source code in nebula/core/network/externalconnection/nebuladiscoveryservice.py
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
|
search()
async
¶
Send a multicast discovery message to locate other Nebula nodes.
Constructs and sends an SSDP-like M-SEARCH request targeted to all devices on the local multicast group. This message indicates interest in finding other participants in the Nebula DFL federation.
If an error occurs during sending, it is logged as an exception.
Source code in nebula/core/network/externalconnection/nebuladiscoveryservice.py
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 |
|
stop()
async
¶
Stop the client protocol by setting the search_done event to release any waiting tasks.
Source code in nebula/core/network/externalconnection/nebuladiscoveryservice.py
119 120 121 122 123 |
|
wait_for_search()
async
¶
Wait for the search phase to complete.
This coroutine blocks until the search_done
event is set,
signaling that the search loop has finished.
Source code in nebula/core/network/externalconnection/nebuladiscoveryservice.py
141 142 143 144 145 146 147 148 |
|
NebulaServerProtocol
¶
Bases: DatagramProtocol
Source code in nebula/core/network/externalconnection/nebuladiscoveryservice.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 |
|
handle_beacon_received(msg)
async
¶
Process a received beacon message from another node.
Extracts and parses the beacon content, validates it is not from this same node, and then notifies the associated Nebula service about the presence of a neighbor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
msg
|
str
|
The raw message string received via multicast. |
required |
Source code in nebula/core/network/externalconnection/nebuladiscoveryservice.py
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 |
|
respond(addr)
async
¶
Send a unicast HTTP-like response message to a given address.
This method is typically called when a discovery request is received. It returns metadata indicating that this node is available for participation in a DFL federation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
addr
|
tuple
|
The address (IP, port) to send the response to. |
required |
Source code in nebula/core/network/externalconnection/nebuladiscoveryservice.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
|