Saturday 28 June 2014

Routers and Addresses

•Routers compare the network prefix portion of the address to a value in their routing tables.
•Suppose a router is given a destination address, D and a pair (A,M) that 
represents the 32 bit address and the 32 bit subnet mask.
•To make the comparison, the router tests the logical "and" condition to set 
the host bits of address D to zero and then compares the result with the network prefix A:

  A == ( D & M)
•For example consider this 32 bit mask: 
  (255.255.0.0 in decimal)
11111111 11111111 00000000 00000000
  and the network prefix (128.10.0.0 in decimal):
10000000 00001010 00000000 00000000
•Now consider the 32 bit destination address
 128.10.2.3 which has the binary equivalent of
10000000 00001010 00000010 00000011
•The logical "and" between the destination address and the address mask
 produces the result:
10000000 00001010 00000000 00000000
•which is equal to the prefix 128.10.0.0

No comments: