I just recently learned about IPv4 and the different classes. Let's say I have a following arbritary IP address :

Now, the first octet is below 127 and thus, it tells me that this IPv4 address is a Class A address. A class A address is divided as follows enter image description here

From that, I deduce that the first octet (12) in my class is the network ID and the remaining 123.123.45 is the host ID. Now my question is, first of all,

Q1: is network ID (12) the same for everyone on my ISP?

Q2: Why do all devices on my home network share the same IPv4 address? Surely, the hostID part for each of them should change?

In essence, I'm asking what do these NetIDs and HostIDs actually repersent, is a part of the HostID meant to repersent my router? Which part does everyone on my ISP share?


1 Answer 1


Welcome to network engineering! Classful addressing is hopelessly out of date, replaced by Classless InterDomain Routing since 1993. Since the premise of your question is wrong, it’s hard to give you a meaningful answer to your first question.

The answer to your second question is because we are running out of addresses, so a technique called Network Address Translation is used to have multiple devices appear to the Internet as one IP.

There is a lot of good information on CIDR and NAT just a quick Google search away, or you can look at previous questions on this site.

  • Ah. That makes so much more sense. Just about the Network Address Translation. If I say want to send a packet to my friends PC on his home network, and if his PC shares the same IP as other PCs on his network, then how would my packet know that it needs to go to his specific PC. I.e, what does my friends router do when it receives my packet? Is there like a device ID within the header of the packet ? Nov 28, 2018 at 20:06
  • Typically, the translation includes the port number. So for example if you send a packet to port 80, the NAT device will translate that to port 7777. The application on is listening on that port.
    – Ron Trunk
    Nov 28, 2018 at 20:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.