Sign in to follow this  
Followers 0
Marklar

Networking over Internet

8 posts in this topic

#1 ·  Posted (edited)

I'm a bit confused on how games, chat rooms, instant messengers, etc are able to communicate through firewalls. I guess they use their own customized networking protocols? I understand the TCP Send/Recv functions in AutoIt and they work great in a LAN environment. But what about over the internet?

Take my ISP for instance. This ISP has about 1200 customers and the majority of them are behind a NAT. So we all share the same IP address yet I can still normally use VOIP, play most games(some older ones do not work), IM, etc but I suspect that the TCP functions in Autoit would not work?

Is there anyway in Autoit that I could create a utility that could send and receive packets from someone else on the internet without having to configure routers and that would work through a NAT like the one that I'm behind?

EDIT:

Oops.. I thought I was in the General Support forum when I posted this. Sorry about that.

Edited by Marklar

Share this post


Link to post
Share on other sites



I'm a bit confused on how games, chat rooms, instant messengers, etc are able to communicate through firewalls. I guess they use their own customized networking protocols? I understand the TCP Send/Recv functions in AutoIt and they work great in a LAN environment. But what about over the internet?

Usually TCP. When a computer has a firewall, it will usually ask that they accept access to their network. Windows Firewall does this by default, so I am sure you've seen the dialog before. TCP works just fine over the internet too.

Take my ISP for instance. This ISP has about 1200 customers and the majority of them are behind a NAT. So we all share the same IP address yet I can still normally use VOIP, play most games(some older ones do not work), IM, etc but I suspect that the TCP functions in Autoit would not work?

You will be able to do so. ISP's assign each connected customer their own dynamic IP from within that pool. If you're interested, Google it.

Is there anyway in Autoit that I could create a utility that could send and receive packets from someone else on the internet without having to configure routers and that would work through a NAT like the one that I'm behind?

Yes there is, the AutoIt TCP functions. I'm not sure about the configurations you'll need to make, if any, but there are many examples of TCP in use on the forum. Even the game Connect 4 has been created, which allows internet play, through the native TCP functions.

Oops.. I thought I was in the General Support forum when I posted this. Sorry about that.

I've reported the topic so that a moderator will move it for you ;)

Share this post


Link to post
Share on other sites

I'm a bit confused on how games, chat rooms, instant messengers, etc are able to communicate through firewalls. I guess they use their own customized networking protocols? I understand the TCP Send/Recv functions in AutoIt and they work great in a LAN environment. But what about over the internet?

Take my ISP for instance. This ISP has about 1200 customers and the majority of them are behind a NAT. So we all share the same IP address yet I can still normally use VOIP, play most games(some older ones do not work), IM, etc but I suspect that the TCP functions in Autoit would not work?

Is there anyway in Autoit that I could create a utility that could send and receive packets from someone else on the internet without having to configure routers and that would work through a NAT like the one that I'm behind?

EDIT:

Oops.. I thought I was in the General Support forum when I posted this. Sorry about that.

Mostly you have to set your router to forward anything on port dddd to a particular PC because the router will block them otherwise and secondly, since you only have one IP address for external connections, the router wouldn't know which PC to send data to. Otherwise of your pc communicates with a server on port 80 and then the replies will be automatically routed back the the correct PC, which is how browsers work and how some remote PC control software works.

The TCPIP functions in AutoIt are no different to any other.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

You will be able to do so. ISP's assign each connected customer their own dynamic IP from within that pool. If you're interested, Google it.

The thing is my ISP assigns me an IP address of 192.168.192.38

When I go to ipchicken.com i see the public IP. 67.83.21.93. (thats not the real IP but you get the idea). They do not have enough class Cs to assign everyone a public IP address so they do NAT and it's basically setup like a big home or office network.

So if I send data to a server on the internet and ask for a reply it's going to send it back to 67.83.21.93 and that's where I get lost. How does it know where to go from there?

I haven't tested any TCP functions over the net yet so ultimately that's what I have to do. I was just assuming that with the AutoIt functions if you plan to use any TCP/UDP over the internet you have to setup port forwarding on your router. And in my case since I essentially have two (mine and my ISPs) I cant exactly control the port forwarding on their router.

Share this post


Link to post
Share on other sites

.....Otherwise of your pc communicates with a server on port 80 and then the replies will be automatically routed back the the correct PC, which is how browsers work and how some remote PC control software works.

The TCPIP functions in AutoIt are no different to any other.

That and reading the NAT and TCP/UDP section on Wikipedia kind of makes some sense.

I'll just need to test it and see what happens.

Share this post


Link to post
Share on other sites

The thing is my ISP assigns me an IP address of 192.168.192.38

When I go to ipchicken.com i see the public IP. 67.83.21.93. (thats not the real IP but you get the idea). They do not have enough class Cs to assign everyone a public IP address so they do NAT and it's basically setup like a big home or office network.

So if I send data to a server on the internet and ask for a reply it's going to send it back to 67.83.21.93 and that's where I get lost. How does it know where to go from there?

I haven't tested any TCP functions over the net yet so ultimately that's what I have to do. I was just assuming that with the AutoIt functions if you plan to use any TCP/UDP over the internet you have to setup port forwarding on your router. And in my case since I essentially have two (mine and my ISPs) I cant exactly control the port forwarding on their router.

I'm sure that is how most ISPs work Posted Image

I assume they're getting lost because you have no server/client waiting to receive the commands.

Share this post


Link to post
Share on other sites

This post has exactly what your looking for so that you don't have to forward your ports manually. (I'm just going to assume you use a router that has UPnP enabled)

http://www.autoitscript.com/forum/index.php?showtopic=71957&st=0&p=526209&hl=upnp&fromsearch=1&#entry526209


[size="1"]Please stop confusing "how to" with "how do"[/size]

Share this post


Link to post
Share on other sites

The way NAT works is that the outgoing port number is not required to match the target port.

Say I have two computers behind a NAT and they both access autoitscript.com. One might have the outgoing 1.2.3.4:80, and the other 1.2.3.4:81. When the data comes back to the NAT, it reads which port it says it is coming back on, and delegates it to the appropriate internal IP address.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0