1

I understand that an IPv4 address is represented by 4 consecutive bytes:

<8bits>.<8bts>.<8bits>.<8bits>

And understand that this 32bit address comprises a 'host' and a 'network' component, such as in the image below. But I don't understand what the 2 different components represent.

What information do the network and host components of an IP address indicate, in what part of networks is this information used?

Looking at the image, it looks like the network component allows for configuring 'virtual networks', on which the total number of host devices that can be allocated to network is the highest number that can be represented by the 'host' component of the IP address - i.e. if the 32bit IP address is divided equally into host and network components, does that mean that a switch can support 65 536 networks?

IP address representation

Zach Smith
  • 619
  • 1
  • 5
  • 16

2 Answers2

5

And understand that this 32bit address comprises a 'host' and a 'network' component, such as in the image below. But I don't understand what the 2 different components represent.

The network part addresses the IP network, and the host part addresses a host (or interface) within that IP network.

What information do the network and host components of an IP address indicate, in what part of networks is this information used?

The IP address is a unique identifier for a host/interface in a large network.

While the IP address uniquely identifies a destination, a routing table holds the information where to find each destination (logically grouped into subnets).

The division into network and host parts is only relevant for the local subnet. Usually, it isn't even known for remote subnets.

IP packets are routed, based on the local routing tables of the originating host and each intermediate hop (gateway). Each routing table is from the perspective of its node - it may be anything from a simple default gateway to thousands of entries for hundreds of gateways and dozens of interfaces.

Looking at the image, it looks like the network component allows for configuring 'virtual networks', on which the total number of host devices that can be allocated to network is the highest number that can be represented by the 'host' component of the IP address

Basically, yes. Note that you can split the network/host parts at any bit, not just octet boundaries.

i.e. if the 32bit IP address is divided equally into host and network components, does that mean that a switch can support 65 536 networks?

Don't mix up layer-3 and layer-2 mechanisms. While a layer-3 network uses a layer-2 network for local delivery, each layer has little to no knowledge of what exactly the other does. It is much easier to look at each layer separately. Once you understand each one you can look at their interfacing, then you get the whole picture.

A switch is a layer-2 device that connects a data link layer segment. While that is most often identical to a layer-3 subnet it doesn't need to be. A switch can support any number of hosts up to its MAC table limit (depending on its hardware, commonly 32,000 or 16,000). It doesn't know nor care how these hosts communicate on the layers further up.

So, from the layer-3 perspective you could easily have a /16 subnet (or rather route), especially when subnetted to several smaller subnets later on. From the layer-2 perspective, a 64K segment would be extremely large - normally too large for practical use.

Decent switches can use another concept of "networks" called VLANs. Each VLAN represents an L2 segment of its own. The common 802.1Q tagging allows up to 4,094 VLANs but most switches don't support using all of them simultanously (often up to 256 or 512).

Zac67
  • 90,111
  • 4
  • 75
  • 141
3

To expand on Zac's answer...

The division into network and host parts is only relevant for the local subnet. Usually, it isn't even known for remote subnets.

This cannot be overstated. Classful networking went away thousands of (internet) year ago. So, unless you are part of the network (and thus, know the netmask), it's "just a number". You can't know what bits are network and which are host. Even if you have the explicit network in your route table(s), you don't know how the bits are actually being used at the destination; the route is just a pointer to who knows more about it. For example, the postman delivers items based on the street address; you take it out of the mailbox and deliver it to the appropriate person.

Ricky
  • 32,810
  • 2
  • 45
  • 85