none
Generate and transmit data (in char array) within MAC layer RRS feed

  • Question

  • Hello,

    We currently study the source code of 802.11 brick implementation. Meanwhile, we are trying to add small piece of code to the MAC layer.

    Here is the thing we have decided to try. We have two Sora machines, call it A and B.
    Machine A transmits a small dummy packet periodically. This operation is always performed. It does not matter whether node A and node B are communicating or not.

    Currently, we set the small dummy packet to be a char array with length of 3. This dummy packet is not coming from the OS layer, we declared such array in the MAC layer.

    Now, the problem we have encountered is that we could not modulate that dummy packet. 
    The code we wrote can be compiled, but gives us runtime error when it is executing.

    Can anyone give us a simple sketch showing how this can be accomplished?

    Thanks
    Muye 

    Tuesday, December 10, 2013 4:50 AM

Answers

  • It's hard for me to find the root reason of your modification and experiment, because I cannot easily reproduce it. Some suggestions

    1. Firstly debug the problem with offline wrapper, such as demod11.exe

    2. If you really want to debug the real-time program inter-operating with hardware, you can firstly try the debug build. But the performance of checked build is not good enough, the behavior will be different from free build. But it may help you find buffer overflow bugs and others.

    3. From your code, I guess DummyBuffer[0] is quite suspectable. Does the casting make sense in your context?

    • Marked as answer by MUYE20 Thursday, December 19, 2013 6:19 AM
    Thursday, December 19, 2013 3:55 AM
    Answerer

All replies

  • The following is the code segment we have. It is trying to modulate the dummy char array.

    Thanks for your time.

    /*
    A's MAC address: 02-50-F2-4C-AD-07
    B's MAC address: 02-50-F2-7E-55-4D
    */

    bool bret;
    ulong sample_size;
    char dummy[3];
    dummy[0] = 'A';
    dummy[1] = 'B';
    dummy[2] = 'C';

    DOT11RFC1042ENCAP wheader = { 0 };
    struct PACKETxID* ptid;
    ptid = (struct PACKETxID*)malloc(sizeof(struct PACKETxID));
    memset(ptid, 0, sizeof(struct PACKETxID));
    ptid->m_packet = NULL;

    wheader.MacHeader.Address1 = MACaddrB;
    wheader.MacHeader.Address2 = MACaddrA;
    wheader.MacHeader.Address3 = adhoc_bssid;
    wheader.MacHeader.FrameControl.Type = FRAME_DATA;
    wheader.MacHeader.FrameControl.Subtype = SUBT_DATA;
    wheader.MacHeader.FrameControl.Retry = 1;

    wheader.MacHeader.SequenceControl.usValue = (SendSeQ << 4);
    wheader.SNAP.DSAP = 0xAA;
    wheader.SNAP.SSAP = 0xAA;
    wheader.SNAP.Control = 0x03;
    wheader.Type = eheader->Type;
    SendSeQ++;

    ptid->m_status = PACKET_NOT_MOD;
    ptid->m_needack = TRUE;

    // something wrong here. Runtime error when it is trying to modulation
    // dummy packet
    bret = ModBuffer11a ( (UCHAR*)&wheader, sizeof(DOT11RFC1042ENCAP), 
                    (UCHAR *) dummy, 3,
                    (ushort) gDataRateK, 
                    (COMPLEX8*)DummyBuffer[0], DummySize, &sample_size );

    Tuesday, December 10, 2013 5:06 AM
  • It's hard for me to find the root reason of your modification and experiment, because I cannot easily reproduce it. Some suggestions

    1. Firstly debug the problem with offline wrapper, such as demod11.exe

    2. If you really want to debug the real-time program inter-operating with hardware, you can firstly try the debug build. But the performance of checked build is not good enough, the behavior will be different from free build. But it may help you find buffer overflow bugs and others.

    3. From your code, I guess DummyBuffer[0] is quite suspectable. Does the casting make sense in your context?

    • Marked as answer by MUYE20 Thursday, December 19, 2013 6:19 AM
    Thursday, December 19, 2013 3:55 AM
    Answerer
  • Hello Qi,

    Thanks for your suggestions.
    I think solved that problem couple days ago. It was my mistake.

    I added modulation function "ModBuffer11a" to the MAC receiving state ("MAC11a_Receive") and sending procedure ("Dot11aSendProc").
    But "MAC11a_Receive" and "Dot11aSendProc" are running on two different threads. Run time error would occur if both of them are trying to perform packet modulation.

    By the way, could you please take a look at this one
    http://social.microsoft.com/Forums/en-US/ddc78cc8-d78b-4680-a862-08a04402de54/channel-coefficient-in-umxsdrbrick?forum=sora 

    We still cannot figure out what is the problem.

    Thank you for your time 
    Muye


    Thursday, December 19, 2013 6:19 AM
  • Please be patient with the other thread. We are actually investigating now.

    Thanks, -Qi

    Thursday, December 19, 2013 6:23 AM
    Answerer