Computer Networks WS1819 Exercise Sheet 04 Solution
Computer Networks WS1819 Exercise Sheet 04 Solution
They forward packets between networks with different logical address ranges
and provide a WAN interface.
They are Routers too which means they forward packets between networks
with different logical address ranges but they do not provide a WAN interface.
4. Why are Gateways in the network layer of computer networks seldom requi-
red nowadays?
Modern computer networks operate almost exclusively with the Internet Pro-
tocol (IP). For this reason, a protocol conversion at the Network Layer is
mostly not required.
3. Sketch in the diagram of the network topology all collision domains and all
broadcast domains.
IPv4 addresses have a length of 32 bits (4 bytes). Thus, the address space
contains 232 = 4, 294, 967, 296 possible addresses.
Because with address classes, many addresses are wasted and it is impossible
to dynamically adjust address classes.
Calculate for each subtask of this exercise the first and last host addresses, the
network address and the broadcast address of the subnet.
Subnet ID of sender? 0
Subnet ID of receiver? 1
Subnet ID of sender? 3
Subnet ID of receiver? 3
Calculate for each subtask of this exercise the subnet masks and answer the que-
stions.
4. Split the class C network 195.3.128.0 into subnets, which contain 17 hosts
each.
5. Split the class B network 129.15.0.0 into subnets, which contain 10 hosts
each.
1. Sketch in the diagram of the network topology all collision domains and all
broadcast domains.
2. Sketch in the diagram of the network topology all collision domains and all
broadcast domains.
• 10.0.0.0/8
• 172.16.0.0/12
• 192.168.0.0/16
Calculate for each network configuration in the table whether an IP packet, which
is send from the given IP address to the destination address, leaves the subnet
during transmission or not.
11001001.00010100.11011110.00001101 201.20.222.13
AND 11111111.11111111.11111111.11110000 255.255.255.240
---------------------------------------
11001001.00010100.11011110.00000000
^^^^ => 0 = subnet ID sender
11001001.00010100.11011110.00010001 201.20.222.17
AND 11111111.11111111.11111111.11110000 255.255.255.240
---------------------------------------
11001001.00010100.11011110.00010000
^^^^ => 1 = subnet ID sender
Sender and receiver have different subnet IDs =⇒ the subnet is left.
00001111.11001000.01100011.00010111 15.200.99.23
AND 11111111.11000000.00000000.00000000 255.192.0.0
---------------------------------------
00001111.11000000.00000000.00000000
^^ => 3 = subnet ID sender
00001111.11101111.00000001.00000001 15.239.1.1
AND 11111111.11000000.00000000.00000000 255.192.0.0
---------------------------------------
00001111.11000000.00000000.00000000
^^ => 3 = subnet ID sender
Sender and receiver have equal subnet IDs =⇒ the subnet is not left.
172.21.23.14 and 172.21.24.14 are private IP addresses =⇒ they are not forwarded
by Routers.
11010010.00000101.00010000.11000110 210.5.16.198
AND 11111111.11111111.11111111.11111100 255.255.255.252
---------------------------------------
11010010.00000101.00010000.11000100
^^^^^^ => 49 = subnet ID sender
11010010.00000101.00010000.11000101 210.5.16.197
AND 11111111.11111111.11111111.11111100 255.255.255.252
---------------------------------------
11010010.00000101.00010000.11000101
^^^^^^ => 49 = subnet ID sender
Sender and receiver have equal subnet IDs =⇒ the subnet is not left.
11010010.00000101.00010000.11000110 210.5.16.198
AND 11111111.11111111.11111111.11111100 255.255.255.252
---------------------------------------
11010010.00000101.00010000.11000100
^^^^^^ => 49 = subnet ID sender
11010010.00000101.00010000.11001001 210.5.16.201
AND 11111111.11111111.11111111.11111100 255.255.255.252
---------------------------------------
11010010.00000101.00010000.11001000
^^^^^^ => 50 = subnet ID receiver
Sender and receiver have different subnet IDs =⇒ the subnet is left.
00000101.00000101.00000101.00000101 5.5.5.5
AND 11111111.11111110.00000000.00000000 255.254.0.0
---------------------------------------
00000101.00000100.00000000.00000000
^^^^^^^ => 2 = subnet ID sender
00000101.00000110.00000110.00000110 5.6.6.6
AND 11111111.11111110.00000000.00000000 255.254.0.0
---------------------------------------
00000101.00000110.00000000.00000000
^^^^^^^ => 3 = subnet ID sender
Sender and receiver have different subnet IDs =⇒ the subnet is left.
Specify for each subtask of this exercise the correct subnet mask.
4500 0034 B612 4000 4006 6F80 0A00 008B 5BC6 AEE0
The data contains the values of the fields of the IP packet header.
4 = Version
5 = IHL = IP Header Length (=⇒ 5 ∗ 4 Byte words = 20 bytes)
00 = Differentiated services
0034 = Total length (=⇒ 52 bytes)
B612 = Identification
4000 = Flags + Fragment offset
40 = Time To live (=⇒ 62 hops)
RFC 791 says on page 14: „The checksum field is the 16 bit one’s complement of
the one’s complement sum of all 16 bit words in the header“.
To calculate the checksum of the packet, the sum of each 2 byte word inside the
header must be calculated. The checksum field itself is skipped here!
4500 + 0034 + B612 + 4000 + 4006 + 0A00 + 008B + 5BC6 + AEE0 = 2907D
The first two bits are the carry and need to be added to the rest of the value:
The result 0110 1111 1000 0000 is equal to the value 6F80 in hexadecimal notati-
on, as already shown in the original IP packet header.
RFC 791 says on page 14: „For purposes of computing the checksum, the value of
the checksum field is zero“.
To verify a checksum, the same procedure is used as above, with a single exception:
The original header checksum is not omitted.
4500 + 0034 + B612 + 4000 + 4006 + 6F80 + 0A00 + 008B + 5BC6 + AEE0 = 2FFFD
The first two bits are the carry and need to be added to the rest of the value:
• 4500 0034 4C22 4000 F706 ???? C163 9055 0A00 008B
CRC = DB5D
• 4500 0034 671E 4000 4006 ???? 0A00 008b C163 9055
4500 + 0034 + 671E + 4000 + 4006 + 0A00 + 008b + C163 + 9055 => 2889B
2889B => 10 1000 1000 1001 1011
The first two bits are the carry and need to be added to the rest of the value!
10 + 1000 1000 1001 1011 = 1000 1000 1001 1101
Flip: 1000 1000 1001 1101
0111 0111 0110 0010 => 7762
CRC = 7762
• 4500 00F2 0000 4000 4011 ???? 0A00 008b 0A00 00FF
4500 + 00F2 + 0000 + 4000 + 4011 + 0A00 + 008b + 0A00 + 00FF = DB8D
DB8D => 1101 1011 1000 1101
There is no carry!
Flip: 1101 1011 1000 1101
0010 0100 0111 0010 => 2472
CRC = 2472
• 4500 0034 02FD 4000 3606 276C 6CA0 A330 0A00 008B
Correct.
• 4500 00E7 02FC 4000 3606 37BC 6CA0 A330 0A00 008B
Error!
• 4500 0034 A9D5 4000 4006 814E 0A00 008B ADC2 4613
Error!
4,000 bytes payload need to be transmitted via the IP protocol. The resulting packet
must be fragmented, because it is transmitted over multiple physical networks, whose
MTU is < 4, 000 bytes.
Display graphically the way, the packet is fragmented, and how many
bytes of payload each fragment contains.
2. Which algorithms for best path calculation implement the routing pro-
tocol classes from subtask 1?
Each AS consists of a group of logical networks, which use the Internet Pro-
tocol, are operated and managed by the same organization (e.g. an Internet
Service Provider, a corporation or university) and use the same routing pro-
tocol.
10. When RIP is used, each Router communicates only with its direct neighbors.
What are the advantages and drawbacks of method?
11. When RIP is used, the path cost (metric) depend only on the number of Rou-
ters (hops), which need to be passed on the way to the destination network.
What is the drawback of this method?
The metric hop count often results in routes, which are not optimal, because
all network segments have an equal weight.
12. When OSPF is used, all Routers communicate with each other. What are
the advantages and drawbacks of method?
1. Calculate the entries of the routing tables for each advertisement round of
the Routing Information Protocol (RIP).
(The hop metric is used.)
Step 1
Step 2
Step 3
Step 4
Distance values
Initial Step 1 Step 2 Step 3 Step 4 Step 5
dA 0 ← min 0X 0X 0X 0X 0X
dB ∞ 2 ← min 2X 2X 2X 2X
dC ∞ 2 2 ← min 2 X 2X 2X
dD ∞ 3 3 3 ← min 3X 3X
dE ∞ ∞ 3 3 3 ← min 3X
dF ∞ ∞ 102 12 7 5 ← min
Distance values
Initial Step 1 Step 2 Step 3 Step 4 Step 5
dA 0 ← min 0X 0X 0X 0X 0X
dB ∞ 3 ← min 3X 3X 3X 3X
dC ∞ 5 4 ← min 4 X 4X 4X
dD ∞ ∞ 11 11 9 ← min 9X
dE ∞ ∞ 7 7 ← min 7X 7X
dF ∞ ∞ ∞ ∞ 11 10 ← min
It is used for the exchange of diagnostic and control messages, as well as error
messages.
2. Give two examples for command line tools, which use ICMP.
ping, tranceroute
Exercise 18 (IPv6)
• 1080:0000:0000:0000:0007:0700:0003:316b
Solution: 1080::7:700:3:316b
• 2001:0db8:0000:0000:f065:00ff:0000:03ec
Solution: 2001:db8::f065:ff:0:3ec
• 2001:0db8:3c4d:0016:0000:0000:2a3f:2a4d
Solution: 2001:db8:3c4d:16::2a3f:2a4d
• 2001:0c60:f0a1:0000:0000:0000:0000:0001
Solution: 2001:c60:f0a1::1
• 2111:00ab:0000:0004:0000:0000:0000:1234
Solution: 2111:ab:0:4::1234
• 2001::2:0:0:1
Solution: 2001:0000:0000:0000:0002:0000:0000:0001
• 2001:db8:0:c::1c
Solution: 2001:0db8:0000:000c:0000:0000:0000:001c
• 1080::9956:0:0:234
Solution: 1080:0000:0000:0000:9956:0000:0000:0234
• 2001:638:208:ef34::91ff:0:5424
Solution: 2001:0638:0208:ef34:0000:91ff:0000:5424
• 2001:0:85a4::4a1e:370:7112
Solution: 2001:0000:85a4:0000:0000:4a1e:0370:7112