In IP header , Only the destination ip address and source ip address is indicated . How does a traveling packet know the network section of destination ip address in CIDR notation ? Thanks
2 Answers
There is no mask in the packet. A packet has specific source and destination host addresses. A host address is a /32
network, which means that no part of the address is masked.
A mask is only relevant to routing, not the actual packets. A router will look up the network best match to the destination address, and the masks are for the networks in the routing tables of the routers to be applied against the network addresses in the routing tables.
The traveling packet doesn't need to know net mask of subnet. Netmask is something that used on host itself, so it can calculate its subnet range. If the incoming packet's ip address will be in subnet range of current host, then it will accept it. Otherwise drop action will be aplied.