Imagine we have 3 subnets attached to one router:
Host A: 192.168.1.1 Netmask: 255.255.255.0
Host B: 192.168.2.2 Netmask: 255.255.255.0
Host C: 192.168.2.3 Netmask: 255.255.0.0
If Host A sends an IP packet to the ip 192.168.2.3, how does the router knows to which network the ip belongs to? 192.168.2.3 could be a host of the network 192.168.0.0/16 or an host of 192.168.2.0/24. What happens if both networks have an host with equal ip addresses? e.g.: Host C: 192.168.2.3/16
and Host C: 192.168.2.3/24
.