This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTOS/TDA2EXEVM: Asssigning Specific IPv6 address to TDA2ex

Part Number: TDA2EXEVM


Tool/software: TI-RTOS

Hello All,

I have enabled the IPv6 configurations as suggested in below post :

https://e2e.ti.com/support/arm/automotive_processors/f/1021/t/673201?tisearch=e2e-sitesearch&keymatch=retrieve%20IPV6

After this i can see TDA2ex will have one specific local link IPv6 address calculated from its MAC address.

Is there any way to assign specific IPV6 address to TDA2ex instead of local link address?

Thanks for any suggestions.

Thanks,

Kapil Mehta 

  • Hi Kapil,

    Your thread has been assigned to an engineer. You should be getting a response today. In the meantime, can you confirm what version of the NDK you are using.

    Thanks,
    Todd
  • Hello Todd,

    Thanks for your response.

    I am using ndk_2_24_02_31.
  • Hi Kapil,

    Take a look at the src/ti/ndk/tools/console/conipv6.c file in the NDK. It has a function called CmdIpv6AddAddress() that is used in a telnet console to add an ipv6 address.

    Regards,
    Dalton
  • Hello Dalton,

    I would like to run the console application to understand all the arguments passed to CmdIpv6AddAddress function.

    Could you please tell the steps to be followed for compiling and running it stand alone console application.

    Thanks ,

    Kapil Mehta 

  • Hello Dalton,

    Now i am able to add IPv6 address to TDA2ex , i can ping it also.

    Now since TDA2ex will hold two IPv6 address , one local link address and another what we assign through IPV6addaddress, Is there any function to select which IPv6 address should be used for further communication.

    Because i do sendto from TDA2ex i can see it is still using local link address , and i want to use another address assigned by IPV6addaddress function.

    Thanks for any insights.
  • Hi Kapil,

    Where is the device you are trying to communicate with the TDA2ex? Specifically, is that device on the same LAN as the TDA2ex?

    Regards,

    Dalton

  • Hello Dalton,

    I saw IPv6DelAddress function , but function banner says this function should not be used to delete local link address , Please suggest a way to disable local link or i can select the other address for my socket communication from tda2ex.

    Thanks for your help.
  • Hi Kapil,

    RFC 4291 section 2.1 ( tools.ietf.org/.../rfc4291 ) requires all IPv6 devices to have a link local address, so we cannot delete/disable this address.

    Are you setting up a server socket on the tda2ex? If so, you can try binding to whatever IPv6 address you prefer.

    Regards,
    Dalton

  • Hello Dalton,

    No, I believe It is not on the same LAN.

    But anyway i think in my case TDA2ex is being client and server is expecting data coming from IPv6 address not any local link address. and that is the reason it is not responding back.

    Thanks,
    Kapil Mehta
  • Hello Dalton,

    As i mentioned in above comment , TDA2ex is client here and server is expecting data coming from IPv6 address and not local link address.
  • Hi Kapil,

    Did you add telnet to your app to test the CmdIpv6AddAddress()? If so, could you connect to telnet and run "ipv6 route" and report back what the output is. Below is an example output of the command:

    >ipv6 route
    -------------------------------------------------
    Interface Name : eth0
    Network Address : fe80::
    Next Hop Address : ::
    Route Type : CLONING
    Timeout : Infinite
    -------------------------------------------------
    Interface Name : eth0
    Network Address : fe80::72ff:76ff:fe1c:5b07
    Next Hop Address : fe80::72ff:76ff:fe1c:5b07
    Route Type : LOCAL
    Timeout : Infinite
    -------------------------------------------------
    Interface Name : eth0
    Network Address : ::1
    Next Hop Address : ::1
    Route Type : LOCAL
    Timeout : Infinite
    -------------------------------------------------
    >

    Regards,
    Dalton
  • Hello Dalton ,

    I added ,

    IPv6StringToIPAddress ("fd53:7cb8:383:2::1:50", &IPAddress);
    IPv6AddAddress(1,IPAddress,NumBits,0xFFFFFFFF,0xFFFFFFFF,0);

    where NumBits is 64 inside IPv6DADStatus function which is passed as an argument to

    IPv6InterfaceInit(dev_index, IPv6DADStatus) function. // dev_index is 1 here

    I actually didn't integrated/used telnet application, i went through it and found IPv6AddAddress is the function by which we can add new IPv6 interface /IP on specific dev_index.

    After this i can ping to fd53:7cb8:383:2::1:50 address from my PC to TDA2ex.

    Is this necessary to add telnet app for further any logs ?

    Thanks,

    Kapil Mehta

  • Hi Dalton,

    I am actually using VSDK 3.1 .

    By looking at telnet application , it seems its standalone application , I think to use it i need to integrate it in VSDK , could you please list the steps to be followed for the same. Please correct me if i am wrong. 

  • Hi Kapil,

    I will still need some information from telnet to help diagnose the problem, but don't worry it's pretty easy to add to your project (no problem with VSDK). To add the telnet console to your project add the following lines to your *.cfg file:

    var Telnet = xdc.useModule('ti.ndk.config.Telnet');
    var telnetParams = new Telnet.Params();
    telnetParams.callBackFxn = '&ConsoleOpen';
    var telnet = Telnet.create(telnetParams);

    Now recompile your project and connect to the telnet console. Once connected I will need you to run the following commands:

    1. ipv6 route
    2. ping6 (your PC's IPv6 addr)
    3. ping6 (your server's IPv6 addr)

    For the #2 and #3 can you also take a wireshark capture when you are doing them? Please upload the wireshark captures along with the outputs for the commands.

    Regards,

    Dalton

  • Hi Dalton,

    Ok , One doubt i have after adding this when i compile VSDK , how will i connect telnet console because in VSDK we have one application which by default runs and we have one menu to execute different use-case inside VSDK.

    I have started compilation now , and i will see if i get any more options in default menu to execute telnet console..

    Please share your inputs.
  • Hello Kapil,

    From command/bash prompt, use command "telnet ip_address" to telnet to board.

    If you do "help", you would get all possible commands which can be run on the client.

  • Hello Prasad,

    From command/bash prompt, use command "telnet ip_address" to telnet to board.

    Are you asking me to run this command from PC ? Or serial console from TDA2ex ? because from TDA2ex serial console , i believe it accepts only characters for running use case. I am not sure does it make sense to run it from PC ?
  • Yes, from PC command prompt. You will need to install telnet if not installed earlier.

    >>I am not sure does it make sense to run it from PC ?

    Why do you think so? We are running telnet for getting some information regarding IPv6 routing which Dalton needs. 

  • Hello Prasad / Dalton,

    I could manage yo run Putty and connect to telnet server from PC. I added IP address of IPv4 TDA2ex i.e. 192.168.1.100.

    **** Vision SDK ****

    Welcome connection : 192.168.1.17:61169
    Welcome to the console program.
    Enter '?' or 'help' for a list of commands.

    >ipv6 route
    -------------------------------------------------
    Interface Name : eth0
    Network Address : fe80::
    Next Hop Address : ::
    Route Type : CLONING
    Timeout : Infinite
    -------------------------------------------------
    Interface Name : eth0
    Network Address : fe80::c6f3:12ff:feb6:566c
    Next Hop Address : fe80::c6f3:12ff:feb6:566c
    Route Type : LOCAL
    Timeout : Infinite
    -------------------------------------------------
    Interface Name : eth0
    Network Address : ::1
    Next Hop Address : ::1
    Route Type : LOCAL
    Timeout : Infinite
    -------------------------------------------------
    Interface Name : eth0
    Network Address : fd53:7cb8:383:2::
    Next Hop Address : ::
    Route Type : CLONING
    Timeout : Infinite
    -------------------------------------------------
    Interface Name : eth0
    Network Address : fd53:7cb8:383:2::1:50
    Next Hop Address : fd53:7cb8:383:2::1:50
    Route Type : LOCAL
    Timeout : Infinite
    -------------------------------------------------
    Interface Name : eth0
    Network Address : fd53:7cb8:383:2::1:16a
    Next Hop Address : fd53:7cb8:383:2::1:16a
    Route Type : HOST
    Timeout : Infinite
    -------------------------------------------------
    Interface Name : eth0
    Network Address : fd53:7cb8:383:2::1:16b
    Next Hop Address : fd53:7cb8:383:2::1:16b
    Route Type : HOST
    Timeout : Infinite
    -------------------------------------------------
    Interface Name : eth0
    Network Address : fd53:7cb8:383:2::1:16c
    Next Hop Address : fd53:7cb8:383:2::1:16c
    Route Type : HOST
    Timeout : Infinite
    -------------------------------------------------
    Interface Name : eth0
    Network Address : fd53:7cb8:383:2::1:16d
    Next Hop Address : fd53:7cb8:383:2::1:16d
    Route Type : HOST
    Timeout : Infinite
    -------------------------------------------------


    Above is the output from ipv6 route command.

    My PC IPv6 address is : fd53:7cb8:383:2::1:52
    TDA2ex IPv4 address is : 192.168.1.100
    TDA2ex IPv6 address is : fd53:7cb8:383:2::1:50 added by IPv6AddAddress function and local link address is fe80::c6f3:12ff:feb6:566c.
    and server where i am sending data to from TDA2ex is : ff14::1:a .

    I am also attaching wireshark capture from ping6 My PC and ping6 My server.

    What i found is i am able to ping to my PC address with response but i am not able to ping to my server address from Putty .

    Thanks for your help.

  • Ok , I binded my socket to specific IP address other than local link address (fd53:7cb8:383:2::1:50) , And it is working now.

    What i observed is when i was sending data to ff14::1:a it was using local link address so i thought of binding it to specific IP address which server is expecting.

    Thanks for your help..
  • Hello Kapil,

    Happy to hear that it is working now. Does that cover everything you needed help with?

    Regards,

    Dalton

  • Hello Dalton,

    Yes , it covers everything.

    Thanks,
    Kapil Mehta
  • Hi Kapil,

    Great that you resolved your issue! But, I think it would be helpful if you clarified a little on the solution (for us, and for others having a similar problem who might search/find this thread).

    Can you please post the following?

    a) bind code that was not working, and
    b) bind code you changed to get it working

    Thanks,

    Steve
  • Hello Steve,

    Sorry for the late response..

    To Summarize, My understanding is TDA2ex will calculate one default local link address and after adding specific IPv6 address, when i was sending data to one multicast address i.e. FF14::1:a TDA2ex by default was using Local link address , to make TDA2ex to use specific address i did following after creating socket :

    if ((ret = getaddrinfo("fd53:7cb8:383:2::8:50", SERVER_PORT, &hints, &servinfo)) != 0)
    return ret;

    ptrservinfo = servinfo;
    ret = bind(Obj->sockfd,ptrservinfo->ai_addr,ptrservinfo->ai_addrlen); // Binding created socket to use fd53:7cb8:383:2::8:50 address only
    if(ret < 0 ){
    ret = fdError();
    return ret;
    }

    if you don´t bind TDA2ex will use local link address.

    Thanks,
    Kapil Mehta
  • Thanks for clarifying on that, Kapil.

    Steve