some trick about the mack on calculation
1.we can just calulate the last bit that we need
eg: 206.34.221.33/7
we can just compute the last (8-7) bit on the first byte
206%2==0 so last bit equals 0;
eg2: 206.34.221.35/20
we can anology the first one we just compute previously
just compute the last (8*3-20) bit one the fourth byte
221%2==1. so we donote 1
110%2==0 so we donote 01
55%2==1 so we donote 101
27%2==1 so we donote 1101
13%2==1 so we donote 11101
in practice ,we just need the last fourth bits ,to make clearly,we calculate the last fourth bits
so the mask is 206.34.(221-13=208).0
hope you can enjoy it
give the length of the mask ,calculate the mask address
eg: length=11
we can split 11 equals 8 plus 3
the first 8 bits are abvious ,i.e. 255
the following 3 bits .we can think it like this way.(255-(2^5-1))=224.
so the problem can be solved easily.
so if the length is 18
we can easily write the mask address like this way.
i.e.,the answer is 255.255.192.0