Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Tue Oct 17, 2017 6:42 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 23 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Basic Networking Question: Public vs. Local IP Addresses
PostPosted: Thu Sep 24, 2009 1:30 pm 
Offline

Joined: Tue Dec 25, 2007 4:51 pm
Posts: 72
Even after perusing various old threads in this form that seem to bear on my question, I still can't figure out if it's a simple question or a complex one, and I'm just confused--though I just can't see how what I want to do could possibly be too difficult. Bear in mind that I (alas) know next to nothing about networking and the internet and have, for whatever reason, always found the subject hard to wrap my brain around.

I'm just trying to figure out how to set up an app that can connect to other instances of itself on other computers via the internet. I get the basics of how to use a socket, but I'm stumped by the complexities of IP addresses. If I have multiple computers connecting to the internet via a wireless router (which is in turn connected to a cable modem), what IP address can a computer somewhere else use to connect to one of mine? It's my understanding that I have a "public IP address" from my ISP, and then each of my computers has a local IP address that's assigned by my router and meaningful only within the context of my own little network...right? So a computer somewhere else can't send to one particular computer's "local" IP address...but the "public" one isn't specific to any *one* of my computers, so that doesn't seem right either. Can someone please educate me a bit on this?


Thanks!


Top
 Profile  
Reply with quote  
 Post subject: Re: Basic Networking Question: Public vs. Local IP Addresses
PostPosted: Thu Sep 24, 2009 2:12 pm 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
Basically each of the computers on your LAN [local network, ie those computer on THIS side of your router] all have an IP address, which normally startes with 10. or 193.

However, on the OTHER side [the Internet] of your router, your LAN appears as a single IP addreess [this address may be static or dynamic, depending on your ISP, and the services you rent from them]. The only way an external web server knows which of your LAN computers to send a webpage to, is by information coded by your router into the request packet, which is sent back along with the web content.

So the only way for you to write an app that can communicate peer-to-peer via the internet is to employ port-forwarding on your router.... which basiclly pokes a great big hole in your fire wall

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
 Post subject: Re: Basic Networking Question: Public vs. Local IP Addresses
PostPosted: Thu Sep 24, 2009 2:16 pm 
Offline
User avatar

Joined: Thu Aug 06, 2009 2:25 pm
Posts: 261
Location: Oregon
You'll have to get your true IP address. ipchicken.com is good for that.

Then you'll have to connect up to your apps using that IP address, but you'll also need to set up port forwarding on your router.

Forward the port(s) that your app uses to the router IP of the computer you want to connect to. For example, if your machine has an IP of 192.168.1.100 and it uses port 8980 you'd forward port 8980 to 102.168.1.100 - then just connect to your machine via the true IP you got from ipchicken.com and make sure you're connecting up to the correct port you forwarded, and everything should work just fine.

_________________
AppleSource Software
http://www.applesource.biz


Top
 Profile  
Reply with quote  
 Post subject: Re: Basic Networking Question: Public vs. Local IP Addresses
PostPosted: Thu Sep 24, 2009 2:49 pm 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR USA
Port forwarding limits you to a single local machine. You couldn't have an outside computer talk to more than one of your local machines, or have one outside computer talk to one local machine while another outside computer talks to a different local machine. That may not be an issue for you, but be aware of the limitation.

Most peer-to-peer networking uses a public machine as a go-between, either as a relay or to at least initiate the conversation. You can poke a hole in your firewall for your own enjoyment, but it isn't recommended for more than just you and your friends.

Tim


Top
 Profile  
Reply with quote  
 Post subject: Re: Basic Networking Question: Public vs. Local IP Addresses
PostPosted: Thu Sep 24, 2009 3:17 pm 
Offline

Joined: Tue Dec 25, 2007 4:51 pm
Posts: 72
Thanks for the responses.

Tim, your info addressed what was the most puzzling aspect of this, to me. I had read elsewhere about all of this port forwarding business, but I was baffled, because obviously there are plenty of apps floating around that let you connect across the internet without having to muck with this kind of thing...so I assumed I had to be missing something. If I understand you correctly, what you're saying is that such apps accomplish this by having both machines connect to some third party (like a website) to initiate things? That makes sense (even if it also isn't what I want to hear...). Bafflement un-baffled!

Dave


Top
 Profile  
Reply with quote  
 Post subject: Re: Basic Networking Question: Public vs. Local IP Addresses
PostPosted: Thu Sep 24, 2009 3:39 pm 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR USA
Quote:
what you're saying is that such apps accomplish this by having both machines connect to some third party (like a website) to initiate things?

Exactly.


Top
 Profile  
Reply with quote  
 Post subject: Re: Basic Networking Question: Public vs. Local IP Addresses
PostPosted: Thu Sep 24, 2009 3:49 pm 
Offline
User avatar

Joined: Thu Aug 06, 2009 2:25 pm
Posts: 261
Location: Oregon
Yes, the most user-friendly and common method floating around these days is a public server/website connecting between the two (or more) communicating machines.

_________________
AppleSource Software
http://www.applesource.biz


Top
 Profile  
Reply with quote  
 Post subject: Re: Basic Networking Question: Public vs. Local IP Addresses
PostPosted: Fri Sep 25, 2009 1:09 pm 
Offline
User avatar

Joined: Sat Nov 11, 2006 2:43 pm
Posts: 1221
Location: This poster has left the forums
timhare wrote:
Port forwarding limits you to a single local machine. You couldn't have an outside computer talk to more than one of your local machines, or have one outside computer talk to one local machine while another outside computer talks to a different local machine. That may not be an issue for you, but be aware of the limitation.


