Documentation ¶
Overview ¶
Package dnsblast [DNS Distinct Heavy Hitter, refer to the scientific article https://faculty.idc.ac.il/bremler/Papers/HotWeb_18.pdf]
Index ¶
- Constants
- func Start(ctx context.Context, wg *sync.WaitGroup, config *Config) error
- type Config
- type DNSBlaster
- func (rcv *DNSBlaster) ExecuteStressTest(ctx context.Context, nameserver string, parameters *StressTestParameters) error
- func (rcv *DNSBlaster) SimpleQuery(sharedDNSClient *dns.Client, parameters *QueryParameters) *Response
- func (rcv *DNSBlaster) SimpleQueryWithNoResponse(sharedDNSClient *dns.Client, parameters *QueryParameters)
- type DistinctHeavyHitterGenerator
- type QueryParameters
- type Response
- type StressTestParameters
Constants ¶
const ( DefaultDNSPort = 53 DefaultDNSOverTLSPort = 853 UDPProtoName = "udp" TCPProtoName = "tcp" TCPTLSProtoName = "tcp-tls" )
Useful contants
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { RootDomain string Protocol string // "udp", "tcp", "tcp-tls" SeedDomains []string // Used to generate domain names using the Distinct Heavy Hitter algorithm Delay time.Duration // The delay between two packets to send ParallelQueries int }
Config contains all the necessary configuration for dns-blast
type DNSBlaster ¶
type DNSBlaster struct{}
DNSBlaster is a main worker struct for the package
func NewDNSBlaster ¶
func NewDNSBlaster() *DNSBlaster
NewDNSBlaster returns properly initialized blaster instance
func (*DNSBlaster) ExecuteStressTest ¶
func (rcv *DNSBlaster) ExecuteStressTest(ctx context.Context, nameserver string, parameters *StressTestParameters) error
ExecuteStressTest executes a stress test based on parameters
func (*DNSBlaster) SimpleQuery ¶
func (rcv *DNSBlaster) SimpleQuery(sharedDNSClient *dns.Client, parameters *QueryParameters) *Response
SimpleQuery performs a simple dns query based on parameters
func (*DNSBlaster) SimpleQueryWithNoResponse ¶
func (rcv *DNSBlaster) SimpleQueryWithNoResponse(sharedDNSClient *dns.Client, parameters *QueryParameters)
SimpleQueryWithNoResponse is like SimpleQuery but with optimizations enabled by not needing a response
type DistinctHeavyHitterGenerator ¶
type DistinctHeavyHitterGenerator struct {
// contains filtered or unexported fields
}
DistinctHeavyHitterGenerator creates an endless stream of fake domain names using the random subdomain.
func NewDistinctHeavyHitterGenerator ¶
func NewDistinctHeavyHitterGenerator(ctx context.Context, seedDomains []string) (*DistinctHeavyHitterGenerator, error)
NewDistinctHeavyHitterGenerator creates an endless stream of fake domain names using the random subdomain.
func (*DistinctHeavyHitterGenerator) Cancel ¶
func (rcv *DistinctHeavyHitterGenerator) Cancel()
Cancel allows to cancel execution prematurely
func (*DistinctHeavyHitterGenerator) Next ¶
func (rcv *DistinctHeavyHitterGenerator) Next() chan string
Next is here for iteration purposes
type QueryParameters ¶
QueryParameters contains parameters of a single dns query