Homework 1 Solutions
Homework 1 Solutions
Homework Assignment 1
(Solutions due 17:00, Mon., 12 Sept. 2022)
(Review due 17:00, Wed., 14 Sept. 2022)
Consider the network above, a routed network in an organization’s enterprise network. The organization
built a core network (network F) connected to a central router (R1) and connected to a router (R2) with
a (long-haul) switched Ethernet (network E). The access routers (R3 to R6) are connected to a set of
local offices (networks A to D). The host H1, connected to network F, performs various traffic
monitoring tasks. All networks use Ethernet on the link layer.
The organization wants to make an address allocation by assigning an address block to networks A to
F in the following way:
i. Networks A and B require 1000 hosts each, and networks C and D require 200 hosts each. The
lowest address should be assigned to network A.
ii. There are no unnumbered point-to-point links: all Ethernet networks have IP sub-networks
and all nodes (routers and hosts) have an IP address on all their network interfaces. All nodes
need to be reachable from any other host.
iii. The address allocation should be such that the sub-networks can be aggregated.
iv. Each sub-network should not be larger than necessary in order to accommodate all hosts in the
sub-network.
a) Assume that the allocated address block is 131.84.192.0/21. Is it possible to have such an address
allocation? Why? (4p)
b) Now, assume that the enterprise allocated prefix 131.84.192.0/20 for its internal addresses. Make an
address allocation as described in (i-iv). Based on your address allocation, provide the network addresses
of networks A to F, and the required entries of the forwarding table of router R1. Choose appropriate IP
addresses for the router interfaces that appear as next hop in the forwarding table. Give a sketch of your
reasoning to support your solution. (26p)
a) No, it is not possible because block 131.84.192.0/21 provides 232-21=2048 distinct addresses
while we need more than 1000+200+1000+200=2400 addresses.
b) Any solution should be accepted that is correct in the sense that packets destined to ANY of
the subnets and to any of the IP addresses assigned to actual nodes (host or router) can be
forwarded.
The solution does not necessarily have to give a detailed explanation, but a good explanation
is a merit, of course, and helps to provide partial points should the solution not be entirely
correct.
The following solution assumes that the router interfaces in networks A-F are not one of the
“hosts”. If the solution clearly states that the contrary was assumed, and the solution is
consistent with the assumption then it should be considered correct.
We assume that within the subnet allocated to network F the first IP address is assigned to
R1, the second IP address is assigned to R2, the third address is assigned to R5, and the fourth
address is assigned to R6. Similarily, addresses in network E are assigned in increasing order
of the routers´ names (R2, R3, R4).
R1’s forwarding table (not including the forwarding rules for the ‘rest of the network’):
Destination Next hop Flags Interface
1 131.84.202.8/29 - U North
2 131.84.192.0 /21 131.84.202.10 UG North
3 131.84.202.0 /29 131.84. 202.10 UG North
4 131.84.200.0/24 131.84. 202.11 UG North
5 131.84.201.0/24 131.84. 202.12 UG North
80.5.0.0/16 - U m2
129.40.160.0/20 - U m1
201.50.1.0/24 - U m0
172.16.0.0/22 129.40.160.8 UG m1
91.0.0.96/28 80.5.0.100 UG m2
147.16.0.0/14 201.50.1.44 UG m0
129.40.128.0/18 201.50.1.2 UG m0
0.0.0.0/0 80.5.0.1 UG m2
a) 201.50.1.39 (4p)
201.50.1.39 on m0, direct delivery
b) 91.0.0.115 (4p)
80.5.0.1 on m2, default route
c) 129.40.181.48 (4p)
201.50.1.2 on m0, indirect delivery
d) 129.40.195.2 (4p)
80.5.0.1 on m2, default route
e) 147.17.224.224 (4p)
201.50.1.44 on m0, indirect delivery
a. In IPv4 fragmentation can be done in any host and router, but defragmentation can only be
done at the destination. Provide three reasons why defragmentation should not be done in
routers. (5p)
- A router cannot know if more fragmentation will be needed at subsequent routers on the
path towards the destination
- Defragmentation is resource intensive (requires a buffer and a timer)
- The fragments may traverse different routes, hence a router may not receive all
fragments of a datagram
b. Why does the IPv4 header contain a “checksum” field? Does the IPv6 header contain a
“checksum” field? If not, please explain why. (5p)
IPv4 contains a checksum header field for detecting potential bit errors in the transmission of
the datagram header. IPv6 does not have this field. The reason is that link layer technologies
typically have a stronger checksum than that in IPv4 and the transport layer protocols also
include a (checksum), hence having a checksum like the one in IPv4 in IPv6 would be redundant.
c. In IPv4 the source route option allows a sender to specify the list of IP addresses that a
datagram should pass through. Take the strict source route option as an example, and
explain how strict source routing is implemented in the IPv4 header option, and how the
options are handled by the routers that the datagram passes through. (5p)
The information about source routing is encoded in the strict source route option in the options
part of the IPv4 header. In the option, the type contains the option number of strict source route
(i.e., 9), the length field specifies the length of the entire option, and the data field contains the
IP addresses of the routers that the datagram needs to pass through. The last address in the list
is that of the destination. No deviations from this list are allowed.
The strict source route option uses an 8-bit pointer field that resides in the option-data field.
The pointer indicates the byte position that contains the IP address of the next router. Once a
router has been visited, the pointer is moved to an offset that points to the IP address of the next
router, it stops when the pointer exceeds the option-length value, then no more routes can be
used.
d. The Hop-by-hop options extension header in IPv6 can contain various options. What are
those options? What are the purposes? Which of them corresponds to no-operation and end-
of-option options used in IPv4? (Hint: You can consult rfc2675, rfc2711 and rfc8200) (5p)
Pad1: This option is 1 byte long and is designed for padding alignment purposes
PadN: This option is similar in concept to Pad1. The difference is that PadN is used
when 2 or more bytes are needed for alignment.
Router Alert: This option indicates to a router that the datagram requires additional processing.