7 декабря 2010 г. 9:48
When I read the 802.11 code, there is a question confusing me.
In file src/driver/ll/sdr_ll_send.c , the data passed from NDIS is <ethHead><data><CRC32>, then the <ethHead> is replaced by <wlanHead>, and the data is <wlanHead><data><CRC32>, then another CRC32(we call it wlanCRC32) is calculated and put into pDLCB->PacketBase.Reserved1, when the frame is sent to radio, the wlanCRC32 is appended to the rear. so the data sent is <PLCP preamble><PLCP head><wlanHead><data><CRC32><wlanCRC32>, is it right?
then when the data is received and put uplink, the <PLCP preamble><PLCP head> is removed and the <wlanHead> is replaced into <ethHead>, but the <wlanCRC32> is not removed. It is still in the MDL, and passed to NDIS. That is , the NDISPacket sent to NDIS is factually contains <ethHead><data><CRC32><wlanCRC32>, it is different from the original NDISPacket passed from the NDIS , why? Is it OK?
8 декабря 2010 г. 12:24
The packet from NDIS does NOT contain CRC32, so the format is <ethHead><data>.
The CRC32 is calculated in sdr_ll_send and stroed in pDLCB->PacketBase.Reserved1. And, etheHead in replaced by wlanHead. NOW, the format is <wlanHead><data><CRC32>.
In the physical layer, PLCP preamble and PLCP header are prepended. The format now is <PLCP preamble><PLCP head><wlanHead><data><CRC32>.
On the receive path, the decoded packet will be passed to NDIS along with CRC32 after converting wlan format to eth format. The CRC32 is not removed. But it's OK, because the upper layer will only uses the data part, the CRC32 will not be used.
- Помечено в качестве ответа Kun TanOwner 13 декабря 2010 г. 18:04
12 декабря 2010 г. 3:14
If I remove the CRC32 of the packet passed to NDIS in the Tx, is there any problem?
21 декабря 2010 г. 10:50If you remove the CRC32 at transmitter, then the receiver would not be able to receive packets because the CRC32 check will always be failed. So, the packets will never be delivered to NDIS.
- Предложено в качестве ответа Danial.F 21 декабря 2010 г. 10:50
22 декабря 2010 г. 2:10I remove it in the receiver, and it works. Thank you
27 июля 2011 г. 8:21
I also have a question about the procedure of the packets's send. After link level handles the replacement between etheHead and wlanHead,what will cause the MAC level's SEND PROCEDURE?????(Which function or some other thread??)
28 июля 2011 г. 16:57
What do you mean the SEND procedure? The MAC layer or application layer?
There is one thread waiting for packets from upper layer (i.e., TCP/IP). Once there are packets in the sending list, the thread is woke up and start to do the modulation by calling the physical layer modulation function.
So, where are packets from? From applications, of course. Also, some packets are from internal protocols such ARP.
In summary, the the send procedure of MAC is triggered by the packets from application layer or internal protocols.
A brief outline could help you understand the details:
Application(s)=>TCP/IP=>Link Layer (eth -> wlan header conversion, insert the converted packets to a list and notify send thread)=>send thread in MAC (send thread is woke up and starts to do modulation)
Hope this will help you!