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.

CC3000:Issue with TCP

I have encountered this same issue. I am sending large files via TCP during an HTTP session and I see packets being transmitted out of order. This is unacceptable. Attached is a copy for a Wireshark capture of communications between the CC3000 (192.168.1.101) and my PC web browser (192.168.1.102). The HTTP server will transmit segments of the file in block sizes determined by the lesser of the following (1000 bytes or the remaining bytes to be transmitted from the file). I have instrumented my code an have observed that the send() function was indeed sent a series of 1000 bytes blocks followed by the last segment of 355 bytes. However, as can be seen from the Wireshark trace, these are being transmitted out of order by the CC3000.

I changed the code to wait for a HCI_EVENT_CC3000_CAN_SHUT_DOWN event after each send. This appeared to "fix" the problem, but at a HUGE performance hit to data throughput. The issue seems to be triggered by numerous back-to-back send() requests from the application code.

This is serious enough to scrap further development with your part. Please get back to me with the corrective action ASAP.

No.     Time           Source                Destination           Protocol Length Info
      7 6.337004000    192.168.1.102         192.168.1.101         TCP      62     slingshot > http [SYN] Seq=0 Win=65535 Len=0 MSS=1460 SACK_PERM=1

Frame 7: 62 bytes on wire (496 bits), 62 bytes captured (496 bits) on interface 0
Ethernet II, Src: Intel_55:18:66 (00:07:e9:55:18:66), Dst: LsResear_02:22:cb (00:25:ca:02:22:cb)
Internet Protocol Version 4, Src: 192.168.1.102 (192.168.1.102), Dst: 192.168.1.101 (192.168.1.101)
Transmission Control Protocol, Src Port: slingshot (1705), Dst Port: http (80), Seq: 0, Len: 0
    Source port: slingshot (1705)
    Destination port: http (80)
    [Stream index: 0]
    Sequence number: 0    (relative sequence number)
    Header length: 28 bytes
    Flags: 0x002 (SYN)
    Window size value: 65535
    [Calculated window size: 65535]
    Checksum: 0xae3f [validation disabled]
    Options: (8 bytes), Maximum segment size, No-Operation (NOP), No-Operation (NOP), SACK permitted

No.     Time           Source                Destination           Protocol Length Info
      8 6.341217000    192.168.1.101         192.168.1.102         TCP      60     http > slingshot [SYN, ACK] Seq=0 Ack=1 Win=1460 Len=0 MSS=1460

Frame 8: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface 0
Ethernet II, Src: LsResear_02:22:cb (00:25:ca:02:22:cb), Dst: Intel_55:18:66 (00:07:e9:55:18:66)
Internet Protocol Version 4, Src: 192.168.1.101 (192.168.1.101), Dst: 192.168.1.102 (192.168.1.102)
Transmission Control Protocol, Src Port: http (80), Dst Port: slingshot (1705), Seq: 0, Ack: 1, Len: 0
    Source port: http (80)
    Destination port: slingshot (1705)
    [Stream index: 0]
    Sequence number: 0    (relative sequence number)
    Acknowledgment number: 1    (relative ack number)
    Header length: 24 bytes
    Flags: 0x012 (SYN, ACK)
    Window size value: 1460
    [Calculated window size: 1460]
    Checksum: 0x4b46 [validation disabled]
    Options: (4 bytes), Maximum segment size
    [SEQ/ACK analysis]

No.     Time           Source                Destination           Protocol Length Info
      9 6.341255000    192.168.1.102         192.168.1.101         TCP      54     slingshot > http [ACK] Seq=1 Ack=1 Win=65535 Len=0

Frame 9: 54 bytes on wire (432 bits), 54 bytes captured (432 bits) on interface 0
Ethernet II, Src: Intel_55:18:66 (00:07:e9:55:18:66), Dst: LsResear_02:22:cb (00:25:ca:02:22:cb)
Internet Protocol Version 4, Src: 192.168.1.102 (192.168.1.102), Dst: 192.168.1.101 (192.168.1.101)
Transmission Control Protocol, Src Port: slingshot (1705), Dst Port: http (80), Seq: 1, Ack: 1, Len: 0
    Source port: slingshot (1705)
    Destination port: http (80)
    [Stream index: 0]
    Sequence number: 1    (relative sequence number)
    Acknowledgment number: 1    (relative ack number)
    Header length: 20 bytes
    Flags: 0x010 (ACK)
    Window size value: 65535
    [Calculated window size: 65535]
    [Window size scaling factor: -2 (no window scaling used)]
    Checksum: 0x8436 [validation disabled]
    [SEQ/ACK analysis]

No.     Time           Source                Destination           Protocol Length Info
     10 6.341576000    192.168.1.102         192.168.1.101         HTTP     370    GET /dygraph/rgbcolor/rgbcolor.js HTTP/1.1 

