Jump to content


Photo
- - - - -

Issues TCP-ing with a C program on same computer


  • Please log in to reply
49 replies to this topic

#41 Cat

Cat

    The 500 club

  • Members
  • PipPipPipPipPip
  • 758 posts
  • Location:Maryland, USA
  • Version:LabVIEW 2012
  • Since:1994

Posted 06 August 2011 - 11:54 PM

Well. If they have difficulty with DLLs (SOs on linux) then kernel level drivers will slay them. The randrive.sys driver is no longer available in windows 7 (hope they weren't thinking of using it Posted Image ) but there are a few 3rd party solutions I think.

One final thought. Turn off the nagle algo. It is known to play hell with things like games and it is known to silently introduce delays in packet sending through the loopback. It is off for my setups for this very reason, although I never saw 2 second delays.

I'm the one setting up the ramdrive and had originally hoped to use ramdrive.sys. :rolleyes: The Unix guys got a little glassy-eyed about it until I told them not to worry -- it just looks like another disk to their code. The whole ramdrive thing was a step into the wayback machine for me. I haven't used one since my BASIC/MS-DOS days. I'm using RamDisk and so far it seems to be working.

Disabling Nagle's algorithm is something I haven't tried yet, but only because it's supposed to be for optimizing small data packets, and 5MB isn't very small. But hey, I've tried everything else, I can try that, too.
"It's only funny until someone gets hurt... then it's hilarious!"

#42 Mark Yedinak

Mark Yedinak

    Extremely Active

  • Premium Member
  • 422 posts
  • Location:Huntley, IL
  • Version:LabVIEW 2011
  • Since:1997

Posted 10 August 2011 - 09:44 PM

I'm the one setting up the ramdrive and had originally hoped to use ramdrive.sys. :rolleyes: The Unix guys got a little glassy-eyed about it until I told them not to worry -- it just looks like another disk to their code. The whole ramdrive thing was a step into the wayback machine for me. I haven't used one since my BASIC/MS-DOS days. I'm using RamDisk and so far it seems to be working.

Disabling Nagle's algorithm is something I haven't tried yet, but only because it's supposed to be for optimizing small data packets, and 5MB isn't very small. But hey, I've tried everything else, I can try that, too.


I've also experienced TCP/IP issues with Windows 7. We haven't fully isolated the issue but an application we have that sends quite a bit of data over TCP/IP in Win7 experiences lots of problems but runs like a charm on XP. I also did some traces of the communications and the traffic pattern in the Win7 cases was very strange from a networking perspective, including unexpected TCP-RSTs.
---
Mark Yedinak - Certified LabVIEW Architect and LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot

#43 Cat

Cat

    The 500 club

  • Members
  • PipPipPipPipPip
  • 758 posts
  • Location:Maryland, USA
  • Version:LabVIEW 2012
  • Since:1994

Posted 11 August 2011 - 11:18 AM

I've also experienced TCP/IP issues with Windows 7. We haven't fully isolated the issue but an application we have that sends quite a bit of data over TCP/IP in Win7 experiences lots of problems but runs like a charm on XP. I also did some traces of the communications and the traffic pattern in the Win7 cases was very strange from a networking perspective, including unexpected TCP-RSTs.

Hmm... yes, that's my concern -- that this isn't just a loopback problem.

Thanks for the input. NI is working on this and I'll post here when they get back to me.
"It's only funny until someone gets hurt... then it's hilarious!"

#44 Cat

Cat

    The 500 club

  • Members
  • PipPipPipPipPip
  • 758 posts
  • Location:Maryland, USA
  • Version:LabVIEW 2012
  • Since:1994

Posted 06 September 2011 - 11:15 AM

This issue has been assigned CAR #313508.
"It's only funny until someone gets hurt... then it's hilarious!"

#45 Cat

Cat

    The 500 club

  • Members
  • PipPipPipPipPip
  • 758 posts
  • Location:Maryland, USA
  • Version:LabVIEW 2012
  • Since:1994

Posted 28 September 2011 - 10:13 AM

Here's the bottom line from the AE at NI (Kyle, who has been very helpful):

It appears that there is investigation being done into the TCP stack in LabVIEW, but it's still not clear if this is the cause of the problem. It's still possible that the problem may be the fault of Windows 7 and not LabVIEW. If there will be a fix for this, it will be a part of the normal patch release cycle. This means that any fix will be pushed live in 2012 at the earliest. We have verified, however, that the issue you're seeing only occurs with TCP loopback, and is not present in any other TCP scenarios.

The important part, I guess, is that this issue shouldn't be affecting "regular" TCP usage. This isn't great for anyone else out there who might be thinking about using TCP to communicate with other applications on the same machine, however.

Also from Kyle: The R&D folks working on this are very impressed by the amount of information they were able to start with.

I want to again thank everyone who tested code on various platforms and offered suggestions, so I had all that information to pass on to NI. At this point, the ramdrive is working well, so that's what I'll stick with.

Cat
"It's only funny until someone gets hurt... then it's hilarious!"

#46 Tim_S

Tim_S

    The 500 club

  • Members
  • PipPipPipPipPip
  • 522 posts
  • Location:Michigan
  • Version:LabVIEW 2011
  • Since:1994

Posted 28 September 2011 - 01:07 PM

Appreciate the update.

Tim
Tim

"If this was easy our kids would be doing it." - Coworker

#47 Anders Björk

Anders Björk

    Very Active

  • Members
  • PipPipPip
  • 227 posts
  • Location:Sweden
  • Version:LabVIEW 2009
  • Since:1996

Posted 30 September 2011 - 12:15 AM

I would test to use TCP-optimizer to tweak the Win7 network settings. I have experienced some improvements by tweaking those. There are lots of examples on to improve networking on vista and w7.

TCP-optimizer can be downloaded here:
http://www.speedguid...t/downloads.php

#48 Cat

Cat

    The 500 club

  • Members
  • PipPipPipPipPip
  • 758 posts
  • Location:Maryland, USA
  • Version:LabVIEW 2012
  • Since:1994

Posted 04 October 2011 - 11:23 AM

I would test to use TCP-optimizer to tweak the Win7 network settings.

Thanks for the link to the software. Unfortunately, I got the same negative results. I had actually played with a lot of these settings by hand using this article. The issue isn't aggregate TCP performance, it's that the TCP Read just seems to go to sleep every once in awhile for a really long time.
"It's only funny until someone gets hurt... then it's hilarious!"

#49 ShaunR

ShaunR

    LabVIEW Archetype

  • Members
  • PipPipPipPipPipPip
  • 2,274 posts
  • Version:LabVIEW 2009
  • Since:1994

Posted 04 October 2011 - 01:30 PM

Thanks for the link to the software. Unfortunately, I got the same negative results. I had actually played with a lot of these settings by hand using this article. The issue isn't aggregate TCP performance, it's that the TCP Read just seems to go to sleep every once in awhile for a really long time.

Just one final thought on this (probably not relevant). I have seen exactly what you describe when a machine has Bluetooth . The 5- 8 second freezes go away when the Bluetooth adapter is disabled. I never got to the bottom of this since the machine didn't need Bluetooth, so I just disabled it.
A positive attitude may not solve all your problems, but it will annoy enough people to make it worth the effort. (Herm Albright 1876-1944).

Founder and general mischief maker on www.labview-tools.com.
SQlite aficionado and websocket zealot.
If it 'aint in LabVIEW, then you 'aint got a clue!

#50 asbo

asbo

    I have no idea what you're talking about... so:

  • V I Engineering, Inc.
  • 1,273 posts
  • Version:LabVIEW 2011
  • Since:2008

Posted 04 October 2011 - 02:13 PM

Just one final thought on this (probably not relevant). I have seen exactly what you describe when a machine has Bluetooth . The 5- 8 second freezes go away when the Bluetooth adapter is disabled. I never got to the bottom of this since the machine didn't need Bluetooth, so I just disabled it.

Bluetooth and TCP both use the Windows Socket API, so it might be a hang-up internally where bluetooth blocks TCP for some reason. 5-8 seconds sounds a lot like the timeframe necessary for a discovery scan.