Skip to content

Commit

Permalink
Use valid DNS queries as largest UDP and TCP test payloads
Browse files Browse the repository at this point in the history
EDNS0 option PADDING is used to inflate the queries.
Largest UDP payload over IPv4 is 65507 bytes, 65527 for the IPv6.
We go with IPv4. Oversized payloads are already tested using largest TCP
payload (65535 bytes).

Generated with dnspython 2.6.1:
    import dns.message
    m = dns.message.make_query('.', 'TYPE666')
    print(len(m.to_wire(max_size=65535)))
    m.options.append(dns.edns.GenericOption(dns.edns.OptionType.PADDING, '\x00' * 65475))
    print(len(m.to_wire(max_size=65535)))
    binary = m.to_wire(max_size=65535)

    import struct
    binary = struct.pack('>H', len(binary)) + binary
    open('output.blob', 'wb').write(binary)
  • Loading branch information
pspacek committed May 23, 2024
1 parent 17c680d commit c3a8870
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 0 deletions.
Binary file modified src/test/largesttcp.blob
Binary file not shown.
Binary file modified src/test/largestudp.blob
Binary file not shown.

0 comments on commit c3a8870

Please sign in to comment.