Tutorial 9

Tutorial 9
1 Router Architecture
Consider a router with a switch fabric, 2 input ports (A and B) and 2 output ports (C and
D). Suppose the switch fabric operates at 1.5 times the line speed.
a. If, for some reason, all packets from A are destined to D, and all packets from B are
destined to C, can a switch fabric be designed so that there is no input port queuing ?
Explain why or why not in one sentence.
b. Suppose now packets from A and B are randomly destined to both C and D. Can a switch
fabric be designed so that there is no input port queuing? Explain why or why not in
one sentence.
SOLUTION
a. Yes. Use crossbar fabric let A‐>D, B‐>C operate at line speed simultaneously (at the
same time ).
b. No. If A and B both send to C, we’ll have input port queuing no matter which switch
fabric is used.
2 IPV4 SUBNETTING
TASK A
Consider a router that interconnects three subnets: Subnet 1, Subnet 2, and Subnet 3.
Suppose all of the interfaces in each of these three subnets are required to have the prefix
223.1.17/24. Also suppose that Subnet 1 is required to support at least 60 interfaces,
Subnet 2 is to support at least 90 interfaces, and Subnet 3 is to support at least 12
interfaces.
Provide three network addresses (of the form a.b.c.d/x) that satisfy these constraints.
SOLUTION
Since the number of supported interfaces is different for each subnet, this is a VariableLength Subnet Masking (VLSM) problem.
As such, subnets should be sorted in descending order of number of supported
interfaces before subnetting is performed.
Subnet 2 (90 interfaces)
2^n – 2 ≥90
Notice that we subtract 2 from the total number of available IP addresses because 2
IP addresses are reserved for the network and broadcast addresses.
2^n ≥92
n=7
Number of bits allocated to host part = n = 7
Number of bits allocated to network part = Prefix length = 32 -n = 32 -7 = 25
The network address of the first subnet is always the address of the given address
space.
Network address of first subnet = 223.1.17.0/25
To obtain the broadcast address of a subnet, we keep the network part of the
subnet's network address as it is, and convert all bits in its host part to 1s.
Broadcast address of first subnet = 223.1.17.01111111/25 = 223.1.17.127/25
Subnet 1 (60 interfaces)
2^n – 2 ≥60
Notice that we subtract 2 from the total number of available IP addresses because 2
IP addresses are reserved for the network and broadcast addresses.
2^n ≥62
n=6
Number of bits allocated to host part = n = 6
Number of bits allocated to network part = Prefix length = 32 - n = 32 - 6 = 26
The network address of any subnet (that is NOT the first subnet) is obtained by
adding one to the broadcast address of its preceding subnet.
Network address of second subnet = 223.1.17.128/26
Broadcast address of second subnet = 223.1.17.10111111/26 =223.1.17.191/26
Subnet 3 (12 interfaces)
2^n – 2 ≥12
Notice that we subtract 2 from the total number of available IP addresses because 2
IP addresses are reserved for the network and broadcast addresses.
2^n ≥14
n=4
Number of bits allocated to host part = n = 4
Number of bits allocated to network part = Prefix length = 32 -n = 32 - 4 = 28
Network address of third subnet = 223.1.17.192/28
TASK B:
Assign network addresses to six subnets, with the following constraints:
– All addresses must be allocated from 214.97.254/14.
– Subnet A should have enough addresses to support 250 interfaces.
– Subnet B should have enough addresses to support 120 interfaces.
– Subnet C should have enough addresses to support 120 interfaces.
– Subnets D, E, and F should each be able to support two interfaces.
For each subnet, provide the network and broadcast addresses (in the form a.b.c.d/x).
SOLUTION
Since this is a Variable-Length Subnet Masking (VLSM) problem, recall that subnets
should be sorted in descending order of number of supported interfaces before
subnetting is performed. This is already done in the problem for you.
Subnet A (250 interfaces)
2^n – 2 ≥250
Notice that we subtract 2 from the total number of available IP addresses because 2
IP addresses are reserved for the network and broadcast addresses.
2^n ≥252
n=8
Number of bits allocated to host part = n = 8
Number of bits allocated to network part = Prefix length = 32 – n = 32 – 8 = 24
Network address of subnet A = 214.97.254.0/24 = 214.97.254/24
Broadcast address of subnet A = 214.97.254.11111111/24 = 214.97.254.255/24
Subnet B (120 interfaces)
2^n – 2 ≥120
Notice that we subtract 2 from the total number of available IP addresses because 2
IP addresses are reserved for the network and broadcast addresses.
2^n ≥122
n=7
Number of bits allocated to host part = n = 7
Number of bits allocated to network part = Prefix length = 32 – n = 32 – 7 = 25
Network address of subnet B = 214.97.255.0/25 = 214.97.255/25
Broadcast address of subnet B = 219.97.255.01111111/25 = 219.97.255.127/25
Subnet C (120 interfaces)
2^n – 2 ≥120
Notice that we subtract 2 from the total number of available IP addresses because 2
IP addresses are reserved for the network and broadcast addresses.
2^n ≥122
n=7
Number of bits allocated to host part = n = 7
Number of bits allocated to network part = Prefix length = 32 – n = 32 – 7 = 25
Network address of subnet C = 219.97.255.128/25
Broadcast address of subnet C = 219.97.255.11111111/25 = 219.97.255.255/25
Subnet D (2 interfaces)
2^n – 2 ≥2
Notice that we subtract 2 from the total number of available IP addresses because 2
IP addresses are reserved for the network and broadcast addresses.
2^n ≥4
n=2
Number of bits allocated to host part = n = 2
Number of bits allocated to network part = Prefix length = 32 – n = 32 – 2 = 30
Network address of subnet D = 219.98.0.0/30
Broadcast address of subnet D = 219.98.0.00000011/30 = 219.98.0.3/30
Subnet E (2 interfaces)
2^n – 2 ≥2
Notice that we subtract 2 from the total number of available IP addresses because 2
IP addresses are reserved for the network and broadcast addresses.
2^n ≥4
n=2
Number of bits allocated to host part = n = 2
Number of bits allocated to network part = Prefix length = 32 – n = 32 – 2 = 30
Network address of subnet E = 219.98.0.4/30
Broadcast address of subnet E = 219.98.0.00000111/30 = 219.98.0.7/30
Subnet F(2 interfaces)
2^n – 2 ≥2
Notice that we subtract 2 from the total number of available IP addresses because 2
IP addresses are reserved for the network and broadcast addresses.
2^n ≥4
n=2
Number of bits allocated to host part = n = 2
Number of bits allocated to network part = Prefix length = 32 – n = 32 – 2 = 30
Network address of subnet F = 219.98.0.8/30
Broadcast address of subnet F = 219.98.0.00001011/30 = 219.98.0.11/30
TASK C
Consider a subnet with prefix 128.119.40.128/26.
a. Give an example of one IP address (of form xxx.xxx.xxx.xxx) that can be assigned to this
network.
Suppose an ISP owns the block of addresses of the form 128.119.40.64/26. Suppose it
wants to create four subnets from this block, with each block having the same number of IP
addresses.
a. What are the prefixes (of form a.b.c.d/x) for the four subnets?
SOLUTION
a. 128.119.40.128/26 is the network address of the given subnet.
Broadcast address of given subnet = 128.119.40.10111111/26 = 128/119/40.191/26
Any IP address in the range of 128.119.40.129 to 128.119.40.190 (between and
excluding network and broadcast addresses) can be assigned.
b. It is required to create four subnets from the block of addresses 128.119.40.64/26.
To do so, we need to borrow 2 bits for the network part from the host part because
borrowing 2 bits gives a combination of 2^2= 4 subnets.
After doing so, we now have 28 bits for the network part and 4 bits for the host part.
a. This means that each of the four subnets will have a prefix of a.b.c.d/28, and will be
capable of supporting up to 2^4 - 2= 14 host addresses.
3 IPV4 DATAGRAM FRAGMENTATION
Consider sending a 2,400-byte datagram into a link that has an MTU (Maximum
Transmission Unit) of 700 bytes. Suppose the original datagram is stamped with the
identification number 422.
a. How many fragments are generated?
b. What are the values in the various fields in the IP datagram(s) generated related to
fragmentation?
SOLUTION
a. Since there is a 20-byte IP header, each fragment can carry up to 700 – 20 = 680 bytes
of data.
Notice that the transport-layer header is not considered as in problem 2 because we are
partitioning an IP datagram into several smaller IP datagrams. However, in problem 2, we
were partitioning an entire file into several datagrams, which is why we consider both
transport-layer (TCP) and IP headers.
You should always consider IP headers in these types of questions. However, if the
question is not clear regarding whether or not you should consider transport-layer
(TCP) headers as well, make an assumption and build your solution on it.
In addition, the original IP datagram is carrying 2400 – 20 = 2380 bytes of data.
Number of generated fragments = ceil (amount of data in original IP datagram /
amount of data in fragment) = ceil (2380 / 680) = 4 fragments.
b. All fragments will have the same identification number, since all fragments belong to
the same original IP datagram.
Each of the first three fragments will contain 680 bytes of data and 20 bytes of IP
header, thus amounting to a total of 700 bytes.
The fourth fragment will contain 2380 – (680) (3) = 340 bytes of data and 20 bytes of
IP header, giving a total length of 360 bytes.
The offset value is expressed in units of 8-byte chunks. As such, the offsets increment by
amount of data in fragment / 8 = 680 / 8 = 85.
The offsets of the 4 fragments will be 0, 85, 170, and 255.
Each of the first three fragments will have flag = 1 (meaning that more fragments
belonging to the same IP datagram are still expected), and the fourth fragment will have
flag = 0.
4 IPV4 DATAGRAM TRANSMISSION
Suppose datagrams are limited to 1,500 bytes (including header) between source Host A
and destination Host B.
Assuming a 20-byte IP header, how many datagrams would be required to send an MP3
consisting of 5 million bytes? Explain how you computed your answer.
SOLUTION
Assume that the data is carried in TCP segments, with each TCP segment having 20 bytes of
header. The question also assumes a 20-byte IP header. As such, each datagram can carry
up to 1500 – 40 = 1460 bytes of data.
Number of required datagrams = ceil (amount of data in MP3 / amount of data in
datagram) = ceil ((5 x 10^6) / 1460) = 3425 datagrams.
All except the last datagram will contain 1460 bytes of data, 20 bytes of TCP header,
and 20 bytes of IP header, thus amounting to a total of 1500 bytes.
The last datagram will contain (5 x 10^6 ) - (1460) (3424) = 960 bytes of data, 20
bytes of TCP header, and 20 bytes of IP header, giving a total length of 1000 bytes.
4 NAT (NETWORK ADDRESS TRANSLATION)
Consider the following figure Suppose that the ISP instead assigns :
 The router the address 24.34.112.235
 The network address of the home network is 192.168.1/24 .
a. Assign addresses to all interfaces in the home network.
b. Suppose each host has two ongoing TCP connections, all to port 80 at host
128.119.40.86. Provide the six corresponding entries in the NAT translation table.
SOLUTION
a. Network address of home network = 192.168.1.0/24
There are three hosts, and thus three interfaces, in the home network. One solution is to
assign the first three usable host addresses of the home network for the hosts.
These addresses are 192.168.1.1/24, 192.168.1.2/24 and 192.168.1.3/24.
Assigning any three addresses between and excluding the home network’s network and
broadcast addresses is also acceptable.
b.
NAT Translation Table
WAN Side
24.34.112.235, 5000
24.34.112.235, 5001
24.34.112.235, 5002
24.34.112.235, 5003
24.34.112.235, 5004
24.34.112.235, 5005
LAN Side
192.168.1.1, 3345
192.168.1.1, 3346
192.168.1.2, 3445
192.168.1.2, 3446
192.168.1.3, 3545
192.168.1.3, 3546