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.

NC_NetStart with IPV6 not working

Other Parts Discussed in Thread: TMS320C6678, OMAPL138

Hi, i'm trying to setup and UDP connection with IPv6

While I was using IPv4 I could see the print message of the function NetworkIPAddr (which is called by NC_NetStart ):

"Network Added: xxx.xxx.x.xxx"

But now i'm using an IPV6 address and i can't see that print anymore and the DSP (C6678) cant receive neither send data.

Looking at the source code of  NC_NetStart  and NetworkIPAddr , I see that both functions require an address in the format IPN (defined in usertype.h). That same header has an type defined por IPv6 which is IP6N, but the compiler gives me an error if I try to cast from one type to another.

How should I proceed in that case? Do I need to rebuild some NDK library for this??

Thanks!

  • Hi jose carlos cazarin,

    IPv6 must be initialized at run time in the NDK.  You can try this out with the NDK client example (it comes with your MCSDK installation) by running that example, then Telnet into the 6678 and use the ipv6 init command.  There are other commands, too, just type ipv6 to display a list of what's available.  I believe you can use the ipv6 route command to see your IPv6 address.

    I've also attached an example from our TI-RTOS product, which is a UDP/IPv6 echo example and shows a better and more practical way to initialize IPv6 in an application.  This example is for different hardware, but the code should work fine for your 6678.

    Notice in the example, the netOpenHook() (this is the open function passed to NC_NetStart) initializes IPv6 and in the callback function for DAD, it prints out the IPv6 address.  IPv6 is deinitialized in netCloseHook(), which is called when the stack shuts down.

    Hope this helps...

    Steve

    7485.udpEchoIPv6.c

  • Hi Steven, thanks for the reply, i'm trying to follow what the example you attached does, but it still not working.

    The function IPv6InterfaceInit works fine and I can see an address printed in the console, but when my application on the PC tries to send data it sends an Neighbor Solicitation with the DSP ipv6 address but the DSP never answer this, and therefore nothing happens.

    Besides, if I include the  #define _INCLUDE_IPv6_CODE (otherwise, any IPV6 command on the Telnet returns nothing)  the client example  won't build, it gives me that error:

    And I can't find the headers that has this definitions.

    Regards,

    Jose.

  • Hi Jose,

    Are you able to perform an IPv6 ping to the 6678 from your PC?

    Also, can you try the client example?  I see that it's included in the product, for example it's here on my machine:

    C:\ti\MultiCore-SDK\mcsdk_2_01_00_03\examples\ndk\client

    I think it will be easier for you to start with the client example, using that to then Telnet into the 6678.

    The IPv6 commands should be there when you Telnet in using this example:

    You would then need to initialize IPv6 and you can use the route command to see the IPv6 address.  Then you should be able to ping the board:

    >ipv6 init 1
    IPv6 stack has been initialized on 1
    >ipv6 route
    -------------------------------------------------
    Interface Name   : eth0
    Network  Address : fe80::
    Next Hop Address : ::
    Route Type       : CLONING
    Timeout          : Infinite
    -------------------------------------------------
    Interface Name   : eth0
    Network  Address : fe80::217:eaff:feca:5a81
    Next Hop Address : fe80::217:eaff:feca:5a81
    Route Type       : LOCAL
    Timeout          : Infinite
    -------------------------------------------------
    Interface Name   : eth0
    Network  Address : ::1
    Next Hop Address : ::1
    Route Type       : LOCAL
    Timeout          : Infinite
    -------------------------------------------------
    >

    Steve

  • Hi Steven, 

    It seems to me that i'm having the same problem of masayuki in this topic:

    http://e2e.ti.com/support/embedded/bios/f/355/t/257601.aspx

    I can't ping the board, when I try to do that I can see the neighbor solicitation of the PC with Wireshark, but the DSP don't reply to that.

    I'm using the latest version of NDK (2.22.3.20) which is said on the release notes that this bug is fixed:

    "Fixed bug in ICMPv6 causing NDK not to respond properly to Neighbor Solicitation DAD messages."

    Maybe thats a new bug on the 6678??

    Regards,

    Jose.

  • Jose,

    Which DSP are you loading/running on?  Is it core 0?

    Can you please take a Wireshark capture of this problem and attach it to this thread so I can look?

    Also, can you try to Telnet into the 6678, then try to ping your PC (similar to what's described in the other thread).  Are you able to ping from 6678 -> PC?  If so, then are you able to ping from PC to 6678?

    Steve

  • It's an tms320c6678 and it is in core 0.

    My ipv6 config on the DSP it's the following:

    When I try to ping the DSP on the PC, thats what I see in Wireshark:

    I can see (in pink) the neighbor solicitation of the PC, looking for the link layer address of the DSP. But there's no reply from the DSP.

    I can ping the ipv4 of the DSP (192.168.2.100) on the PC, but I can't ping the ipv4 of the PC (192.168.2.101) on the DSP.

    The ipv6 ping don't work in none of the ways.

  • Jose,

    Can you try putting a break point at the following function?  You should enable the break point *just before* you try to ping the 6678's IPv6 address from Windows:

    IPv6RxPacket

    You should hit this function when a packet successfully comes into the stack from the driver.

    If you don't hit this function when you IPv6 ping from Windows, then it means that the driver is not calling NIMUReceivePacket.

    If that's the case, then I suspect there's something wrong with the driver's configuration and we'll need the 6678 driver team to look at that.

    Steve

  • Hi Steven, sorry for the  more than a month late response, I had to do another tasks.

    I put the breakpoint in the function, as it is in the picture:

    My IPV6 address it's the following:

    And I pinged this adress like that, and I got an error of  "destination host unreachable".

    And in the the Wireshark i can see the same thing of my previous post:

    And the breakpoint was never reached. Thanks,

    Jose.

  • Jose,

    Can you please retry the ping but specify the scope ID at the end of the address?  E.g.:

    ping fe80::217:eaff:fecb:71bb%11

    Steve

  • Sorry, I did that but it wasn't captured in the print.

    Heres it:

    Thanks,

    Jose.

  • Jose,

    Ok, depending on the version of Windows you have, the IPv6 ping command will fail without the scope ID appended to the end.

    I am suspecting that these ICMPv6 packets may be getting dropped at the driver level, since you don't see the packets reaching the break point you set on the 6678.  I am going to ask the 6678 driver team to help with this.

    But first, can I get you to provide a little more info on your set up?  Can you please describe your network topology?  For example, how is your PC connected to the 6678?  Is it directly connected via a crossover cable?  Or do you have a router or switch in between?  Or maybe you are using your corporate network?

    Also, are you able to IPv6 ping from your Windows PC to another IPv6 Windows PC?  For example, if your current Windows PC is connected to a router, and the 6678 is also connected to the same router, can you try connecting another Windows machine (or Linux, Mac, any standard PC running IPv6) to the same router and try to IPv6 ping between the PCs?

    Actually, knowing if you are able to do this or not will be a very helpful data point.

    Steve

  • Hi Steve, i'm back at this after a long time, so I have some questions regarding the code you posted on your first response.

    I made the DSP print and IPV6 address on the console (it's fe80::217:eaff:fecc:7c0e), my question is:

    Do I need to store this adrress on the struct "sockaddr_in6 sLocalAddr" that's on the code?

    How can I put my PC IPV6 address on the "sockaddr_in6 client_addr" struct? (if I need to do that at all)

    Is there an example code with UDP?

    Thanks

  • Were you ever able to get past your ping problem?

    Also, could you describe your network topology?

    Reviewing the thread, it seems that you were not receiving any ICMPv6 packets (from PC when trying to ping the board).

    Since you didn't hit the break point in NIMUReceivePacket, it seemed that the driver was possibly dropping it.

    Steve

  • Hi Steve, the problem continues. One thing I don't remind trying the other time was ping the IPV4 address of the DSP.

    I can ping to and from the DSP and the PC using an IPV4 address. When I try to ping using the IPV6 address I still see the neighbor solicitation from the PC in the Wireshark window.

    The DSP is directly connected to the PC via an ethernet cable, there's no other machine on the network.

    Also, I don't see how putting the telnet example to work can help me establishing an IPV6 interface between the DSP and the PC, because there's no source files for the example program.

    Jose.

  • Hi Jose,

    Did you see the UDP IPv6 example I attached to the thread previously?  Were you able to add that code to your application in order to get it working?  If so, are you hitting the DAD function (IPv6DADStatus) that's in the example?

    Note that you will need to set the NDK network open and close hooks (i.e. netOpenHook and netCloseHook) in your configuration file (*.cfg file):

    Global.networkOpenHook = '&netOpenHook';
    Global.networkCloseHook = '&netCloseHook';

    Steve

  • I tried to run pieces of that code in my project but it doesn't work (I've added the 2 lines you mentioned on the .cfg file).

    So I'm trying to run the full code in a separated project, but the program is getting stuck after the BIOS_start() call.

    Should the netOpenHook() function be called automatically after the BIOS_start() call?

    From what I could understand of the code, it should happen, then the netOpenHook() function would create the task that will send and receive the data through the IPV6 interface.

    Is that right?

  • Can you attach your *.cfg file?  I have a feeling you may have a configuration option that is disabling code generation for the NDK (which in that case those hooks wouldn't be called, and we would need to configure them in a different way)

    Also, the app you are working with ... is it your own app?  Or is it the "client example"?

    It may be easier to start with the "client" example and get IPv6 working on that, first.

    Steve

  • Right now the only code in my app it's the example from TI-RTOS you attached on your first post. I'm attaching my main file and my .cfg file. I modified the main file to use the board init functions of the evaluation module of the 6678 that i'm using.

    5873.main.cpp

    5684.IPV6.cfg

    Thanks, Jose.

  • Jose,

    I didn't get a chance to look at this today, but I'll have a look and respond tomorrow.

    Steve

  • Jose,

    Could you also attach your generated *.c file?  This file is generated based on your BIOS configuration file (i.e. IPV6.cfg).  You can find this file under your "debug" or "release" folders in your project.  For example, it's here in my project (note that the file name is of the format "<project name>_<target>.c, so the name will be different):

    Next ... Do you have a call similar to the following in your code?  I didn't see it in your main.cpp file:

         rc = NC_NetStart( hCfg, NetworkOpen, NetworkClose, NetworkIPAddr );

    The arguments passed in the above call are similar to the network open and close hooks I mentioned previously.

    Since you have the setting Global.enableCodeGeneration = false in your configuration, I believe you should have the above function call in your project code, and also the code of those functions themselves - NetworkOpen , NetworkClose.

    You can modify these open and close functions to call the functions netOpenHook and netCloseHook from the TI-RTOS example.

    Also, please set a break point at each of the following functions to ensure that they are being run in your app:

    1. NetworkOpen
    2. netOpenHook
    3. netCloseHook
    4. IPv6DADStatus

    Lastly, I think you should add the following line of code into your IPV6.cfg file:

    Global.IPv6 = true;

    Steve

  • Hi Steve, thanks for the response.

    I've put the NC_NetStart() function on my program, and I changed it to call the netOpenHook and the netCloseHook functions instead of NetworkOpen and NetworkClose. And i've added the line Global.IPv6 = true; to my .cfg file

    But the program it's still hanging when it calls BIOS_start();

    One thing that i've tried was to modify the setting Global.enableCodeGeneration to TRUE. When I did that, the open and close hook functions got called (I didn't need to include the NC_NetStart in the code), but the console gives me this error:

    "[C66xx_0] Starting the UDP Echo example

    Error opening a PA Command Response queue
    PASS init failed
    00000.000 NIMUIOCTL Failed with error code: -22

    Service Status: DHCPC : Failed : : 000
    Error -1: failed to add IPv6 interface"

    Did I need to include on my app some part of the code that's on the X:\mcsdk_2_01_02_06\examples\ndk\helloWorld\helloWorld.c?

    I'm talking about the part that initializes the QMSS, CPPI and the packet accelerator.

    Because this services needs to be initialized when i'm using the IPV4 interface.

    Thanks,

    Jose.

  • Jose,

    jose carlos cazarin said:
    I've put the NC_NetStart() function on my program, and I changed it to call the netOpenHook and the netCloseHook functions instead of NetworkOpen and NetworkClose. And i've added the line Global.IPv6 = true; to my .cfg file

    Did you have to add a call to NC_NetStart?  You should have already had this call in your main NDK stack thread.  Or maybe you meant that you updated the call to NC_NetStart?  If you actually did add it, where did you add that call?

    In any case, did you hit the break points for those functions?

    jose carlos cazarin said:
    But the program it's still hanging when it calls BIOS_start();

    BIOS_start doesn't return, so I think this should be expected.

    jose carlos cazarin said:
    One thing that i've tried was to modify the setting Global.enableCodeGeneration to TRUE. When I did that, the open and close hook functions got called

    You have to be careful with this setting.  I'm guessing that since you already had the stack running, you must have an NDK stack thread function.  This function would run as a Task and contain calls to NC_NetOpen/NetStart, etc.  Did you already have such a function?

    Once you enable code generation, the above mentioned function will then be generated ... so if you already have it in your app, it will result in 2 instances of the NDK stack running.  This could cause problems and I suspect it may be the cause of the errors you show above.

    Steve

  • Hi Steve,

    As I said in the other post, i've started a new project from scratch to test the IPV6 interface,
    so all the code I have in my project is the code that's in the example that you've posted.
    I didn't have the stack running on this this app (but I have it running on another separated
    project, and I want to add the IPV6 interface to this another project).

    So, I put the call to NC_NetStart on my main (I didn't have this call before), right before calling Bios_start.

    When I said that Bios_start hangs, I mean that when I call this function, the whole program stops,
    and no other functions are called

    I'm also attaching the generated .c file that you've talked about. I forgot to attach it on my last post.

    6237.configCFM_pe66.c

    Thanks, Jose

  • Jose,

    Ok, this clarifies things up a bit for me.  I didn't realize you were starting from scratch.  But, I think it's a good thing; let me help you get your new project running properly.

    Since you're starting from scratch, let's try to take advantage of the NDK's code generation in your new app.  This means that the NDK "stack thread" code will be created for you.  This will also generate the call to NC_NetStart, and other functions, for you.

    First, give the attached *.cfg file a try.  You should be able to just delete the one you currently have in your new project and copy this one into the project, in its place:

    7587.IPV6_updated_by_steve.cfg

    You can diff this file with the previous one you uploaded. Notice that I've done the following:

    1. Turned on code generation (by commenting out the code that disabled it)
    2. Enabled IPv6 support
    3. Left the code for auto calling netOpenHook and netCloseHook
    4. Commented out the following setting.  Did you need this setting?  It seemed like "an experiment" so I commented it out.  But if you really do need it, please add it back in:
      Ip.socketBufMinTxSize = 415000;

    Next:

    Please remove this call to NC_NetStart (since it's now going to be generated for you).  I think the "main.cpp" that you attached previously to the thread should be OK.

    Can you give that a try and see what happens?

    Steve

  • Thanks for the response Steve.

    Now the program is not hanging on the  BIOS_start call, but the console is showing this errors:

     

    "[C66xx_0] Starting the UDP Echo example

    Error opening a PA Command Response queue
    PASS init failed
    00000.000 NIMUIOCTL Failed with error code: -22

    Service Status: DHCPC : Failed : : 000
    Error -1: failed to add IPv6 interface"

     

    Then, I added this piece of code in the main function, right before calling BIOS_start, I got that code from the NDK Hello World example of the MCSDK:

    int rc;

    // Handle network configuration
    HANDLE hCfg;

    // QMSS configuration structure
    QMSS_CFG_T qmss_cfg;

    // CPPI configuration structure
    CPPI_CFG_T cppi_cfg;

    platform_info gPlatformInfo;

    /* Get information about the platform so we can use it in various places */
    memset( (void *) &gPlatformInfo, 0, sizeof(platform_info));
    (void) platform_get_info(&gPlatformInfo);

    /* Initialize the components required to run this application:
    * (1) QMSS
    * (2) CPPI
    * (3) Packet Accelerator
    */
    /* Initialize QMSS */
    if (platform_get_coreid() == 0) {
    qmss_cfg.master_core = 1;
    } else {
    qmss_cfg.master_core = 0;
    }

    // Set QMSS configuration
    qmss_cfg.max_num_desc = MAX_NUM_DESC;
    qmss_cfg.desc_size = MAX_DESC_SIZE;
    qmss_cfg.mem_region = Qmss_MemRegion_MEMORY_REGION0;

    // Initialize QMSS
    if (res_mgr_init_qmss (&qmss_cfg) != 0) {
    platform_write ("Failed to initialize the QMSS subsystem \n");
    // goto main_exit;
    }

    /* Initialize CPPI */
    if (platform_get_coreid() == 0) {
    cppi_cfg.master_core = 1;
    } else {
    cppi_cfg.master_core = 0;
    }

    // Set CPPI configuration
    cppi_cfg.dma_num = Cppi_CpDma_PASS_CPDMA;
    cppi_cfg.num_tx_queues = NUM_PA_TX_QUEUES;
    cppi_cfg.num_rx_channels = NUM_PA_RX_CHANNELS;

    // Initialize CPPI
    if (res_mgr_init_cppi (&cppi_cfg) != 0) {
    platform_write ("Failed to initialize CPPI subsystem \n");
    // goto main_exit;
    }

    // Initialize PASS
    if (res_mgr_init_pass()!= 0) {
    platform_write ("Failed to initialize the Packet Accelerator \n");
    // goto main_exit;
    }

    Now the console doesn't show any errors anymore, it prints that everything is OK (I suppose):

    "[C66xx_0] Starting the UDP Echo example

    PASS successfully initialized
    Ethernet subsystem successfully initialized
    Ethernet eventId : 48 and vectId (Interrupt) : 7
    Registration of the EMAC Successful, waiting for link up ..
    Service Status: DHCPC : Enabled : : 000
    Service Status: DHCPC : Enabled : Running : 000
    Address: fe80::217:eaff:fecc:7c0e on device 1 is UNIQUE"

     

    I don't know if that is the right way to fix that, but at least there are no more error messages.

    But in BOTH cases the program hangs on the fdSelect function that 's called inside the udpHandler task. It doesn't return an error, it enters the function and never leaves. Is there something i'm missing? I'm attaching my main file again in case you need to take a closer look.

    Jose.

    1411.main_09_23_14.cpp

  • Jose,

    Are you able to ping the board though?  (IPv6 ping)

    This app is a UDP echo server, so it's meant to run with a UDP echo client application.  Let me see if I can attach it for you.

    The select call is waiting for activity on the socket .... since there isn't any (i.e. no one  is trying to connect to the server) it eventually times out.

    So, you need to make a connection to the app using the attached.  Be sure to rename it to have the ".exe" extension instead of ".txt"

    8546.udpSendReceive.txt

    2476.udpSendReceive.c

    Steve

  • Hi Steve,

    I can't ping the board. I was already using an app that I made to send data to the pc through UDP. But the program you posted doesn't work as well.

    I think i'm stuck at the same problem than before, the DSP is not responding to Neighbor Solicitation messages coming from the PC, as you can see in the picture:

    The fe80::217:eaff:fecc:7c0e address displayed on the image is the address of the DSP

    I've put an breakpoint in the IPv6RxPacket function as you said earlier, but the breakpoint it's not being hit.

    Can you show me how the IPV6 address of your PC is configured? Is it static?

    Thanks.

  • Jose,

    Can you please attach your executable for your app?  I'd like to give it a try here locally on a 6678 board (I believe that's what you're using).

    I don't have any special IPv6 set up for my PCs (Linux nor Windows), both are using link local addresses that are automatically enabled via SLAAC.

    Steve

  • I'm attaching the executable (the .txt one) and the source code. I've tried with both programs, the one I made and the one you sent me, but the same error occurs with both programs: the DSP doesn't seem to respond to the neighbor solicitation requests of the PC..

    Thanks, Jose.

    3755.Socket_IPV6.txt

    7510.Socket_IPV6.cpp

  • Jose,

    I was not able to load the program, I got errors when trying.

    Can you please try to re-attach the app?

    Maybe, you can add the *.out file to a *.zip archive, and then attach the zip archive.  I think this should work.

    Steve

  • I thought you're talking about the app that I was using on the PC side, so I attached my windows application and it's source code.

    Now i'm attaching the .out file of the DSP and it's source code.

    0474.IPV6_6678.rar

    Jose

  • Jose,

    I was able to reproduce the problem.  I should have known this problem looked familiar ... I actually have seen this issue before on different hardware and I am pretty sure that it is a problem in the driver related to the reception of multicast packets for IPv6 (and possibly IPv4, as well)

    The problem you are seeing exactly matches the following bug, which was a driver problem and was fixed in the driver for a different hardware platform (OMAPL138, a.k.a "Freon"):

    SDOCM00098789 - NDK doesn't respond to Neighbor Solicitation messages on Freon

    I will get in touch with the 6678 driver team about this issue.

    Steve

    P.S. From the bug's description:

    "This problem only seems to occur on Freon.  I suspect it may be a driver issue (ICMPv6 messages or IPv6 multicast messages being filtered at driver level ...)

    When running the IPv6 enabled client example, a Linux or Windows host will not get any response when trying to ping6 to the Freon board.

    It seems that the stack never receives the NS message that comes out from the Windows/Linux host as a result of running IPv6 ping.

    What's interesting is that if one telnets into the NDK, then runs an IPv6 ping from the NDK to the Linux or Windows host, the NDK will get a response.  (this is due to the Linux/Windows host *not* having such a problem receiving NS messages).

    Once the Linux/Win host responds to the NDK's NS message (with a NA), it updates its neighbor table and can then "see" the other hosts.

    After this, it is possible to ping6 from Linux/Windows host to the NDK.

    Note that this does not happen on M3.  These NS messages are received on the Concerto platform and pings work right off the bat there."

  • Thanks Steve! At least now we know what's happening. I'll wait for a response on this thread.

    Jose

  • Jose,

    You and Steve had a long discussion for IPv6. Can you share the IPv6 added whole "client project" ? If I start add the code for IPv6 freshly, It may take time to reach your issue level. I will check your code on C6678 EVM. I hope, you are using C6678 EVM. 

  • Yes Pubesh, i'm working on a C6678 EVM  from Advantech.

    I'm attaching the whole project.

    8836.IPV6_Test.rar

    Thanks!