Networking Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationNetworking Help

Closed Thread
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 29th, 2009, 01:07 PM
iRobert iRobert is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 6 iRobert User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 38 m 3 sec
Reputation Power: 0
Winsock problem...

I have a server and client app using winsock TCP ports.

If i use my class C network address on the LAN my client can talk to server and visaversa.

My client can connect and get data from google.com on port 80.

my router tells me it's extrnal ip address, and I set up a port forward for my port to my server machine, and all outgoing ports are open by default.

If I use ShieldsUp to scan my port (16016) server gets a connection.

But if my client tries to connect to port 16016 using the external ipaddress of my router it fails with error 10061 (No connection could be made because the target machine actively refused it)

Telnet has the same issues, can connect on LAN but not WAN.

ZoneAlarm is turned off, and windows firewall is also off.

Can anybody help, even if only with more tests I could try?

Could it be my ISP or choice of port number?

Thanks

Reply With Quote
  #2  
Old June 29th, 2009, 02:36 PM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 7th Plane (8000 - 8499 posts)
 
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
Posts: 8,313 Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 4 Days 4 h 37 m 14 sec
Reputation Power: 2529
Sounds like your client is on the internal network and you're trying to connect using the external router address. Ask someone external to connect to your open port and see if it works.
__________________
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne

Puzzle of the Month solved by Fishmonger, superior perl programmer of the month

Reply With Quote
  #3  
Old June 29th, 2009, 03:36 PM
iRobert iRobert is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 6 iRobert User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 38 m 3 sec
Reputation Power: 0
Quote:
Originally Posted by Scorpions4ever
Sounds like your client is on the internal network and you're trying to connect using the external router address. Ask someone external to connect to your open port and see if it works.


my client connects to google's server, and a connect attempt from the ShieldsUp website on my port number successfully connects to my server.

Both client and server apps are on the same machine.

I wanted to check I could connect to my server via the port forward I set up on my router, which works in the case of the ShieldsUp website.

Am I missing something?

Reply With Quote
  #4  
Old June 29th, 2009, 04:25 PM
jwdonahue's Avatar
jwdonahue jwdonahue is offline
Bellevue WA, USA
Click here for more information.
 
Join Date: May 2004
Location: Bellevue Washington, USA
Posts: 2,388 jwdonahue User rank is Colonel (50000 - 60000 Reputation Level)jwdonahue User rank is Colonel (50000 - 60000 Reputation Level)jwdonahue User rank is Colonel (50000 - 60000 Reputation Level)jwdonahue User rank is Colonel (50000 - 60000 Reputation Level)jwdonahue User rank is Colonel (50000 - 60000 Reputation Level)jwdonahue User rank is Colonel (50000 - 60000 Reputation Level)jwdonahue User rank is Colonel (50000 - 60000 Reputation Level)jwdonahue User rank is Colonel (50000 - 60000 Reputation Level)jwdonahue User rank is Colonel (50000 - 60000 Reputation Level)jwdonahue User rank is Colonel (50000 - 60000 Reputation Level)jwdonahue User rank is Colonel (50000 - 60000 Reputation Level)jwdonahue User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 2 Weeks 4 Days 5 h 53 m 34 sec
Reputation Power: 563
Just setup your client to connect to localhost, if it can connect then the port is open on your machine (at least to local connections). You can't expect it to route from your machine via an external router unless your client and your server software have different IP addresses. Better to test your client from a different machine, preferably one outside of your LAN if you must test connectivity from the internet.
__________________
My worst nightmare was a pointless infinite loop.
Work in progress; don't poke the curmudgeon!
http://www.odonahue.com/

Reply With Quote
  #5  
Old June 29th, 2009, 05:10 PM
iRobert iRobert is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 6 iRobert User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 38 m 3 sec
Reputation Power: 0
Quote:
Originally Posted by jwdonahue
Just setup your client to connect to localhost, if it can connect then the port is open on your machine (at least to local connections). You can't expect it to route from your machine via an external router unless your client and your server software have different IP addresses. Better to test your client from a different machine, preferably one outside of your LAN if you must test connectivity from the internet.


I tested the port was open both locally and externally, both of which succeeded.

I'll try an external machine, thanks for the help, I thought I was doing something in error.

I suppose expecting a router to route packets to an IP address, is my error.

On my pc I already know I can route packets from it's own ip to it's own ip, via localhost or it's LAN ip, but my router can't route from it's LAN ip to it's external ip then do it's own port forwarding?

Sounds like lazy implementation by the router manufacturer to me, why am I not surprised?

What would happen if I had a server on a machine on my LAN and a client on another machine on my LAN too? I guess you're saying if I got the ip for the server from an internet source, the client could not connect from my own LAN, because the router can't route to it's own external ip and back in to do the port forwards? seems odd behaviour to me.

Reply With Quote
  #6  
