0% found this document useful (0 votes)
77 views

Assignment 2 Solution

The document provides the solution to an assignment on data communication and networks. It includes 6 questions assessing concepts like constructing forwarding tables for routers in a VC, calculating IP datagram fragmentation, using classful IP addressing, applying subnetting, and finding least cost paths using Dijkstra's algorithm. The questions are in short answer and table format with numerical and conceptual responses.

Uploaded by

Raza Kazmi
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)
77 views

Assignment 2 Solution

The document provides the solution to an assignment on data communication and networks. It includes 6 questions assessing concepts like constructing forwarding tables for routers in a VC, calculating IP datagram fragmentation, using classful IP addressing, applying subnetting, and finding least cost paths using Dijkstra's algorithm. The questions are in short answer and table format with numerical and conceptual responses.

Uploaded by

Raza Kazmi
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

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 0.0.0.0 127.255.255.255

B 10 16 16 214 216 230 128.0.0.0 191.255.255.255

C 110 24 8 221 28 229 192.0.0.0 223.255.255.255

Not Not Not Not


D 1110
Defined Defined Defined Defined
228 224.0.0.0 239.255.255.255

Not Not Not Not


E 1111
Defined Defined Defined Defined
228 240.0.0.0 255.255.255.255

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 223.1.1.0 255.255.255.0

Subnet 2 Hosts connected to R2 223.1.2.0 255.255.255.0

Subnet 3 Hosts connected to R3 223.1.3.0 255.255.255.0

Subnet 4 Interfaces that connect routers R1 and R2 223.1.9.0 255.255.255.0

Subnet 5 Interfaces that connect routers R2 and R3 223.1.8.0 255.255.255.0

Subnet 6 Interfaces that connect routers R3 and R1 223.1.7.0 255.255.255.0

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 128.25.60.10/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 = 255.255.224.0
It is a class B IP address. In class B IP address, the subnet mask is 255.255.0.0, 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 128.25.0.0 128.25.0.1 128.25.31.254 128.25.31.255 128.25.0.1
2 128.25.32.0 128.25.32.1 128.25.63.254 128.25.63.255 128.25.32.1
3 128.25.64.0 128.25.64.1 128.25.65.254 128.25.95.255 128.25.64.1
4 128.25.96.0 128.25.96.1 128.25.127.254 128.25.127.255 128.25.96.1
5 128.25.128.0 128.25.128.1 128.25.159.254 128.25.159.255 128.25.128.1
6 128.25.160.0 128.25.160.1 128.25.191.254 128.25.191.255 128.25.160.1
7 128.25.192.0 128.25.192.1 128.25.223.254 128.25.223.255 128.25.192.1
8 128.25.224.0 128.25.224.1 128.25.255.254 128.25.255.255 128.25.224.1

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

You might also like