LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Does tcp works on different networks

Solved!
Go to solution

Hello, 

 

I have a problem with TCP/IP communication. 

 

I write a program for TCP/IP communication (server-client) and it works fine when I tested in office (the same network). But when I tested program when server and client VI are connected to different network I dont have any communication.

 

Does TCP/IP work when client.VI and server.VI are connected to different networks? If not, does anybody have suggestion which protocol to use? Problem is that server VI must be in exe format but client VI must be open for change.  

 

Thanks

0 Kudos
Message 1 of 7
(5,064 Views)
Solution
Accepted by topic author Laza22

I think we have to clear up some things before going into detailed "debugging".

First of, when talking about "networks", i expect you to refer to "LAN" (local area network). A LAN often uses a dedicated "subnet" identification, which is a combination of the IP address(es) and the subnet mask. The subnet mask defines which part of the IP address refers to the LAN identification, the "rest" of the IP refers to the specific PC.

An IP(4) address consists of four bytes, a subnet mask gives instruction on how many bits and bytes are the "LAN ID". Subnet masks often are 255.255.255.0.

 

So when saying "works in office (same network)", you do mean: same subnet. Correct?

(All IP addresses share the same values in the bytes of the subnet mask, but differ in the rest. Example: PC A 192.168.1.12, subnet 255.255.255.0. PC B 192.168.1.15, subnet 255.255.255.0.)

 

If the PCs are NOT within the same subnet, it depends on the network setup on how to proceed. If there is a "direct connection path" from A to B, simply the target IP address is sufficient (e.g. A 192.168.1.15, subnet 255.255.255.0, B 11.88.2.126, subnet 255.255.255.0 works if subnet 192.168.1 has direct connection to subnet 11.88.2).

If there is NO direct connection, you require "port forwarding" on the hardware (router) inbetween. This can get quite difficult.

 

So depending on the goal of this request, you maybe better re-architect the approach of loading dynamic components in your application.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 2 of 7
(5,053 Views)

I'm no expert on TCP/IP, but I have used it. The problem could be getting out of your local network to the other network. If you're going via routers at both bounderies you may need to set up things like port forwarding and firewall things.

 

Edit, beaten to it, with a much better reply!

0 Kudos
Message 3 of 7
(5,051 Views)

Yes i will absolutely

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 4 of 7
(5,031 Views)

Hy Norbet, 

 

Thanks for response. 

 

Yes, when I talk about ''networks'' I refer to LAN. 

 

Yes, when a say ''work in office (same network)'' I mean same subnet.

 

 Please tell me, if you know, how to set ''direct connection path'' and how to set ''port forwarding''. 

 

Thanks, 

 

Lazar

0 Kudos
Message 5 of 7
(5,022 Views)

Lazar,

 

i recommend you to start with some information gathering. Wikipedia is a good start for information, also "google is your friend". You might also try to catch an IT specialist in your company.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 6 of 7
(5,017 Views)

It may also be best to talk to whoever looks after your network. There are all sorts of firewall settings that may need to be changed to allow a program to exit one network and enter the second. Port forwarding will very much depend on the hardware on the network.

0 Kudos
Message 7 of 7
(5,012 Views)