I assume you're trying to setup a home network. Following is a general overview of things.
For cable, your Internet Service Provider feeds you a coax (TV style) cable you plug in to your cable modem for demodulation. For DSL, I believe a phone line plugs in to a DSL modem. Whatever the case, your modem will output an RJ45 connector to which you connect a CAT5 (rated for 100 Mbps) or CAT 5e/6 (rated for 1000 Mbps - gigabit Ethernet). The other end of that cable will plug in to a network interface, which could be
[*]your PC's network adapter
[*]a hub, router, or other network interface
Every network interface has its unique IP address (and MAC address).
In the case of a PC, you can just plug that in to your NIC (network interface card), and configure it for DHCP (dynamic host configuration protocol) or a static (stays same) IP, as your ISP suggests.
For a router, you plug it in the WAN (Wide Area Network-Internet "in") port. Most (all?) consumer routers have switches. The switch is less wasteful than a hub. With a hub, each PC gets all network data ever sent. So if you and I were connected to a hub, and I went to google.com, you could see that with a packet sniffer, and it's also wasting your bandwidth and processing a little bit. With a switch, you just get the data you requested, which in this case, would be nothing at all. And I'd get google.com in my connection.
Router configuration
Anyway, back to the point. If your router is a "4-port", you will have 4 "out" ports for use with your home computers. You will need 4 CAT5 (or 5e/6) cables to connect these to your computer's NICs. Once this is done, you should be all set once you set your PCs to use DHCP. Then you will need to configure your router for WAN (Internet). It's almost always one of the following URLs and (for Linksys routers) a blank login and default password of
admin. That of course will vary by manufacturer. These are typically used URLs for router configuration. At this point, your LAN (should be) working while your WAN may not.
http://192.168.0.1/
http://192.168.1.1/
http://192.168.2.1/
Generally the PPPoE protocol is used for DSL and usually dynamic (DHCP) for cable. You really shouldn't have to set much in here, but you will need to type in your DNS (domain name server) IP addresses.
Establishing the connection
Now, I'll talk briefly about how connections are established. If you can just get through this, you will understand why you have to do that notorious "port forwarding", etc.
😀
When you type google.com in your browser, here's what happens:
[*]The browser contacts DNS, which is like the Internet's phone book, as the Internet domain name (google.com) is like a company name. The "company name" is looked up, and it is resolved to an IP address (phone number) usable by your browser.
[*]Your browser calls that number (establishes a network socket), and sends a request for the main web site.
[*]Your browser receives the web site and renders it.
About servers
If you want to set up something like a game server and want it accessible to the WAN (outside world) you will need to forward that port. Reason being: your router is
really the only system at the end of your WAN IP (Internet protocol) address. It does NAT (network address translation) to allow other clients to use it as a gateway for sending information. The reason a router is a hardware firewall is because
it is the one that receives unrequested data, no longer your PC as was the case with your old dialup modem, or a cable modem directly connected to your PC. But, then what happens when someone tries to connect to your server? Let's say you were hosting a Quake 3 server (which happens to use a default port of 27960 and the UDP (user datagram protocol). So the client sends a request to your port 27960, and it gets no response. The router discards this, it was never requested in the first place. Since client connections can't really be "requested", you will have to tell your router to push the data received on this port to your server. Only
then will your server even know there was a connection! Now that it does, the connection continues from there. The server "shakes hands" with the client in case of TCP, and usually connections on UDP implement their own handshaking.
Notes about the two commonly used protocols
[*]TCP: uses "connections" (handshakes implemented at the socket level). has checksums for data verification.
[*]UDP: connection-less, no socket-handled handshakes. no checksums (data verification) at socket level, so it's faster than TCP, which is why it is used for non-critical, speed-hungry applications like games.
There are a couple of ways to forward ports
[*]Individual port forwarding: labeled "port forwarding" in router settings.
[*]DMZ (demilitarized zone): this will disable the router's hardware firewall for your PC. All unrequested data is now sent to your PC, so you can host any server you want.
One thing to keep in mind is that you may be hosting a server and not even know it. Stuff like the Azureus BitTorrent client will open port 8661 so it can upload. Stuff like this will also need to be forwarded. These are technically servers, but you can call them "listen sockets" to distinguish.
Layout of a connection
- PC - physical
- NIC - physical
- All available ports (65,535) - virtual
- Socket - virtual
- "Connection" - virtual
- Data - virtual
- Packets - virtual
There's an official version of this "layout" called the OSI Model. If you're interested in a more in-depth explanation, more info available here:
OSI Layers Guide
If you have any more questions, feel free to ask! I know a
lot more about cable than I do about DSL, so the DSL information may not be spot-on.
😱 I've actually covered almost all the bases here.
🙂