0% found this document useful (0 votes)
157 views5 pages

Homework 1 Solutions

The document provides details of an assignment for a networking course, including questions on IPv4 addressing, address allocation, IPv4 forwarding, and IPv4 and IPv6 datagram formats. It includes multiple parts asking students to determine network masks, subnet networks, find organizations that own IP blocks, make address allocations that satisfy constraints, determine next hop routers and interfaces for packet forwarding, and explain differences between IPv4 and IPv6 header fields.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
157 views5 pages

Homework 1 Solutions

The document provides details of an assignment for a networking course, including questions on IPv4 addressing, address allocation, IPv4 forwarding, and IPv4 and IPv6 datagram formats. It includes multiple parts asking students to determine network masks, subnet networks, find organizations that own IP blocks, make address allocations that satisfy constraints, determine next hop routers and interfaces for packet forwarding, and explain differences between IPv4 and IPv6 header fields.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

EP2120 Internetworking

IK2218 Protocols and Principles of the Internet

Homework Assignment 1
(Solutions due 17:00, Mon., 12 Sept. 2022)
(Review due 17:00, Wed., 14 Sept. 2022)

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 126 hosts in it? (5p)
You need 126 IP addresses for the hosts, plus a network address plus a directed
broadcast address = 128 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 128 addresses, and hence 7 bits are needed and the netmask is
255.255.255.128. Otherwise, if the router is not a host then you need 129 addresses,
and hence 8 bits are needed and the netmask is 255.255.255.0.
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 /26 network? (5p)
/26 means that you have 32-26=6 bits for host addresses, which means 2 6=64
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 62 hosts. If the router needs its own
IP address, then 61 hosts.
c) Split up the network 130.225.100.0/24 into five networks, including one /25 network
and four /27 networks. Provide the results 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 10000010.11100001.01100100. To solve
the problem, we can split up the /24 network into two /25 networks, and further divide
one of the /25 networks into four /27 networks.
Bit 25 of the first /25 network will be 0, while that of the second /25 network will be 1.
We can split the second /25 network (for which bit 25 is 1) into four /27 networks, then
bits 25, 26 and 27 of the four /27 networks will be 100,101, 110, and 111.
The first network in binary format will be
10000010.11100001.01100100.00000000/25,
networks will be
10000010.11100001.01100100.10000000/27,
10000010.11100001.01100100.10100000/27,
10000010.11100001.01100100.11000000/27,
10000010.11100001.01100100.11100000/27.
130.225.100.0/25, 130.225.100.128/27, 130.225.100.160/27, 130.225.100.192/27 and
130.225.100.224/27.
An equally good solution is to split up the first /25 network into four /27 networks.
d) What is the directed broadcast address of the network 130.225.128.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, 130.225.143.255.
e) What is the limited broadcast address of the network 130.225.128.0/20? (5p)
The limited broadcast address is the address with all bits set to 1. Consequently, it is
255.255.255.255.
f) Use the services of IANA and a regional registry to figure out to whom the IP address
block 130.237.14.0/23 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 “KTH Royal Institute of Technology”. The AS number is AS2839.

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

One possible solution is given below.


Assign the networks as follows:
A: 131.84.192.0/22
B: 131.84.196.0 /22
C: 131.84.200.0/24
D: 131.84.201.0/24
E: 131.84.202.0/29
F: 131.84.202.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 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

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/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

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

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)

Options are Pad1, PadN, Jumbo Payload, Router Alert.

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.

Jumbo Paylod: This option allows for payloads up to 4GBs long.

Router Alert: This option indicates to a router that the datagram requires additional processing.

Pad1 and PadN correspond to no-operation and end-of-option in IPv4.

You might also like