# NAME

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

# TARGET

            Router

# SYNOPSIS

        rfc2765_3.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 TTL - 1 to
            Hop Limit, or sends an ICMPv4 Time Exceeded.

            Network Topology

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

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

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

            1.1.
                                       <===================
            ICMPv4 Echo request
                    IPv4 Header
                            src address : TN LINK1 IPv4 address
                            dst address : TN LINK0 IPv4 address
                            Don't Fragment = 1
                            More fragments = 0
                            Offset = 0
                            TTL = 255
                    ICMPv4 echo request

            1.2.
            <<JUDGMENT>>
            <===================
            ICMPv6 Echo Request
                    IPv6 Header
                            src address : TN LINK1 IPv4 embedded IPv6 address
                            dst address : TN LINK0 IPv4 embedded IPv6 address
                            Hop Limit = 254
                    ICMPv6 echo request

            2.1.
                                       <===================
            ICMPv4 Echo request
                    IPv4 Header
                            src address : TN LINK1 IPv4 address
                            dst address : TN LINK0 IPv4 address
                            Don't Fragment = 1
                            More fragments = 0
                            Offset = 0
                            TTL = 64
                    ICMPv4 echo request

            2.2.
            <<JUDGMENT>>
            <===================
            ICMPv6 Echo Request
                    IPv6 Header
                            src address : TN LINK1 IPv4 embedded IPv6 address
                            dst address : TN LINK0 IPv4 embedded IPv6 address
                            Hop Limit = 63
                    ICMPv6 echo request

            3.1.
                                       <===================
            ICMPv4 Echo request
                    IPv4 Header
                            src address : TN LINK1 IPv4 address
                            dst address : TN LINK0 IPv4 address
                            Don't Fragment = 1
                            More fragments = 0
                            Offset = 0
                            TTL = 2
                    ICMPv4 echo request

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

            4.1.
                                       <===================
            ICMPv4 Echo request
                    IPv4 Header
                            src address : TN LINK1 IPv4 address
                            dst address : TN LINK0 IPv4 address
                            Don't Fragment = 1
                            More fragments = 0
                            Offset = 0
                            TTL = 1
                    ICMPv4 echo request

            4.2.
            <<JUDGMENT>>
                                        ===================>
            ICMPv4 Time Exceeded
                    IPv4 Header
                            src address : NUT LINK1 IPv4 address
                            dst address : TN LINK1 IPv4 address
                    ICMPv4 Time Exceeded
                            Code = 0
                            Data = ICMPv4 Echo Request, TTL = 1

# JUDGMENT

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

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

# NOTE

# REFERENCE

RFC2765

3.1. Translating IPv4 Headers into IPv6 Headers

             Hop Limit:
                     TTL value copied from IPv4 header.  Since the
                     translator is a router, as part of forwarding the
                     packet it needs to decrement either the IPv4 TTL
                     (before the translation) or the IPv6 Hop Limit (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