#!/usr/bin/perl # # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 # Yokogawa Electric Corporation. # All rights reserved. # # Redistribution and use of this software in source and binary # forms, with or without modification, are permitted provided that # the following conditions and disclaimer are agreed and accepted # by the user: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in # the documentation and/or other materials provided with # the distribution. # # 3. Neither the names of the copyrighters, the name of the project # which is related to this software (hereinafter referred to as # "project") nor the names of the contributors may be used to # endorse or promote products derived from this software without # specific prior written permission. # # 4. No merchantable use may be permitted without prior written # notification to the copyrighters. # # 5. The copyrighters, the project and the contributors may prohibit # the use of this software at any time. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHTERS, THE PROJECT AND # CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING # BUT NOT LIMITED THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS # FOR A PARTICULAR PURPOSE, ARE DISCLAIMED. IN NO EVENT SHALL THE # COPYRIGHTERS, THE PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # # $TAHI: ct/nd.p2/v6LC_2_3_17.seq,v 1.4 2008/03/26 05:08:09 akisada Exp $ # ######################################################################## use redirect; BEGIN {} END {} if($V6evalTool::NutDef{'Type'} ne 'router') { exitRouterOnly($Link0); #NOTREACHED } vCapture($Link0); unless(commonSetup_1_2($Link0)) { exitInitFail($Link0); #NOTREACHED } unless(additionalSetup_v6LC_2_3_17($Link0)) { exitInitFail($Link0); #NOTREACHED } $pktdesc{'local_redirect'} = ' Send Redirect w/ TLL w/o Redirected Header: '. 'TR1 (link-local) -> RUT (global)'; unless(v6LC_2_3_17($Link0, $Link1)) { exitFail($Link0); #NOTREACHED } exitPass($Link0); #NOTREACHED # # perldoc # ######################################################################## __END__ =head1 NAME =begin html
v6LC_2_3_17 - Redirect - Receive =end html =begin html
=end html =head1 TARGET =begin html
Router
=end html =head1 TOPOLOGY =begin html
                   TN2
                    |
----+-------+-------+--- LinkY
    |       |
   TR1     TR2
    |       |
----+-------+-------+--- Link0
                    |
                   RUT
                    |

Link0 global 3ffe:501:ffff:100::/64
link-local fe80::/64
LinkY global 3ffe:501:ffff::/64
link-local fe80::/64
TR1 global 3ffe:501:ffff:100:200:ff:fe00:a0a0
link-local fe80::200:ff:fe00:a0a0
ether 00:00:00:00:a0:a0
TR2 global 3ffe:501:ffff:100:200:ff:fe00:a1a1
link-local fe80::200:ff:fe00:a1a1
ether 00:00:00:00:a1:a1
RUT global 3ffe:501:ffff:100::<NutDef.Link0_addr>
link-local fe80::<NutDef.Link0_addr>
ether <NutDef.Link0_addr>
TN2 global 3ffe:501:ffff::<TnDef.Link0_addr>
link-local fe80::<TnDef.Link0_addr>
ether <TnDef.Link0_addr>

=end html =head1 SETUP =begin html
This minimal setup procedure provides the NUT with two default routers TR1 and TR2, a global prefix, and ensures that the NUT can communicate with TR1 and TR2. Configure the RUT with a static route to TN2's Link B prefix through TR1.
   TR1     TR2     RUT
    |       |       |
    | ------------> | Echo Request
    |       |   <-- | NS
    | ------------> | NA
    | <------------ | Echo Reply
    |       |       |
    |       | ----> | Echo Request
    |       |   <-- | NS
    |       | ----> | NA
    |       | <---- | Echo Reply
    |       |       |
    V       V       V

1. Send Echo Request
        IPv6 header
            source      = TR1 (link-local)
            destination = RUT (link-local)
        Echo Request