Frame 10: 370 bytes on wire (2960 bits), 370 bytes captured (2960 bits) on interface 0
Ethernet II, Src: Intel_55:18:66 (00:07:e9:55:18:66), Dst: LsResear_02:22:cb (00:25:ca:02:22:cb)
Internet Protocol Version 4, Src: 192.168.1.102 (192.168.1.102), Dst: 192.168.1.101 (192.168.1.101)
Transmission Control Protocol, Src Port: slingshot (1705), Dst Port: http (80), Seq: 1, Ack: 1, Len: 316
    Source port: slingshot (1705)
    Destination port: http (80)
    [Stream index: 0]
    Sequence number: 1    (relative sequence number)
    [Next sequence number: 317    (relative sequence number)]
    Acknowledgment number: 1    (relative ack number)
    Header length: 20 bytes
    Flags: 0x018 (PSH, ACK)
    Window size value: 65535
    [Calculated window size: 65535]
    [Window size scaling factor: -2 (no window scaling used)]
    Checksum: 0x8572 [validation disabled]
    [SEQ/ACK analysis]
Hypertext Transfer Protocol

No.     Time           Source                Destination           Protocol Length Info
     11 6.345587000    192.168.1.101         192.168.1.102         TCP      60     http > slingshot [ACK] Seq=1 Ack=317 Win=1460 Len=0

Frame 11: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface 0
Ethernet II, Src: LsResear_02:22:cb (00:25:ca:02:22:cb), Dst: Intel_55:18:66 (00:07:e9:55:18:66)
Internet Protocol Version 4, Src: 192.168.1.101 (192.168.1.101), Dst: 192.168.1.102 (192.168.1.102)
Transmission Control Protocol, Src Port: http (80), Dst Port: slingshot (1705), Seq: 1, Ack: 317, Len: 0
    Source port: http (80)
    Destination port: slingshot (1705)
    [Stream index: 0]
    Sequence number: 1    (relative sequence number)
    Acknowledgment number: 317    (relative ack number)
    Header length: 20 bytes
    Flags: 0x010 (ACK)
    Window size value: 1460
    [Calculated window size: 1460]
    [Window size scaling factor: -2 (no window scaling used)]
    Checksum: 0x61c7 [validation disabled]
    [SEQ/ACK analysis]

No.     Time           Source                Destination           Protocol Length Info
     12 6.354588000    192.168.1.101         192.168.1.102         TCP      168    [TCP segment of a reassembled PDU]

Frame 12: 168 bytes on wire (1344 bits), 168 bytes captured (1344 bits) on interface 0
Ethernet II, Src: LsResear_02:22:cb (00:25:ca:02:22:cb), Dst: Intel_55:18:66 (00:07:e9:55:18:66)
Internet Protocol Version 4, Src: 192.168.1.101 (192.168.1.101), Dst: 192.168.1.102 (192.168.1.102)
Transmission Control Protocol, Src Port: http (80), Dst Port: slingshot (1705), Seq: 1, Ack: 317, Len: 114
    Source port: http (80)
    Destination port: slingshot (1705)
    [Stream index: 0]
    Sequence number: 1    (relative sequence number)
    [Next sequence number: 115    (relative sequence number)]
    Acknowledgment number: 317    (relative ack number)
    Header length: 20 bytes
    Flags: 0x018 (PSH, ACK)
    Window size value: 1460
    [Calculated window size: 1460]
    [Window size scaling factor: -2 (no window scaling used)]
    Checksum: 0xfe0d [validation disabled]
    [SEQ/ACK analysis]
    TCP segment data (114 bytes)

No.     Time           Source                Destination           Protocol Length Info
     13 6.357904000    192.168.1.101         192.168.1.102         TCP      1054   [TCP segment of a reassembled PDU]

Frame 13: 1054 bytes on wire (8432 bits), 1054 bytes captured (8432 bits) on interface 0
Ethernet II, Src: LsResear_02:22:cb (00:25:ca:02:22:cb), Dst: Intel_55:18:66 (00:07:e9:55:18:66)
Internet Protocol Version 4, Src: 192.168.1.101 (192.168.1.101), Dst: 192.168.1.102 (192.168.1.102)
Transmission Control Protocol, Src Port: http (80), Dst Port: slingshot (1705), Seq: 115, Ack: 317, Len: 1000
    Source port: http (80)
    Destination port: slingshot (1705)
    [Stream index: 0]
    Sequence number: 115    (relative sequence number)
    [Next sequence number: 1115    (relative sequence number)]
    Acknowledgment number: 317    (relative ack number)
    Header length: 20 bytes
    Flags: 0x018 (PSH, ACK)
    Window size value: 1460
    [Calculated window size: 1460]
    [Window size scaling factor: -2 (no window scaling used)]
    Checksum: 0x3f52 [validation disabled]
    [SEQ/ACK analysis]
    [Reassembled PDU in frame: 26]
    TCP segment data (1000 bytes)

No.     Time           Source                Destination           Protocol Length Info
     14 6.357949000    192.168.1.102         192.168.1.101         TCP      54     slingshot > http [ACK] Seq=317 Ack=1115 Win=64421 Len=0

