To get network id we perform $\text{Bitwise AND}$ operation of ip address with every
subnet mask...after if the obtain value matches with the network id ..then we send
the data through that..if more than one network id matches then we check for
the longest mask.
ip address $=144.16.68.117$ and with all mask one by one
first mask $=255.255.0.0 \Rightarrow 11111111.11111111.00000000.00000000$
$144.16.68.117\Rightarrow 10010000.00010000.01000100.01110101$
bit wise and operation
we get , $144.16.0.0\Rightarrow 10010000.00010000.00000000.00000000$
which is matching with network id $144.16.0.0$ given opposite to mask $255.255.0.0$
but we cannot stop here may some more network id matches..so check for every mask
Similarly,
$255.255.224.0$
$144.16.68.117$
$144.16.64.0$
which is matching with network id $144.16.64.0$ given opposite to mask $255.255.224.0$
Now next ,
$255.255.255.0$
$144.16.68.117$
$144.16.68.0$
Which is matching with network id $144.16.68.0$ given opposite
to mask $255.255.255.0$
Now last,
$255.255.255.224$
$144.16.68.117$
$144.16.68.96$
Which is $\text{NOT}$ matching with network id $144.16.68.64$ given opposite
to mask $255.255.255.224$
Now $3$ of the networks are matching...now we check for longest mask..
i.e $255.255.0.0$
$255.255.224.0$
$255.255.255.0$
So, last one is the largest therefore $\text{eth2}$ will be chosen to send packet.