Raw TX Packet Transmission Issues with nRF WiFi

I'm trying to use raw packet transmission (IN combination with wifi promiscous mode and raw sockets eventually) with my nRF WiFi device. I have both the sample raw_tx_packet application and my modified version which attempts to send UDP packets over WiFi, but neither seems to be working correctly. The packets appear to be sent according to my application logs, but I can't see any traffic in Wireshark when monitoring in promiscuous mode, except for the initial ARP requests.

Unmodified Sample Issues

The unmodified sample gives me the following errors:

[00:00:13.243,591] <wrn> net_conn: pkt cloning failed, pkt 0x200682f8 dropped
[00:00:23.688,385] <err> wifi_nrf: hal_rpu_event_get: Unable to alloc HAL msg for event
[00:00:23.688,690] <err> wifi_nrf: hal_rpu_event_get: Unable to alloc HAL msg for event
[00:00:23.688,964] <err> wifi_nrf: hal_rpu_event_get: Unable to alloc HAL msg for event


Modified Sample Issues

My modified sample appears to successfully construct and send UDP packets (with logs showing successful transmission and returning proper byte counts), but no packets are visible in Wireshark monitoring.

#
# Copyright (c) 2023 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#
CONFIG_WIFI=y
CONFIG_WIFI_NRF700X=y
CONFIG_NRF_WIFI_LOW_POWER=n
CONFIG_NRF700X_RAW_DATA_TX=y
CONFIG_RAW_TX_PKT_SAMPLE_INTER_FRAME_DELAY_MS=100
# WPA supplicant
CONFIG_WPA_SUPP=y

CONFIG_WIFI_MGMT_EXT=y
CONFIG_WIFI_CREDENTIALS=y
CONFIG_WIFI_CREDENTIALS_STATIC=y
CONFIG_WIFI_CREDENTIALS_STATIC_SSID="xxxxxxxx"
CONFIG_WIFI_CREDENTIALS_STATIC_PASSWORD="xxxxxxx"
CONFIG_RAW_TX_PKT_SAMPLE_CONNECTION_MODE=y
# Networking
CONFIG_NETWORKING=y
CONFIG_NET_SOCKETS=y
CONFIG_NET_LOG=y
CONFIG_NET_IPV4=y
CONFIG_NET_UDP=y
CONFIG_NET_TCP=y
CONFIG_NET_DHCPV4=y

CONFIG_NET_PKT_RX_COUNT=8
CONFIG_NET_PKT_TX_COUNT=8

# Below section is the primary contributor to SRAM and is currently
# tuned for performance, but this will be revisited in the future.
CONFIG_NET_BUF_RX_COUNT=16
CONFIG_NET_BUF_TX_COUNT=16
CONFIG_NET_BUF_DATA_SIZE=1500
CONFIG_HEAP_MEM_POOL_SIZE=200000
CONFIG_NET_TC_TX_COUNT=1

CONFIG_NET_IF_UNICAST_IPV4_ADDR_COUNT=1
CONFIG_NET_MAX_CONTEXTS=5
CONFIG_NET_CONTEXT_SYNC_RECV=y

CONFIG_INIT_STACKS=y

CONFIG_NET_L2_ETHERNET=y

CONFIG_NET_CONFIG_SETTINGS=y
CONFIG_NET_CONFIG_INIT_TIMEOUT=0

CONFIG_NET_SOCKETS_POLL_MAX=10

# Memories
CONFIG_MAIN_STACK_SIZE=4096
CONFIG_NET_TX_STACK_SIZE=4096
CONFIG_NET_RX_STACK_SIZE=4096

# Debugging
CONFIG_STACK_SENTINEL=y
CONFIG_DEBUG_COREDUMP=y
CONFIG_DEBUG_COREDUMP_BACKEND_LOGGING=y
CONFIG_DEBUG_COREDUMP_MEMORY_DUMP_MIN=y
CONFIG_SHELL_CMDS_RESIZE=n

CONFIG_RAW_TX_PKT_SAMPLE_RATE_VALUE=1
CONFIG_RAW_TX_PKT_SAMPLE_RATE_FLAGS=0
CONFIG_RAW_TX_PKT_SAMPLE_QUEUE_NUM=0
# Kernel options
CONFIG_ENTROPY_GENERATOR=y

