EE317 – DCN Assignment Number 2 (Solution)
EE317 – Data Communication and Networks
Assignment Number 2 (Solution)
Fall 2020
Maximum Marks: 60 Due Date: 13 December 2020
Instructions:
• Partially or fully copied assignments will be marked as zero.
• Only handwritten solution on A4 page will be accepted.
• Use the title page provided with this assignment.
• Late submissions are not allowed.
Taxonomy
CLO No. CLO Statement Domain
Level
Demonstrate the network layer services including IPv4, IPv6,
3 Cognitive 3
routing algorithms, subnetting and supernetting.
Question Number 1 (CLO 3) (4 + 6 = 10 marks)
Suppose that a VC is established between host A and host B, Construct the forwarding table
for all the router if the VC uses the path
• A→R1→R2→B
• A→R1→R3→R4→R2→B
Suppose the VC numbers of your choice.
Suppose the port numbers and VC numbers as shown in the figure above.
For A→R1→R2→B path
Forwarding table for R1 Forwarding table for R2
Incoming Incoming Outgoing Outgoing Incoming Incoming Outgoing Outgoing
Interface VC # Interface VC # Interface VC # Interface VC #
1 10 2 20 1 20 2 30
For A→R1→R3 → R4 → R2 →B path
Forwarding table for R1 Forwarding table for R2
Incoming Incoming Outgoing Outgoing Incoming Incoming Outgoing Outgoing
Interface VC # Interface VC # Interface VC # Interface VC #
1 10 3 40 3 50 2 30
Forwarding table for R3 Forwarding table for R4
Incoming Incoming Outgoing Outgoing Incoming Incoming Outgoing Outgoing
Interface VC # Interface VC # Interface VC # Interface VC #
1 40 3 60 2 60 1 50
National University of Computer and Emerging Sciences – FAST, CFD Campus 1
EE317 – DCN Assignment Number 2 (Solution)
Question Number 2 (CLO 3) (2 + 8 = 10 marks)
Suppose that we have a 5000 bytes datagram with ID = x and MTU size is 800 bytes.
i. Calculate the number of fragments
ii. Calculate the value of length, ID, fragflag and offset for each fragment.
i. MTU size is 800 bytes, but there is a 20 byte header so 780 bytes can be transferred at
once.
5000
𝑁𝑜. 𝑜𝑓 𝐹𝑟𝑎𝑔𝑚𝑒𝑛𝑡𝑠 = = 6.41
(800 − 20)
𝑵𝒐. 𝒐𝒇 𝑭𝒓𝒂𝒈𝒎𝒆𝒏𝒕𝒔 = 𝟕
ii. If we transfer 780 bytes at once, then offset value is not an integer, so we can transfer
776 bytes in one fragment. It means 4 bytes capacity is wasted due to incorrect MTU
size.
Fragment No. 1 Length = 800 ID = x Fragflag = 1 Offset = 0
Fragment No. 2 Length = 800 ID = x Fragflag = 1 Offset = 97
Fragment No. 3 Length = 800 ID = x Fragflag = 1 Offset = 194
Fragment No. 4 Length = 800 ID = x Fragflag = 1 Offset = 291
Fragment No. 5 Length = 800 ID = x Fragflag = 1 Offset = 388
Fragment No. 6 Length = 800 ID = x Fragflag = 1 Offset = 485
Fragment No. 7 Length = 344 ID = x Fragflag = 0 Offset = 582
Question Number 3 (CLO 3) (5 marks)
Use the concept of classful IP addresses to complete the following table.
Number Addresses Total
Leading Network Host Start
Class of per Addresses End Address
Bit(s) Bits Bits Address
Networks Network in Class
A 0 8 24 27 224 231 [Link] [Link]
B 10 16 16 214 216 230 [Link] [Link]
C 110 24 8 221 28 229 [Link] [Link]
Not Not Not Not
D 1110
Defined Defined Defined Defined
228 [Link] [Link]
Not Not Not Not
E 1111
Defined Defined Defined Defined
228 [Link] [Link]
National University of Computer and Emerging Sciences – FAST, CFD Campus 2
EE317 – DCN Assignment Number 2 (Solution)
Question Number 4 (CLO 3) (1 + 3 + 1 = 5 marks)
Use the concept of subnetting to find the:
• Number of subnets
• Subnet address(es)
• Subnet mask
In the following network.
There are 6 subnets in this network.
Subnet Name Description Subnet Address Subnet Mask
Subnet 1 Hosts connected to R1 [Link] [Link]
Subnet 2 Hosts connected to R2 [Link] [Link]
Subnet 3 Hosts connected to R3 [Link] [Link]
Subnet 4 Interfaces that connect routers R1 and R2 [Link] [Link]
Subnet 5 Interfaces that connect routers R2 and R3 [Link] [Link]
Subnet 6 Interfaces that connect routers R3 and R1 [Link] [Link]
National University of Computer and Emerging Sciences – FAST, CFD Campus 3
EE317 – DCN Assignment Number 2 (Solution)
Question Number 5 (CLO 3) (20 marks)
Calculate the given items for the IP address [Link]/19
• Subnet Mask
• Subnet Address
• No. of Subnets
• No. of Hosts in each subnet
• Subnet Identifier and Broadcast address for each subnet
• First and last host address for each subnet
• Default Gateway of each subnet
Subnet Mask = 1111 1111 1111 1111 1110 0000 0000 0000 = [Link]
It is a class B IP address. In class B IP address, the subnet mask is [Link], so
Mask bits = 3
No. of subnets = 2Mask Bits = 23 = 8
No. of hosts in each subnet = 213 – 2 = 8192 – 2 = 8190
Subnet Number Subnet Address First Host Address Last Host Address Broadcast Address Default Gateway
1 [Link] [Link] [Link] [Link] [Link]
2 [Link] [Link] [Link] [Link] [Link]
3 [Link] [Link] [Link] [Link] [Link]
4 [Link] [Link] [Link] [Link] [Link]
5 [Link] [Link] [Link] [Link] [Link]
6 [Link] [Link] [Link] [Link] [Link]
7 [Link] [Link] [Link] [Link] [Link]
8 [Link] [Link] [Link] [Link] [Link]
National University of Computer and Emerging Sciences – FAST, CFD Campus 4
EE317 – DCN Assignment Number 2 (Solution)
Question Number 6 (CLO 3) (10 marks)
Apply the Dijkstra’s algorithm on the following network to find the least cost paths from node u to
every other node.
Step N' D(v), p(v) D(w), p(w) D(x), p(x) D(y), p(y) D(z), p(z)
0 u 2, u 5, u 1, u
1 ux 2, u 4, x 2, x
2 uxy 2, u 4, x 5, y
3 vuxy 3, y 5, y
4 wvuxy 5, y
5 wvuxyz
National University of Computer and Emerging Sciences – FAST, CFD Campus 5