TCP/IP Addressing
On my own network, I use 192.168.3.0 as my network number (er, three coz it's my house number;-)). This allows me to have my hosts numbered from 1 to 254, or, in other words 254 hosts. For example, the PC that this web page was written on is 192.168.3.80, whilst my gateway machine is 192.168.3.254. Note, you cannot use the numbers 0 or 255 as the last number as these are used by all the network devices to know where they are in the IP world and to respond to low-level network requests, which, TBH, do not usually come into the 'basics' category.
The address ranges designated as privately assigned are as shown in the following table. Note that it is highly unlikely that a home network will require thousands or millions of addreses, but it is still possible to use the Class A and B address ranges for your internal network without any penalty. It is very common for the 192.168 address range to be used within a home network as it is very easy to manage.
Network | Class | Available address Range | Available number of Hosts |
---|---|---|---|
10.0.0.0 | A | 10.0.0.1 -> 10.255.255.254 | Millions;-) |
172.16.0.0 | B | 172.16.0.1 -> 172.31.255.254 | Thousands;-) |
192.168.0.0 | C | 192.168.0.1 -> 192.168.255.254 | 254 per network |
For example, if the network number is 192.168.0.0, then this will allow us to use the numbers 192.168.0.1 through 192.168.0.254 for our hosts. If 254 is used as the gateway's address, then each of the other machines can be allocated addresses such as 192.168.0.10, 192.168.0.20, 192.168.0.30, etc.. When setting these other machines, you need to specify the address of your gateway as the Default Router, Default Gateway, depending on your networking software. This tells the PC's IP stack to use your gateway as the route for all your non-local traffic, or, to put it another way, 'I've no idea where that is, ask that geezer over there with the map'.
It is also possible to subnet your network, subnetting being a means of dividing large networks into smaller ones. An IP address consists of two halves, a network portion and a host portion. This is determined by the subnet mask of a network which is either depicted in the 'dotted' form, e.g., 255.255.255.0 or by using the CIDR 'slash' notation, e.g., /24. This figure refers to the numnber of bits of a network address that are the network portion. The CIDR (Classless Inter-Domain Routing) format is the generally accepted form used in networking as it allows networks to be subnetted without reference to IP network classes. It also saves having to keep forever typing 255;-).
The following table shows some subnets and their CIDR notation, together with the number of available hosts and networks that are available for a particular subnet. The reason that the number of hosts differs from the number of address is that two addresses are used to denote the network address and one denotes the broadcast address. For example, network 192.168.0.0/24 will have 192.168.0.0 as it's network address and 192.168.0.255 as it's broadcast. Note that an address stated with a /32 value is a host address and that a /31 subnet is next to useless;-)Network Mask | CIDR | # Addresses | # Hosts | # Subnets |
---|---|---|---|---|
255.255.255.255 | /32 | 1 | 1 | 0 |
255.255.255.254 | /31 | 2 | 0 | 0 |
255.255.255.252 | /30 | 4 | 2 | 64 |
255.255.255.248 | /29 | 8 | 6 | 32 |
255.255.255.240 | /28 | 16 | 14 | 16 |
255.255.255.224 | /27 | 32 | 30 | 8 |
255.255.255.192 | /26 | 64 | 62 | 4 |
255.255.255.128 | /25 | 128 | 126 | 2 |
255.255.255.0 | /24 | 256 | 254 | 1 |
The first of the following diagrams shows how IP addresses are allocated where a LAN dhcp server is available. The only address that is fixed is that of the LAN interface of the gateway device. This is the typical set-up where Microsoft ICS, Sygate, Wingate, Netgear, SMC and Linksys routers are used as the gateway device, i.e., very common.
- Automatic IP Settings
Where DHCP is used to supply IP addresses, it is normal practice for DHCP to also supply both the Gateway Address and the DNS servers to be used for name resolution.
- Manual IP Address Settings
Most internet sharing devices will offer DHCP services to the LAN but there may be instances where either DHCP does not work (this is more likely with MS ICS rather than a router), or you want to have fixed address set on your LAN. In this case you must also define the subnet mask as well, which for our example below is 255.255.255.0. Note that essentially nothing changes on the gateway device, it still has DHCP set on the Cable interface and a fixed address on the LAN interface.
In addition, where you set a manual address, you also need to set the Gateway address and the DNS servers. In this example, the Gateway and DNS would be 192.168.0.1 but again there are instances where DNS does not work (again more likely with MS ICS!) so there may be a need to set NTL's DNS servers instead. These are 194.168.4.100 and 194.168.8.100 and it is usual to specify both in your set-up.
When setting manual addresses it is important not to cause an IP clash, or, in other words, do not set two IP addresses the same. In addition you should avoid setting any addresses that clash with the IP address scope of any DHCP servers you are running.
Most Operating Systems have facilities for discovering assigned IP addresses, some examples of which are ahown below.
- Win9X
Use the command winipcfg by selecting Run from the Start Menu. A window will be shown that looks like this:
Note that this screen will also show the MAC or hardware address of your NIC, or, in the case of Winipcfg, the Adapter Address. This is the address that your Cable Modem learns on boot-up.
- WinNT/2000
In a dos command window, type ipconfig :
C:\>ipconfig Windows 2000 IP Configuration Ethernet adapter Local Area Connection 5: Connection-specific DNS Suffix . : nigs.net IP Address. . . . . . . . . . . . : 192.168.3.201 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 192.168.3.254
Or, for more detail, ipconfig /all :
C:\>ipconfig /all Windows 2000 IP Configuration Host Name . . . . . . . . . . . . : NIGS Primary DNS Suffix . . . . . . . : Node Type . . . . . . . . . . . . : Hybrid IP Routing Enabled. . . . . . . . : No WINS Proxy Enabled. . . . . . . . : No DNS Suffix Search List. . . . . . : nigs.net Ethernet adapter Local Area Connection 5: Connection-specific DNS Suffix . : nigs.net Description . . . . . . . . . . . : Linksys EtherFast 10/100 PC Card Physical Address. . . . . . . . . : 00-E0-98-21-25-4C DHCP Enabled. . . . . . . . . . . : Yes Autoconfiguration Enabled . . . . : Yes IP Address. . . . . . . . . . . . : 192.168.3.201 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 192.168.3.254 DHCP Server . . . . . . . . . . . : 192.168.3.254 DNS Servers . . . . . . . . . . . : 192.168.3.254 Primary WINS Server . . . . . . . : 192.168.3.254 Lease Obtained. . . . . . . . . . : 15 July 2001 20:06:44 Lease Expires . . . . . . . . . . : 16 July 2001 20:06:44
- Linux
At your shell prompt type ifconfig, which will result in output that will look very similar to that shown in the following screen dump, which shows the output from a two NIC Linux machine where eth0 is attached to an NTL Cable Modem and eth1 is attached to the internal network. Note that there is no indication here as to eth0 having obtained it's address via DHCP.
© Nig's Net Written using the Bluefish HTML Editor on RedHat 9.0.All Copyrights and Trademarks ACK'd. Not to do so would be a SYN!