net
net
¶
NIP-66 network metadata container with ASN lookup capabilities.
Resolves a relay's hostname to IPv4/IPv6 addresses and queries the GeoIP ASN database for autonomous system number, organization name, and CIDR network ranges as part of NIP-66 monitoring. Clearnet relays only.
Note
Hostname resolution uses resolve_host
to obtain both IPv4 and IPv6 addresses. The GeoIP ASN database
(GeoLite2-ASN) must be provided as an open geoip2.database.Reader
-- the caller is responsible for database lifecycle management.
IPv4 ASN data takes priority; IPv6 ASN data is used only as a fallback when no IPv4 address is available. IPv6-specific network ranges are always recorded separately.
See Also
bigbrotr.nips.nip66.data.Nip66NetData: Data model for network/ASN fields. bigbrotr.nips.nip66.logs.Nip66NetLogs: Log model for network lookup results. bigbrotr.nips.nip66.geo.Nip66GeoMetadata: Geolocation test that also uses resolve_host for IP resolution. bigbrotr.utils.dns.resolve_host: DNS resolution utility used to obtain IP addresses.
Classes¶
Nip66NetMetadata
¶
Bases: BaseNipMetadata
Container for network/ASN data and lookup logs.
Provides the execute() class method that resolves the relay hostname
and performs GeoIP ASN lookups for both IPv4 and IPv6 addresses.
See Also
bigbrotr.nips.nip66.nip66.Nip66:
Top-level model that orchestrates this alongside other tests.
bigbrotr.models.metadata.MetadataType:
The NIP66_NET variant used when storing these results.
bigbrotr.nips.nip66.geo.Nip66GeoMetadata:
Geolocation test that shares the IP resolution step.
Functions¶
execute
async
classmethod
¶
execute(relay: Relay, asn_reader: Reader) -> Self
Perform network/ASN lookups for a clearnet relay.
Resolves the relay hostname to IPv4 and IPv6 addresses, then queries the GeoIP ASN database in a thread pool.
Parameters:
-
relay(Relay) –Clearnet relay to look up.
-
asn_reader(Reader) –Open GeoLite2-ASN database reader.
Returns:
-
Self–An
Nip66NetMetadatainstance with network data and logs.