CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2006
    Posts
    99

    some stupid question

    hello guys,

    i know very little about network programming. i have some basic questions,

    i'm using a school machine, which has no public ip address. i'm wondering how to send things from a machine that is outside the local network to the machine inside the local network.

    i tried some program, they don't work, for example, the chat example enclosed with QT4, and a remote control tool.

    but some other softwares work, for example MSN and emule.

    i read some material about how to write a simple network program, they all seem to be easy, but none of them talking about the situation that the machines are in different local networks.

    i guess this is a stupid question.

    thank you

  2. #2
    Join Date
    Aug 2007
    Location
    Birmingham, UK
    Posts
    360

    Re: some stupid question

    It basically depends on how the internal network (the LAN) is connected to the outside world (Internet).

    On most smaller networks people use a router/firewall that connects the LAN with the Internet. Then all you do is setup the local IP address of the router/firewall as the gateway in the network settings of each local computer. When a local computer then needs to send a packet it checks if the IP address is on the LAN or not. In the case of an IP address that is not on the LAN the local computer will send the packet to the gateway and assumes that the gateway will know what to do with it. The gateway can of course be configured to only allow packets for particular ports (like port 80 for web browsing) to pass and to block any other ports not on the list of acceptable ports.

    On a school network it is very likely that access to the Internet is strictly policed by the router and that this is the reason why you are having problems accessing the Internet with other software than the ones provided by the school.

  3. #3
    Join Date
    Nov 2002
    Location
    California
    Posts
    4,556

    Re: some stupid question

    If your internal machines on the LAN are connected to the Internet through a router, then you must configure the router for port-forwarding.

    See www.portforward.com

    Also see this utility, which should work if the router has UPnP enabled: "Using UPnP for Programmatic Port Forwardings and NAT Traversal" at http://www.codeproject.com/KB/IP/PortForward.aspx

    However, as correctly noted by Edders, most schools have very strict limits on Internet connectivity, particularly for incoming traffic.

    Mike

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured