Modems and Routers
So what exactly is a modem and what is a router?
A Modem is a piece of network equipment which connects you to your broadband provider. In the old days of the internet, modems were based on analogue dialup technology and had as maximum speed of 56k. You would plug one end into the phone socket and the other would normally connect to a USB socket.When you wanted to use the internet, you would iniatiate the connection. This would dial a phone number and make the connection.
Around the year 2000, broadband internet became available to most people. This required a connection from either a cable or telephone (ADSL) provider. The connection was notmally a permanent one and most tended to have unlimited use, so you no longer paid per minute, just a fixed monthly cost.
In order to connect to the internet, you still required a modem. This does what is called a PPP (Point to Point Protool) connection. Now with a simple modem, you can attach this to your cable or phone line and then plug itb into your computer via Ethernet or USB. You computer will then have a direct connection to the internet. There will be no barrier between the two. Your computer will have a public IP address and will be exposed directly to web traffic. Yopu will also only be able to onnct a single machine to the internet.
A Router, on the other hand is responsible for managing your local network. It hands out IP addresses to all the devices on the local network, such as laptops, TVs, printers and smart audio devices such as Sonos players using a system called DHCP. When a device first connects to the a network it sends out a Broadcast message asking if there is a DHCP server. The router should respond by assigning it an IP address.
Routers often have in built Wireless Access Points (WAPs), which gives you access to wifi. Also many outers will have a built in Modem, so with a single device, you connect to the internet, run your local network and enable WiFi in your home.
Your router has two different IP addresses. It has a public IP address on its Wide Area Network (WAN) port. This is the IP someone needs to know to reach you from outside the network. It then has an internal IP address, which is also known as the gateway. Devcics on your network get their IP address via DHCP. This service also hads them a subnet mask and gateway. The gateway is simply the address of the router. The subnet mask tells the machine how big the network is so it knows which IP addresses are in the local network and which need to be sent to the gateway to be routed on to the rest of the Internet. e.g A gateway of 192.168.0.1 and subnetmak of 255.255.255.0 will mean your local devices are all within the range of 192.168.0.2-254.
If you widsh to host your own services, such as a web server or email server behind your router, you will need to set a few things up. Firstly you need to tell your router to send incoming requests for certain services, to specific IP addresses on your network. These services are knwn as ports. For example port 80 is for web servers and port 21 is for FTP (file transfer protocol). If you wish a PC on IP 1932.168.1.20 to host a web server, then you need to tell your router to set a rule that incoming traffic for port 80 should be sent to 192.168.1.20. This process is called Network Address Translation or NAT.
The next problem is how to find your IP address. If you have a static public IP address then your WAN port on your router will always get the same address and it can be accessed by typing this in. Most pople, however, have their WAN IP address as a dynamic address, allocatd by the Internet Service Provider's DHCP server. So if someones WAN address is always changing, how do you find their network if they are hosting a web server? The easiest way to do this is via a service called Dynamic DNS. This is whre you register with a Dynamic DNS provider, such as DynDns.com. You register a name, like xyz.selfip.com with a username and password. You put this address, username and password into your DynDns settings on yor router. Everytime your router gets allocated a new IP address it updates the IP adssigned to xyzzy.selfip.com so this is alwasys pointing at your network.
If you ever wish to know what your current public IP address is, go to http://www.whatsmyip.net