I know that subnetting helps in dividing the internet part and physical address + host part.

Like, a class C prefix uses 3 octets for network part and 1 byte for host part. I'm reading this book and they keep referring that subnets are used in the internet.

But how do the router happen to change the last part of the public IP address to send request for a particular host in the local network?

Does the router have control over the last octet to change it by itself? Or is the subnetting technology used for local network only?

And does the ISP have any control over how we use subnet? Like my public IP is Does it change the last part 112 (if it were using Class C) for different hosts in a network?

  • 7
    There are no Class-A, B, C networks anymore. Haven't been for years. Forget about them. Fast!
    – user2084
    Jul 24, 2014 at 11:38
  • Ashish, it's not clear what you're asking. Do you mean: How can multiple computers on a local network use the same public IP address?
    – Ron Trunk
    Jul 24, 2014 at 12:47
  • I know that routers use something called NAT and PAT and how the same IP address is used to send and receive packets. But is the subnet used in local network or the public network? Jul 24, 2014 at 13:46
  • Assuming no NAT, there is no difference between 'public' networks and 'local' networks. I'm not sure what you mean by the router "using the subnet", or "changing the last octet."
    – Ron Trunk
    Jul 24, 2014 at 21:44
  • 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 could provide and accept your own answer.
    – Ron Maupin
    Aug 8, 2017 at 21:40

3 Answers 3


Just continue reading. Both global and local IP networks can be subneted. Network Address Translation (NAT) is used to translate local IP into public.


When talking about your specific address, you're talking about a /32. Your network might be in any subnet your ISP sees fit.

Example: is the network as received by your ISP from its local IP authority. They might divide it further for different routers, CMTS, dslam or whatever your technology uses, so let's say you receive your in the subnet /20. An internet router might have in his table the full network as in its table, but then it need to forward packets to your address, a specific /32, so he thinks: if I take the first 16 bits of this address will it match this If yes, it forwards your packet to "network". As the packet reach your ISP network, /16 is not enough anymore, so your ISP router looks for the network, which is the network address for the network your address is in.

It maches ones and zeros, from left to right, that's why is the network address of, even if the third octet is not the same. Very confusing at first. Keep practicing and you'll get the hang of it.

  • Might help to add mention of inside local address, inside global address, outside global address, etc.
    – HAL
    Jul 24, 2014 at 19:01

A subnetwork or subnet is a logical subdivision of an IP network.

A router doesn't change anything in the IP adress. A router is only passing IP packets between subnets it is aware of (routing table).

A routing table is a data table stored in a router that lists the routes to particular network destinations (one or more subnets).

A router doesn't know if a subnet it has in the routing table is divided into smaller subnets.

And as a router is unaware if a subnet has been divided into smaller subnets, its is the same for an ISP.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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