Embedded Systems
Products & Resources

Home Products Shipping Resources About Contact

Other Resources and Links

All material on
this Web site is
protected under
United States
and International
copyright law.

Liability for your
use of information
on this Web site is
strictly limited.

Trademarks used
on this Web site
are the property of
their respective

Links and Resources related to Data Networking

IP Network Addressing Tutorial

An IP address consists of 32 binary digits (bits), usually broken up into four groups of eight bits each, and written in "dotted decimal" format, thus: Each group can be from 0 to 255 (otherwise, it would not represent eight binary digits). Some IP addresses have special meanings and should not be used outside of that context. For example, is the "loopback address" and messages to this address are turned around and sent back to whoever sent them (see IETF RFC3330 for more information).

The 32 bits can be divided into two parts. The "subnet" address occupies some number of bits at the left (or most significant) end and the "host" address occupies the remaining bits at the right (or least significant) end. Where the division occurs is defined by something called the "subnet mask", which must be known, along with the IP address, to any device wishing to participate in IP networking. The subnet mask is also a 32 bit number and is usually written in dotted decimal format. It has ranges of contiguous ones at the left and zeros at the right. The ones denote bits in the IP address that are part of the subnet address and the ones bits that are part of the host address. Commonly, the division is on an eight bit boundary. This results in the subnet mask being written with only the decimal numbers 255 and 0. For example, denotes 16 bits of subnet (two groups of eight bits) and 16 bits of host address. Similarly, denotes 24 bits of subnet and 8 bits of host address.

Example: A device with the IP address and subnet mask has a subnet address of 192.168.-.- and a host address of 100.133.

Devices with the same subnet address can communicate with each other directly over an Ethernet connection without the assistance of a router. For example, could communicate with if they both have the subnet mask because they both have the same subnet address (192.168.-.-).

Devices with different subnet addresses cannot communicate with each other directly over an Ethernet connection. A properly configured router is needed between them. For example, will not be able to communicate directly with if they have the subnet mask because one has the subnet address 192.168.100.- and the other 192.168.4.-.

Setting up a router is a complicated business, so unless it is necessary for some reason (network segmentation, security, etc.) it should be avoided. IP devices can be hooked up with patch cables and simple Ethernet switches (or two devices with just a crossover cable) as long as all the devices are configured for the same subnet. The IETF has set aside the subnet 192.168.-.- for use in private networks (i.e. networks not directly routed to the public Internet). Therefore, large private networks usually use IP addresses of the form 192.168.XXX.YYY and the subnet mask Smaller networks use some locally chosen value for XXX, for example 4, so that IP addresses are of the form 192.168.4.YYY and the subnet mask A large private network can also consist of multiple smaller network segments of the latter form, but then is is necessary to place routers between the segments (this being the point of configuring a network this way).

The smallest and largest IP addresses on a subnet are reserved and should not be used for devices. The smallest address is the network identifier, so where above I have written 192.168.-.-, I should really write because the smallest address rule makes it clear that I'm referring to a network, not a device. The largest address is the broadcast address. Every device listens to messages sent to this address. On the subnet, this address would be

For small, isolated networks, the simplest setup is to give every device a subnet mask of and an IP address of the form 192.168.XXX.YYY where XXX is the same for every device, but freely chosen from 0 to 255 and YYY is different for each device, chosen from 1 to 254.