# NAME

hostRecvRaRFlag - Verifying that a RA sets a IsRouter flag true

# TARGET

Host only

# SYNOPSIS

      hostRecvRaRFlag.seq [-tooloption ...] -p hostRecvRaRFlag.def

# INITIALIZATION

1. Create an neighbor cache entry for TN where a IsRouter flag is FALSE.
2. Set its state to REACHABLE.
3. Cache either TN's LLA or a bogus LLA.

## Cache a LLA of TN

      TN                 NUT
      ----------------------
      State: NONCE (for TN)

      ==== echo-request ===>
            src=TN's link-local
            dst=NUT's link-local

      State: INCOMPLETE (for TN)

      <=== multicast NS ====
            src:NUT's link-local
            dst:solicited-node[TN's link-local]
            target=TN's link-local
            SLLA=NUT's LLA
            timeout: RETRANS_TIMER * MAX_MULTICAST_SOLICIT

      ==== solicited NA ===>
            src:TN's link
            dst:NUT's link-local
            R=0, S=1, O=1
            target=TN's link-local
            TLLA=TN's LLA

      State: REACHABLE (for TN)

## Cache a bogus LLA

      TN                 NUT
      ----------------------
      State: NONCE (for TN)

      ==== echo-request ===>
            src=TN's link-local
            dst=NUT's link-local

      State: INCOMPLETE (for TN)

      <=== multicast NS ====
            src:NUT's link-local
            dst:solicited-node[TN's link-local]
            target=TN's link-local
            SLLA=NUT's LLA
            timeout: RETRANS_TIMER * MAX_MULTICAST_SOLICIT

      ==== solicited NA ===>
            src:TN's link
            dst:NUT's link-local
            R=0, S=1, O=1
            target=TN's link-local
            TLLA=a bogus LLA (0:0:0:0:a9:a9)

      State: REACHABLE (for TN)

# TEST PROCEDURE

hostRecvRaRFlag verifies that a RA sets a IsRouter flag true.

      TN                 NUT
      ----------------------

      State: REACHABLE (for TN), NONCE(for X)

      ==== unsolicited RA ===>
           src=X's link-local
           dst=all-node
           M=0, O=0
           RouterLifetime=10
           ReachableTime=0
           RetransTimer=0
           w/ SLLA
           Prefix Option:
               L=1, A=1
               ValidLifetime=2592000
               PreferredLifetime=604800
               Prefix=3ffe:501:ffff:100::/64

      State: REACHABLE (for TN), STALE(for X)

      ==== solicited NA ===>
            src:X's link
            dst:NUT's link-local
            R=1, S=1, O=1
            target=X's link-local
            w/ TLLA

      Wait for 2 sec to ignore DAD NS

      State: REACHABLE (for TN, X)

      ==== echo-request ===>
           src=off-link global, but LLA is X's one
           dst=NUT's global

      <=== Judgment #1: echo-reply ====
           src=NUT's global
           dst=off-link global, but LLA is X's one

      ==== unsolicited RA ===>
           src=TN's link-local
           dst=all-node
           M=0, O=0
           RouterLifetime=600
           ReachableTime=0
           RetransTimer=0
           w/ or w/o SLLA
           Prefix Option:
               L=1, A=1
               ValidLifetime=2592000
               PreferredLifetime=604800
               Prefix=3ffe:501:ffff:100::/64

      State: REACHABLE/STALE (for TN), REACHABLE (for X)

      Wait (10 sec) for X's router lifetime to be expired

      ==== echo-request ===>
           src=off-link global, but LLA is TN's one
           dst=NUT's global

      <=== Judgment #3: echo-reply ====
           src=NUT's global
           dst=off-link global, but LLA is TN's one

      State: REACHABLE/DELAY (for TN), REACHABLE (for X)

# JUDGMENT

      1. NUT throw an echo-reply to the default router (i.e. X).

      2. RA set IsRouter flag.

    6.3.4.  Processing Received Router Advertisements

       After extracting information from the fixed part of the Router
       Advertisement message, the advertisement is scanned for valid
       options.  If the advertisement contains a Source Link-Layer Address
       option the link-layer address SHOULD be recorded in the Neighbor
       Cache entry for the router (creating an entry if necessary) and the
       IsRouter flag in the Neighbor Cache entry MUST be set to TRUE.
       If no Source Link-Layer Address is included, but a corresponding Neighbor
       Cache entry exists, its IsRouter flag MUST be set to TRUE.  The
       IsRouter flag is used by Neighbor Unreachability Detection to
       determine when a router changes to being a host (i.e., no longer
       capable of forwarding packets).  If a Neighbor Cache entry is created
       for the router its reachability state MUST be set to STALE as
       specified in Section 7.3.3.  If a cache entry already exists and is
       updated with a different link-layer address the reachability state
       MUST also be set to STALE.

      ============+===========+===============================
      RA received by the NUT  | NUT's Neighbor Cache State
      ------------+-----------+---------+---------------------
      Destination | SLLA      | Current | New
      ============+===========+=========+=====================
      all-node    | none      | 0       | 1
      ------------+-----------+---------+---------------------
      all-node    | same      | 0       | 1
      ------------+-----------+---------+---------------------
      all-node    | different | 0       | 1
      ============+===========+=========+=====================

      3. NUT throw an echo-reply to NUT instead of X.

# TERMINATION

      Send the following RAs to clear the Default Router List:
      - RA (src: TN) with RouterLifetime=0
      - RA (src: X)  with RouterLifetime=0

# NOTE

      The test does not invoke any remote command.

# SEE ALSO

      perldoc V6evalTool
      perldoc V6evalRemote