annotated-HW2_Basit (1)
annotated-HW2_Basit (1)
• 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.
A. Here is the forwarding table that uses longest prefix matching and ensure correct
forwarding to specified link interface :
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:
Updated Table:
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).
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
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:
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.
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
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
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
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.