Frame 14: 54 bytes on wire (432 bits), 54 bytes captured (432 bits) on interface 0
Ethernet II, Src: Intel_55:18:66 (00:07:e9:55:18:66), Dst: LsResear_02:22:cb (00:25:ca:02:22:cb)
Internet Protocol Version 4, Src: 192.168.1.102 (192.168.1.102), Dst: 192.168.1.101 (192.168.1.101)
Transmission Control Protocol, Src Port: slingshot (1705), Dst Port: http (80), Seq: 317, Ack: 1115, Len: 0
    Source port: slingshot (1705)
    Destination port: http (80)
    [Stream index: 0]
    Sequence number: 317    (relative sequence number)
    Acknowledgment number: 1115    (relative ack number)
    Header length: 20 bytes
    Flags: 0x010 (ACK)
    Window size value: 64421
    [Calculated window size: 64421]
    [Window size scaling factor: -2 (no window scaling used)]
    Checksum: 0x8436 [validation disabled]
    [SEQ/ACK analysis]

No.     Time           Source                Destination           Protocol Length Info
     15 6.363369000    192.168.1.101         192.168.1.102         TCP      1054   [TCP segment of a reassembled PDU]

Frame 15: 1054 bytes on wire (8432 bits), 1054 bytes captured (8432 bits) on interface 0
Ethernet II, Src: LsResear_02:22:cb (00:25:ca:02:22:cb), Dst: Intel_55:18:66 (00:07:e9:55:18:66)
Internet Protocol Version 4, Src: 192.168.1.101 (192.168.1.101), Dst: 192.168.1.102 (192.168.1.102)
Transmission Control Protocol, Src Port: http (80), Dst Port: slingshot (1705), Seq: 1115, Ack: 317, Len: 1000
    Source port: http (80)
    Destination port: slingshot (1705)
    [Stream index: 0]
    Sequence number: 1115    (relative sequence number)
    [Next sequence number: 2115    (relative sequence number)]
    Acknowledgment number: 317    (relative ack number)
    Header length: 20 bytes
    Flags: 0x018 (PSH, ACK)
    Window size value: 1460
    [Calculated window size: 1460]
    [Window size scaling factor: -2 (no window scaling used)]
    Checksum: 0x9899 [validation disabled]
    [SEQ/ACK analysis]
    [Reassembled PDU in frame: 26]
    TCP segment data (1000 bytes)

No.     Time           Source                Destination           Protocol Length Info
     16 6.363944000    192.168.1.101         192.168.1.102         TCP      1054   [TCP segment of a reassembled PDU]

Frame 16: 1054 bytes on wire (8432 bits), 1054 bytes captured (8432 bits) on interface 0
Ethernet II, Src: LsResear_02:22:cb (00:25:ca:02:22:cb), Dst: Intel_55:18:66 (00:07:e9:55:18:66)
Internet Protocol Version 4, Src: 192.168.1.101 (192.168.1.101), Dst: 192.168.1.102 (192.168.1.102)
Transmission Control Protocol, Src Port: http (80), Dst Port: slingshot (1705), Seq: 2115, Ack: 317, Len: 1000
    Source port: http (80)
    Destination port: slingshot (1705)
    [Stream index: 0]
    Sequence number: 2115    (relative sequence number)
    [Next sequence number: 3115    (relative sequence number)]
    Acknowledgment number: 317    (relative ack number)
    Header length: 20 bytes
    Flags: 0x018 (PSH, ACK)
    Window size value: 1460
    [Calculated window size: 1460]
    [Window size scaling factor: -2 (no window scaling used)]
    Checksum: 0x4b21 [validation disabled]
    [SEQ/ACK analysis]
    [Reassembled PDU in frame: 26]
    TCP segment data (1000 bytes)

No.     Time           Source                Destination           Protocol Length Info
     17 6.363984000    192.168.1.102         192.168.1.101         TCP      54     slingshot > http [ACK] Seq=317 Ack=3115 Win=65535 Len=0

Frame 17: 54 bytes on wire (432 bits), 54 bytes captured (432 bits) on interface 0
Ethernet II, Src: Intel_55:18:66 (00:07:e9:55:18:66), Dst: LsResear_02:22:cb (00:25:ca:02:22:cb)
Internet Protocol Version 4, Src: 192.168.1.102 (192.168.1.102), Dst: 192.168.1.101 (192.168.1.101)
Transmission Control Protocol, Src Port: slingshot (1705), Dst Port: http (80), Seq: 317, Ack: 3115, Len: 0
    Source port: slingshot (1705)
    Destination port: http (80)
    [Stream index: 0]
    Sequence number: 317    (relative sequence number)
    Acknowledgment number: 3115    (relative ack number)
    Header length: 20 bytes
    Flags: 0x010 (ACK)
    Window size value: 65535
    [Calculated window size: 65535]
    [Window size scaling factor: -2 (no window scaling used)]
    Checksum: 0x8436 [validation disabled]
    [SEQ/ACK analysis]

