# NAME

            rfc2765_4.1_hoplimit.seq - Verify IPv6 <-> IPv4 header
            translation in accordance with RFC2765 [SIIT]

# TARGET

            Router

# SYNOPSIS

             rfc2765_4.1_hoplimit.seq [-tooloption ...]
            -p rfc2765_3.1_hoplimit.def

# INITIALIZATION

    	Before this test starts, run initialize.seq.

# TEST PROCEDURE

            This test verifies that NUT properly translates Hop Limit - 1 to
            TTL, or sends an ICMPv6 Time Exceeded.

            Network Topology

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

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

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

            1.1.
            ===================>
            ICMPv6 Echo Request
                    IPv6 Header
                            src address : TN LINK0 IPv4 embedded IPv6 address
                            dst address : TN LINK1 IPv4 embedded IPv6 address
                            Hop Limit = 255
                    ICMPv6 echo request

            1.2.
            <<JUDGMENT>>
                                       ===================>
            ICMPv4 Echo request
                    IPv4 Header
                            src address : TN LINK0 IPv4 address
                            dst address : TN LINK1 IPv4 address
                            Don't Fragment = 1
                            TTL = 254
                    ICMPv4 echo request

            2.1.
            ===================>
            ICMPv6 Echo Request
                    IPv6 Header
                            src address : TN LINK0 IPv4 embedded IPv6 address
                            dst address : TN LINK1 IPv4 embedded IPv6 address
                            Hop Limit = 64
                    ICMPv6 echo request

            2.2.
            <<JUDGMENT>>
                                       ===================>
            ICMPv4 Echo request
                    IPv4 Header
                            src address : TN LINK0 IPv4 address
                            dst address : TN LINK1 IPv4 address
                            Don't Fragment = 1
                            TTL = 63
                    ICMPv4 echo request

            3.1.
            ===================>
            ICMPv6 Echo Request
                    IPv6 Header
                            src address : TN LINK0 IPv4 embedded IPv6 address
                            dst address : TN LINK1 IPv4 embedded IPv6 address
                            Hop Limit = 2
                    ICMPv6 echo request

            3.2.
            <<JUDGMENT>>
                                       ===================>
            ICMPv4 Echo request
                    IPv4 Header
                            src address : TN LINK0 IPv4 address
                            dst address : TN LINK1 IPv4 address
                            Don't Fragment = 1
                            TTL = 1
                    ICMPv4 echo request

            4.1.
            ===================>
            ICMPv6 Echo Request
                    IPv6 Header
                            src address : TN LINK0 IPv4 embedded IPv6 address
                            dst address : TN LINK1 IPv4 embedded IPv6 address
                            Hop Limit = 1
                    ICMPv6 echo request

            4.2.
            <<JUDGMENT>>
            <===================
            ICMPv6 Time Exceeded
                    IPv6 Header
                            src address : TN LINK0 IPv4 embedded IPv6 address
                            dst address : TN LINK1 IPv4 embedded IPv6 address
                    ICMPv6 Time Exceeded
                            Type = 3
                            Code = 0 (hop limit exceeded in transit)
                            data = ICMPv6 Echo Request

# JUDGMENT

            << PASS >>
                    NUT translates ICMPv6 with Hop Limit = 255, 64, 2 to
                    ICMPv4 with TTL = 254, 63, 1.
                    NUT responds to ICMPv6 Echo Request with TTL = 1
                    with an ICMPv6 Time Exceeded message.

            << FAIL >>
                    NUT doesn't translate Hop Limit properly, or doesn't
                    respond with ICMPv6 Time Exceeded messages when
                    Hop Limit = 1 on incoming packages.

# NOTE

# REFERENCE

RFC2765

4.1. Translating IPv6 Headers into IPv4 Headers

       If there is no IPv6 Fragment header the IPv4 header fields are set as
       follows:

             Time to Live:
                     Hop Limit value copied from IPv6 header.  Since the
                     translator is a router, as part of forwarding the
                     packet it needs to decrement either the IPv6 Hop
                     Limit (before the translation) or the IPv4 TTL (after
                     the translation).  As part of decrementing the TTL or
                     Hop Limit the translator (as any router) needs to
                     check for zero and send the ICMPv4 or ICMPv6 "ttl
                     exceeded" error.

# SEE ALSO

            perldoc V6evalTool