#!/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_2_10_I.seq,v 1.2 2006/04/28 11:27:54 akisada Exp $ # ######################################################################## use rdisc; BEGIN {} END {} if($V6evalTool::NutDef{'Type'} ne 'router') { exitRouterOnly($Link0); #NOTREACHED } vCapture($Link0); $pktdesc{'rs_local'} = ' Send RS w/ SLL: '. 'TN1 (link-local) -> all-routers multicast address'; unless(v6LC_2_2_10_I($Link0)) { exitFail($Link0); #NOTREACHED } exitPass($Link0); #NOTREACHED # # perldoc # ######################################################################## __END__ =head1 NAME =begin html
v6LC_2_2_10_I - Router Solicitation Processing, Neighbor Cache (RA with SLLA unchanged, NCE PROBE) =end html =begin html
=end html =head1 TARGET =begin html
Router
=end html =head1 TOPOLOGY =begin html
            |
   TN1     RUT
    |       |
----+-------+--- Link0

Link0 global 3ffe:501:ffff:100::/64
link-local fe80::/64
RUT global 3ffe:501:ffff:100::<NutDef.Link0_addr>
link-local fe80::<NutDef.Link0_addr>
ether <NutDef.Link0_addr>
TN1 global 3ffe:501:ffff:100::<TnDef.Link0_addr>
link-local fe80::<TnDef.Link0_addr>
ether <TnDef.Link0_addr>