# Logging
CONFIG_LOG=y
CONFIG_LOG_BUFFER_SIZE=2048
CONFIG_POSIX_CLOCK=y
CONFIG_POSIX_API=y

CONFIG_NET_CONFIG_MY_IPV4_ADDR="192.168.1.99"
CONFIG_NET_CONFIG_MY_IPV4_NETMASK="255.255.255.0"
CONFIG_NET_CONFIG_MY_IPV4_GW="192.168.1.1"

# printing of scan results puts pressure on queues in new locking
# design in net_mgmt. So, use a higher timeout for a crowded
# environment.
CONFIG_NET_MGMT_EVENT_QUEUE_TIMEOUT=5000




  • How can I verify that the generic sample is actually sending packets? Are there any debug logs or hardware indicators I should be looking for or any errors from the nrf7000 i can read back?
  • Can anyone recreate this issue with the standard raw TX sample? It would help to know if others can successfully see the packets in Wireshark or if this is a widespread issue.

Parents
  • Hi Olaifa,

    What NCS version are you using?

    And I hear you have already gotten an email with some help from an FAE on this. I hope that will clear things up.

    Regards,

    Elfving

  • Hi Elfving,

    Thank you for your response. Yes, I'm using NCS 2.7 for my main project, but I tested the raw tx packet sample in NCS 2.9 where I was able to successfully capture the beacon frames in Wireshark.

    However, when I switched the sample to connection mode and it successfully connects to WiFi, I'm encountering memory allocation errors in the logs and no longer see any data packets in Wireshark. Here are some of the errors I'm seeing:


    *** Booting nRF Connect SDK v2.9.0-7787b2649840 ***
    *** Using Zephyr OS v3.7.99-1f8f3dc29142 ***
    [00:00:00.361,816] <inf> net_config: Initializing network
    [00:00:00.361,846] <inf> net_config: Waiting interface 1 (0x200011b8) to be up...
    [00:00:00.361,999] <inf> net_config: IPv4 address: 192.168.1.99
    [00:00:00.362,060] <inf> net_config: Running dhcpv4 client...
    [00:00:00.363,952] <inf> wifi_supplicant: wpa_supplicant initialized
    [00:00:00.366,302] <inf> raw_tx_packet: TX Injection mode enabled
    [00:00:01.366,821] <inf> wifi_connect: Static IP address (overridable): 192.168.1.99/255.255.255.0 -> 192.168.1.1
    [00:00:03.288,787] <inf> wifi_mgmt_ext: Connection requested
    [00:00:03.288,818] <inf> wifi_connect: Connection requested
    [00:00:03.288,879] <inf> wifi_connect: ==================
    [00:00:03.288,879] <inf> wifi_connect: State: SCANNING
    [00:00:03.589,050] <inf> wifi_connect: ==================
    [00:00:03.589,080] <inf> wifi_connect: State: SCANNING
    [00:00:03.889,190] <inf> wifi_connect: ==================
    [00:00:03.889,221] <inf> wifi_connect: State: SCANNING
    [00:00:04.189,361] <inf> wifi_connect: ==================
    [00:00:04.189,392] <inf> wifi_connect: State: SCANNING
    [00:00:04.489,501] <inf> wifi_connect: ==================
    [00:00:04.489,532] <inf> wifi_connect: State: SCANNING
    [00:00:04.789,733] <inf> wifi_connect: ==================
    [00:00:04.789,764] <inf> wifi_connect: State: SCANNING
    [00:00:05.089,874] <inf> wifi_connect: ==================
    [00:00:05.089,904] <inf> wifi_connect: State: SCANNING
    [00:00:05.390,045] <inf> wifi_connect: ==================
    [00:00:05.390,075] <inf> wifi_connect: State: SCANNING
    [00:00:05.690,216] <inf> wifi_connect: ==================
    [00:00:05.690,246] <inf> wifi_connect: State: SCANNING
    [00:00:05.990,447] <inf> wifi_connect: ==================
    [00:00:05.990,478] <inf> wifi_connect: State: SCANNING
    [00:00:06.290,618] <inf> wifi_connect: ==================
    [00:00:06.290,618] <inf> wifi_connect: State: SCANNING
    [00:00:06.590,759] <inf> wifi_connect: ==================
    [00:00:06.590,789] <inf> wifi_connect: State: SCANNING
    [00:00:06.890,930] <inf> wifi_connect: ==================
    [00:00:06.890,960] <inf> wifi_connect: State: SCANNING
    [00:00:07.191,162] <inf> wifi_connect: ==================
    [00:00:07.191,192] <inf> wifi_connect: State: SCANNING
    [00:00:07.491,333] <inf> wifi_connect: ==================
    [00:00:07.491,333] <inf> wifi_connect: State: SCANNING
    [00:00:07.791,473] <inf> wifi_connect: ==================
    [00:00:07.791,503] <inf> wifi_connect: State: SCANNING
    [00:00:08.091,674] <inf> wifi_connect: ==================
    [00:00:08.091,705] <inf> wifi_connect: State: AUTHENTICATING
    [00:00:08.395,233] <inf> wifi_connect: ==================
    [00:00:08.395,263] <inf> wifi_connect: State: 4WAY_HANDSHAKE
    [00:00:08.395,294] <inf> wifi_connect: Interface Mode: STATION
    [00:00:08.395,294] <inf> wifi_connect: Link Mode: WIFI 6 (802.11ax/HE)
    [00:00:08.395,324] <inf> wifi_connect: SSID: TELUS3784
    [00:00:08.395,355] <inf> wifi_connect: BSSID: D6:35:1D:B4:D6:4A
    [00:00:08.395,385] <inf> wifi_connect: Band: 5GHz
    [00:00:08.395,385] <inf> wifi_connect: Channel: 52
    [00:00:08.395,416] <inf> wifi_connect: Security: WPA2-PSK
    [00:00:08.395,416] <inf> wifi_connect: MFP: Optional
    [00:00:08.395,446] <inf> wifi_connect: RSSI: -33
    [00:00:08.395,446] <inf> wifi_connect: TWT: Not supported
    [00:00:08.418,609] <inf> wifi_connect: Connected
    [00:00:08.480,834] <inf> net_dhcpv4: Received: 192.168.1.253
    [00:00:08.481,506] <inf> net_config: IPv4 address: 192.168.1.253
    [00:00:08.481,506] <inf> net_config: Lease time: 86400 seconds
    [00:00:08.481,567] <inf> net_config: Subnet: 255.255.255.0
    [00:00:08.481,597] <inf> net_config: Router: 192.168.1.1
    [00:00:08.483,245] <inf> wifi_connect: DHCP IP address: 192.168.1.253
    [00:00:08.695,648] <inf> raw_tx_packet: Sending raw tx packets continuously
    [00:00:10.829,925] <wrn> net_conn: pkt cloning failed, pkt 0x20047ae4 dropped
    [00:00:10.930,755] <wrn> net_conn: pkt cloning failed, pkt 0x20047ae4 dropped
    [00:00:11.031,860] <wrn> net_conn: pkt cloning failed, pkt 0x20047ae4 dropped
    [00:00:11.132,690] <wrn> net_conn: pkt cloning failed, pkt 0x20047ae4 dropped
    [00:00:11.233,551] <wrn> net_conn: pkt cloning failed, pkt 0x20047ae4 dropped
    [00:00:11.936,553] <wrn> net_conn: pkt cloning failed, pkt 0x20047ae4 dropped
    [00:00:12.037,384] <wrn> net_conn: pkt cloning failed, pkt 0x20047ae4 dropped
    [00:00:12.334,960] <wrn> net_conn: pkt cloning failed, pkt 0x20047ae4 dropped
    [00:00:12.863,739] <wrn> net_conn: pkt cloning failed, pkt 0x20047ae4 dropped
    [00:00:13.214,111] <wrn> net_conn: pkt cloning failed, pkt 0x20047ae4 dropped
    [00:00:13.314,910] <wrn> net_conn: pkt cloning failed, pkt 0x20047ae4 dropped
    [00:00:13.416,137] <wrn> net_conn: pkt cloning failed, pkt 0x20047ae4 dropped
    [00:00:13.517,913] <wrn> net_conn: pkt cloning failed, pkt 0x20047ae4 dropped
    [00:00:13.618,255] <wrn> net_conn: pkt cloning failed, pkt 0x20047ae4 dropped
    [00:00:13.719,970] <wrn> net_conn: pkt cloning failed, pkt 0x20047ae4 dropped
    [00:00:13.839,447] <wrn> net_conn: pkt cloning failed, pkt 0x20047ae4 dropped
    [00:00:14.364,746] <wrn> net_conn: pkt cloning failed, pkt 0x20047ae4 dropped
    [00:00:14.864,135] <wrn> net_conn: pkt cloning failed, pkt 0x20047ae4 dropped
    [00:00:14.964,874] <wrn> net_conn: pkt cloning failed, pkt 0x20047ae4 dropped
    [00:00:15.065,887] <wrn> net_conn: pkt cloning failed, pkt 0x20047ae4 dropped
    [00:00:15.166,473] <wrn> net_conn: pkt cloning failed, pkt 0x20047ae4 dropped
    [00:00:15.734,130] <wrn> net_conn: pkt cloning failed, pkt 0x20047ae4 dropped
    [00:00:15.952,362] <wrn> net_conn: pkt cloning failed, pkt 0x20047ae4 dropped
    [00:00:16.053,161] <wrn> net_conn: pkt cloning failed, pkt 0x20047ae4 dropped
    [00:00:16.258,850] <err> wifi_nrf: zep_shim_llist_node_alloc: Unable to allocate memory for linked list node
    [00:00:16.258,911] <err> wifi_nrf: nrf_wifi_utils_list_add_tail: Unable to allocate list node
    [00:00:16.258,972] <err> wifi_nrf: hal_rpu_event_get: Unable to queue event
    [00:00:16.259,033] <err> wifi_nrf: hal_rpu_event_get_all: Failed to queue event
    [00:00:16.259,429] <err> wifi_nrf: zep_shim_llist_node_alloc: Unable to allocate memory for linked list node
    [00:00:16.259,490] <err> wifi_nrf: nrf_wifi_utils_list_add_tail: Unable to allocate list node
    [00:00:16.259,552] <err> wifi_nrf: hal_rpu_event_get: Unable to queue event
    [00:00:16.259,643] <err> wifi_nrf: hal_rpu_event_get_all: Failed to queue event
    [00:00:16.965,423] <err> wifi_nrf: hal_rpu_event_get: Unable to alloc HAL msg for event (49 bytes)
    [00:00:16.965,728] <err> wifi_nrf: hal_rpu_event_get: Unable to alloc HAL msg for event (49 bytes)
    [00:00:16.966,064] <err> wifi_nrf: hal_rpu_event_get: Unable to alloc HAL msg for event (49 bytes)
    [00:00:16.966,339] <err> wifi_nrf: hal_rpu_event_get: Unable to alloc HAL msg for event (49 bytes)
    [00:00:16.966,644] <err> wifi_nrf: hal_rpu_event_get: Unable to alloc HAL msg for event (49 bytes)
    [00:00:16.966,918] <err> wifi_nrf: hal_rpu_event_get: Unable to alloc HAL msg for event (49 bytes)
    [00:00:16.967,193] <err> wifi_nrf: hal_rpu_event_get: Unable to alloc HAL msg for event (49 bytes)
    [00:00:16.967,498] <err> wifi_nrf: hal_rpu_event_get: Unable to alloc HAL msg for event (49 bytes)
    [00:00:16.967,773] <err> wifi_nrf: hal_rpu_event_get: Unable to alloc HAL msg for event (49 bytes)
    [00:00:17.573,486] <err> wifi_nrf: zep_shim_llist_node_alloc: Unable to allocate memory for linked list node
    [00:00:17.573,547] <err> wifi_nrf: nrf_wifi_utils_list_add_tail: Unable to allocate list node
    [00:00:17.573,608] <err> wifi_nrf: hal_rpu_event_get: Unable to queue event
    [00:00:17.573,669] <err> wifi_nrf: hal_rpu_event_get_all: Failed to queue event
    [00:00:18.279,541] <err> wifi_nrf: hal_rpu_event_get: Unable to alloc HAL msg for event (49 bytes)
    [00:00:18.279,846] <err> wifi_nrf: hal_rpu_event_get: Unable to alloc HAL msg for event (49 bytes)
    [00:00:18.280,120] <err> wifi_nrf: hal_rpu_event_get: Unable to alloc HAL msg for event (49 bytes)
    [00:00:19.190,856] <err> wifi_nrf: hal_rpu_event_get: Unable to alloc HAL msg for event (49 bytes)
    [00:00:19.191,131] <err> wifi_nrf: hal_rpu_event_get: Unable to alloc HAL msg for event (49 bytes)
    [00:00:19.191,436] <err> wifi_nrf: hal_rpu_event_get: Unable to alloc HAL msg for event (49 bytes)
    [00:00:20.825,653] <err> wifi_nrf: hal_rpu_event_get: Unable to alloc HAL msg for event (49 bytes)
    [00:00:20.825,958] <err> wifi_nrf: hal_rpu_event_get: Unable to alloc HAL msg for event (25 bytes)
    [00:00:24.353,851] <err> wifi_nrf: zep_shim_llist_node_alloc: Unable to allocate memory for linked list node
    [00:00:24.353,912] <err> wifi_nrf: nrf_wifi_utils_list_add_tail: Unable to allocate list node
    [00:00:24.353,973] <err> wifi_nrf: hal_rpu_event_get: Unable to queue event
    [00:00:24.354,034] <err> wifi_nrf: hal_rpu_event_get_all: Failed to queue event
    [00:00:25.563,781] <err> wifi_nrf: hal_rpu_event_get: Unable to alloc HAL msg for event (49 bytes)
    [00:00:25.564,056] <err> wifi_nrf: hal_rpu_event_get: Unable to alloc HAL msg for event (49 bytes)
    [00:00:25.564,361] <err> wifi_nrf: hal_rpu_event_get: Unable to alloc HAL msg for event (49 bytes)
    [00:00:25.564,666] <err> wifi_nrf: hal_rpu_event_get: Unable to alloc HAL msg for event (49 bytes)
    [00:00:25.564,941] <err> wifi_nrf: hal_rpu_event_get: Unable to alloc HAL msg for event (49 bytes)
    [00:00:28.997,131] <err> wifi_nrf: hal_rpu_cmd_queue: Unable to allocate buffer for HAL command
    [00:00:28.997,192] <err> wifi_nrf: nrf_wifi_hal_ctrl_cmd_send: Queueing of command failed
    [00:00:32.360,137] <err> wifi_nrf: hal_rpu_event_get: Unable to alloc HAL msg for event (49 bytes)
    [00:00:32.360,443] <err> wifi_nrf: hal_rpu_event_get: Unable to alloc HAL msg for event (49 bytes)
    [00:00:32.360,717] <err> wifi_nrf: hal_rpu_event_get: Unable to alloc HAL msg for event (49 bytes)
    [00:00:32.361,022] <err> wifi_nrf: hal_rpu_event_get: Unable to alloc HAL msg for event (49 bytes)
    [00:00:32.361,297] <err> wifi_nrf: hal_rpu_event_get: Unable to alloc HAL msg for event (49 bytes)
    [00:00:37.803,924] <err> wifi_nrf: hal_rpu_event_get: Unable to alloc HAL msg for event (49 bytes)
    [00:00:41.330,261] <err> wifi_nrf: hal_rpu_event_get: Unable to alloc HAL msg for event (100 bytes)
    [00:01:25.567,352] <err> wifi_nrf: hal_rpu_event_get: Unable to alloc HAL msg for event (100 bytes)
    [00:02:37.127,563] <err> wifi_nrf: hal_rpu_event_get: Unable to alloc HAL msg for event (117 bytes)
    


    For my WiFi test setup, I've configured my laptop's WiFi card in monitor mode and I'm tracking all WiFi traffic through Wireshark. This setup works well for beacon frames, but I can't see any data packets when in connection mode.

    I did receive the email from the FAE, which was helpful, but I'm still working through the issues, my eventual task is to operate a socket raw to transmit data. Would increasing the network buffer configurations in my project help with these errors?

    Any additional guidance would be greatly appreciated.
    i modified the sketch with this to test sending data frames

    struct data_frame {
        uint16_t frame_control;
        uint16_t duration;
        uint8_t da[6];      // Destination Address
        uint8_t sa[6];      // Source Address
        uint8_t bssid[6];   // BSSID
        uint16_t seq_ctrl;
        // For a data frame containing UDP, we add LLC/SNAP headers followed by IP and UDP headers
        uint8_t payload[BEACON_PAYLOAD_LENGTH]; // Reusing the same buffer size
    } __packed;
    
    static struct data_frame test_data_frame = {
        .frame_control = htons(0x0208),  // Data frame (0x08) with "to DS" bit set (0x02)
        .duration = 0x0000,
        .da = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55},  // Access Point MAC
        .sa = {0xA0, 0x69, 0x60, 0xE3, 0x52, 0x15},  // Your MAC address
        .bssid = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55},  // Access Point BSSID
        .seq_ctrl = 0x0001,
        .payload = {
            // LLC/SNAP Header
            0xAA, 0xAA, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00,
            
            // IP Header (simplified)
            0x45, 0x00, 0x00, 0x1C, // Version, IHL, TOS, Total Length
            0xAB, 0xCD, 0x00, 0x00, // Identification, Flags, Fragment Offset
            0x40, 0x11, 0x00, 0x00, // TTL, Protocol (UDP=17), Header Checksum (to be calculated)
            0xC0, 0xA8, 0x01, 0x02, // Source IP: 192.168.1.2
            0xC0, 0xA8, 0x01, 0x01, // Destination IP: 192.168.1.1
            
            // UDP Header
            0x12, 0x34, 0x45, 0x67, // Source Port (4660), Destination Port (17767)
            0x00, 0x08, 0x00, 0x00, // Length (8 bytes), Checksum (to be calculated)
            
            // UDP Payload - "HELLO"
            0x48, 0x45, 0x4C, 0x4C, 0x4F
        }
    };

    Also do you have any documentation on the RAW socket type ?
    I was wondering if i could connect that to the wifi interface and send data that way as opposed to raw_tx_transmit 

    Best regards,
    Olaifa

  • drfhaust said:
    Yes, I'm using NCS 2.7 for my main project, but I tested the raw tx packet sample in NCS 2.9 where I was able to successfully capture the beacon frames in Wireshark.

    I would've ofcourse expected this to work in 2.7 as well, so that is a problem. Though I guess this is also still a problem for you and your application, right? Since you are not going to migrate to 2.9 because of this? 

    drfhaust said:
    However, when I switched the sample to connection mode and it successfully connects to WiFi, I'm encountering memory allocation errors in the logs and no longer see any data packets in Wireshark. Here are some of the errors I'm seeing:

    Could you try increasing the network buffers and stack sizes? Ie:

    CONFIG_NET_PKT_RX_COUNT=16
    CONFIG_NET_PKT_TX_COUNT=16
    CONFIG_NET_BUF_RX_COUNT=80
    CONFIG_NET_BUF_TX_COUNT=80
    CONFIG_NET_BUF_DATA_SIZE=512
    CONFIG_HEAP_MEM_POOL_SIZE=120000
    CONFIG_MAIN_STACK_SIZE=8192
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
    CONFIG_NET_TX_STACK_SIZE=4096
    CONFIG_NET_RX_STACK_SIZE=4096
    drfhaust said:
    Also do you have any documentation on the RAW socket type ?
    We do have this. I'll ask the relevant R&D team about the rest. I'll let you know once I hear from them.
    Regards,
    Elfving
  • Hi elfving,

    I was able to transmit beacon packets in connected mode. I also successfully modified my UDP packets to send, however I'm facing a few issues:

    1. I need to send at least 1000 packets (the system crashes in continuous mode)
    2. Out of those 0000 packets, I only see about 5-20 of them received (with sequence numbers that are often sequential and randomly placed between 2 and 1000)
    3. The transmission isn't very reliable - sending fewer packets likely results in no successful transmissions

    For UDP sockets, I can see fully formed UDP packets in Wireshark, but on the listening sockets I don't see the actual data being receivedin my socket listener.

    Frame 781202: 143 bytes on wire (1144 bits), 143 bytes captured (1144 bits) on interface \Device\NPF_{05A6AE1F-1522-4B0D-AE5F-5F66B116ECD9}, id 0
    Radiotap Header v0, Length 15
    802.11 radio information
        Signal strength (dBm): -84 dBm
    IEEE 802.11 Data, Flags: .......T
        Type/Subtype: Data (0x0020)
        Frame Control Field: 0x0801
            .... ..00 = Version: 0
            .... 10.. = Type: Data frame (2)
            0000 .... = Subtype: 0
            Flags: 0x01
                .... ..01 = DS status: Frame from STA to DS via an AP (To DS: 1 From DS: 0) (0x1)
                .... .0.. = More Fragments: This is the last fragment
                .... 0... = Retry: Frame is not being retransmitted
                ...0 .... = PWR MGT: STA will stay up
                ..0. .... = More Data: No data buffered
                .0.. .... = Protected flag: Data is not protected
                0... .... = +HTC/Order flag: Not strictly ordered
        .000 0000 0000 0000 = Duration: 0 microseconds
        Receiver address: d6:35:1d:b4:d6:42 (d6:35:1d:b4:d6:42)
            .... ..1. .... .... .... .... = LG bit: Locally administered address (this is NOT the factory default)
            .... ...0 .... .... .... .... = IG bit: Individual address (unicast)
        Transmitter address: NordicSemico_00:69:ed (f4:ce:36:00:69:ed)
            .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
            .... ...0 .... .... .... .... = IG bit: Individual address (unicast)
        Destination address: fa:95:82:89:69:e4 (fa:95:82:89:69:e4)
            .... ..1. .... .... .... .... = LG bit: Locally administered address (this is NOT the factory default)
            .... ...0 .... .... .... .... = IG bit: Individual address (unicast)
        Source address: NordicSemico_00:69:ed (f4:ce:36:00:69:ed)
            .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
            .... ...0 .... .... .... .... = IG bit: Individual address (unicast)
        BSS Id: d6:35:1d:b4:d6:42 (d6:35:1d:b4:d6:42)
            .... ..1. .... .... .... .... = LG bit: Locally administered address (this is NOT the factory default)
            .... ...0 .... .... .... .... = IG bit: Individual address (unicast)
        STA address: NordicSemico_00:69:ed (f4:ce:36:00:69:ed)
            .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
            .... ...0 .... .... .... .... = IG bit: Individual address (unicast)
        .... .... .... 0000 = Fragment number: 0
        0100 1001 0111 .... = Sequence number: 1175
        [WLAN Flags: .......T]
    Logical-Link Control
        DSAP: SNAP (0xaa)
        SSAP: SNAP (0xaa)
        Control field: U, func=UI (0x03)
        Organization Code: 00:00:00 (Officially Xerox, but 0:0:0:0:0:0 is more common)
        Type: IPv4 (0x0800)
    Internet Protocol Version 4, Src: 192.168.1.30, Dst: 192.168.1.159
        0100 .... = Version: 4
        .... 0101 = Header Length: 20 bytes (5)
        Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT)
        Total Length: 43
        Identification: 0xabcd (43981)
        000. .... = Flags: 0x0
        ...0 0000 0000 0000 = Fragment Offset: 0
        Time to Live: 64
        Protocol: UDP (17)
        Header Checksum: 0xe74a [validation disabled]
        [Header checksum status: Unverified]
        Source Address: 192.168.1.30
        Destination Address: 192.168.1.159
        [Stream index: 3]
    User Datagram Protocol, Src Port: 12345, Dst Port: 1234
        Source Port: 12345
        Destination Port: 1234
        Length: 23
        Checksum: 0x0000 [zero-value ignored]
        [Stream index: 7]
        [Stream Packet Number: 100]
        [Timestamps]
        UDP payload (15 bytes)
    Data (15 bytes)
        Data: 48656c6c6f2c2057692d4669210d0a
        [Length: 15]
    

    Do you have any additional pointers that might help improve the reliability of transmission? Would it be helpful to share my code for you to review?

