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
  • 14
  • 1
    Simply put, the network part addresses the IP network and the host part addresses a host (or interface) within that IP network. – Zac67 Aug 06 '19 at 11:14
  • Thank you @Zac67 - if a host was making a network request, then that host would specify the network address, and the host address to contact on that network? – Zach Smith Aug 06 '19 at 11:27
  • 1
    To use an analogy in the physical world, the network portion represents the street name, and the host portion represents the house number. – Ron Trunk Aug 06 '19 at 11:42
  • @ZachSmith The sender routes the destination address: first, it checks whether they're part of the same subnet, based on the sender's IP address and network mask. If they are, it sends the packet to the destination directly. If not, it consults its routing table and sends the packet to the according gateway. The gateway does the same thing only that it often uses a larger routing table. This repeats until the destination is reached. – Zac67 Aug 06 '19 at 11:51
  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can provide and accept your own answer. – Ron Maupin Dec 15 '19 at 05:46

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
  • 84,333
  • 4
  • 69
  • 133
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,147
  • 2
  • 43
  • 85
  • We had to do some nasty stuff in a redundant network scenario where some of the devices had a rather "interesting" implementation of redundancy. In the end, we configured some devices with a /25 net mask to make them think that their two interfaces are in different networks and other devices with a /24 net mask to make them think their two interfaces are in the same network. Also required some interesting gymnastics with the IGMP queriers on the two redundant switches. So, this is an example, where even being in the same network, there are different notions of how many bits are host and nw. – Jörg W Mittag Aug 12 '19 at 20:40