=end html =head1 SETUP =begin html
none
=end html =head1 TEST PROCEDURE =begin html
- Verify that a router correctly processes Router Solicitations and transmits Router Advertisements.
   TN1     RUT
    |       |
    |       * Configure Interface A on the RUT to be an advertising interface.
    |       |
    |   <-- | RA (multicast)
    |   <-- | RA (multicast)
    |   <-- | RA (multicast)
    |       |
    | -->   | RS (multicast)
    |   <-- | RA (multicast) [Judgment #1]
    |       |
    |       * Wait (MIN_DELAY_BETWEEN_RAS)
    |       |
    | -->   | RS (multicast)
    |   <-- | RA (multicast) [Judgment #1]
    |       |
    V       V

1. Configure Interface A on the RUT to be an advertising interface.
2. Observe RA
        RA message format #1
            IPv6 header
                hop limit          = 255
                source             = RUT (link-local)
                destination        = all-nodes multicast address
            RA
                cur hop limit      = 64
                M                  = 0
                O                  = 0
                router lifetime    = 1800
                reachable time     = 0
                retrans timer      = 0
            SLL option
            Prefix Information option
                prefix length      = 64
                L                  = 1
                A                  = 1
                valid Lifetime     = 2592000
                preferred lifetime = 604800
                prefix             = 3ffe:501:ffff:100::
        RA message format #2
            IPv6 header
                hop limit          = 255
                source             = RUT (link-local)
                destination        = all-nodes multicast address
            RA
                cur hop limit      = 64
                M                  = 0
                O                  = 0
                router lifetime    = 1800
                reachable time     = 0
                retrans timer      = 0
            Prefix Information option
                prefix length      = 64
                L                  = 1
                A                  = 1
                valid Lifetime     = 2592000
                preferred lifetime = 604800
                prefix             = 3ffe:501:ffff:100::
3. Send RS
        IPv6 header
            hop limit   = 255
            source      = unspecified address
            destination = all-routers multicast address
        RS
4. Observe RA
        RA message format #1
            IPv6 header
                hop limit          = 255
                source             = RUT (link-local)
                destination        = all-nodes multicast address
            RA
                cur hop limit      = 64
                M                  = 0
                O                  = 0
                router lifetime    = 1800
                reachable time     = 0
                retrans timer      = 0
            SLL option
            Prefix Information option
                prefix length      = 64
                L                  = 1
                A                  = 1
                valid Lifetime     = 2592000
                preferred lifetime = 604800
                prefix             = 3ffe:501:ffff:100::
        RA message format #2
            IPv6 header
                hop limit          = 255
                source             = RUT (link-local)
                destination        = all-nodes multicast address
            RA
                cur hop limit      = 64
                M                  = 0
                O                  = 0
                router lifetime    = 1800
                reachable time     = 0
                retrans timer      = 0
            Prefix Information option
                prefix length      = 64
                L                  = 1
                A                  = 1
                valid Lifetime     = 2592000
                preferred lifetime = 604800
                prefix             = 3ffe:501:ffff:100::
5. Wait (MIN_DELAY_BETWEEN_RAS)
        Router constants:
            MIN_DELAY_BETWEEN_RAS: 3 seconds
6. Send RS
        IPv6 header
            hop limit   = 255
            source      = unspecified address
            destination = all-routers multicast address
        RS
7. Observe RA
        RA message format #1
            IPv6 header
                hop limit          = 255
                source             = RUT (link-local)
                destination        = all-nodes multicast address
            RA
                cur hop limit      = 64
                M                  = 0
                O                  = 0
                router lifetime    = 1800
                reachable time     = 0
                retrans timer      = 0
            SLL option
            Prefix Information option
                prefix length      = 64
                L                  = 1
                A                  = 1
                valid Lifetime     = 2592000
                preferred lifetime = 604800
                prefix             = 3ffe:501:ffff:100::
        RA message format #2
            IPv6 header
                hop limit          = 255
                source             = RUT (link-local)
                destination        = all-nodes multicast address
            RA
                cur hop limit      = 64
                M                  = 0
                O                  = 0
                router lifetime    = 1800
                reachable time     = 0
                retrans timer      = 0
            Prefix Information option
                prefix length      = 64
                L                  = 1
                A                  = 1
                valid Lifetime     = 2592000
                preferred lifetime = 604800
                prefix             = 3ffe:501:ffff:100::
=end html =head1 JUDGEMENT =begin html
[Judgment #1] The RUT MUST transmit a Router Advertisement between 0 and MAX_RA_DELAY_TIME (0.5) seconds after the receipt of each Router Solicitation A.
=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.
   TN1     RUT
    |       |
    |       * Ceasing to be an advertising interface
    |       |
    |   <-- | RA (multicast)
    |   <-- | RA (multicast)
    |   <-- | RA (multicast)
    |       |
    V       V

1. Ceasing to be an advertising interface
2. Observe RA
        RA message format #1
            IPv6 header
                hop limit          = 255
                source             = RUT (link-local)
                destination        = all-nodes multicast address
            RA
                cur hop limit      = 64
                M                  = 0
                O                  = 0
                router lifetime    = 0
                reachable time     = 0
                retrans timer      = 0
            SLL option
            Prefix Information option
                prefix length      = 64
                L                  = 1
                A                  = 1
                valid Lifetime     = 2592000
                preferred lifetime = 604800
                prefix             = 3ffe:501:ffff:100::
        RA message format #2
            IPv6 header
                hop limit          = 255
                source             = RUT (link-local)
                destination        = all-nodes multicast address
            RA
                cur hop limit      = 64
                M                  = 0
                O                  = 0
                router lifetime    = 0
                reachable time     = 0
                retrans timer      = 0
            Prefix Information option
                prefix length      = 64
                L                  = 1
                A                  = 1
                valid Lifetime     = 2592000
                preferred lifetime = 604800
                prefix             = 3ffe:501:ffff:100::
=end html =cut # =head1 REFERENCE # # =begin html #
#
# 6.2.6.  Processing Router Solicitations
# 
#
#    A host MUST silently discard any received Router Solicitation
#    messages.
# 
#
#    In addition to sending periodic, unsolicited advertisements, a router
#    sends advertisements in response to valid solicitations received on
#    an advertising interface.  A router MAY choose to unicast the
#    response directly to the soliciting host's address (if the
#    solicitation's source address is not the unspecified address), but
#    the usual case is to multicast the response to the all-nodes group.
#    In the latter case, the interface's interval timer is reset to a new
#    random value, as if an unsolicited advertisement had just been sent
#    (see Section 6.2.4).
# 
#
#    In all cases, Router Advertisements sent in response to a Router
#    Solicitation MUST be delayed by a random time between 0 and
#    MAX_RA_DELAY_TIME seconds. (If a single advertisement is sent in
#    response to multiple solicitations, the delay is relative to the
#    first solicitation.)  In addition, consecutive Router Advertisements
#    sent to the all-nodes multicast address MUST be rate limited to no
#    more than one advertisement every MIN_DELAY_BETWEEN_RAS seconds.
# 
#
#    A router might process Router Solicitations as follows:
# 
#
#     - Upon receipt of a Router Solicitation, compute a random delay
#       within the range 0 through MAX_RA_DELAY_TIME.  If the computed
#       value corresponds to a time later than the time the next multicast
#       Router Advertisement is scheduled to be sent, ignore the random
#       delay and send the advertisement at the already-scheduled time.
# 
#
#     - If the router sent a multicast Router Advertisement (solicited or
#       unsolicited) within the last MIN_DELAY_BETWEEN_RAS seconds,
#       schedule the advertisement to be sent at a time corresponding to
#       MIN_DELAY_BETWEEN_RAS plus the random value after the previous
#       advertisement was sent.  This ensures that the multicast Router
#       Advertisements are rate limited.
# 
#
#     - Otherwise, schedule the sending of a Router Advertisement at the
#       time given by the random value.
# 
#
#    Note that a router is permitted to send multicast Router
#    Advertisements more frequently than indicated by the
#    MinRtrAdvInterval configuration variable so long as the more frequent
#    advertisements are responses to Router Solicitations.  In all cases,
#    however, unsolicited multicast advertisements MUST NOT be sent more
#    frequently than indicated by MinRtrAdvInterval.
# 
#
#    Router Solicitations in which the Source Address is the unspecified
#    address MUST NOT update the router's Neighbor Cache; solicitations
#    with a proper source address update the Neighbor Cache as follows. If
#    the router already has a Neighbor Cache entry for the solicitation's
#    sender, the solicitation contains a Source Link-Layer Address option,
#    and the received link-layer address differs from that already in the
#    cache, the link-layer address SHOULD be updated in the appropriate
#    Neighbor Cache entry, and its reachability state MUST also be set to
#    STALE.  If there is no existing Neighbor Cache entry for the
#    solicitation's sender, the router creates one, installs the link-
#    layer address and sets its reachability state to STALE as specified
#    in Section 7.3.3.  Whether or not a Source Link-Layer Address option
#    is provided, if a Neighbor Cache entry for the solicitation's sender
#    exists (or is created) the entry's IsRouter flag MUST be set to
#    FALSE.
# 
#
# # =end html # =pod =head1 REFERENCE =begin html
RFC 2461 - Neighbor Discovery for IPv6
=end html =cut