Routing tables

1. How to set a routing table?



 
The rule is:
A host send a packet to another host.
If the destination is the segment where the sending host is palced, a gateway (router) is not needed.
If the destination is different from the segment where the sending host is palced, a gateway (router) is needed.


 


For the first case:

The routing table is:
Network destination NetmaskGateway Interface
xxx.yyy.zzz.0 255.aaa.bbb.ccc xxx.yyy.zzz.n xxx.yyy.zzz.n
0.0.0.00.0.0.0 xxx.yyy.zzz.n xxx.yyy.zzz.n




For the second case:

The routing table is:
Network destination NetmaskGateway Interface
xxx.yyy.zzz.0255.aaa.bbb.cccxxx.yyy.zzz.n xxx.yyy.zzz.n
0.0.0.00.0.0.0xxx.yyy.zzz.mxxx.yyy.zzz.n

2.Example:


From the ISP, we are assigned a Class B network: 200.100.x.y. From this assigned IP-Address, we want to make 2 subnets Class C networks. - Class C Network1: 200.100.0.0, and - Class C Network2 and Network3: 200.100.1.0 repecively

Segment Network1:
The IP-Addresses in this subnet will range from 1 to 254.
The related mask is 0 (that is the netmask is 255.255.0.0.)
0: Reserved: This Network.
255: Reserved: Broadcast

The subnet (Network2, Network2)is divided into two sub-subnets, which will take the same number of hosts. Then the mask is 128 (256/2 = 128) (that is the netmask is 255.255.255.128)

Segment Network2:
The IP-Addresses will range from 1 ? 126
0: Reserved: This Network.
127: Reserved: Broadcast

Segment Network3:
The IP-Addresses will range from 129 ? 254
128: Reserved: This Network.
255: Reserved: Broadcast


3. Related routing tables

The network address of the segment Network1 is 200.100.0.0. This portion is a Class C network. The addresses range from 200.100.0.1 to 200.100.0.254 (recall 200.100.1.0 and 200.100.1.255 are reserved for This-Network and Broadcast addresses respectively). The IP-Address 200.100.0.1 is given for the B-Network1 Interface. Foretheremore,
let's give 200.100.0.2 as an IP-Address for the node A
(we can assign also for the node X the address 200.100.0.3 ? 200.100.0.254).
Node A
Network destination NetmaskGateway Interface
200.100.0.0255.255.255.0200.100.0.2200.100.0.2
0.0.0.00.0.0.0200.100.0.1200.100.0.2


Let's assign to the router B the IP-Address 200.100.2.1 toward ISP; and
200.100.2.254 to the Interface for ISP towards B
.
Node B
Network destination NetmaskGateway Interface
200.100.0.0 255.255.255.0 200.100.0.1 200.100.0.1
200.100.1.0 255.255.255.128 200.100.1.1 200.100.1.1
200.100.2.0 255.255.254.0 200.100.2.1200.100.2.1
0.0.0.0 0.0.0.0 200.100.2.254 200.100.2.1


Node C
Network destination NetmaskGateway Interface
200.100.1.0255.255.255.128200.100.1.2 200.100.1.2
200.100.1.128255.255.255.128200.100.1.129200.100.1.129
0.0.0.00.0.0.0200.100.1.2200.100.1.2


Let's assign to the node D the IP-Address 200.100.1.130
(the node Z can be assigned 200.100.1.131 ? 200.100.1.254)
Node D
Network destination NetmaskGateway Interface
200.100.128255.255.255.128200.100.1.130200.100.1.130
0.0.0.00.0.0.0200.100.1.129200.100.1.130