Tuesday, July 6, 2021

understanding forwarding tables

tl;dr: solution to textbook problem doesn't make sense to me, a router's forwarding table only has entries for its immediate neighboring subnets. How does the router know how to route packets to other subnets?

Hi kids,

I'm struggling with understanding the solution to a problem in the Kurose book and would appreciate some pointers. Not sure if this is the right sub, feel free to delete.

Problem 4.15 in the 8th edition asks to assign subnets to a simple network topology with 3 routers, and to write down the forwarding table for each router. Apparently I'm not allowed to post images in ths sub, so I'll try my hand at an ASCII visualization: subnet A | router R1 / \ subnet D / \ subnet F / subnet E \ router R2 -------- router R3 / \ subnet C subnet B The problem is:

a.Assign network addresses to each of these six subnets, with the following constraints: All addresses must be allocated from 214.97.254/23; Subnet A should have enough addresses to support 250 interfaces; Subnet B should have enough addresses to support 120 interfaces; and Subnet C should have enough addresses to support 120 interfaces. Of course, subnets D, E and F should each be able to support two interfaces. For each subnet, the assignment should take the form a.b.c.d/x or a.b.c.d/x – e.f.g.h/y. b. Using your answer to part (a), provide the forwarding tables (using longest prefix matching) for each of the three routers.

I have no problem with a), and I thought I had solved b), but when I looked up the solution online, the routing tables e.g. for router R1 only have entries for subnets A, D, and F. The full solution is:

From 214.97.254/23, possible assignments are Subnet A: 214.97.255/24 (256 addresses) Subnet B: 214.97.254.0/25 - 214.97.254.0/29 (128-8 = 120 addresses) Subnet C: 214.97.254.128/25 (128 addresses) Subnet D: 214.97.254.0/31 (2 addresses) Subnet E: 214.97.254.2/31 (2 addresses) Subnet F: 214.97.254.4/30 (4 addresses)

To simplify the solution, assume that no datagrams have router interfaces as ultimate destinations.

Router 1

Longest Prefix Match Outgoing Interface
11010110 01100001 11111111 Subnet A
11010110 01100001 11111110 0000000 Subnet D
11010110 01100001 11111110 000001 Subnet F

Router 2

Longest Prefix Match Outgoing Interface
11010110 01100001 11111111 0000000 Subnet D
11010110 01100001 11111110 0 Subnet B
11010110 01100001 11111110 0000001 Subnet E

Router 3

Longest Prefix Match Outgoing Interface
11010110 01100001 11111111 000001 Subnet F
11010110 01100001 11111110 0000001 Subnet E
11010110 01100001 11111110 1 Subnet C

So my question is: assuming a host in subnet A wants to send data to a host in subnet B (necessarily via router 1), how does router 1 know how to route the packet, if subnet B is missing from its routing table?



No comments:

Post a Comment