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

annotated-HW2_Basit (1)

The document outlines the requirements and questions for Homework #2 in CSCI 4311/5311, due on Nov 18, 2024. It includes various networking problems related to routing protocols, distance vector routing, IP address allocation, and CRC calculations. Each question is structured to assess the understanding of networking concepts and protocols.

Uploaded by

basithussainusa
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

annotated-HW2_Basit (1)

The document outlines the requirements and questions for Homework #2 in CSCI 4311/5311, due on Nov 18, 2024. It includes various networking problems related to routing protocols, distance vector routing, IP address allocation, and CRC calculations. Each question is structured to assess the understanding of networking concepts and protocols.

Uploaded by

basithussainusa
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Fall 2024 Name: Basit HussainID:

CSCI 4311/5311 Homework # 2


Due: Nov 18, 2024 (11:59 pm), via Canvas.
The rules:

• All work must be your own. You are not to work in teams on this assignment.
• Submit as a single file (via Canvas) containing a PDF file. Email me ([email protected]) assignment
only if Canvas is not working.
• Do NOT attempt to cheat. If you get caught, you get an F from the class and directly reported to
the department and student affairs.
• If you cheat from your friend, I will assume that both of you are cheaters and I will act accordingly.

Total Marks = 100

(Q1) [10 points]

A. Destination H3 and link interface 3


B. No because for diagram networks forwarding is only based on destination address not
source address
Q2) [10 points]

A. Here is the forwarding table that uses longest prefix matching and ensure correct
forwarding to specified link interface :

Prefix Match Link Interface


11100000 0
11100000 01000000 1
1110000 2
11100001 3
otherwise 3
B.
C. The first address matches the 5th entry, so it is forwarded to Link Interface 3.
D. The second address matches the 3rd entry, so it is forwarded to Link Interface 2.
E. The third address matches the 4th entry, so it is forwarded to Link Interface 3.
Question3 :

A.x to all
network
x path cost
t x-v-t 7
u x-v-u 6
v x-v 3
w x-w 6
y x-y 6
z x-z 8

B. U TO ALL
NETWORK
u path cost
t u-t 2
v u-v 3
w u-w 3
x u-v-x 6
y u-t-y 9
z u-t-y-z 21

C. V TO ALL
NWTWORK
v path cost
t v-t 4
v v-v 3
w v-w 4
x v-x 3
y v-y 8
z v-x-z 11
Question4:

Consider the network shown below and assume that all link costs in the network have strictly
positive integer values.

Use distance vector routing algorithm and show distance tables for each node. Note that, there
are 4 nodes, so you need to iterate the process n-1 times, in this case 3 times.

Answer:

Routing Tables at Iteration 0:

Router A Destination Distance Next Hop


A 0 A
B 1 B
C 2 C
D ∞ —
Router B Destination Distance Next Hop
A 1 A
B 0 B
C 4 C
D 2 D
Router C Destination Distance Next Hop
A 2 A
B 4 B
C 0 C
D 3 D
Router D Destination Distance Next Hop
A ∞ —
B 2 B
C 3 C
D 0 D

Iteration 1: First Exchange of Distance Vectors


Each router sends its current distance vector to its immediate neighbors. Each router then
updates its table based on the received information.
Routing Table Updates:
1. At Router A:
Receives distance vectors from B and C.
Using B's vector:
Distance to D = 1 (to B)+2 (from B to D)=31 \, (\text{to B}) + 2 \, (\text{from B to D}) =
31(to B)+2(from B to D)=3.
Using C's vector:
No shorter paths found.

Updated Table:

Destination Distance NextHop


A 0 A
B 1 B
C 2 C
D 3 B

At Router B:
Receives distance vectors from A and C.
Using A's vector:
No shorter paths found.
Using C's vector:
Distance to D = 4 (to C)+3 (from C to D)=74 \, (\text{to C}) + 3 \, (\text{from C to D}) =
74(to C)+3(from C to D)=7 (no update, as 2 is shorter).

Updated Table (no change):


Destination Distance Next Hop
A 1 A
B 0 B
C 4 C
D 2 D

At Router C:
Receives distance vectors from A and D.
Using A's vector:
Distance to B = 2 (to A)+1 (from A to B)=32 \, (\text{to A}) + 1 \, (\text{from A to B}) =
32(to A)+1(from A to B)=3.
Using D's vector:
No shorter paths found.

Updated Table:
Destination Distance Next Hop
A 2 A
B 3 A
C 0 C
D 3 D

At Router D:
Receives distance vectors from B and C.
Using B's vector:
Distance to A = 2 (to B)+1 (from B to A)=32 \, (\text{to B}) + 1 \, (\text{from B to A}) =
32(to B)+1(from B to A)=3.
Using C's vector:
No shorter paths found.

Updated Table:
Destination Distance Next Hop
A 3 B
B 2 B
C 3 C
D 0 D

Iteration 2: Second Distance Vector Exchange


Each router shares updated distance vectors and adds fresh data when the procedure is
repeated.

Routing Table Updates: Since all shortest paths were calculated in the first iteration, no updates
are discovered after the second iteration.
Final Routing Tables (After 3 Iterations):

At the end of the algorithm, the routing tables for all nodes
converge as follows:

Next
Router A Destination Distance
Hop
A 0 A
B 1 B
C 2 C
D 3 B
Next
Router B Destination Distance
Hop
A 1 A
B 0 B
C 3 C
D 2 D
Next
Router C Destination Distance
Hop
A 2 A
B 3 A
C 0 C
D 3 D
Next
Router D Destination Distance
Hop
A 3 B
B 2 B
C 3 C
D 0 D
Question5:

