01-17-2013 09:49 AM
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
Solved! Go to Solution.
01-17-2013 10:05 AM
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
01-17-2013 10:06 AM - edited 01-17-2013 10:06 AM
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!
01-18-2013 12:17 AM
Yes i will absolutely
01-18-2013 04:37 AM
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
01-18-2013 04:50 AM
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
01-18-2013 05:01 AM
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.