2. Observe NS
        IPv6 header
            hop limit   = 255
            source      = RUT (link-local)
            destination = TR1 (solicited-node multicast address)
        NS
            target      = TR1 (link-local)
        SLL option
3. Send NA
        IPv6 header
            hop limit   = 255
            source      = TR1 (link-local)
            destination = RUT (link-local)
        NA
            R           = 1
            S           = 1
            O           = 1
            target      = TR1 (link-local)
        TLL option
4. Observe Echo Reply
        IPv6 header
            source      = RUT (link-local)
            destination = TR1 (link-local)
        Echo Reply
5. Send Echo Request
        IPv6 header
            source      = TR2 (link-local)
            destination = RUT (link-local)
        Echo Request
6. Observe NS
        IPv6 header
            hop limit   = 255
            source      = RUT (link-local)
            destination = TR2 (solicited-node multicast address)
        NS
            target      = TR2 (link-local)
        SLL option
7. Send NA
        IPv6 header
            hop limit   = 255
            source      = TR2 (link-local)
            destination = RUT (link-local)
        NA
            R           = 1
            S           = 1
            O           = 1
            target      = TR2 (link-local)
        TLL option
8. Observe Echo Reply
        IPv6 header
            source      = RUT (link-local)
            destination = TR2 (link-local)
        Echo Reply
