element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Ultimate RoadTest
  • Challenges & Projects
  • Design Challenges
  • Ultimate RoadTest
  • More
  • Cancel
Ultimate RoadTest
Blog Project "code name" Part 024
  • Blog
  • Forum
  • Documents
  • Files
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: COMPACT
  • Date Created: 22 Jun 2012 2:01 PM Date Created
  • Views 559 views
  • Likes 1 like
  • Comments 1 comment
  • ultimate_roadtest
Related
Recommended

Project "code name" Part 024

COMPACT
COMPACT
22 Jun 2012
June 22nd
"My Problem has been confirmed."

I had a look on the TI Forums and it appears that some one else has encountered the same issue.

It's listed under "cc3000 socket API recv() does not return correct data".

The recv() and recvfrom() functions are identical apart from the fact that recv() is for TCP and recvfrom() is for UDP.

 

Attached is the response from the TI engineer who investigated the problem.

 

Please find below the analysis done so far.

 

Test setup: a laptop connected to an AP via Ethernet cable and CC3000 connects via WiFi. The laptop has a simple application to connects to the CC3000 over TCP and sends data in small chunks of 4 bytes.

Issue description: it is conclusive that CC3000 gets the first 4 bytes correctly but then the second chunk of 4 bytes is received with two zeros padding at the beginning. all the rest are thus shifted by two bytes.

 

Debugging: I opened a sniffer and I could see the extra two zeros transmitted by the AP although the length in the IP section is not counting for it. CC3000 should thus ignore this 2 zeros. Btw, when a Laptop replaced the CC3000, it is all OK.

So, I asked to change the size to 2 bytes, 5 bytes and 8 bytes. To my surprise, I found that when only 2 bytes are send/recieved, the padding on the first packet is 4 zeros. With 5 bytes, the padding is 1 zero. With 8 bytes there is no padding.

Another interesting observation: when the Laptop is connected with Ethernet, the problem is 100% reproduced and when it is connected with WiFi, it is not reproduced. Interesting right?

I guess you already see the common groung here. The minimum data length on the TCP layer is 6 bytes, hence the padding.

 

But why? this is just an educated guess but since the minimum IP packet is 64 bytes, and we have 18 bytes of Ethernet header (remember the Laptop is connected via Ethernet) + 20 bytes IP header + 20 bytes TCP header => 6 bytes are left for data. Thus, a padding is required.

If you follow the same logic, with UDP it is even worse since the UDP header is much smaller so the minimum UDP payload is larger.

Btw, it makes sense why it works with WiFi, since the WiFi header is 24 bytes and not 18 bytes (so there is no restriction on the minimum).

 

Implications: this issue is not blocking in any way.

The reason for it is that the tests you applied are artificial tests where only TCP level is transmitted and not higher level.

In practice, some kind of application would always be necessary so the minimum payload of 64 bytes should be achieved.

 

Solution: it should be fixed in next releases

 

This is quite interesting because I too have my test PC connected to the Access Point using wired ethernet.

I shall connect using WiFi to see what difference it makes.

  • Sign in to reply
  • DAB
    DAB over 13 years ago

    Good find.

    It is all probably buried in the documentation somewhere, but having it work on a laptop and not with the embedded wifi means that there are conditions checked in the normal software that were missed in the wifi implementation.

     

    It will be interesting to see how they resolve the issue and see who admits to the error.

     

    Thanks

    DAB

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube