# NAME

            rfc2766_4.1_dns_v4tov6.seq - Verify IPv6 <-> IPv4 header
            translation in accordance with RFC2766 [NATPT]

# TARGET

            Router

# SYNOPSIS

            rfc2766_4.1_dns_v4tov6.seq [-tooloption ...]
            -p rfc2766_4.1_dns_v4tov6.def

# INITIALIZATION

    	Before this test starts, run initialize_natpt.seq.

# TEST PROCEDURE

            This test verifies that NUT adjusts header checksum for TCP/UDP
            packets.

            Network Topology

            Link0
            --------------------------
                |               |
               TN              NUT
                |               |
            --------------------------
            Link1

            TN -- (Link0) -- NUT        NUT -- (Link1) -- TN

            ---------------------      ------------------------

            1.1.
                                       <===================
            IPv4 UDP packet
                    IPv4 Header
                            src address : TN LINK1 IPv4 address
                            dst address : TN LINK0 IPv4 address
                            DF = 1
                    UDP packet
                            SourcePort = 1234;
                            DestinationPort = 53
                    DNS query
                            Transaction ID = 0xABCD
                            Flags = 0x0100 (Standard query)
                            Questions: 1
                            Answer RRs: 0
                            Authority RRs: 0
                            Additional RRs: 0
                    Queries
                            1.0.168.192.in-addr.arpa: type PTR, class inet
                                    Name: 1.1.168.192.in-addr.arpa
                                    Type: domain name pointer
                                    Class: inet
            1.2.
            <<JUDGMENT>>
            <===================
            IPv6 UDP packet
                    IPv6 Header
                            src address : TN LINK1 IPv4 embedded IPv6 address
                            dst address : TN LINK0 IPv4 embedded IPv6 address
                    UDP packet
                            SourcePort = 1234;
                            DestinationPort = 53
                    DNS query
                            Transaction ID = 0xAAAA
                            Flags = 0x0100 (Standard query)
                            Questions: 1
                            Answer RRs: 0
                            Authority RRs: 0
                            Additional RRs: 0
                    Queries
                            1.0.168.192.in-addr.arpa: type PTR, class inet
                                    Name: 1.1.168.192.in-addr.arpa
                                    Type: domain name pointer
                                    Class: inet

            2.1.
                                       <===================
            IPv4 UDP packet
                    IPv4 Header
                            src address : TN LINK1 IPv4 address
                            dst address : TN LINK0 IPv4 address
                            DF = 1
                    UDP packet
                            SourcePort = 1234;
                            DestinationPort = 53
                    DNS query
                            Transaction ID = 0xABCD
                            Flags = 0x8580 (Standard query response, No error)
                            Questions: 1
                            Answer RRs: 1
                            Authority RRs: 2
                            Additional RRs: 2
                    Queries
                            1.0.168.192.in-addr.arpa: type PTR, class inet
                    Answers
                            1.0.168.192.in-addr.arpa: type PTR, class inet, ptr ns1.ericsson.se
                    Authoritative nameservers
                            0.168.192.in-addr.arpa: type NS, class inet, ns ns1.ericsson.se
                            0.168.192.in-addr.arpa: type NS, class inet, ns ns2.ericsson.se
                    Additional records
                            ns1.ericsson.se: type A, class inet, addr 192.168.0.1
                            ns2.ericsson.se: type A, class inet, addr 192.168.0.2
            2.2.
            <<JUDGMENT>>
            <===================
            IPv6 UDP packet
                    IPv6 Header
                            src address : TN LINK1 IPv4 embedded IPv6 address
                            dst address : TN LINK0 IPv4 embedded IPv6 address
                    UDP packet
                            SourcePort = 1234;
                            DestinationPort = 53
                    DNS query
                            Transaction ID = 0xAAAA
                            Flags = 0x0100 (Standard query)
                            Questions = 1
                            Answer RRs: 1
                            Authority RRs: 2
                            Additional RRs: 2
                    Queries
                            1.1.168.192.in-addr.arpa: type PTR, class inet
                                    Name: 1.1.168.192.in-addr.arpa
                                    Type: domain name pointer
                                    Class: inet

            3.1.
                                       <===================
            IPv4 UDP packet
                    IPv4 Header
                            src address : TN LINK1 IPv4 address
                            dst address : TN LINK0 IPv4 address
                            DF = 1
                    UDP packet
                            SourcePort = 1234;
                            DestinationPort = 53
                    DNS query
                            Transaction ID = 0xABCD
                            Flags = 0x0100 (Standard query)
                            Questions: 1
                            Answer RRs: 0
                            Authority RRs: 0
                            Additional RRs: 0
                    Queries
                            ric.ericsson.se: type A, class inet
                                    Name: ric.ericsson.se
                                    Type: Host address
                                    Class: inet
            3.2.
            <<JUDGMENT>>
            <===================
            IPv6 UDP packet
                    IPv6 Header
                            src address : TN LINK1 IPv4 embedded IPv6 address
                            dst address : TN LINK0 IPv4 embedded IPv6 address
                    UDP packet
                            SourcePort = 1234;
                            DestinationPort = 53
                    DNS query
                            Transaction ID = 0xAAAA
                            Flags = 0x0100 (Standard query)
                            Questions: 1
                            Answer RRs: 0
                            Authority RRs: 0
                            Additional RRs: 0
                    Queries
                            1.0.168.192.in-addr.arpa: type PTR, class inet
                                    Name: 1.1.168.192.in-addr.arpa
                                    Type: domain name pointer
                                    Class: inet

            4.1.
                                       <===================
            IPv4 UDP packet
                    IPv4 Header
                            src address : TN LINK1 IPv4 address
                            dst address : TN LINK0 IPv4 address
                            DF = 1
                    UDP packet
                            SourcePort = 1234;
                            DestinationPort = 53
                    DNS query
                            Transaction ID = 0xABCD
                            Flags = 0x8580 (Standard query response, No error)
                            Questions: 1
                            Answer RRs: 1
                            Authority RRs: 2
                            Additional RRs: 2
                    Queries
                            ric.ericsson.se: type A, class inet
                    Answers
                            ric.ericsson.se: type A, class inet, addr 192.168.0.3
                    Authoritative nameservers
                            ericsson.se: type NS, class inet, ns ns1.ericsson.se
                            ericsson.se: type NS, class inet, ns ns2.ericsson.se
                    Additional records
                            ns1.ericsson.se: type A, class inet, addr 192.168.0.1
                            ns2.ericsson.se: type A, class inet, addr 192.168.0.2
            4.2.
            <<JUDGMENT>>
            <===================
            IPv6 UDP packet
                    IPv6 Header
                            src address : TN LINK1 IPv4 embedded IPv6 address
                            dst address : TN LINK0 IPv4 embedded IPv6 address
                    UDP packet
                            SourcePort = 1234;
                            DestinationPort = 53
                    DNS query
                            Transaction ID = 0xAAAA
                            Flags = 0x0100 (Standard query)
                            Questions = 1
                            Answer RRs: 1
                            Authority RRs: 2
                            Additional RRs: 2
                    Queries
                            1.1.168.192.in-addr.arpa: type PTR, class inet
                                    Name: 1.1.168.192.in-addr.arpa
                                    Type: domain name pointer
                                    Class: inet

