I have a question regarding subnet masks and my understanding (or misunderstanding of them).
So when a subnet mask is used, a bitwise AND is performed using the subnet mask and the IP address(es). Traffic is exchanged (routed) between subnetworks with special gateways (routers) when the routing prefixes of the source address and the destination address differ. A router constitutes the logical or physical boundary between the subnets.
OK so far. But surely on everything has to be sent to a router/switch anyway right? So why do you need to have the subnet mask on your computer? If all data goes through the router, surely it is only the router that needs to have the subnet mask on it?