KEMBAR78
Routing table and routing algorithms | PPT
Routing table and routing algorithms
Route Maintenance and lookup Routing table is divided into two groups Procedures used to determine the correct rout for a datagram Procedure used to add , change or delete routes The main data structure for storing the routes is an array Each entry in the array corresponds to a bucket Contains pointers to a linked list of records for a route to destination Each record on the list contains Destination IP address Subnet mask Next-hop address Network interface to use for sending the next-hop address To compute hash function  - IP uses only the network portion of the destination IP address To Search linked list  – entire destination address is used
Routing table data structure Structure  route  contains the contents of a node on the linked list and contains routing information for one possible destination rt-net  -  destination address rt-mask  -  32 bir mask rt-gw  -  next-hop gateway for the route rt-metric  -  distance of the gateway in hops rt-ifnum  -  internal number of the network interface Fields used by the IP software rt-key  -  sort key used when inserting a node on the linked list rt-refcnt  - reference count of processes that hold a pointer to the route rt-usecnt  -  counts  the number of times the route has been used rt-next  -  contains pointers to the next node on the list
Routing table data structure … rttable is defined in route.h  it is an array of pointers to route structures rtinfo – aglobal structure holds few other data items Default route – used for any destination not contained in the table ri-default – points to a route struc. that has the next-hop addr. for default route ri-valid  -  a boolean value TRUE if data structures are initialized
Origin of route and persistence Information in the routing table comes from several sources initial set of routes from secondary storage when system starts during execution network managers Field rt-ttl in each routing entries specify a time that the entry remains val id  routing ptorocols can use this rt-ttl Managers can use infinite rt-ttl
Routing a datagram Utility procedure netnum procedure  – extracts the network portion of a given IP address Address class is used to determine which octets contain the network part Returns the specified address with all host bytes set to zero
netmatch procedure  – used to compare a destination address to a routing entry Routing entry has subnet mask and IP address Subnet mask is used to mask off host bits and compare the result to the network entry If there is match TRUE else FALSE netmatch tests for a broadcast datagram explicitly
NOTE: Action taken on a broadcast message depends on the source of the datagram Broadcast message from n/w interface Deliver to the local machine via pseudo-network interface A mask of all 1’s is used to route the arriving broadcast datagram Locally generated broad cast  Send to the appropriate n/w interface n/w specific route is used to route outgoing datagram
netmask procedure  – to find the subnet mask for a destination address Two parameters are used Subnet mask variable Destination IP address First sets the subnet mask to all 0’s and then checks several cases If destination address is all 0’s  netmask returns mask of all 0’s for other destinations procedure calls netnum to extract the network portion of the destination address Check each locally-connected network for the subnet mask If dest. netmask and locally-connected n/w, extract the subnet mask and return it If no iformation is found, it set the subnet mask to cover the network part of the address
rthash procedure  – called to hash a destination n/w addres Sums the individual octets of the network address Divide by the hash table size  Return the remainder
Obtaining a route rtget procedure  - searches the routing table and returns a pointer to the entry for that route Route.ri_valid – specifies whether

Routing table and routing algorithms

  • 1.
    Routing table androuting algorithms
  • 2.
    Route Maintenance andlookup Routing table is divided into two groups Procedures used to determine the correct rout for a datagram Procedure used to add , change or delete routes The main data structure for storing the routes is an array Each entry in the array corresponds to a bucket Contains pointers to a linked list of records for a route to destination Each record on the list contains Destination IP address Subnet mask Next-hop address Network interface to use for sending the next-hop address To compute hash function - IP uses only the network portion of the destination IP address To Search linked list – entire destination address is used
  • 3.
    Routing table datastructure Structure route contains the contents of a node on the linked list and contains routing information for one possible destination rt-net - destination address rt-mask - 32 bir mask rt-gw - next-hop gateway for the route rt-metric - distance of the gateway in hops rt-ifnum - internal number of the network interface Fields used by the IP software rt-key - sort key used when inserting a node on the linked list rt-refcnt - reference count of processes that hold a pointer to the route rt-usecnt - counts the number of times the route has been used rt-next - contains pointers to the next node on the list
  • 4.
    Routing table datastructure … rttable is defined in route.h it is an array of pointers to route structures rtinfo – aglobal structure holds few other data items Default route – used for any destination not contained in the table ri-default – points to a route struc. that has the next-hop addr. for default route ri-valid - a boolean value TRUE if data structures are initialized
  • 5.
    Origin of routeand persistence Information in the routing table comes from several sources initial set of routes from secondary storage when system starts during execution network managers Field rt-ttl in each routing entries specify a time that the entry remains val id routing ptorocols can use this rt-ttl Managers can use infinite rt-ttl
  • 6.
    Routing a datagramUtility procedure netnum procedure – extracts the network portion of a given IP address Address class is used to determine which octets contain the network part Returns the specified address with all host bytes set to zero
  • 7.
    netmatch procedure – used to compare a destination address to a routing entry Routing entry has subnet mask and IP address Subnet mask is used to mask off host bits and compare the result to the network entry If there is match TRUE else FALSE netmatch tests for a broadcast datagram explicitly
  • 8.
    NOTE: Action takenon a broadcast message depends on the source of the datagram Broadcast message from n/w interface Deliver to the local machine via pseudo-network interface A mask of all 1’s is used to route the arriving broadcast datagram Locally generated broad cast Send to the appropriate n/w interface n/w specific route is used to route outgoing datagram
  • 9.
    netmask procedure – to find the subnet mask for a destination address Two parameters are used Subnet mask variable Destination IP address First sets the subnet mask to all 0’s and then checks several cases If destination address is all 0’s netmask returns mask of all 0’s for other destinations procedure calls netnum to extract the network portion of the destination address Check each locally-connected network for the subnet mask If dest. netmask and locally-connected n/w, extract the subnet mask and return it If no iformation is found, it set the subnet mask to cover the network part of the address
  • 10.
    rthash procedure – called to hash a destination n/w addres Sums the individual octets of the network address Divide by the hash table size Return the remainder
  • 11.
    Obtaining a routertget procedure - searches the routing table and returns a pointer to the entry for that route Route.ri_valid – specifies whether