Old June 29th, 2009, 05:30 PM
jwdonahue's Avatar
jwdonahue jwdonahue is offline
Bellevue WA, USA
Click here for more information.
 
Join Date: May 2004
Location: Bellevue Washington, USA
Posts: 2,388 jwdonahue User rank is Colonel (50000 - 60000 Reputation Level)jwdonahue User rank is Colonel (50000 - 60000 Reputation Level)jwdonahue User rank is Colonel (50000 - 60000 Reputation Level)jwdonahue User rank is Colonel (50000 - 60000 Reputation Level)jwdonahue User rank is Colonel (50000 - 60000 Reputation Level)jwdonahue User rank is Colonel (50000 - 60000 Reputation Level)jwdonahue User rank is Colonel (50000 - 60000 Reputation Level)jwdonahue User rank is Colonel (50000 - 60000 Reputation Level)jwdonahue User rank is Colonel (50000 - 60000 Reputation Level)jwdonahue User rank is Colonel (50000 - 60000 Reputation Level)jwdonahue User rank is Colonel (50000 - 60000 Reputation Level)jwdonahue User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 2 Weeks 4 Days 5 h 53 m 34 sec
Reputation Power: 563
No it's probably got nothing to do with the router. Perhaps I should ask for more details before I comment further...

Is your host dual-homed (two NIC's on separate LAN segments)?

Is your client using DNS to find your host IP address? Is it succeeding?

What is the current route from your client IP to your host IP? Does it include your router? Which side of the router would your client packets arrive on? Would that be the same side of your router that has the port mapping defined?

Hmm... I should be able to think of some quesitons but that should get you going for now.

Reply With Quote
  #7  
Old June 29th, 2009, 05:31 PM
jwdonahue's Avatar
jwdonahue jwdonahue is offline
Bellevue WA, USA
Click here for more information.
 
Join Date: May 2004
Location: Bellevue Washington, USA
Posts: 2,388 jwdonahue User rank is Colonel (50000 - 60000 Reputation Level)jwdonahue User rank is Colonel (50000 - 60000 Reputation Level)jwdonahue User rank is Colonel (50000 - 60000 Reputation Level)jwdonahue User rank is Colonel (50000 - 60000 Reputation Level)jwdonahue User rank is Colonel (50000 - 60000 Reputation Level)jwdonahue User rank is Colonel (50000 - 60000 Reputation Level)jwdonahue User rank is Colonel (50000 - 60000 Reputation Level)jwdonahue User rank is Colonel (50000 - 60000 Reputation Level)jwdonahue User rank is Colonel (50000 - 60000 Reputation Level)jwdonahue User rank is Colonel (50000 - 60000 Reputation Level)jwdonahue User rank is Colonel (50000 - 60000 Reputation Level)jwdonahue User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 2 Weeks 4 Days 5 h 53 m 34 sec
Reputation Power: 563
Doh! This thread really should be moved to an appropriate forum. There's no language specific issues here.

Reply With Quote
  #8  
Old June 29th, 2009, 06:32 PM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 7th Plane (8000 - 8499 posts)
 
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
Posts: 8,313 Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 4 Days 4 h 37 m 14 sec
Reputation Power: 2529
That's exactly why I suggested getting someone external to try to connect to it. Quite a few routers will not route from internal to external to back to internal. With that said, I'm moving this to the networking forum.

Reply With Quote
  #9  
Old June 30th, 2009, 07:57 AM
iRobert iRobert is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 6 iRobert User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 38 m 3 sec
Reputation Power: 0
Quote:
Originally Posted by jwdonahue
No it's probably got nothing to do with the router. Perhaps I should ask for more details before I comment further...

Is your host dual-homed (two NIC's on separate LAN segments)?

Is your client using DNS to find your host IP address? Is it succeeding?

What is the current route from your client IP to your host IP? Does it include your router? Which side of the router would your client packets arrive on? Would that be the same side of your router that has the port mapping defined?

Hmm... I should be able to think of some quesitons but that should get you going for now.


My host is wireless to the router on my LAN.

I specify the ip directly using dot notation but when I check what's happening using TCPView which does domain name lookup It correctly resolves the ip to a name.

I can ping the router on it's internal and external ip and I did a tracert and it worked, and I think it only had one hop.

my router will log when port forward rules are applied, and when I use shieldsUP I get a log from the incoming packet, but my client from my lan does not get logged.

I'll do the external test as soon as I can.

Reply With Quote
  #10  
Old July 1st, 2009, 05:56 AM
iRobert iRobert is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 6 iRobert User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 38 m 3 sec
Reputation Power: 0
Solved...

External clients can connect.

The router (netgear DG834GT)does not support loopback, and this is the reason I could not connect from my own lan on the external ip.

Solution is to use the hosts table to resolve the domain name locally.

Thanks for pointing me in the right direction.

Reply With Quote
Closed Thread

Viewing: Dev Shed ForumsSystem AdministrationNetworking Help > Winsock problem...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
Stay green...Green IT