[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[dna] Pseudocode for Simple DNA (Providing text to resolve issue #10)



Hi Folks,

   I propose to add the following text to a new section called
"Pseudocode for Simple DNA" to resolve issue #10. The pseudocode is 
written in an imaginary language and any resemblance to real programming 
languages is unintentional.


6.  Pseudocode for Simple DNA

        /* Link up indication received on INTERFACE */
        /* Start Simple DNA process */

        /* Mark All Addresses as deprecated */
        Configured_Address_List=Get_Address_List(INTERFACE);
        foreach Configured_Address in Configured_Address_List
        {
          if (Get_Address_State(Configured_Address)!=AS_TENTATIVE)
          {
            Set_Address_State(Configured_Address,AS_DEPRECATED);
          }
        }

        /* Mark all routers' NC entries as STALE to speed up */
        /* acquisition of new router if link change has occurred */
        foreach Router_Address in DEFAULT_ROUTER_LIST
        {
          NCEntry=Get_Neighbor_Cache_Entry(Router_Address);
          Set_Neighbor_Cache_Entry_State(NCEntry,NCS_STALE);
        }

        /* Thread A : Send Router Solicitation */
        RS_Target_Address=FF02::2;
        RS_Source_Address=Get_Any_Link_Local_Address(INTERFACE);
        Send_Router_Solicitation(RS_Source_Address,RS_Target_Address);

        /* Thread B : Send Neighbor Solicitation(s) */
        Previously_Known_Router_List=Get_Router_List_from_SDAT();
        NS_Source_Address=Get_Any_Link_Local_Address(INTERFACE);

        foreach Router_Address in Previously_Known_Router_List
        {
          if (Get_Any_Valid_Address_from_SDAT(Router_Address))
          {
            Send_Neighbor_Solicitation(NS_Source_Address,Router_Address);
          }
        }

        /* Thread C : Response collection */

        /* Received Router Advertisement processing */
        /* Only for RAs received as response to DNA RSs */

        L3_Source=Get_L3_Source(RECEIVED_MESSAGE);
        L2_Source=Get_L2_Source(RECEIVED_MESSAGE);
        SDAT_Entry_List=Get_Entries_from_SDAT_L2L3(L3_Source,L2_Source));
        foreach SDAT_Entry in SDAT_Entry_List
        {
          if (Exists_PIO(RECEIVED_MESSAGE,Get_Prefix(SDAT_Entry)))
          {
            /* Address is operable. Configure on Interface */
            /* Rejoin solicited-node multicast group for address */
          }
          else
          {
            /* If address is configured on interface, remove it */
            /* This could be because of a NA arriving before RA */
          }
        }

        /* Mark router as reachable */
        NCEntry=Get_Neighbor_Cache_Entry(L3_Source);
        if (NCEntry is not NULL)
        {
          Set_Neighbor_Cache_Entry_State(NCEntry,NCS_REACHABLE);
        }
        else
        {
          Create_Neighbor_Cache_Entry(L3_Source,NCS_REACHABLE);
        }

        /* Ignore further NAs from this router */
        Add_Router_to_NA_Ignore_List(L3_Source);


        /* Received Neighbor Advertisement processing */
        /* Only for NAs received as response to DNA NSs */

        L3_Source=Get_L3_Source(RECEIVED_MESSAGE);
        L2_Source=Get_L2_Source(RECEIVED_MESSAGE);

        if (Is_Router_on_NA_Ignore_List(L3_Source)) {
          /* Ignore message and wait for next message */
          continue;
        }

        SDAT_Entry_List=Get_Entries_from_SDAT_L2L3(L3_Source,L2_Source));

        foreach SDAT_Entry in SDAT_Entry_List
        {
            /* Address is operable. Configure on Interface */
        }


If you have any issues with this text, please respond to this mail on list.

Thanks
Suresh


_______________________________________________
dna mailing list
dna@ietf.org
https://www.ietf.org/mailman/listinfo/dna