May not be relevant in your instance, but FYI:
You can port forward to more than one machine.
It is perfectly acceptable to have inbound traffic on port 8001 (for example) forward to machine 1 on the LAN on port 22, then inbound traffic on port 8002 forward to machine 2 on the LAN on port 22 etc.


This opens up possibilities if the client application is HTTP aware, and understands redirects.
using an example of having two web servers on your LAN, but only one real IP address:
It is perfectly acceptable to have inbound traffic on port 8001 (for example) forward to machine 1 on the LAN on port 80, then inbound traffic on port 8002 forward to machine 2 on the LAN on port 80 etc.

Using a redirection service you could forward traffic to http://www.My1stGreatSite.com to your real IP address on port 8001 (machine 1), and traffic to http://www.My2ndGreatSite.com to your real IP address on port 8002 (machine 2)

Using a service like http://www.dyndns.com (their redirect is called WebHop Redirect) you could give every one of your machines on your LAN a DNS entry with the ability to accept inbound traffic to port 80 on each local machine. You'd add the records at http://www.dyndns.com and the corresponding port forwarding in your router.

_________________
%Invalidforumsignatureexception% user signature not found


Top
 Profile  
Reply with quote  
 Post subject: Re: Basic Networking Question: Public vs. Local IP Addresses
PostPosted: Fri Sep 25, 2009 1:17 pm 
Offline
Site Admin
User avatar

Joined: Tue May 06, 2008 1:07 pm
Posts: 1464
Location: NotEvenOnTheMap, CT
Has anybody written a UPnP and or NAT traversal framework for REALbasic yet? More and more apps are utilizing the technology, and it's quite effective for peer-to-peer communication.

_________________
Thom McGrath - @tekcor
Web Framework Architect, Real Software, Inc.


Top
 Profile  
Reply with quote  
 Post subject: Re: Basic Networking Question: Public vs. Local IP Addresses
PostPosted: Sat Sep 26, 2009 3:00 pm 
Offline

Joined: Sat May 26, 2007 11:37 pm
Posts: 52
Location: Tumwater, Wa
Unfortunately UPnP is not widely supported in an enterprise environment. Although I'm only speaking from the aspect of the 800 lb Gorilla Cisco,.. Upnp is more widely supported in the Home market,

anybody who is new to Networking I would recommend looking at this site, http://www.tcpipguide.com/free/index.htm

it has a lot of information.

_________________
• program, n.: A magic spell cast over a computer allowing it to turn one's input into error messages.
tr.v. To engage in a pastime similar to banging one's head against a wall, but with fewer opportunities for reward


Top
 Profile  
Reply with quote  
 Post subject: Re: Basic Networking Question: Public vs. Local IP Addresses
PostPosted: Sat Sep 26, 2009 5:04 pm 
Offline
Site Admin
User avatar

Joined: Tue May 06, 2008 1:07 pm
Posts: 1464
Location: NotEvenOnTheMap, CT
Correct, but I would imagine the average deployment of UPnP would be to home market, since the enterprise users know how to handle port forwarding and all that jazz. The average home user doesn't know how, and generally doesn't care to know how, they just want it to work.

_________________
Thom McGrath - @tekcor
Web Framework Architect, Real Software, Inc.


Top
 Profile  
Reply with quote  
 Post subject: Re: Basic Networking Question: Public vs. Local IP Addresses
PostPosted: Fri Oct 02, 2009 2:11 pm 
thommcgrath wrote:
Has anybody written a UPnP and or NAT traversal framework for REALbasic yet? More and more apps are utilizing the technology, and it's quite effective for peer-to-peer communication.


Yes I did a UPnP module in RB.
I will get your external IP address and also it will open ports. (For UPnP enabled routers)
Is it well tested? Nope. but it works for my linksys.


Top
  
Reply with quote  
 Post subject: Re: Basic Networking Question: Public vs. Local IP Addresses
PostPosted: Fri Oct 02, 2009 6:13 pm 
Offline
User avatar

Joined: Sat Nov 11, 2006 2:43 pm
Posts: 1221
Location: This poster has left the forums
JustSomeGuy wrote:
Yes I did a UPnP module in RB.
I will get your external IP address and also it will open ports. (For UPnP enabled routers)
Is it well tested? Nope. but it works for my linksys.


Want to share?

_________________
%Invalidforumsignatureexception% user signature not found


Top
 Profile  
Reply with quote  
 Post subject: Re: Basic Networking Question: Public vs. Local IP Addresses
PostPosted: Sun Oct 04, 2009 2:23 pm 
pony wrote:
JustSomeGuy wrote:
Yes I did a UPnP module in RB.
I will get your external IP address and also it will open ports. (For UPnP enabled routers)
Is it well tested? Nope. but it works for my linksys.


Want to share?


Sure, I'd love to. Where can I post the project?


Top
  
Reply with quote  
 Post subject: Re: Basic Networking Question: Public vs. Local IP Addresses
PostPosted: Sun Oct 04, 2009 2:35 pm 
Offline
User avatar

Joined: Sat Nov 11, 2006 2:43 pm
Posts: 1221
Location: This poster has left the forums
JustSomeGuy wrote:
Sure, I'd love to. Where can I post the project?


The ARBP has a source code repository.
Whilst key areas of the site are not free, the source code section is available for free

http://www.arbpmembers.org/

You'll probably have to email them to ask them to put it on there. I tried to upload some source and just got "You have no permitted upload categories - please refer to the webmaster."

contact:
http://www.arbpmembers.org/index.php?op ... 1&Itemid=3

_________________
%Invalidforumsignatureexception% user signature not found


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 23 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group