Uploaded by mwamba chipate

4-set2-3-solutions

advertisement
Assignment: IP forwarding
Solutions
Problem 1. Describe how class A, B, and C IP addresses are recognized in a binary representation
of IP addresses ?
Class A address start with “0”
Class B address start with “10”
Class C address start with “110”
Problem 2.
a) Why is a subnet of all zeros or all ones cannot be used in a classful routing environment?
A subnet address of all zeroes cannot be used because a classful routing protocol has no way to
differentiate between the all-zeroes subnet and the network address. (Example: Class B address
128.143.0.0 with subnetmask.255.255.255.0. Here, 128.143.0.0 can be interpreted as the address of
the entire network (128.143.0.0/16) or subnetwork “0”on this network (128.143.0.0/24) )
A subnet address of all ones cannot be used because a classful routing protocol has no way to
differentiate between the broadcast address on the subnet and the broadcast address on the entire
network. (Example: Class B address 128.143.0.0 with subnetmask.255.255.255.0. Here,
128.143.255.255 can be interpreted as “all hosts on subnetwork 128.143.255.0” or the address
“all hosts on network 128.143.0.0”)
b)
How many subnets are available if a class C address has six bits of subnetting? How many
host addresses are available per subnet. (Hint: The problem statement of (a) contains a part of
your answer.)
With six bits of subnetting, a class C address wil l have 26 –2 = 62 subnets and 22 –2 = 2 host
addresses per subnet.
Problem 3. How would you express the entire Class B address space as a single CIDR
advertisement?
Since the leading two bits of all Class B addresses are “10”, the entireClass B address space
can be expressed as 128/2.
Problem 4. Assume that you have been assigned the 198.42.180.0/22 block of IP addresses.
a) Specify an extended network prefix that allows the creation of 200 hosts on each subnet.
b) With your answer to (a), what is the maximum number of hosts that can be assigned to
each subnet?
c) With your answer to (a), what is the maximum number of subnets that can be defined?
d) Give the IP address (in CIDR notation) of one of these subnets. Give the broadcast
address for this subnet.
(a)
(b)
(c)
(d)
8 bits are needed (28 >200 > 27)  Extended network prefix is /24 or 255.255.255.0
28-2 = 254 hosts (broadcast address and network address need to be subtracted)
22=4
Here are all subnet addresses with network addresses
198.42.180.0/24, 198.42.180.255/24
198.42.181.0/24, 198.42.181.255/24
198.42.182.0/24, 198.42.182.255/24
198.42.183.0/24, 198.42.183.255/24
Problem 5. Aggregate the following set of four /24 IP network addresses to the highest degree
possible.
212.56.132.0/24
212.56.133.0/24
212.56.134.0/24
212.56.135.0/24
•
•
List each address in binary format and determine the common prefix for all of the
addresses:
212.56.132.0/24 11010100.00111000.10000100.00000000
212.56.133.0/24 11010100.00111000.10000101.00000000
212.56.134.0/24 11010100.00111000.10000110.00000000
212.56.135.0/24 11010100.00111000.10000111.00000000
Common Prefix: 11010100.00111000.10000100.00000000
The CIDR aggregation is:
212.56.132.0/22
Problem 6. Aggregate the following set of four /24 IP network addresses to the highest degree
possible.
212.56.146.0/24
212.56.147.0/24
212.56.148.0/24
212.56.149.0/24
•
List each address in binary format and determine the common prefix for all of the
addresses:
212.56.146.0/24 11010100.00111000.10010010.00000000
212.56.147.0/24 11010100.00111000.10010011.00000000
212.56.148.0/24 11010100.00111000.10010100.00000000
212.56.148.0/24 11010100.00111000.10010101.00000000
•
•
Note that this set of four /24s cannot be summarized as a single /23.
212.56.146.0/23 11010100.00111000.10010010.00000000
212.56.148.0/23 11010100.00111000.10010100.00000000
The CIDR aggregation is:
212.56.146.0/23
212.56.148.0/23
Note that if two /23s are to be aggregated into a /22, then both /23s must fall within a single
/22 block. Since each of the two /23s is a member of a different /22 block, they cannot be
aggregated into a single /22 (even though they are consecutive). They could be aggregated
into 222.56.144/21, but this aggregation would include four network numbers that were not
part of the original allocation. Hence, the smallest possible aggregate is two /23s.
Problem 7. (10 points) IP Routing Tables
Consider the following routing table:
Network Destination
142.150.64.0/20
142.150.71.128/28
142.150.71.128/30
142.150.0.0/16
Next Hop
A
B
D
C
a. (5 Points) Assume that a router receives an IP datagram with destination
142.150.71.132. Determine the next hop of the IP datagram that is selected by the
router? Explain you answer.
b. (3 Points) Add a routing table entry to the table above which enforces that all IP
datagrams with destination 142.150.71.132 have “A” as Next Hop. For all other IP
destination addresses, the Next Hop should not change.
c. (2 Points) Add a routing table entry to the table above which enforces that all IP
datagrams whose destination address does not match any of the entries in the table, are
forwarded to next hop “C”. (The network destination for this entry must be provided as
an network prefix)
(a)
142.150.71.132
142.150.64.0/20
= 1000 1110.1001 0110.0100 0111.1000 0100
= 1000 1110.1001 0110.0100 0000.0000 0000
142.150.71.128/28 = 1000 1110.1001 0110.0100 0111.1000 0000
142.150.71.128/30 = 1000 1110.1001 0110.0100 0111.1000 0000
142.150.0.0/16
= 1000 1110.1001 0110.0000 0000.0000 0000
The bold digits show the bits of the prefix that need to match the
destination address. The first, second and fourth entry match. The second
entry has the longest matching prefix, so the next hop is B.
(b)
The routing table to be added is:
Network Destination
142.150.71.132/32
Next Hop
A
The routing table to be added is:
Network Destination
0.0.0.0/0
Next Hop
C
(c)
Download