No.     Time           Source                Destination           Protocol Length Info
     18 6.369513000    192.168.1.101         192.168.1.102         TCP      1054   [TCP segment of a reassembled PDU]

Frame 18: 1054 bytes on wire (8432 bits), 1054 bytes captured (8432 bits) on interface 0
Ethernet II, Src: LsResear_02:22:cb (00:25:ca:02:22:cb), Dst: Intel_55:18:66 (00:07:e9:55:18:66)
Internet Protocol Version 4, Src: 192.168.1.101 (192.168.1.101), Dst: 192.168.1.102 (192.168.1.102)
Transmission Control Protocol, Src Port: http (80), Dst Port: slingshot (1705), Seq: 3115, Ack: 317, Len: 1000
    Source port: http (80)
    Destination port: slingshot (1705)
    [Stream index: 0]
    Sequence number: 3115    (relative sequence number)
    [Next sequence number: 4115    (relative sequence number)]
    Acknowledgment number: 317    (relative ack number)
    Header length: 20 bytes
    Flags: 0x018 (PSH, ACK)
    Window size value: 1460
    [Calculated window size: 1460]
    [Window size scaling factor: -2 (no window scaling used)]
    Checksum: 0xabba [validation disabled]
    [SEQ/ACK analysis]
    [Reassembled PDU in frame: 26]
    TCP segment data (1000 bytes)

No.     Time           Source                Destination           Protocol Length Info
     19 6.373187000    192.168.1.101         192.168.1.102         TCP      1054   [TCP segment of a reassembled PDU]

Frame 19: 1054 bytes on wire (8432 bits), 1054 bytes captured (8432 bits) on interface 0
Ethernet II, Src: LsResear_02:22:cb (00:25:ca:02:22:cb), Dst: Intel_55:18:66 (00:07:e9:55:18:66)
Internet Protocol Version 4, Src: 192.168.1.101 (192.168.1.101), Dst: 192.168.1.102 (192.168.1.102)
Transmission Control Protocol, Src Port: http (80), Dst Port: slingshot (1705), Seq: 4115, Ack: 317, Len: 1000
    Source port: http (80)
    Destination port: slingshot (1705)
    [Stream index: 0]
    Sequence number: 4115    (relative sequence number)
    [Next sequence number: 5115    (relative sequence number)]
    Acknowledgment number: 317    (relative ack number)
    Header length: 20 bytes
    Flags: 0x018 (PSH, ACK)
    Window size value: 1460
    [Calculated window size: 1460]
    [Window size scaling factor: -2 (no window scaling used)]
    Checksum: 0x9091 [validation disabled]
    [SEQ/ACK analysis]
    [Reassembled PDU in frame: 26]
    TCP segment data (1000 bytes)

No.     Time           Source                Destination           Protocol Length Info
     20 6.373237000    192.168.1.102         192.168.1.101         TCP      54     slingshot > http [ACK] Seq=317 Ack=5115 Win=65535 Len=0

Frame 20: 54 bytes on wire (432 bits), 54 bytes captured (432 bits) on interface 0
Ethernet II, Src: Intel_55:18:66 (00:07:e9:55:18:66), Dst: LsResear_02:22:cb (00:25:ca:02:22:cb)
Internet Protocol Version 4, Src: 192.168.1.102 (192.168.1.102), Dst: 192.168.1.101 (192.168.1.101)
Transmission Control Protocol, Src Port: slingshot (1705), Dst Port: http (80), Seq: 317, Ack: 5115, Len: 0
    Source port: slingshot (1705)
    Destination port: http (80)
    [Stream index: 0]
    Sequence number: 317    (relative sequence number)
    Acknowledgment number: 5115    (relative ack number)
    Header length: 20 bytes
    Flags: 0x010 (ACK)
    Window size value: 65535
    [Calculated window size: 65535]
    [Window size scaling factor: -2 (no window scaling used)]
    Checksum: 0x8436 [validation disabled]
    [SEQ/ACK analysis]

No.     Time           Source                Destination           Protocol Length Info
     21 6.378212000    192.168.1.101         192.168.1.102         TCP      409    [TCP segment of a reassembled PDU]

Frame 21: 409 bytes on wire (3272 bits), 409 bytes captured (3272 bits) on interface 0
Ethernet II, Src: LsResear_02:22:cb (00:25:ca:02:22:cb), Dst: Intel_55:18:66 (00:07:e9:55:18:66)
Internet Protocol Version 4, Src: 192.168.1.101 (192.168.1.101), Dst: 192.168.1.102 (192.168.1.102)
Transmission Control Protocol, Src Port: http (80), Dst Port: slingshot (1705), Seq: 5115, Ack: 317, Len: 355
    Source port: http (80)
    Destination port: slingshot (1705)
    [Stream index: 0]
    Sequence number: 5115    (relative sequence number)
    [Next sequence number: 5470    (relative sequence number)]
    Acknowledgment number: 317    (relative ack number)
    Header length: 20 bytes
    Flags: 0x018 (PSH, ACK)
    Window size value: 1460
    [Calculated window size: 1460]
    [Window size scaling factor: -2 (no window scaling used)]
    Checksum: 0xdf48 [validation disabled]
    [SEQ/ACK analysis]
    [Reassembled PDU in frame: 26]
    TCP segment data (355 bytes)

