if we took Windows as an example, we can use the command "netstat -rn" to show route table as follows:

    IPv4 Route Table
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
                              (omit other items..)         On-link    281         On-link    281         On-link    281

we can also use the command "ipconfig" to list interfaces as follows:

Ethernet adapter Ethernet 3:
                       (omit other items..)
   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::e1d6:d479:c8d3:3032%8
   IPv4 Address. . . . . . . . . . . :
   Subnet Mask . . . . . . . . . . . :
   Default Gateway . . . . . . . . . :

if we are sending an ip packet to "", this dest ip address will be ANDed the "Netmask(" and compared to "Network Dest AND Netmask" for all items in IPv4 Route Table, and get the Interface "".

my question is that in the interface information got from ipconfig, there is another "Subnet Mask(". What's the different purpose between "Netmask" and "Subnet Mask"? is "Subnet Mask" just used for another AND operation after getting interface from route table to determine if "" is in the same LAN(broadcast domain) or not?

  • 1
    They are the same thing. Packets destined to go to local CPU. Unicast packets destined to 192.168.56.xx/24 exit via Ethernet 3 interface, if there is an ARP entry to that destination. If there is no ARP to 192.168.56.xx host, OS first generates an ARP request.
    – manish ma
    Jul 23, 2021 at 19:49

2 Answers 2


Network and subnet are the same thing in the post-network address class world, and IPv6 never had network address classes, but still uses masks (always written as the mask length, not an explicit mask).

An address mask is used to distinguish the network and host portions of an address. It is used to determine the part of the destination address that should be matched against a routing table network address to determine if there is a match, and the longest match will be used (or the lowest metric in case of a length tie).

The interface is the actual interface to which the packet (not package) gets forwarded when a match is determined. It is quite possible, even required, in routers to have multiple interfaces, ether physical or logical, or both, because routers route packets between different networks.

  • but after "a match is determined"(we knew which interface to forward to), why there is another "Subnet Mask" assigned to this interface?
    – 柯鴻儀
    Jul 23, 2021 at 19:46
  • The interface address has a mask so that you know the network attached to that interface. You need to know if the network is directly attached, or if the network is distant and needs to be sent to a gateway.
    – Ron Maupin
    Jul 23, 2021 at 19:56
  • Interface information is reflected in the routing table as a "local route". Its is redundant.
    – manish ma
    Jul 23, 2021 at 19:56
  • No, the information on the interface is used to determine the data-link frame created for the packet. If the destination address is in the network on the interface, the the frame is built for the destination host, else the frame is built for the gateway to leave the network.
    – Ron Maupin
    Jul 23, 2021 at 19:59
  • @RonMaupin so if I understand the comment above right, the mask on interface will be used to get network id the second times after comparing to the route table, right?
    – 柯鴻儀
    Jul 23, 2021 at 20:00

They are the same thing. A subnet mask is used to divide the IP address into network address and host address. In this example the subnet mask equals to 11111111.11111111.11111111.00000000 which is the equivalent of it in bits, stating that it has 256 hosts in which 254 are available.

The interface on the other hand is simply an actual interface that is used to forward traffic. the interface needs to have a mask so it knows to what subnet it relates to.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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