The binary representation of the mask 255.255.240.0 is 11111111.11111111.11110000.00000000. Therefore, the host portion is 12 bits. 2^12=4098. Subtract from it the all-zero for itself and all-one for broadcasting, this mask can support 4098-2=4096 hosts.
The binary representation of the IP address is 160.36.00011110.110 and t he binary representation of the mask is 255.255.11111110.0, indicating the network portion of the mask is 23 bits. Therefore,
the broadcast address is 160.36.31.255 (all host bits are zero)
the network ID is 160.36.30.0 (all host bits are zero)
the number of hosts supported is 2^9-2=510
First, represent the IP addresses in binary format:
135.46.56.0/22 ==> 135.46.00111000.0/22 for interface 0
135.46.60.0/22 ==> 135.46.00111100.0/22 for interface 1
192.53.40.0/23 ==> 192.53.00101000.0/23 for Router 1
For the IP addresses asked for:
(a) 135.46.63.10 ==> 135.46.00111111.10, has to go through interface 1
(b) 135.46.57.14 ==> 135.46.00111001.14, has to go through interface 0
(c) 135.46.52.2 ==> 135.46.00110100.2, doesn't have common network ID for any interfaces above, therefore, go through Router 2
(d) 192.53.40.7 ==> 192.53.00101000.7, has to go through Router 1
(e) 192.53.56.7 ==> 192.53.00111000.7, doesn't have common network ID with any interfaces above, therefore, take the default which is Router 2
This question is basically asking what are the common network ID of the four IP addresses given.
57.6.96.0/21 ==> 57.6.01100000.0/21
57.6.104.0/21 ==> 57.6.01101000.0/21
57.6.112.0/21 ==> 57.6.01110000.0/21
57.6.120.0/21 ==> 57.6.01111000.0/21
Therefore, the aggregate address is 57.6.01100000/19
For organization A, which requested 4000 IP addresses, the number of bits for host portion would be at least 12, i.e., 2^12=4096. Therefore,
For organization B, which requested 2000 IP addresses, the number of bits for host portion would be at least 11, i.e., 2^11=2048. Therefore,
For organization C, which requested 4000 IP addresses, the number of bits for host portion would be at least 12, i.e., 2^12=4096. Therefore,
For organization D, which requested 8000 IP addresses, the number of bits for host portion would be at least 12, i.e., 2^13=8192. Therefore,
/etc/exports /home 160.36.30.0/255.255.254.0(rw)
/etc/hosts.allow ALL: 127.0.0.1 ALL: 160.36.30. sshd:ALL sendmail:ALL
Because of the subnet changes, two steps need to be carried out:
/etc/exports
/home 160.36.30.0/255.255.254.0(rw) 160.36.40.0/255.255.252.0(rw)
/etc/hosts.allow
ALL: 127.0.0.1
ALL: 160.36.30. 160.36.40.
ssh: ALL
sendmail:ALL
We need to understand the definition of fields first:
Total length: total IP packet length, not including Ethernet header
DF: if 1, indicating fragment is not allowed
MF: if 1, indicating more fragments are coming
offset: has to be multiple of 8 bytes
Between A and R1
Between R1 and R2
ID: x
DF: 0 (although there's no fragmentation occurs, fragmentation is still allowed
MF: 0
offset: 0
Between R2 and B
Total Length: 464 (msg len) + 20 + 20 = 504 bytes
ID: x
DF: 0
MF: 1
Offset: 0
DF: 0
MF: 0
Offset: 504 bytes
Total Length: 436 (msg len) + 20 + 20 = 496 bytes
ID: x
DF: 0
MF: 1
Offset: 0
DF: 0
MF: 1
Offset: 496 bytes
DF: 0
MF: 0
Offset: 992 bytes
See lecture slides