Tuesday, June 17, 2014

More Complex Networking Routing

Now let's modify the small network in the example in the previous section. The 192.168.1.x network is changed to 192.168.x.x and gateway B's address is changed to 192.168.10.1. All the netmasks on the computers on the 192.168.x.x network are modified to 255.255.0.0 to accommodate the change, except machine S3 which keeps the netmask 255.255.255.0 and changes its address to 192.168.10.3. This effectively puts S3 on a different network than S2 and S1, it no longer believes it can talk directly to them and must talk to gateway B to talk to them. It can't even talk to gateway A anymore since it can't address it directly. Machines S1, S2, and A are not on network 192.168.10.0, their addresses are 192.168.1.*. S1 and S2 can talk to S3, but S3 will not be able to respond unless it utilizes gateway B.




Please be aware, in the example in the previous section, that gateway A was aware of gateway B. If it were not, no messages could have been transmitted from the internet to the 192.168.2.0 network. In this example, gateway A knows nothing about gateway B, and as far as it's concerned, the network 192,168.2.0 is part of 192.168.0.0 and there is no gateway between them. Gateway B, does know about gateway A and is using that gateway as its default gateway. Therefore if S1 and S2 use gateway A for their default gateway, they will not be able to talk to S4, 5, or 6 unless their routing table is modified. S1 and S2 will be able to talk to S3, however, assuming S3 is using gateway B.



Here is a listing of machine S1's routing table, using gateway A as default and no other routes.


Destination
Gateway
Genmask
Flags Metric Ref Use Iface
192.168.1.5
*
255.255.255.255
UH
0
0
0
eth0
192.168.0.0
*
255.255.0.0
U
0
0
0
eth0
127.0.0.0
*
255.0.0.0
U
0
0
0
lo
default
192.168.1.1
0.0.0.0
UG
0
0
0
eth0



Here it is modified to let it use network 192.168.2.0.


Destination
Gateway
Genmask
Flags Metric Ref Use Iface
192.168.1.5
*
255.255.255.255
UH
0
0
0
eth0
192.168.0.0
*
255.255.0.0
U
0
0
0
eth0
192.168.2.0 192.168.10.1
255.255.255.0
UG
0
0
0
eth0
192.168.2.0
*
255.255.255.0
U
0
0
0
eth0
127.0.0.0
*
255.0.0.0
U
0
0
0
lo
default
192.168.1.1
0.0.0.0
UG
0
0
0
eth0



It specifies the gateway B, 192,168.10.1 to be used if the destination is 192.168.2.x.

The figure below shows an ethernet network with bus topology excluding the hubs. It is a large Class A network with many subnetworks. The machines labeled A through D are routers or potential routers and each have two network interface cards(NIC). These machines may be called gateways since their function is to be a gate to another location. Each card has a valid address on its own network or subnetwork. The table below lists each gateway, and each NIC address and associated network.



Gateway
eth0
eth0 network
eth1
eth1 network
A
10.0.0.1
10.x.x.x
164.25.74.131
Internet
B
10.0.0.2
10.x.x.x
10.1.0.1
10.1.x.x.
C
10.0.0.3
10.x.x.x
10.2.0.1
10.2.x.x.
D
10.0.0.4
10.x.x.x
10.3.0.1
10.3.x.x.
E
10.3.50.1
10.3.x.x
10.3.100.1
10.3.100.x.
F
10.1.0.2
10.1.x.x
10.1.20.1
10.1.20.x.
G
10.2.0.2
10.2.x.x
192.168.1.1
192.168.1.x.
H
10.3.100.2
10.3.100.x
10.3.150.1
10.3.150.x.
I
10.3.150.2
10.3.150.x
192.168.1.2
192.168.1.x.


In this figure, there are 9 gateways. which are labeled A through I. There are multiple paths between several networks. The possible paths between networks 10.1.100.x and 192.168.1.x can be through gateways E, D, C, then G (E-D-C-G) or through gateways H-I. The path from 10.3.100.x ot 10.1.20.x can be E-D-B-F or H-I-G-C-B-F. Obviously there are ways to set the routing paths up that may not be fully efficient. In this type of network, the administrator must give careful thought to the setup of the routing tables in their gateways. It would be easy to set up an infinite packet route loop in this network where some packets may go in circles from router to router. Here's how I would route for this network.

The below table lists each network and their default router.


Network   Default Router

10.3.100.x             E

10.3.150.x             H

192.168.1.x            G

10.1.20.x               F
10.1.x.x
B
10.2.x.x
C
10.3.x.x
D
10.x.x.x
A


The router, I, is not used as a default router for any network.

The table below lists an abbreviated route table for each gateway.


Router
Destination
Gateway
A
192.168.1.x
C

10.1.x.x
B

10.2.x.x
C

10.3.x.x
D

10.x.x.x
10.0.0.1

default
internet
B
10.1.20.x
F

10.1.x.x
10.1.0.1

default
A
C
192.168.1.x
G

10.2.x.x
10.2.0.1

default
A
D
10.3.150.x
E

10.3.100.x
E

10.3.x.x
10.3.0.1

default
A
E
192.168.1.x *
H

10.3.150.x
H

10.3.100.x
10.3.100.1

default
D
F
10.1.20.x
10.1.20.1

default
B
G
10.3.100.x *
I

192.168.1.x
192.168.1.1

10.3.150.x *
I

default
C
H
192.168.1.x
I

10.3.100.x
10.3.100.2

10.3.150.x
10.3.150.1

default
E
I
10.3.100.x
H

192.168.1.x
192.168.1.2

10.3.150.x
10.3.150.2

default
G


The destinations with '*' indicate destinations that shorten the normal route path through network 10.3.150.x.

Also in this network since there are multiple possible paths, dynamic routing can be used to provide alternate routing, if one router goes down.