No.     Time           Source                Destination           Protocol Length Info
     22 6.380514000    192.168.1.101         192.168.1.102         TCP      1054   [TCP segment of a reassembled PDU]

Frame 22: 1054 bytes on wire (8432 bits), 1054 bytes captured (8432 bits) on interface 0
Ethernet II, Src: LsResear_02:22:cb (00:25:ca:02:22:cb), Dst: Intel_55:18:66 (00:07:e9:55:18:66)
Internet Protocol Version 4, Src: 192.168.1.101 (192.168.1.101), Dst: 192.168.1.102 (192.168.1.102)
Transmission Control Protocol, Src Port: http (80), Dst Port: slingshot (1705), Seq: 5470, Ack: 317, Len: 1000
    Source port: http (80)
    Destination port: slingshot (1705)
    [Stream index: 0]
    Sequence number: 5470    (relative sequence number)
    [Next sequence number: 6470    (relative sequence number)]
    Acknowledgment number: 317    (relative ack number)
    Header length: 20 bytes
    Flags: 0x018 (PSH, ACK)
    Window size value: 1460
    [Calculated window size: 1460]
    [Window size scaling factor: -2 (no window scaling used)]
    Checksum: 0x33ae [validation disabled]
    [SEQ/ACK analysis]
    [Reassembled PDU in frame: 26]
    TCP segment data (1000 bytes)

No.     Time           Source                Destination           Protocol Length Info
     23 6.380559000    192.168.1.102         192.168.1.101         TCP      54     slingshot > http [ACK] Seq=317 Ack=6470 Win=64180 Len=0

Frame 23: 54 bytes on wire (432 bits), 54 bytes captured (432 bits) on interface 0
Ethernet II, Src: Intel_55:18:66 (00:07:e9:55:18:66), Dst: LsResear_02:22:cb (00:25:ca:02:22:cb)
Internet Protocol Version 4, Src: 192.168.1.102 (192.168.1.102), Dst: 192.168.1.101 (192.168.1.101)
Transmission Control Protocol, Src Port: slingshot (1705), Dst Port: http (80), Seq: 317, Ack: 6470, Len: 0
    Source port: slingshot (1705)
    Destination port: http (80)
    [Stream index: 0]
    Sequence number: 317    (relative sequence number)
    Acknowledgment number: 6470    (relative ack number)
    Header length: 20 bytes
    Flags: 0x010 (ACK)
    Window size value: 64180
    [Calculated window size: 64180]
    [Window size scaling factor: -2 (no window scaling used)]
    Checksum: 0x8436 [validation disabled]
    [SEQ/ACK analysis]

No.     Time           Source                Destination           Protocol Length Info
     24 6.389790000    192.168.1.101         192.168.1.102         TCP      1054   [TCP segment of a reassembled PDU]

Frame 24: 1054 bytes on wire (8432 bits), 1054 bytes captured (8432 bits) on interface 0
Ethernet II, Src: LsResear_02:22:cb (00:25:ca:02:22:cb), Dst: Intel_55:18:66 (00:07:e9:55:18:66)
Internet Protocol Version 4, Src: 192.168.1.101 (192.168.1.101), Dst: 192.168.1.102 (192.168.1.102)
Transmission Control Protocol, Src Port: http (80), Dst Port: slingshot (1705), Seq: 6470, Ack: 317, Len: 1000
    Source port: http (80)
    Destination port: slingshot (1705)
    [Stream index: 0]
    Sequence number: 6470    (relative sequence number)
    [Next sequence number: 7470    (relative sequence number)]
    Acknowledgment number: 317    (relative ack number)
    Header length: 20 bytes
    Flags: 0x018 (PSH, ACK)
    Window size value: 1460
    [Calculated window size: 1460]
    [Window size scaling factor: -2 (no window scaling used)]
    Checksum: 0xb703 [validation disabled]
    [SEQ/ACK analysis]
    [Reassembled PDU in frame: 26]
    TCP segment data (1000 bytes)

No.     Time           Source                Destination           Protocol Length Info
     25 6.524375000    192.168.1.102         192.168.1.101         TCP      54     slingshot > http [ACK] Seq=317 Ack=7470 Win=65535 Len=0

