Jump to content

Networking


Rick
 Share

Recommended Posts

I did this once before but I can't seem to get it working now. I have a no-ip address. So it should connect me back to my PC. I have a client and server application. When I connect to 127.0.0.1 the connection works, but when I do the no-ip address the connection fails. I have a linksys router and did do a port forward to my computers ip address. So what else am I missing?

Link to comment
Share on other sites

If you have a dynamic ip you need to configure your router to tell the DNS service when your IP changes.

That's all I can think of atm ^^

Core2Duo, 3.33GHz, Radeon HD 5850 Black Edition, 4GB RAM, 4 TB HDD, Windows 7.

Core2Duo, 2.00GHz, Geforce 9500m, 4GB RAM, 320 GB HDD, Windows 7.

Link to comment
Share on other sites

Oh, and also.

Connecting from inside your network to your outside address doesn't seem like a good idea if you're doing just that ^^

Core2Duo, 3.33GHz, Radeon HD 5850 Black Edition, 4GB RAM, 4 TB HDD, Windows 7.

Core2Duo, 2.00GHz, Geforce 9500m, 4GB RAM, 320 GB HDD, Windows 7.

Link to comment
Share on other sites

It's quite possible that your router is dropping the packets. When you use your external IP address, the router is actually talking to itself. It may notice that it is doing so, so that it never hits the forwarding chain, because it is not an "incoming" packet. Try testing from outside your network.

Windows 7 x64 - Q6700 @ 2.66GHz - 4GB RAM - 8800 GTX

ZBrush - Blender

Link to comment
Share on other sites

If you have a dynamic ip you need to configure your router to tell the DNS service when your IP changes.

That's all I can think of atm ^^

 

This is what the No-IP service does for you. You have a program that runs on your PC that talks to their servers. It updates my ip address to the domain name they setup for me. So I can have something like rick.redirectme.net and it'll point to my server. This is all for testing however. I just don't have a static ip and want to test with something coming from the outside.

 

It's quite possible that your router is dropping the packets. When you use your external IP address, the router is actually talking to itself. It may notice that it is doing so, so that it never hits the forwarding chain, because it is not an "incoming" packet. Try testing from outside your network.

 

 

I have Wireshark and am watching the packets and it does go out to query the domain name and comes back with my ip address. After it does that I get:

 

ICMP Source port: synchronite Destination port: krb524

UDP Destination unreachable (port unreachable)

 

So not sure what's up there.

 

 

I've done this before though. Just can't remember what I needed to do.

Link to comment
Share on other sites

Right, it queries DNS fine, but it's the actual traffic that isn't getting back in, not the DNS request. You have your system set up in a DMZ or just forwarding selected ports? If it's just selected ports are you forwarding TCP instead of UDP by accident?

Windows 7 x64 - Q6700 @ 2.66GHz - 4GB RAM - 8800 GTX

ZBrush - Blender

Link to comment
Share on other sites

I tried turning off dhcp because the router page said:

 

When users send this type of request to your network via the Internet, the Router will forward those requests to the appropriate PC. Any PC whose port is being forwarded must have its DHCP client function disabled and must have a new static IP address assigned to it because its IP address may change when using the DHCP function.

 

But that didn't seem to work either.

Link to comment
Share on other sites

I don't think I've fully understood what you're trying to ask, but it sounds like you are trying test Internet connectivity by getting a computer on your network to connect to your "router's" external IP address, so the router forwards the packet back inside your network to the intended host. And then trying to get a simple acknowledgement back in the opposite direction to confirm its working. If that's not what you're asking then ignore the rest of the post

 

For example, your computer's IP might be 10.0.0.1 - the server's IP might be 10.0.0.2 and the router's external IP address might be 1.1.1.1 (Obviously it's example, because you'll never get that number)

 

By going through the router, it will transparently muck up the ports.

So if the client sent a message from it's own port 2222 to 1.1.1.1:3333 because that's the forwarded port. The message's sender details would appear that it came from 1.1.1.1:1024 rather than 1.1.1.1:2222 A common mistake is to only read the sender's IP, and not the port. In this case, merely assuming that the client will only send on 2222 and so that's the port it must have come from would be incorrect. To get it back to the sender, you would set the packet's target as 1.1.1.1:1024.

 

Now when it arrives at the router, it thinks "Data for me? On port 1024... That's the port where I sent outbound data from 10.1.1.1:2222 - I'll send this packet there." ...And the 2-way communication between the clients should be complete. This 'thought' of the router's, is why I put the word router i quotes, the first time I used it. A device like this is actually a "Port Address Translator"

 

Even if that hasn't solved your problem, hopefully it will provide something to think about for anyone who reads this. I should also check, is this a TCP or a UDP communication? Because what I've described, doesn't really apply to TCP

LE Version: 2.50 (Eventually)

Link to comment
Share on other sites

I don't think I've fully understood what you're trying to ask, but it sounds like you are trying test Internet connectivity by getting a computer on your network to connect to your "router's" external IP address, so the router forwards the packet back inside your network to the intended host. And then trying to get a simple acknowledgement back in the opposite direction to confirm its working. If that's not what you're asking then ignore the rest of the post

 

Yeah, that sounds like what I'm trying to do. I have the server application and client application on one PC. These programs use RakNet for the networking code. I make a server and have it listen on port 4444. The client will listen on a random port number. The client then connects to rick.redirectme.com. That will resolve to my external IP address.

 

So what I would expect is the following flow:

 

Server starts up and listens on port 4444.

Client starts up and tries to connect to rick.redirectme.com on port 4444 and sends this request from a random port. I assume rick.redirectme.com gets resolved to my external IP address. So this connection request would come back to my PC on port 4444, which my server application is listening on.

The server application gets the request and says fine with me that you connect. And the connection is made.

 

But my server never gets the message. When I use 127.0.0.1 instead of rick.redirectme.com my server gets the message and a connection is made.

Link to comment
Share on other sites

you shouldn't resolve the server to listen on an external. the redirect me site takes care of forwarding to your computer, so the server should basically be listening on any IP your computer has, but just the port you specify.

 

If you set it to listen on 0.0.0.0:4444 and has someone connect or ping to the external domain name, it pings your server?

AMD Phenom II x6 1100T - 16GB RAM - ATI 5870 HD - OCZ Vertex 2 60GB SSD

76561197984667096.png

Link to comment
Share on other sites

When setting up a server you don't specify the IP address to listen on just the port. It will automatically use your IP address and the port you specify to listen with RakNet.

 

I don't resolve anything I was just saying I would assume my router would resolve that redirectme address to my computers IP, and it does do that.

Link to comment
Share on other sites

I don't know too much about RakNet, but with winsock you have to bind to IP "0.0.0.0" to allow any data to be received from the Internet (which would include your external IP). If you bind to your internal LAN IP (ex: 10.1.1.1) Then only data from your local subnet will be delivered to you. But I believe that binding to zero is also the default option in winsock, so I presume that's the same for RakNet.

 

One option could be to look up your external IP, and enter that in place of rick.redirectme.com - doesn't matter if its a dynamic address, it' unlikely to change in that short space of time. And if that works, you know that it's DNS lookups that are getting stuffed up somewhere...

LE Version: 2.50 (Eventually)

Link to comment
Share on other sites

OK, outside people can't connect either. I also noticed that I can't have people connect to the Chat server Josh did created. When people ping me I don't see it on Wireshark but that's watching my PC's nic card so if things were getting lost at my router I wouldn't see it.

 

Is there any program where I can see what's hitting my router and see what it's doing?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...