Basic PC Tips

IP Addressing - how computers communicate across the Internet

IP Addresses
Public Networks
Private Networks
Subnets
Subnet Masks
IP Addresses vs Website Addresses
How a computer obtains an IP Address
Related Documents

It is rare nowadays to find a computer that is not attached to some form of network, allowing it to access resources or information stored on other computing devices.

A network may be relatively small - consisting of computers that are close to each other (this sort of network is called a Local Area Network - or LAN - and is typically found within a single building). The largest network that computers connect to these days is the internet.

One essential function that is part of any network, whatever the size, is the ability for equipment attached to that network to communicate. In order to do this each piece of equipment must have a unique address so that other equipment can send information to it.

There are a number of different protocols (sets of rules) defining ways for networked equipment to talk to each other, by far the most commonly used is the Internet Protocol (TCP/IP). TCP/IP was originally designed to allow computers to communicate across the internet, but now is used to communicate across networks of all sizes.

Top

IP Addresses

Each piece of equipment (computers etc..) on a TCP/IP network must have a unique IP Address. This address will consist of four groups of numbers separated by '.' - each number can be between 1, 2 or 3 digits long.

For example: 56.173.8.95 (this is a made up address and may not be the actual address of a computer)

The easiest way to find out the IP Address of your computer is to follow these steps:

  1. Click on the start button (bottom left corner of your screen)
  2. From the menu that appears click on Run...


  3. In the dialog box that appears, type cmd and click on the OK button


  4. The window that appears is the Command Prompt; type ipconfig and press the Enter key
  5. You will get various information about your network connection (when you've finished viewing it just type exit and press the Enter key to close this window)

After entering ipconfig the command prompt window will display information similar to the following picture:


In this case you can see that my current IP Address is: 192.168.1.5 (I will explain the other information later in this document)

IPv4 is the traditional and most widely used version of IP - however, with the explosion of the internet a new version (IPv6) has been developed.

The main advantage of IPv6 is that IP addresses are larger, allowing for more of them (there was a real risk of IP addresses running out with IPv4).

The discussion in this document relates to IPv4 and is sufficient for the purpose. If you want to learn more about the different versions there are many excellent resources available on the web that will provide a detailed technical explanation.

Top

You can think of the internet as being a collection of smaller networks that are connected by pieces of equipment called routers. Each of these networks will have a range of IP Addresses that can be used for equipment connected to it.

Routers are pieces of network equipment that are able to direct network traffic between different networks.

Public Networks

A public network is one that gives equipment connected to it direct access to the internet. This means that every bit of equipment on a public network must have an IP Address that is unique across all other equipment connected to public networks across the globe.

If you have a home PC that is connected directly to the internet via a dial-up or broadband modem you are connected to a public network and your computer will have a unique IP Address.

Top

Private Networks

A private network may not be connected to the internet, or if it is it will be 'hidden' behind a NAT Firewall.

NAT stands for Network Address Translation and allows a Local Area Network (LAN) to share one set of IP Addresses within the LAN and one or more different IP Addresses for traffic external to the LAN - essentially it translates the IP Addresses of traffic between the private network and the public network that it is attached to (the following diagram will hopefully make this clearer)


In this diagram you can see that the NAT firewall has two IP Addresses. 192.168.1.0 is the internal address that is visible to all the equipment on the private network - this address cannot be seen from the internet. 201.56.123.4 is the external address that is visible to the public internet - this address cannot be seen by any of the computers connected to the private network.

Scenario 1 - computers communicating within the private network

All the equipment within the private network communicate by sending information to their individual IP Addresses (e.g. computer with address 192.168.1.2 sends information directly to computer with address 192.168.1.3 using that address, and the second computer can reply directly to the address 192.168.1.2).

Scenario 2 - an internal computer communicates with a computer on the internet

Computer with address 192.168.1.2 can send information to an internet address (e.g. 123.321.1.2). The information passes through the NAT firewall and when it is received by the destination computer it appears to have come from address 201.56.123.4. When the computer on the internet responds it will do so to address 201.56.123.4 which is the NAT firewall. The NAT firewall will receive this response, translate the address and send it on to 192.168.1.2.

In this situation the internal address of the original computer has been hidden from the computer on the internet.

The rules of IP Addresses specify a number of addresses that should be used for private networks. Because these addresses are hidden from anything outside the private network it doesn't matter if different private networks use the same addresses.

The three address ranges that can be used are:

  • 192.168.0.0 to 192.168.255.255
  • 172.16.0.0 to 172.31.255.255
  • 10.0.0.0 to 10.255.255.255

Which address range is right for a particular network depends on the size and complexity of that network (for small home networks the most appropriate address range is the first in the above list.

Top

Subnets

Local Area Networks are often divided into subnets, which are logical groupings of networked equipment.

Subnets are created to help simplify the administration of networks, and when implemented properly they can improve both the security and performance of a network. Subnets are usually only used when there are many devices attached to a network in relatively close proximity to each other.

Subnet masks are used to define subnets within a larger network.

The use of different subnets is generally only practical for larger networks. While all network equipment uses subnet masks (following section), they only have an effect on networks divided up in this way.

Subnet Masks

The easiest way to understand a subnet mask is to think of it as a filter that blocks unwanted network traffic.

The topic of subnet masks is a long and complicated one. This document only attempts to describe the concept, if you want more information there are plenty of great technical resources available on the internet.

When we discussed the ipconfig command earlier we showed an example of the results:


You can see that in this example the computer has a subnet mask of 255.255.255.0.

The subnet mask is used to compare received traffic with the IP address of the computer. 255 in a subnet mask means that only traffic from addresses that match the computer's IP Address will be accepted - any other traffic will be ignored.

In the example above, the IP Address is 192.168.1.5 and the subnet mask is 255.255.255.0 so the computer will only accept traffic from addresses that have the same first three groups of numbers.

For example, traffic from the following address would be accepted:

whereas, traffic from these addresses would be ignored:

Top

IP Addresses vs Website Addresses

Since IP Addresses are the way that computers can communicate over the internet you may be wondering why you don't need an IP Address to visit a website, after all a website is stored on a computer on the internet.

When you visit a website you do so by entering a Uniform Resource Locator (URL) - which is the technical term for a website address (e.g. the URL for this website is http://www.dtex-consulting.co.uk).

One of the services provided by computers on the internet is Domain Name Service (DNS) and you may have come across the term DNS server. A DNS server is a computer running Domain name Services.

But what is DNS?

Essentially, a DNS server contains a list of website names (URLs) and the IP Address of the computer that has that website (the computer with the website is 'hosting' the website).

When you visit a website your computer will ask a DNS server for the IP Address of the computer hosting that website. If the DNS server your computer asks doesn't know what the address is, it will pass the request on to another DNS server.

So you don't have to know and remember the IP Addresses of websites (which would be a nightmare!), just the URL (which is much easier to remember!).

Recalling the process we discussed to display the IP Address and subnet mask of your computer, if you type ipconfig /all instead of just ipconfig you will be shown more detailed information which includes the initial DNS server that your computer queries.


Top

How a computer obtains an IP Address

Assigning IP Addresses is another function provided by some computers in a network.

Dynamic Host Configuration Protocol (DHCP) is a service usually provided by one piece of equipment in a network (this might be a computer or a router).

Forget the technical term! Simply put, when a computer (or printer etc..) connected to a network is turned on it will send out a signal asking for an IP Address (assuming that the network is configured for DHCP). This signal will be received by a DHCP server which will then respond by assigning the new equipment an address.

When an IP Address is assigned it cannot be given to another piece of equipment, it will remain assigned even if the computer it has been assigned to is turned off or removed from the network.

It is possible for a computer to be assigned an IP Address and then be removed from the network, in theory this means that the IP Address would be 'lost' and couldn't be assigned again.

To avoid this problem each assigned IP Address has a lease time - to keep an IP Address, a computer must renew it's lease of an address within this period. If it fails to do this it will lose the IP Address which then becomes available to be assigned to another computer.

You can see the address of the DHCP server as well as the lease details of your computer's current IP Address from the ipconfig /all command.

Top

Related Documents: