📄 draft-ietf-dnsop-respsize-02.txt
字号:
ns-ext.isc.org requires 16 bytes ns.psg.com requires 12 bytes ns.ripe.net requires 13 bytes ns.eu.int requires 11 bytes # of NS: 4 For maximum size query (255 byte): if only A is considered: # of A is 4 (green) if A and AAAA are condered: # of A+AAAA is 3 (yellow) if prefer_glue A is assumed: # of A is 4, # of AAAA is 2 (yellow) For average size query (64 byte): if only A is considered: # of A is 4 (green) if A and AAAA are condered: # of A+AAAA is 4 (green) if prefer_glue A is assumed: # of A is 4, # of AAAA is 4 (green) (Note: The response simulator program is shown in Section 5.) Here we use the term "green" if all address records could fit, or "orange" if two or more could fit, or "red" if fewer than two could fit. It's clear that without a common parent for nameserver names, much space would be lost. For these examples we use an average/common name size of 15 octets, befitting our assumption of GTLD-SERVERS.NET as our common parent name. Expires December 2005 [Page 5] INTERNET-DRAFT July 2005 RESPSIZE We're assuming an average query name size of 64 since that is the typical average maximum size seen in trace data at the time of this writing. If Internationalized Domain Name (IDN) or any other technology which results in larger query names be deployed significantly in advance of EDNS, then new measurements and new estimates will have to be made. 4 - Conclusions 4.1. The current practice of giving all nameserver names a common parent (such as GTLD-SERVERS.NET or ROOT-SERVERS.NET) saves space in DNS responses and allows for more nameservers to be enumerated than would otherwise be possible. (Note that in this case it is wise to serve the common parent domain's zone from the same servers that are named within it, in order to limit external dependencies when all your eggs are in a single basket.) 4.2. Thirteen (13) seems to be the effective maximum number of nameserver names usable traditional (non-extended) DNS, assuming a common parent domain name, and given that response truncation is undesirable as an average case, and assuming mostly IPv4-only reachability (only A RRs exist, not AAAA RRs). 4.3. Adding two to five IPv6 nameserver address records (AAAA RRs) to a prototypical delegation that currently contains thirteen (13) IPv4 nameserver addresses (A RRs) for thirteen (13) nameserver names under a common parent, would not have a significant negative operational impact on the domain name system. 5 - Source Code #!/usr/bin/perl # # SYNOPSIS # repsize.pl [ -z zone ] fqdn_ns1 fqdn_ns2 ... # if all queries are assumed to have zone suffux, such as "jp" in # JP TLD servers, specify it in -z option # use strict; use Getopt::Std; my ($sz_msg) = (512); my ($sz_header, $sz_ptr, $sz_rr_a, $sz_rr_aaaa) = (12, 2, 16, 28); my ($sz_type, $sz_class, $sz_ttl, $sz_rdlen) = (2, 2, 4, 2); my (%namedb, $name, $nssect, %opts, $optz); my $n_ns = 0; Expires December 2005 [Page 6] INTERNET-DRAFT July 2005 RESPSIZE getopt('z', opts); if (defined($opts{'z'})) { server_name_len($opts{'z'}); # just register it } foreach $name (@ARGV) { my $len; $n_ns++; $len = server_name_len($name); print "$name requires $len bytes\n"; $nssect += $sz_ptr + $sz_type + $sz_class + $sz_ttl + $sz_rdlen + $len; } print "# of NS: $n_ns\n"; arsect(255, $nssect, $n_ns, "maximum"); arsect(64, $nssect, $n_ns, "average"); sub server_name_len { my ($name) = @_; my (@labels, $len, $n, $suffix); $name =~ tr/A-Z/a-z/; @labels = split(/./, $name); $len = length(join('.', @labels)) + 2; for ($n = 0; $#labels >= 0; $n++, shift @labels) { $suffix = join('.', @labels); return length($name) - length($suffix) + $sz_ptr if (defined($namedb{$suffix})); $namedb{$suffix} = 1; } return $len; } sub arsect { my ($sz_query, $nssect, $n_ns, $cond) = @_; my ($space, $n_a, $n_a_aaaa, $n_p_aaaa, $ansect); $ansect = $sz_query + 1 + $sz_type + $sz_class; $space = $sz_msg - $sz_header - $ansect - $nssect; $n_a = atmost(int($space / $sz_rr_a), $n_ns); $n_a_aaaa = atmost(int($space / ($sz_rr_a + $sz_rr_aaaa)), $n_ns); $n_p_aaaa = atmost(int(($space - $sz_rr_a * $n_ns) / $sz_rr_aaaa), $n_ns); printf "For %s size query (%d byte):\n", $cond, $sz_query; printf "if only A is considered: "; printf "# of A is %d (%s)\n", $n_a, &judge($n_a, $n_ns); printf "if A and AAAA are condered: "; printf "# of A+AAAA is %d (%s)\n", $n_a_aaaa, &judge($n_a_aaaa, $n_ns); Expires December 2005 [Page 7] INTERNET-DRAFT July 2005 RESPSIZE printf "if prefer_glue A is assumed: "; printf "# of A is %d, # of AAAA is %d (%s)\n", $n_a, $n_p_aaaa, &judge($n_p_aaaa, $n_ns); } sub judge { my ($n, $n_ns) = @_; return "green" if ($n >= $n_ns); return "yellow" if ($n >= 2); return "orange" if ($n == 1); return "red"; } sub atmost { my ($a, $b) = @_; return 0 if ($a < 0); return $b if ($a > $b); return $a; } Security Considerations The recommendations contained in this document have no known security implications. IANA Considerations This document does not call for changes or additions to any IANA registry. IPR Statement Copyright (C) The Internet Society (2005). This document is subject to the rights, licenses and restrictions contained in BCP 78, and except as set forth therein, the authors retain all their rights. This document and the information contained herein are provided on an "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Expires December 2005 [Page 8] INTERNET-DRAFT July 2005 RESPSIZE Authors' Addresses Paul Vixie 950 Charter Street Redwood City, CA 94063 +1 650 423 1301 vixie@isc.org Akira Kato University of Tokyo, Information Technology Center 2-11-16 Yayoi Bunkyo Tokyo 113-8658, JAPAN +81 3 5841 2750 kato@wide.ad.jp Expires December 2005 [Page 9]
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -