You are on page 1of 5

EP2120 Internetworking

IK2218 Protocols and Principles of the Internet

Homework Assignment 1
(Solutions due 19:00, Mon., 11 Sept. 2023)
(Review due 19:00, Wed., 13 Sept. 2023)

1. IPv4 Addressing (30/100)


a) What is the best fit netmask (i.e., resulting in as few host addresses as possible) for a
network with 62 hosts in it? (5p)
You need 62 IP addresses for the hosts, plus a network address plus a directed
broadcast address = 64 addresses required. Additionally, you might need one more IP
address for the router, but the router could be one of the hosts. If the router is a host
then you need 64 addresses, and hence 6 bits are needed and the netmask is
255.255.255.192. Otherwise, if the router is not a host then you need 65 addresses,
and hence 7 bits are needed and the netmask is 255.255.255.128.
Note: the question did not ask the prefix length, but the netmask. Providing the correct
prefix length is half the solution. It is not necessary to give a solution for both cases,
but it is important that the assumptions underlying the solution are clearly stated.
b) What is the maximum number of hosts you can have in a /24 network? (5p)
/24 means that you have 32-24=8 bits for host addresses, which means 2 8=256
addresses in the subnet, out of which one is the network address, and one is the
directed broadcast address, so there can be up to 254 hosts. If the router needs its own
IP address, then 253 hosts.
c) Split up the network 172.20.16.0/24 into five networks, three /26 networks and two
/27 networks. Provide the resulting subnets in binary and in dotted decimal notation
including the prefix length. (5p)
/24 means that the first 24 bits of the address are the network address. Hence the first
24 bits of the five networks will have to be 10101100.00010100.00010000. To solve
the problem, we can split up the /24 network into four /26 networks, and further divide
one of the /26 networks into two /27 networks.
Bits 25 and 26 of the four /26 network will be 00,01,10, and 11. We can split the fourth
/26 network (for which bits 25 and 26 is 11) into two /27 networks, then bit 27 of the
two /27 networks will be 0 and 1.
The first network in binary format will be
10101100. 00010100. 00010000.00000000/26,
the other networks will be
10101100. 00010100. 00010000.01000000/26,
10101100. 00010100. 00010000.10000000/26,
10101100. 00010100. 00010000.11000000/27,
10101100. 00010100. 00010000.11100000/27.
172.20.16.0/26, 172.20.16.64/26, 172.20.16.128/26, 172.20.16.192/27 and
172.20.16.224/27.
An equally good solution is to split up any of the /26 networks into two /27 networks.
d) What is the directed broadcast address of the network 37.156.192.0/20? (5p)
The directed broadcast address of this network is the address with all bits set to 1
between positions 21 and 32. That is, 37.156.207.255.
e) Assume that the address of a host in a network is 172.20.17.193 and the directed
broadcast address of the network is 172.20.17.255. What is the network address of the
largest and smallest subnet that the device may belong to? Provide the results in dotted
decimal notation including the prefix length. (5p)
The addresses of the first device and the directed broadcast address in binary format
are
10101100.00010100.00010001.11000001
10101100.00010100.00010001.11111111
- The largest subnet
Since the directed broadcast address set all host bits to 1s, the largest subnet is
172.20.16.0/23. Then, the bits belonging to the host address of the device are
1.1100001 (i.e., 9 bits).
- The smallest subnet
Since the subnet mask fixes the prefix in the binary format, we can find the host bits by
focusing on the difference between the host’s address and the directed broadcast
address. The difference starts from the 27th bit of the address showing that the last 6
bits are the host bits. Hence, the smallest network address is 172.20.17.192/26. Then
the bits belonging to the host address of the device are 000001 (i.e., 6 bits)
f) Use the services of IANA and a regional registry to figure out to whom the IP address
block 37.156.192.0/24 belongs. Provide the name of the organization and the AS
number. (5p)
Based on the RIPE whois database (http://apps.db.ripe.net/search/query.html) the
network belongs to “SUNET”. The AS number is AS1653.

2. Address allocation (30/100)

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), which provides access to the rest of
the Internet. Router (R2) connects network F to the switched Ethernet network G. The access routers
(R3 to R7) are connected to a set of local offices (networks A to E). 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
G in the following way:
i. Network A requires 500 hosts, networks B and C require 200 hosts each, and networks D and
E require 100 hosts each. The lowest address should be assigned to network A.
ii. There are no unnumbered point-to-point links: all Ethernet networks are IP subnets 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 subnets can be aggregated.
iv. Each subnet should not be larger than necessary in order to accommodate all nodes (host or
router interfaces) in the subnet.