# JUDGMENT

            << PASS >>
                    NUT translated (compressed or uncompressed) IPv4 DNS packages
                    to (compressed or uncompressed) IPv6 DNS packages.
                    IPv4 "A" records are changed to IPv6 "AAAA" records, and
                    IPv4 "IN-ADDR.ARPA" to "IP6.INT".

            << FAIL >>
                    NUT does not translate DNS packages properly.

# NOTE

# REFERENCE

RFC2766

4.1 Use of DNS-ALG

       The DNS-ALG on the NAT-PT device
       would modify DNS Queries for A records going into the V6 domain as
       follows: (Note that a TCP/UDP DNS packet is recognised by the fact
       that its source or destination port number is 53)

          a) For Node Name to Node Address Query requests:  Change the Query
             type from "A" to "AAAA" or "A6".
          b) For Node address to Node name query requests:  Replace the
             string "IN-ADDR.ARPA" with the string "IP6.INT".  Replace the
             V4 address octets (in reverse order) preceding the string "IN-
             ADDR.ARPA" with the corresponding V6 address (if there exists a
             map) octets in reverse order.

       The TTL values on all DNS resource records (RRs) passing through
       NAT-PT SHOULD be set to 0 so that DNS servers/clients do not cache
       temporarily assigned RRs. Note, however, that due to some buggy DNS
       client implementations a value of 1 might in some cases work better.
       The TTL values should be left unchanged for statically mapped
       addresses.

# SEE ALSO

            perldoc V6evalTool