=end html =head1 TEST PROCEDURE =begin html
Verify that a router properly handles reception of Redirect messages.
   TN2     TR1     TR2     RUT
    |       |       |       |
    | ------+-------------> | Echo Request (via TR1)
    | <-----+-------------- | Echo Reply   (via TR1) [Judgment #1]
    |       |       |       |
    |       | ------------> | Redirect
    |       |       |       |
    | ------+-------------> | Echo Request (via TR1)
    | <-----+-------------- | Echo Reply   (via TR1) [Judgment #2]
    |       |       |       |
    V       V       V       V

1. Send Echo Request (via TR1)
        IPv6 header
            source      = TN2 (global)
            destination = RUT (global)
        Echo Request
2. Observe Echo Reply (via TR1)
        IPv6 header
            source      = RUT (global)
            destination = TN2 (global)
        Echo Reply
3. Send Redirect
        IPv6 header
            source      = TR1 (link-local)
            destination = RUT (global)
        Redirect
            target      = TR2 (link-local)
            destination = TN2 (global)
        TLL option
4. Send Echo Request (via TR1)
        IPv6 header
            source      = TN2 (global)
            destination = RUT (global)
        Echo Request
5. Observe Echo Reply (via TR1)
        IPv6 header
            source      = RUT (global)
            destination = TN2 (global)
        Echo Reply
=end html =head1 JUDGEMENT =begin html
[Judgment #1] The RUT should send an Echo Reply with a first hop through TR1.
[Judgment #2] The RUT should still send an Echo Reply with a first hop through TR1, indicating the RUT did not change its routing table with information from TR1's Redirect message.
=end html =head1 CLEANUP =begin html
The Cleanup procedure should cause the NUT to transition Neighbor Cache entries created in this test to state INCOMPLETE and remove any entries from its Default Router and Prefix Lists.
   TR1     TR2     RUT
    |       |       |
    |       | -->   | NA
    |       |       |
    |       | ----> | Echo Request
    |       | <---- | Echo Reply
    |       |       |
    |       *       | Wait (DELAY_FIRST_PROBE_TIME)
    |       |       |
    |       | <---- | NS
    |       | <---- | NS
    |       | <---- | NS
    |       |       |
    | -->   |       | NA
    |       |       |
    | ------------> | Echo Request
    | <------------ | Echo Reply
    |       |       |
    *       |       | Wait (DELAY_FIRST_PROBE_TIME)
    |       |       |
    | <------------ | NS
    | <------------ | NS
    | <------------ | NS
    |       |       |
    V       V       V

1. Send NA w/ TLL (diff)
        IPv6 header
            hop limit   = 255
            source      = TR2 (link-local)
            destination = all-nodes multicast address
        NA
            R           = 1
            S           = 0
            O           = 1
            target      = TR1 (link-local)
        TLL option
            address     = TRX (ether)
2. Send Echo Request
        IPv6 header
            source      = TR2 (link-local)
            destination = RUT (link-local)
        Echo Request
3. Observe Echo Reply
        IPv6 header
            source      = RUT (link-local)
            destination = TR2 (link-local)
        Echo Reply
4. Wait (DELAY_FIRST_PROBE_TIME)
        Node constants:
            DELAY_FIRST_PROBE_TIME: 5 seconds
5. Observe MAX_UNICAST_SOLICIT NSs
        IPv6 header
            hop limit   = 255
            source      = RUT (link-local)
            destination = TR2 (link-local)
        NS
            target      = TR2 (link-local)
        SLL option
        Node constants:
            MAX_UNICAST_SOLICIT: 3 transmissions
6. Send NA w/ TLL (diff)
        IPv6 header
            hop limit   = 255
            source      = TR1 (link-local)
            destination = all-nodes multicast address
        NA
            R           = 1
            S           = 0
            O           = 1
            target      = TR1 (link-local)
        TLL option
            address     = TRX (ether)
7. Send Echo Request
        IPv6 header
            source      = TR1 (link-local)
            destination = RUT (link-local)
        Echo Request
8. Observe Echo Reply
        IPv6 header
            source      = RUT (link-local)
            destination = TR1 (link-local)
        Echo Reply
9. Wait (DELAY_FIRST_PROBE_TIME)
        Node constants:
            DELAY_FIRST_PROBE_TIME: 5 seconds
10. Observe MAX_UNICAST_SOLICIT NSs
        IPv6 header
            hop limit   = 255
            source      = RUT (link-local)
            destination = TR1 (link-local)
        NS
            target      = TR1 (link-local)
        SLL option
        Node constants:
            MAX_UNICAST_SOLICIT: 3 transmissions
=end html =cut # =head1 REFERENCE # # =begin html #
#
# 8.2.  Router Specification
# 
#
#    A router SHOULD send a redirect message, subject to rate limiting,
#    whenever it forwards a packet that is not explicitly addressed to
#    itself (i.e. a packet that is not source routed through the router)
#    in which:
# 
#
#       - the Source Address field of the packet identifies a neighbor,
#         and
# 
#
#       - the router determines that a better first-hop node resides on
#         the same link as the sending node for the Destination Address of
#         the packet being forwarded, and
# 
#
#       - the Destination Address of the packet is not a multicast
#         address, and
# 
#
#    The transmitted redirect packet contains, consistent with the message
#    format given in Section 4.5:
# 
#
#       - In the Target Address field: the address to which subsequent
#         packets for the destination SHOULD be sent.  If the target is a
#         router, that router's link-local address MUST be used.  If the
#         target is a host the target address field MUST be set to the
#         same value as the Destination Address field.
# 
#
#       - In the Destination Address field: the destination address of the
#         invoking IP packet.
# 
#
#       - In the options:
# 
#
#            o Target Link-Layer Address option: link-layer address of the
#              target, if known.
# 
#
#            o Redirected Header: as much of the forwarded packet as can
#              fit without the redirect packet exceeding 1280 octets in
#              size.
# 
#
#    A router MUST limit the rate at which Redirect messages are sent, in
#    order to limit the bandwidth and processing costs incurred by the
#    Redirect messages when the source does not correctly respond to the
#    Redirects, or the source chooses to ignore unauthenticated Redirect
#    messages.  More details on the rate-limiting of ICMP error messages
#    can be found in [ICMPv6].
# 
#
#    A router MUST NOT update its routing tables upon receipt of a
#    Redirect.
# 
#
# # =end html # =pod =head1 REFERENCE =begin html
RFC 2461 - Neighbor Discovery for IPv6
=end html =cut