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.

reading IP header of the packet

Other Parts Discussed in Thread: CC3200, CC3100

Hi,

 

I run the tcp_socket application and I received the TCP packet correctly in CC3200 platform. However I also want to read IP header of the packet like transceiver mode. Is there a way to receive both IP  header and data coming from TCP client in tcp_socket application.

  • Hi Ebru Hanim

    The CC3200 SDK does not support this feature. The only way to read the IP header and the data in the networking layer is to pass the networking stack on CC3200 Network Coprocessor and then you will be able to run your own TCP/IP layer to read the IP header and the data. We are going to povide an example software  to pass the networking layer from CC3200. If this solution is useful for you, the CC3100 will be usefull for you. We will inform you next Monday on the phone and provide this example software.

    Best Regards

    Yunus

  • Hi Ebru Hanim and Yunus,

    There is an option to receive and transmit the IP header.

    If you will use a RAW socket then the default behavior would be that incoming (Rx) IP packets will contain the IP header as well.

    Please note that in this mode (RAW socket) the transmitted IP packets doesn't need to contain the IP header (the CC3200 network stack takes care of it).
    If you would like to "build" the IP header on your own, then you can do that by using the SL_IP_HDRINCL option in sl_SetSockOpt() API.

    For more details please look at the networking programmers guide: http://processors.wiki.ti.com/index.php/CC31xx_Programmers_Guide

    Relevant chapter is: 18.3

    Since our sockets were designed to work as BSD sockets, you can also find useful information in: http://linux.die.net/man/7/raw

    Thanks,
    Alon

  • Dear Alon,

    Thanks for your answer.

    I tried to create RAW socket type in the tcp_socket example. However, the return value of  sl_Listen function was less then zero. Thefore it closed the socket.For this reason I could not set the socket option as you mentioned above. 

    I think , the reason might be the Raw socket can not be created when the device is connected to any AP.

    Is there a way to receive IP header when the device is connected? 

    Is there a way to receive IP header coming from TCP client in the same network?

  • Ebru Hanim

    As we discussed with Alon before, the tranceiver mode is used when the device is not connected to AP.

    You can use 'transceiver-mode' for sending and receiving raw-data in L1 or L2 layers. Please refer 'Trasceiver Mode' section of 'http://www.ti.com/lit/ug/swru368/swru368.pdf' for more details.

    Transceiver mode is in not connected state, yes, but you are also able to get the IP header when using RAW socket, which is a standard BSD socket mode.

    I will be checking if there is any other way to implement this and will get back to you

    Best Regards

    Yunus

  • Hi Ebru Hanim and Yunus,

    Please note that I'm not referring to "transceiver-mode", I was recommending you to use "regular" raw sockets which are working when the device is connected to the AP.

    You should use the following syntax when creating the socket: "sl_Socket(SL_AF_INET,SOCK_RAW, 0);"

    Please note that the first parameter should be "SL_AF_INET" and not "SL_AF_RF".

    Thanks,
    Alon