Reply
  • Hi elfving,

    I was able to transmit beacon packets in connected mode. I also successfully modified my UDP packets to send, however I'm facing a few issues:

    1. I need to send at least 1000 packets (the system crashes in continuous mode)
    2. Out of those 0000 packets, I only see about 5-20 of them received (with sequence numbers that are often sequential and randomly placed between 2 and 1000)
    3. The transmission isn't very reliable - sending fewer packets likely results in no successful transmissions

    For UDP sockets, I can see fully formed UDP packets in Wireshark, but on the listening sockets I don't see the actual data being receivedin my socket listener.

    Frame 781202: 143 bytes on wire (1144 bits), 143 bytes captured (1144 bits) on interface \Device\NPF_{05A6AE1F-1522-4B0D-AE5F-5F66B116ECD9}, id 0
    Radiotap Header v0, Length 15
    802.11 radio information
        Signal strength (dBm): -84 dBm
    IEEE 802.11 Data, Flags: .......T
        Type/Subtype: Data (0x0020)
        Frame Control Field: 0x0801
            .... ..00 = Version: 0
            .... 10.. = Type: Data frame (2)
            0000 .... = Subtype: 0
            Flags: 0x01
                .... ..01 = DS status: Frame from STA to DS via an AP (To DS: 1 From DS: 0) (0x1)
                .... .0.. = More Fragments: This is the last fragment
                .... 0... = Retry: Frame is not being retransmitted
                ...0 .... = PWR MGT: STA will stay up
                ..0. .... = More Data: No data buffered
                .0.. .... = Protected flag: Data is not protected
                0... .... = +HTC/Order flag: Not strictly ordered
        .000 0000 0000 0000 = Duration: 0 microseconds
        Receiver address: d6:35:1d:b4:d6:42 (d6:35:1d:b4:d6:42)
            .... ..1. .... .... .... .... = LG bit: Locally administered address (this is NOT the factory default)
            .... ...0 .... .... .... .... = IG bit: Individual address (unicast)
        Transmitter address: NordicSemico_00:69:ed (f4:ce:36:00:69:ed)
            .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
            .... ...0 .... .... .... .... = IG bit: Individual address (unicast)
        Destination address: fa:95:82:89:69:e4 (fa:95:82:89:69:e4)
            .... ..1. .... .... .... .... = LG bit: Locally administered address (this is NOT the factory default)
            .... ...0 .... .... .... .... = IG bit: Individual address (unicast)
        Source address: NordicSemico_00:69:ed (f4:ce:36:00:69:ed)
            .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
            .... ...0 .... .... .... .... = IG bit: Individual address (unicast)
        BSS Id: d6:35:1d:b4:d6:42 (d6:35:1d:b4:d6:42)
            .... ..1. .... .... .... .... = LG bit: Locally administered address (this is NOT the factory default)
            .... ...0 .... .... .... .... = IG bit: Individual address (unicast)
        STA address: NordicSemico_00:69:ed (f4:ce:36:00:69:ed)
            .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
            .... ...0 .... .... .... .... = IG bit: Individual address (unicast)
        .... .... .... 0000 = Fragment number: 0
        0100 1001 0111 .... = Sequence number: 1175
        [WLAN Flags: .......T]
    Logical-Link Control
        DSAP: SNAP (0xaa)
        SSAP: SNAP (0xaa)
        Control field: U, func=UI (0x03)
        Organization Code: 00:00:00 (Officially Xerox, but 0:0:0:0:0:0 is more common)
        Type: IPv4 (0x0800)
    Internet Protocol Version 4, Src: 192.168.1.30, Dst: 192.168.1.159
        0100 .... = Version: 4
        .... 0101 = Header Length: 20 bytes (5)
        Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT)
        Total Length: 43
        Identification: 0xabcd (43981)
        000. .... = Flags: 0x0
        ...0 0000 0000 0000 = Fragment Offset: 0
        Time to Live: 64
        Protocol: UDP (17)
        Header Checksum: 0xe74a [validation disabled]
        [Header checksum status: Unverified]
        Source Address: 192.168.1.30
        Destination Address: 192.168.1.159
        [Stream index: 3]
    User Datagram Protocol, Src Port: 12345, Dst Port: 1234
        Source Port: 12345
        Destination Port: 1234
        Length: 23
        Checksum: 0x0000 [zero-value ignored]
        [Stream index: 7]
        [Stream Packet Number: 100]
        [Timestamps]
        UDP payload (15 bytes)
    Data (15 bytes)
        Data: 48656c6c6f2c2057692d4669210d0a
        [Length: 15]
    

    Do you have any additional pointers that might help improve the reliability of transmission? Would it be helpful to share my code for you to review?

Children
No Data
Related