a) Assume that the allocated address block is 152.68.208.0/22. Is it possible to have an address
allocation that satisfies the above requirements? Justify your answer. (4p)
b) Now, assume that the enterprise allocated prefix 152.68.208.0/21 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 G, 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 152.68.208.0/22 provides 232-22=1024 distinct addresses
while we need more than 500+200+200+100+100=1100 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.

One possible solution is given below.


Assign the networks as follows:
A: 152.68.208.0/23
B: 152.68.210.0/24
C: 152.68.211.0/24
D: 152.68.212.0/25
E: 152.68.212.128/25
G: 152.68.213.0/29
F: 152.68.213.8/29

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 R6, and the fourth
address is assigned to R7. Similarily, addresses in network G are assigned in increasing
order of the routers´ names (R2, R3, R4, R5).

R1’s forwarding table (not including the forwarding rules for the ‘rest of the network’):
Destination Next hop Flags Interface
1 152.68.213.8/29 - U North
2 152.68.208.0/22 152.68.213.10 UG North
3 152.68.213.0/29 152.68.213.10 UG North
4 152.68.212.0/25 152.68.213.11 UG North
5 152.68.212.128/25 152.68.213.12 UG North
3. IPv4 forwarding (20/100)
A router has the forwarding table shown below. Determine the next-hop address and the
outgoing interface for the packets arriving to the router with destination addresses as
given in points (a)-(e).

Destination Next hop Flags Interface

80.5.0.0/16 - U m2
129.40.160.0/20 - U m1
201.50.1.0/25 - U m0
91.0.0.96/27 80.5.0.100 UG m2
147.17.0.0/16 201.50.1.44 UG m0
129.40.128.0/17 201.50.1.2 UG m0
0.0.0.0/0 80.5.0.1 UG m2

a) 201.50.1.63 (4p)
201.50.1.63 on m0, direct delivery

b) 91.0.0.140 (4p)
80.5.0.1 on m2, default route

c) 129.40.255.48 (4p)
201.50.1.2 on m0, indirect delivery

d) 201.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

4. IPv4 and IPv6 datagram formats (20/100)

a. What is the purpose of TTL in the IPv4 header and in the IPv6 header? Please explain what
could happen if the TTL field did not exist. (5p)

It represents the maximum number of hops (routers) a datagram can traverse before being
dropped. Without the TTL field the lifespan of a datagram would be unlimited, hence a
datagram could potentially loop in the network infinitely, leading to congestion.

b. How is error checking done in IPv4? What is the purpose? (5p)

Error checking is done through the checksum field in the IPv4 header. This involves calculating
the checksum value based on the contents of the packet header. Error checking is done to detect
bit errors occurring during transmission, error checking cannot detect compromise due to
software bugs in routers, for example.

c. In the IPv4 header, the 'Flags' field consists of 3 bits, of which the 'DF' (Don't Fragment)
and 'MF' (More Fragments) flags are used. Explain a scenario where these flags would be
relevant, how they are set, and the implications for packet fragmentation and reassembly.
(5p)
The 'DF' (Don't Fragment) flag is used to indicate that the datagram should not be fragmented
while traversing the network.
The 'MF' (More Fragments) flag is set in every datagram that is not the last fragment of a
datagram.

Consider that a source host sends a datagram to a destination host whose size exceeds the MTU
of a link on the path between the source and the destination. The datagram thus needs to be
fragmented for data to fit in a link layer frame.
If the DF flag is set then the datagram will be dropped.
If the DF flag is not then all fragments except the last will have the MF flag set.

The receiver, upon receiving a datagram with the MF flag set or a datagram with the MF flag
not set but a nonzero offset, will put the datagram in a buffer for reassembly.

d. What is Explicit Congestion Notification (ECN)? How is it used? (5p)

Explicit Congestion Notification (ECN) is a feature in computer networking that enables


routers and endpoints to signal network congestion before it leads to dropped packets. It is a
mechanism designed to improve the efficiency and fairness of data transmission in IP networks,
particularly during times of high traffic or congestion.
Traditionally, network congestion is detected when routers' buffers fill up and packets start to
be dropped. This is a reactive approach and can lead to performance degradation and
retransmissions. ECN takes a proactive approach by allowing routers to mark packets with
congestion information instead of immediately dropping them.

You might also like