1

It's a theory only question.

An host on 192.168.0.0/16 can comunicate with an host on the subnet 192.168.1.0/24 ?

And viceversa?

If no, why?

NOTE: I already CAN calculate host, subnet, network id, host id, etc...

My question is different: I need to know if an host of a subnet can dialogue with a host that is sub-subnetted

Context

Hosts with a common segment in Net ID, but not identical.

This is scenario when an actual /16 net is being subnetted in /24, but the work is done 'some PCs at a time' and not the whole network is already subnetted as /24

Example 1

Host A: 192.168.1.200/16

  • Netmask: 255.255.0.0
  • Net ID: 192.168.0.0/16
  • Host ID: 1.200
  • Network range: 192.168.0.0 ... 192.168.255.255

Host B: 192.168.1.1/24

  • Netmask: 255.255.255.0
  • Net ID: 192.168.1.0/24
  • Host ID: 1
  • Network range: 192.168.1.0 ... 192.168.1.255

Can A send packets to B ? Can B send packets to A ?

Example 2 (from the accepted answer)

Host C: 192.168.0.200/16

  • Netmask: 255.255.0.0
  • Net ID: 192.168.0.0/16
  • Host ID: 0.200
  • Network range: 192.168.0.0 ... 192.168.255.255

Host D: 192.168.1.1/24

  • Netmask: 255.255.255.0
  • Net ID: 192.168.1.0/24
  • Host ID: 1
  • Network range: 192.168.1.0 ... 192.168.1.255

Can C send packets to D ? Can D send packets to A ?

realtebo
  • 123
  • 1
  • 7
  • 192.168.1.0/24 is a subnet of 192.168.0.0/16 so your question doesn't make too much sense... – Zac67 Aug 20 '21 at 10:09
  • @Zac67: I know that 192.168.1.0/24 is a subnet of 192.168.0.0/16. I don't know i a host with a netmask255.255.0.0 can dialogate with an host with netmask 255.255.255.0 (having first 2 subnet octects identical). Probably has not sense the question but I don't know the answer – realtebo Aug 20 '21 at 10:30
  • 1
    Hosts can communicate directly when they share a common subnet, from their mutual perspective. E.g. 192.168.1.200/16 and 192.168.1.1/24 could communicate directly. Hosts on different subnets - even from only a single perspective - require a gateway in between. – Zac67 Aug 20 '21 at 10:32
  • @Zac67: thanks. Post it as answer and I upvote and choose it. It was a stupid question, but it my dubt. – realtebo Aug 20 '21 at 10:34
  • 1
    Routers route packets between networks. Ihat is the entire reason routers were created, and they are necessary to forward packets between networks. – Ron Maupin Aug 20 '21 at 11:38
  • @RonMaupin. Is the switch (or the router) that disallow contacting different subnets? – realtebo Aug 20 '21 at 12:09
  • 1
    Switches are bridges that forward layer-2 frames on the same network, but routers route layer-3 packrats between different networks. – Ron Maupin Aug 20 '21 at 12:13
  • Thanks. Question still was.. who disallow the comunications? – realtebo Aug 20 '21 at 12:23
  • A host will look at the destination address to determine if it is on the same network. If so, it will send directly to the host on the same network. If not, it will send to its configured gateway (router). a router does not send packets from a network back to the same network, it routes packets between networks, It is the sending host that determines where to send a packet based on the destination address. – Ron Maupin Aug 20 '21 at 12:38
  • So what would happen if source host will send a packet to a target host not in the same subnet without pass through the router? – realtebo Aug 20 '21 at 12:49
  • It will not because it will frame the layer-3 packet with the layer-2 address of its configured gateway. You do not seem to understand the network layers. – Ron Maupin Aug 20 '21 at 13:01
  • Now I understand (a litte better). – realtebo Aug 20 '21 at 13:03

1 Answers1

1

[from comment] Hosts can communicate directly when they share a common subnet, from their mutual perspective. Hosts on different subnets - even from only a single perspective - require a gateway in between.

E.g. 192.168.1.200/16 and 192.168.1.1/24 could communicate directly. From 192.168.1.200's perspective, 192.168.1.1 is located within 192.168.0.0/16. From 192.168.1.1's perspective, 192.168.1.200 is part of 192.168.1.0/24. Both hosts will attempt resolving the respective destination IP by ARP and send packets directly.

However, 192.168.0.200/16 would still send to 192.168.1.1 directly,

192.168.0.200 & 255.255.0.0 = 192.168.0.0 = source prefix
192.168.1.1   & 255.255.0.0 = 192.168.0.0 = matches source prefix => destination is local 

but 192.168.1.1/24 would not regard 192.168.0.200 as directly connected and consequently sends packets to its (default) gateway.

192.168.1.1   & 255.255.255.0 = 192.168.1.0 = source prefix
192.168.0.200 & 255.255.255.0 = 192.168.0.0 = mismatches source prefix => destination is not local 

When enlarging an already existing subnet, you should take care to adjust the network masks first and then begin to use addresses from the grown scope. When shrinking an existing subnet, you need to migrate all addresses to the target subnet first and then change the network mask/prefix length.

Note that the term subnet originated from long obsolete classful networking and was carried over to more modern CIDR networks. Presently, it means the same as directly connected IP network, sharing a common prefix.

Zac67
  • 84,333
  • 4
  • 69
  • 133