Frame 25: 54 bytes on wire (432 bits), 54 bytes captured (432 bits) on interface 0
Ethernet II, Src: Intel_55:18:66 (00:07:e9:55:18:66), Dst: LsResear_02:22:cb (00:25:ca:02:22:cb)
Internet Protocol Version 4, Src: 192.168.1.102 (192.168.1.102), Dst: 192.168.1.101 (192.168.1.101)
Transmission Control Protocol, Src Port: slingshot (1705), Dst Port: http (80), Seq: 317, Ack: 7470, Len: 0
    Source port: slingshot (1705)
    Destination port: http (80)
    [Stream index: 0]
    Sequence number: 317    (relative sequence number)
    Acknowledgment number: 7470    (relative ack number)
    Header length: 20 bytes
    Flags: 0x010 (ACK)
    Window size value: 65535
    [Calculated window size: 65535]
    [Window size scaling factor: -2 (no window scaling used)]
    Checksum: 0x8436 [validation disabled]
    [SEQ/ACK analysis]

No.     Time           Source                Destination           Protocol Length Info
     26 7.533083000    192.168.1.101         192.168.1.102         HTTP     60     HTTP/1.0 200 OK  (text/javascript)

Frame 26: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface 0
Ethernet II, Src: LsResear_02:22:cb (00:25:ca:02:22:cb), Dst: Intel_55:18:66 (00:07:e9:55:18:66)
Internet Protocol Version 4, Src: 192.168.1.101 (192.168.1.101), Dst: 192.168.1.102 (192.168.1.102)
Transmission Control Protocol, Src Port: http (80), Dst Port: slingshot (1705), Seq: 7470, Ack: 317, Len: 0
    Source port: http (80)
    Destination port: slingshot (1705)
    [Stream index: 0]
    Sequence number: 7470    (relative sequence number)
    Acknowledgment number: 317    (relative ack number)
    Header length: 20 bytes
    Flags: 0x011 (FIN, ACK)
    Window size value: 1460
    [Calculated window size: 1460]
    [Window size scaling factor: -2 (no window scaling used)]
    Checksum: 0x4499 [validation disabled]