a. Router 3c learns about prefix x from which routing protocol: OSPF, RIP, eBGP, or iBGP?
Answer:
Router 3c learns about prefix x from eBGP routing protocol.
b. Router 3a learns about x from which routing protocol?
Answer:
Router 3a learns about prefix x from iBGP routing protocol.
c. Router 1c learns about x from which routing protocol?
Answer:
Router 1c learns about prefix x from eBGP routing protocol.
d. Router 1d learns about x from which routing protocol?
Answer:
Router 1d learns about prefix x from iBGP routing protocol.

So,
• Router 3c: eBGP
• Router 3a: iBGP
• Router 1c: eBGP
• Router 1d: iBGP
Question6:

A large number of consecutive IP addresses are available starting at 198.16.0.0.


Suppose that four organizations, A, B, C, and D, request 4096, 2048, 4096, and 8192
addresses, respectively, and in that order. For each of these, give the first IP address
assigned, the last IP address assigned, and the mask in the w.x.y.z/s notation.

Answer: We must assign each organization's request to a block size that is a power of two
in order to allocate IP addresses effectively (1024, 2048, 4096, 8192, etc.). These block
sizes are taken into account while selecting subnet masks.

1. Organization A: Requests 4096 addresses

4096 addresses correspond to 2^12. Thus, the subnet mask is /20 (32−12=2032 -
12 = 2032−12=20).
Start IP: 198.16.0.0
End IP: 198.16.15.255 (4096 addresses range from 198.16.0.0 to 198.16.15.255)
Assigned block: 198.16.0.0/20

2. Organization B: Requests 2048 addresses

2048 addresses correspond to 2^11. Thus, the subnet mask is /21 (32−11=2132 -
11 = 2132−11=21).
Start IP: 198.16.16.0 (next address after A's block, 198.16.15.255)
End IP: 198.16.23.255 (2048 addresses range from 198.16.16.0 to 198.16.23.255)
Assigned block: 198.16.16.0/21

3. Organization C: Requests 4096 addresses

4096 addresses correspond to 2^12. Thus, the subnet mask is /20 (32−12=2032 -
12 = 2032−12=20).
Start IP: 198.16.24.0 (next address after B's block, 198.16.23.255)
End IP: 198.16.39.255 (4096 addresses range from 198.16.24.0 to 198.16.39.255)
Assigned block: 198.16.24.0/20

4. Organization D: Requests 8192 addresses

8192 addresses correspond to 2^13. Thus, the subnet mask is /19 (32−13=1932 -
13 = 1932−13=19).
Start IP: 198.16.40.0 (next address after C's block, 198.16.39.255)
End IP: 198.16.71.255 (8192 addresses range from 198.16.40.0 to 198.16.71.255)
Assigned block: 198.16.40.0/19
Organization First IP Address Last IP Address Subnet Mask
A 198.16.0.0 198.16.15.255 /20
B 198.16.16.0 198.16.23.255 /21
C 198.16.24.0 198.16.39.255 /20
D 198.16.40.0 198.16.71.255 /19
(Q7) [16 points]

Consider the 5-bit generator, G = 10011, and calculate the value of R for given D values below.
Show your calculation step-by-step. Do NOT give just number.

a-) 1010101010

b-) 1001010101

c-) 0101101010

d-) 1010100000

a) Data: 1010101010
1. Step 1: Append 4 zeros to the data to account for the 5-bit generator.
Data becomes: 101010101000001010101010000010101010100000.
2. Step 2: Perform the division (using XOR for each step).
Dividing :
10101010100000 ÷ 10011
1. First, XOR the first five bits:
10101 XOR 10011 = 00110
New : 001100000000
2. Now XOR the next five bits of the result:
01100 XOR 10011 = 11111
New: 11111000000
3. Continue the XOR steps, and after performing all steps, the remainder is:
R = 1101 (in binary)

b) Data: 1001010101
1. Step 1: Append 4 zeros to the data.
Data becomes: 10010101010000
2. Step 2: Perform the division (using XOR for each step).
Dividing :
10010101010000 ÷ 10011
1. First, XOR the first five bits:
10010 XOR 10011 = 00001
New data : 0000101010000
2. XOR the next bits:
00001 XOR 10011 = 10000
New data = 100000000000
3. Continue the XOR steps until the remainder is obtained:
▪ R = 0100 (in binary)

c) Data: 0101101010
1. Step 1: Append 4 zeros to the data.
Data becomes: 01011010100000
2. Step 2: Perform the division (using XOR for each step).
Dividing
01011010100000 ÷ 10011
1. XOR the first five bits:
01011 XOR 10011 = 11000
New data : 110000000000
2. Continue the XOR steps until the remainder is obtained:
▪ R = 1001 (in binary)

d) Data: 1010100000
1. Step 1: Append 4 zeros to the data.
Data becomes: 10101000000000
2. Step 2: Perform the division (using XOR for each step).
Dividing :
10101000000000 ÷ 10011
1. XOR the first five bits:
10101 XOR 10011 = 00110
2. Continue the XOR steps until the remainder is obtained:
▪ R = 0110 (in binary)

So,
a) Data:
10101010100000 ÷ 10011 = 1101

b) Data:
10010101010000 ÷ 10011 = 0100

c) Data:
01011010100000 ÷ 10011 = 1001

d) Data:
10101000000000 ÷ 10011 = 0110

These are the binary remainders after performing the CRC division for each data sequence with
the generator G=10011G = 10011G=10011.

You might also like