[10 Reassembled TCP Segments (7469 bytes): #12(114), #13(1000), #15(1000), #16(1000), #18(1000), #19(1000), #21(355), #22(1000), #24(1000), #26(0)]
    [Frame: 12, payload: 0-113 (114 bytes)]
    [Frame: 13, payload: 114-1113 (1000 bytes)]
    [Frame: 15, payload: 1114-2113 (1000 bytes)]
    [Frame: 16, payload: 2114-3113 (1000 bytes)]
    [Frame: 18, payload: 3114-4113 (1000 bytes)]
    [Frame: 19, payload: 4114-5113 (1000 bytes)]
    [Frame: 21, payload: 5114-5468 (355 bytes)]
    [Frame: 22, payload: 5469-6468 (1000 bytes)]
    [Frame: 24, payload: 6469-7468 (1000 bytes)]
    [Frame: 26 (no data)]
    [Segment count: 10]
    [Reassembled TCP length: 7469]
Hypertext Transfer Protocol
Line-based text data: text/javascript

No.     Time           Source                Destination           Protocol Length Info
     27 7.533142000    192.168.1.102         192.168.1.101         TCP      54     slingshot > http [ACK] Seq=317 Ack=7471 Win=65535 Len=0

Frame 27: 54 bytes on wire (432 bits), 54 bytes captured (432 bits) on interface 0
Ethernet II, Src: Intel_55:18:66 (00:07:e9:55:18:66), Dst: LsResear_02:22:cb (00:25:ca:02:22:cb)
Internet Protocol Version 4, Src: 192.168.1.102 (192.168.1.102), Dst: 192.168.1.101 (192.168.1.101)
Transmission Control Protocol, Src Port: slingshot (1705), Dst Port: http (80), Seq: 317, Ack: 7471, Len: 0
    Source port: slingshot (1705)
    Destination port: http (80)
    [Stream index: 0]
    Sequence number: 317    (relative sequence number)
    Acknowledgment number: 7471    (relative ack number)
    Header length: 20 bytes
    Flags: 0x010 (ACK)
    Window size value: 65535
    [Calculated window size: 65535]
    [Window size scaling factor: -2 (no window scaling used)]
    Checksum: 0x8436 [validation disabled]
    [SEQ/ACK analysis]

No.     Time           Source                Destination           Protocol Length Info
     28 7.533379000    192.168.1.102         192.168.1.101         TCP      54     slingshot > http [FIN, ACK] Seq=317 Ack=7471 Win=65535 Len=0

Frame 28: 54 bytes on wire (432 bits), 54 bytes captured (432 bits) on interface 0
Ethernet II, Src: Intel_55:18:66 (00:07:e9:55:18:66), Dst: LsResear_02:22:cb (00:25:ca:02:22:cb)
Internet Protocol Version 4, Src: 192.168.1.102 (192.168.1.102), Dst: 192.168.1.101 (192.168.1.101)
Transmission Control Protocol, Src Port: slingshot (1705), Dst Port: http (80), Seq: 317, Ack: 7471, Len: 0
    Source port: slingshot (1705)
    Destination port: http (80)
    [Stream index: 0]
    Sequence number: 317    (relative sequence number)
    Acknowledgment number: 7471    (relative ack number)
    Header length: 20 bytes
    Flags: 0x011 (FIN, ACK)
    Window size value: 65535
    [Calculated window size: 65535]
    [Window size scaling factor: -2 (no window scaling used)]
    Checksum: 0x8436 [validation disabled]

No.     Time           Source                Destination           Protocol Length Info
     29 7.538832000    192.168.1.101         192.168.1.102         TCP      60     http > slingshot [ACK] Seq=7471 Ack=318 Win=1460 Len=0

Frame 29: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface 0
Ethernet II, Src: LsResear_02:22:cb (00:25:ca:02:22:cb), Dst: Intel_55:18:66 (00:07:e9:55:18:66)
Internet Protocol Version 4, Src: 192.168.1.101 (192.168.1.101), Dst: 192.168.1.102 (192.168.1.102)
Transmission Control Protocol, Src Port: http (80), Dst Port: slingshot (1705), Seq: 7471, Ack: 318, Len: 0
    Source port: http (80)
    Destination port: slingshot (1705)
    [Stream index: 0]
    Sequence number: 7471    (relative sequence number)
    Acknowledgment number: 318    (relative ack number)
    Header length: 20 bytes
    Flags: 0x010 (ACK)
    Window size value: 1460
    [Calculated window size: 1460]
    [Window size scaling factor: -2 (no window scaling used)]
    Checksum: 0x4498 [validation disabled]
    [SEQ/ACK analysis]

  • An additional data point. This problem improves as I slow the SPI clock between the host processor and the CC3000 (TiWI-SL). It is pervasive at a SPI clock of 8MHz and only sporadic at a SPI clock of 1MHz. This is not an acceptable "fix" as it greatly diminishes throughput over the link. However, it does point to a timing/race condition in the CC3000 firmware.

  • Hi,

    We've fixed this issue starting V1.9. Can you please try to recreate it using that version?

    Thanks,

    Tomer

  • Hi Tomer,

    With respect to this original post, what issues are fixed in v1.10.1 (or may be v1.9) ?

    Does CC300 no longer sends out of sequence messages?

    Is it Ok to have SPI baud rate SET at 16  Mbps or I should lower it ?

    Please elobrate the fixes done with respect these issues.

    In my case we are also observing the out of sequence message. and application gets stuck while sending and receiving back to back messages.

    w.r.t. SPI clock, we have option to configure it from 1- 17Mbps. we are hoping to get atleast ~2Mbps rate over wiFi while doing continus Tx and Rx. is it good idea to keep SPI baud rate lowere  (~2Mbps) ?

    Please sugget at your earliest. We are stuck at the point of getting good thruougput as required by our application.

    Thanks,

    Manish K

     

     

  • Hi,

    You can see all resolved issues listed in the release notes page: http://processors.wiki.ti.com/index.php/CC3000_Release_Notes

    we have already version 1.10.2 with additional fixes.

    The CC3000 should no longer send out of sequence messages. Do you observe otherwise even with the latest patches? If so, can you tell us how you reproduce it?

    The SPI baud rate should be set up to 16Mbps. it can be set to lower rates as well. 

    Can you tell how you measure the throughput? is it in a shielded box? what is the rate that you see?

    Can you share more details on the stuck issue? how you reproduce it? what do you mean by get stuck? do you have ping for example?

    Thanks,

    Tomer

  • Hi Tomer,

    Thanks for looking into it.

    We have patch 1.10.1. And using non-TI host micro with TiWi-SL module. As of now it is open prototype board not shielded.  We are using 8Mbps SPI interface.

    Well here is what I am doing:

    We are trying to understand the maximum throughput that we can get over wi fi and then figure out whether it is good enough for our application.

    We have created PC application (Server) that is capable of transmission and reception over wifi. and TiWi module is Client. We did vice-versa as well.

    a)      TiWi is just transmitting 600 bytes of data continuously and PC server is receiving that data. Here we could get max throughput of ~1.3Mbps. Tested for ~30 mins or so. So this part is still ok if we do not run into any drops at long run.

    b)      Now in this case Server is sending messages of 600 bytes long back to back and TiWi is just receiving in a loop. There is no other operation that host micro is doing other then reception.

    In this case reception stops after some time. Attached excel sheet shows some data with different delay and different size and number of messages that we could send.

    In wireshark trace can see that at one point Server do not get Ack and then it is not even retransmitted. But when next packet comes in it tries to send more bytes (last packet + some bytes from new packet) and then does not receive any Ack. And dies over there.

    Please find excel sheet and wireshard trace attached.

    0508.Rx_Data.xlsx

    8688.Log1-WireShark.zip

    Thanks,

    Manish K

  • Hi,

    I was trying to open the wireshark log you attached, but it says the file is corrupted. 

    Can you please verify and attach again?

    In the meantime, I'm trying to reproduce the problem.

    Regards,

    Tomer

  • Hi,

    I believe we have been able to reproduce the problem. The issue is related to a race condition where 2 back to back command (recv) and data (send) reach the CC3000 device. We are currently working on a solution which should be a part of our next official release V1.11. 

    In the meantime, to overcome the issue, and if not already used, please add the select command before the recv. I believe it will overcome the issue.

    Regards,

    Tomer

  • Thanks Tomer for the efforts and update.

    I did not understand how to add select command. Which exact command you are reffering to. It would be great if you can write how to use this.

    Also is there any tentative date for V1.11 release?

    Once again thanks for helping.

    Regards,

    Manish Kakra

  • An example:

    /* Configure parameters for select call */
    FD_ZERO(&readfds);
    FD_SET(sockfd_child,&readfds);

    do
    {
        active_readfds = readfds;
        iRet = select(sockfd_child + 1, &active_readfds, NULL, NULL, &timeout);

        if(iRet > 0)
        {
            bytes_rx = recv(sockfd_child, &RecvBuf[0], MAX_TCP_PAYLOAD_SIZE, 0);
        }

    } while (iRet > 0);

    V1.11 is planned for e/o this month.

  • Thanks Tomer,

    I tried to use this. Below is the code with this for sending data from TiWi module to PC client.

      fd_set readfds, active_readfds;
      fd_set writefds, active_writefds;
      struct timeval timeout;
      int iRet;
      
      FD_ZERO(&writefds);
      FD_SET(clientDescriptor,&writefds);
      timeout.tv_sec = 0;
      timeout.tv_usec = 0;
      
      while(1)
      {
       nNumOfBytesRecvd = 1300;
       do
       {
        active_writefds = writefds;
        iRet = select(clientDescriptor + 1, /*&active_readfds*/ NULL, &active_writefds, NULL, &timeout);

        if(iRet > 0)
        {
         nNumOfBytesRecvd = send(clientDescriptor, DataSendCC3000Buffer, nNumOfBytesRecvd, 0);
         MCF_GPIO_GPIO_OUT  ^= MCF_GPIO_GPIO_OUT_GPIO_OUT29;
        }

       } while (iRet > 0);
       
       hci_unsolicited_event_handler();
      }

    With this, I see that data rate decreased a lot (without select it was ~200,000 Bytes/Sec BUT with this it is ~6000 Bytes/Sec). TiWi is just transmitting at this point.

    Please let me know if it is expected OR I am doing anything wrong ?

    Thanks

    Manish Kakra

  • Hi,

    The select timeout is 5ms by minimum (even if you set the timeout to 0), so this delay should cause a decrease to the throughput. both 200,000 Bytes/Sec and more ever 6000 Bytes/Sec is too low throughput. I would expect to see 2Mbps without select and probably half (1Mbps) with select.

    I believe you used the select command just to see the impact on the throughput, but if you're not waiting to receive, this is not required.

    One more thing you can do is to define the recv as non-blocking. This means that it will check if packets are already in the queue, and if not would return to the application right away. This is currently under testing, and should also be a part of V1.11 release e/o this month.

    In that way, you can remove the select (if working with one socket) and perform the following:

    iRet = setsockopt(sockfd, SOL_SOCKET, SOCKOPT_RECV_NONBLOCK, &optvalue_block, optlen);

     

    where:

     

    SOCKOPT_RECV_NONBLOCK = 0;

    long optvalue_block = 0;

    Please let me know how it goes now.

    Regards,

    Tomer

  • Could you clarify bits (b) vs. bytes (B) to be expected with/without select: (it seems the values might agree above)

    2.0M bps = 250K Bps

    1.6M bps = 200K Bps

    1.0M bps = 125K Bps

    48K bps = 6K Bps

    Thanks, Chris

  • It depends on the environment you test with, but from my experiments in the past, the select decreased the throughput by about half.

    I just noticed that your number were in bytes and not in bits..

    Regards,

    Tomer

  • Regarding the race condition, could you describe the nature of the fix?  I'm assuming the race is when the host is writing to CC3000 and it simultaneously receives radio RX data -- is this correct?  To confirm, the issue appears as an early IRQ assertion (after CS asserted) which causes an early write (before CC3000 ready)? [since the IRQ changed meanings during the write operation and became "host attention", not "SPI ready"?]

  • Hi,

    The issue we have found is when doing a test in a loop back mode, meaning the CC3000 device receives a packet, and only then transmits the same packet to the PC (target). The scenario involves doing recv and right after send commands. Since recv is a blocking command by default, so if the socket is not defined with a timeout, the application would "hang" waiting for receiving some data.

    Usually, a user should either use select command to identify if packets are waiting in the queue, or define a timeout for recv. In the specific scenario, there is no timeout defined.

    The bug involves a race condition, where send is issued and right away recv command. The race condition causes the recv command to be executed before the "send", but it will wait forever, as the target device didn't receive the packet, and therefore will not transmit the next one.

    This specific case is not related to a race condition where packet is received in parallel to send being executed over the SPI lines. Therefore either defining a timeout, or using select would overcome that case.

    Regards,

    Tomer