SlideShare a Scribd company logo
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
Ad

More Related Content

What's hot (20)

11 routing
11 routing11 routing
11 routing
shefali84
 
BASICS OF ROUTING IN NETWORKS
BASICS OF ROUTING IN NETWORKSBASICS OF ROUTING IN NETWORKS
BASICS OF ROUTING IN NETWORKS
KABILESH RAMAR
 
Network layer
Network layerNetwork layer
Network layer
sbkbca
 
Link state routing protocol
Link state routing protocolLink state routing protocol
Link state routing protocol
Aung Thu Rha Hein
 
Computer Network - Network Layer
Computer Network - Network LayerComputer Network - Network Layer
Computer Network - Network Layer
Manoj Kumar
 
Lecture 3 network layer
Lecture 3 network layerLecture 3 network layer
Lecture 3 network layer
Ronoh Kennedy
 
Routing protocols-network-layer
Routing protocols-network-layerRouting protocols-network-layer
Routing protocols-network-layer
Nitesh Singh
 
Routing Techniques
Routing TechniquesRouting Techniques
Routing Techniques
Nishant Munjal
 
Presentation Routing algorithm
Presentation Routing algorithmPresentation Routing algorithm
Presentation Routing algorithm
Basit Hussain
 
Routing
RoutingRouting
Routing
Melvin Cabatuan
 
Network layer ip address assignment and routing
Network layer ip address assignment and routingNetwork layer ip address assignment and routing
Network layer ip address assignment and routing
HamzahMohammed4
 
Routing Presentation
Routing PresentationRouting Presentation
Routing Presentation
Mohsin Ali
 
Introduction to backwards learning algorithm
Introduction to backwards learning algorithmIntroduction to backwards learning algorithm
Introduction to backwards learning algorithm
Roshan Karunarathna
 
Link state routing protocol
Link state routing protocolLink state routing protocol
Link state routing protocol
university of Gujrat, pakistan
 
Routing
RoutingRouting
Routing
Saima Azam
 
Dynamic routing under_sec
Dynamic routing under_secDynamic routing under_sec
Dynamic routing under_sec
subhash85
 
Day 8 2 distance vector routing
Day 8 2 distance vector routingDay 8 2 distance vector routing
Day 8 2 distance vector routing
CYBERINTELLIGENTS
 
Week14 lec2
Week14 lec2Week14 lec2
Week14 lec2
syedhaiderraza
 
Routing algorithm
Routing algorithmRouting algorithm
Routing algorithm
Bushra M
 
Chapter 06 - Routing
Chapter 06 - RoutingChapter 06 - Routing
Chapter 06 - Routing
phanleson
 
BASICS OF ROUTING IN NETWORKS
BASICS OF ROUTING IN NETWORKSBASICS OF ROUTING IN NETWORKS
BASICS OF ROUTING IN NETWORKS
KABILESH RAMAR
 
Network layer
Network layerNetwork layer
Network layer
sbkbca
 
Computer Network - Network Layer
Computer Network - Network LayerComputer Network - Network Layer
Computer Network - Network Layer
Manoj Kumar
 
Lecture 3 network layer
Lecture 3 network layerLecture 3 network layer
Lecture 3 network layer
Ronoh Kennedy
 
Routing protocols-network-layer
Routing protocols-network-layerRouting protocols-network-layer
Routing protocols-network-layer
Nitesh Singh
 
Presentation Routing algorithm
Presentation Routing algorithmPresentation Routing algorithm
Presentation Routing algorithm
Basit Hussain
 
Network layer ip address assignment and routing
Network layer ip address assignment and routingNetwork layer ip address assignment and routing
Network layer ip address assignment and routing
HamzahMohammed4
 
Routing Presentation
Routing PresentationRouting Presentation
Routing Presentation
Mohsin Ali
 
Introduction to backwards learning algorithm
Introduction to backwards learning algorithmIntroduction to backwards learning algorithm
Introduction to backwards learning algorithm
Roshan Karunarathna
 
Dynamic routing under_sec
Dynamic routing under_secDynamic routing under_sec
Dynamic routing under_sec
subhash85
 
Day 8 2 distance vector routing
Day 8 2 distance vector routingDay 8 2 distance vector routing
Day 8 2 distance vector routing
CYBERINTELLIGENTS
 
Routing algorithm
Routing algorithmRouting algorithm
Routing algorithm
Bushra M
 
Chapter 06 - Routing
Chapter 06 - RoutingChapter 06 - Routing
Chapter 06 - Routing
phanleson
 

Similar to Routing table and routing algorithms (20)

Routing table : Notes
Routing table : NotesRouting table : Notes
Routing table : Notes
Subhajit Sahu
 
Mod5
Mod5Mod5
Mod5
Alam Garcia
 
Network layer
Network layerNetwork layer
Network layer
HamzahMohammed4
 
Comparative Analysis of MANET Routing Protocols and Cluster Head Selection Te...
Comparative Analysis of MANET Routing Protocols and Cluster Head Selection Te...Comparative Analysis of MANET Routing Protocols and Cluster Head Selection Te...
Comparative Analysis of MANET Routing Protocols and Cluster Head Selection Te...
IJERA Editor
 
introduction to network and computer security
introduction to network and computer securityintroduction to network and computer security
introduction to network and computer security
abrhamworkie8
 
A maximum residual multicast protocol for large scale mobile ad hoc networks
A maximum residual multicast protocol for large scale mobile ad hoc networksA maximum residual multicast protocol for large scale mobile ad hoc networks
A maximum residual multicast protocol for large scale mobile ad hoc networks
Chandan Thakur
 
routing
routingrouting
routing
tumetr1
 
Introduction to IP
Introduction to IPIntroduction to IP
Introduction to IP
aibad ahmed
 
SIMULATION OF THE COMBINED METHOD
SIMULATION OF THE COMBINED METHODSIMULATION OF THE COMBINED METHOD
SIMULATION OF THE COMBINED METHOD
IJNSA Journal
 
Performance Observation of Proactive and Reactive Routing Protocols with Incr...
Performance Observation of Proactive and Reactive Routing Protocols with Incr...Performance Observation of Proactive and Reactive Routing Protocols with Incr...
Performance Observation of Proactive and Reactive Routing Protocols with Incr...
Computer Science Journals
 
IRJET- Optimum Routing Algorithm for MANET
IRJET-  	  Optimum Routing Algorithm for MANETIRJET-  	  Optimum Routing Algorithm for MANET
IRJET- Optimum Routing Algorithm for MANET
IRJET Journal
 
Unit 3 Network layer and protocols.pptx
Unit 3 Network layer and  protocols.pptxUnit 3 Network layer and  protocols.pptx
Unit 3 Network layer and protocols.pptx
pritimalkhede
 
IRJET - A Review of Routing Protocols for Manets and AEERP
IRJET - A Review of Routing Protocols for Manets and AEERPIRJET - A Review of Routing Protocols for Manets and AEERP
IRJET - A Review of Routing Protocols for Manets and AEERP
IRJET Journal
 
Routing and IP in Advance Computer Network,Vikram Snehi
Routing and IP in Advance Computer Network,Vikram  SnehiRouting and IP in Advance Computer Network,Vikram  Snehi
Routing and IP in Advance Computer Network,Vikram Snehi
MR. VIKRAM SNEHI
 
IP Routing
IP RoutingIP Routing
IP Routing
Peter R. Egli
 
Understanding Network Routing Problem and Study of Routing Algorithms and Heu...
Understanding Network Routing Problem and Study of Routing Algorithms and Heu...Understanding Network Routing Problem and Study of Routing Algorithms and Heu...
Understanding Network Routing Problem and Study of Routing Algorithms and Heu...
IRJET Journal
 
Lession3 Routing
Lession3 RoutingLession3 Routing
Lession3 Routing
leminhvuong
 
Routing
RoutingRouting
Routing
Tan Huynh Cong
 
474-22-DatagramForwarding.pptx
474-22-DatagramForwarding.pptx474-22-DatagramForwarding.pptx
474-22-DatagramForwarding.pptx
ThangamaniR3
 
Unit 4 - Network Layer
Unit 4 - Network LayerUnit 4 - Network Layer
Unit 4 - Network Layer
Chandan Gupta Bhagat
 
Routing table : Notes
Routing table : NotesRouting table : Notes
Routing table : Notes
Subhajit Sahu
 
Comparative Analysis of MANET Routing Protocols and Cluster Head Selection Te...
Comparative Analysis of MANET Routing Protocols and Cluster Head Selection Te...Comparative Analysis of MANET Routing Protocols and Cluster Head Selection Te...
Comparative Analysis of MANET Routing Protocols and Cluster Head Selection Te...
IJERA Editor
 
introduction to network and computer security
introduction to network and computer securityintroduction to network and computer security
introduction to network and computer security
abrhamworkie8
 
A maximum residual multicast protocol for large scale mobile ad hoc networks
A maximum residual multicast protocol for large scale mobile ad hoc networksA maximum residual multicast protocol for large scale mobile ad hoc networks
A maximum residual multicast protocol for large scale mobile ad hoc networks
Chandan Thakur
 
Introduction to IP
Introduction to IPIntroduction to IP
Introduction to IP
aibad ahmed
 
SIMULATION OF THE COMBINED METHOD
SIMULATION OF THE COMBINED METHODSIMULATION OF THE COMBINED METHOD
SIMULATION OF THE COMBINED METHOD
IJNSA Journal
 
Performance Observation of Proactive and Reactive Routing Protocols with Incr...
Performance Observation of Proactive and Reactive Routing Protocols with Incr...Performance Observation of Proactive and Reactive Routing Protocols with Incr...
Performance Observation of Proactive and Reactive Routing Protocols with Incr...
Computer Science Journals
 
IRJET- Optimum Routing Algorithm for MANET
IRJET-  	  Optimum Routing Algorithm for MANETIRJET-  	  Optimum Routing Algorithm for MANET
IRJET- Optimum Routing Algorithm for MANET
IRJET Journal
 
Unit 3 Network layer and protocols.pptx
Unit 3 Network layer and  protocols.pptxUnit 3 Network layer and  protocols.pptx
Unit 3 Network layer and protocols.pptx
pritimalkhede
 
IRJET - A Review of Routing Protocols for Manets and AEERP
IRJET - A Review of Routing Protocols for Manets and AEERPIRJET - A Review of Routing Protocols for Manets and AEERP
IRJET - A Review of Routing Protocols for Manets and AEERP
IRJET Journal
 
Routing and IP in Advance Computer Network,Vikram Snehi
Routing and IP in Advance Computer Network,Vikram  SnehiRouting and IP in Advance Computer Network,Vikram  Snehi
Routing and IP in Advance Computer Network,Vikram Snehi
MR. VIKRAM SNEHI
 
Understanding Network Routing Problem and Study of Routing Algorithms and Heu...
Understanding Network Routing Problem and Study of Routing Algorithms and Heu...Understanding Network Routing Problem and Study of Routing Algorithms and Heu...
Understanding Network Routing Problem and Study of Routing Algorithms and Heu...
IRJET Journal
 
Lession3 Routing
Lession3 RoutingLession3 Routing
Lession3 Routing
leminhvuong
 
474-22-DatagramForwarding.pptx
474-22-DatagramForwarding.pptx474-22-DatagramForwarding.pptx
474-22-DatagramForwarding.pptx
ThangamaniR3
 
Ad

Recently uploaded (20)

IMPACT_OF_SOCIAL-MEDIA- AMONG- TEENAGERS
IMPACT_OF_SOCIAL-MEDIA- AMONG- TEENAGERSIMPACT_OF_SOCIAL-MEDIA- AMONG- TEENAGERS
IMPACT_OF_SOCIAL-MEDIA- AMONG- TEENAGERS
rajaselviazhagiri1
 
Rebuilding the library community in a post-Twitter world
Rebuilding the library community in a post-Twitter worldRebuilding the library community in a post-Twitter world
Rebuilding the library community in a post-Twitter world
Ned Potter
 
How to Share Accounts Between Companies in Odoo 18
How to Share Accounts Between Companies in Odoo 18How to Share Accounts Between Companies in Odoo 18
How to Share Accounts Between Companies in Odoo 18
Celine George
 
PUBH1000 Slides - Module 12: Advocacy for Health
PUBH1000 Slides - Module 12: Advocacy for HealthPUBH1000 Slides - Module 12: Advocacy for Health
PUBH1000 Slides - Module 12: Advocacy for Health
JonathanHallett4
 
Peer Assesment- Libby.docx..............
Peer Assesment- Libby.docx..............Peer Assesment- Libby.docx..............
Peer Assesment- Libby.docx..............
19lburrell
 
UPSA JUDGEMENT.pdfCopyright Infringement: High Court Rules against UPSA: A Wa...
UPSA JUDGEMENT.pdfCopyright Infringement: High Court Rules against UPSA: A Wa...UPSA JUDGEMENT.pdfCopyright Infringement: High Court Rules against UPSA: A Wa...
UPSA JUDGEMENT.pdfCopyright Infringement: High Court Rules against UPSA: A Wa...
businessweekghana
 
How to Add Button in Chatter in Odoo 18 - Odoo Slides
How to Add Button in Chatter in Odoo 18 - Odoo SlidesHow to Add Button in Chatter in Odoo 18 - Odoo Slides
How to Add Button in Chatter in Odoo 18 - Odoo Slides
Celine George
 
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
parmarjuli1412
 
How to Use Upgrade Code Command in Odoo 18
How to Use Upgrade Code Command in Odoo 18How to Use Upgrade Code Command in Odoo 18
How to Use Upgrade Code Command in Odoo 18
Celine George
 
INDIA QUIZ FOR SCHOOLS | THE QUIZ CLUB OF PSGCAS | AUGUST 2024
INDIA QUIZ FOR SCHOOLS | THE QUIZ CLUB OF PSGCAS | AUGUST 2024INDIA QUIZ FOR SCHOOLS | THE QUIZ CLUB OF PSGCAS | AUGUST 2024
INDIA QUIZ FOR SCHOOLS | THE QUIZ CLUB OF PSGCAS | AUGUST 2024
Quiz Club of PSG College of Arts & Science
 
MCQS (EMERGENCY NURSING) DR. NASIR MUSTAFA
MCQS (EMERGENCY NURSING) DR. NASIR MUSTAFAMCQS (EMERGENCY NURSING) DR. NASIR MUSTAFA
MCQS (EMERGENCY NURSING) DR. NASIR MUSTAFA
Dr. Nasir Mustafa
 
Search Matching Applicants in Odoo 18 - Odoo Slides
Search Matching Applicants in Odoo 18 - Odoo SlidesSearch Matching Applicants in Odoo 18 - Odoo Slides
Search Matching Applicants in Odoo 18 - Odoo Slides
Celine George
 
Chemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptxChemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptx
Mayuri Chavan
 
PUBH1000 Slides - Module 11: Governance for Health
PUBH1000 Slides - Module 11: Governance for HealthPUBH1000 Slides - Module 11: Governance for Health
PUBH1000 Slides - Module 11: Governance for Health
JonathanHallett4
 
Module_2_Types_and_Approaches_of_Research (2).pptx
Module_2_Types_and_Approaches_of_Research (2).pptxModule_2_Types_and_Approaches_of_Research (2).pptx
Module_2_Types_and_Approaches_of_Research (2).pptx
drroxannekemp
 
Classification of mental disorder in 5th semester bsc. nursing and also used ...
Classification of mental disorder in 5th semester bsc. nursing and also used ...Classification of mental disorder in 5th semester bsc. nursing and also used ...
Classification of mental disorder in 5th semester bsc. nursing and also used ...
parmarjuli1412
 
How to Manage Manual Reordering Rule in Odoo 18 Inventory
How to Manage Manual Reordering Rule in Odoo 18 InventoryHow to Manage Manual Reordering Rule in Odoo 18 Inventory
How to Manage Manual Reordering Rule in Odoo 18 Inventory
Celine George
 
How To Maximize Sales Performance using Odoo 18 Diverse views in sales module
How To Maximize Sales Performance using Odoo 18 Diverse views in sales moduleHow To Maximize Sales Performance using Odoo 18 Diverse views in sales module
How To Maximize Sales Performance using Odoo 18 Diverse views in sales module
Celine George
 
Pope Leo XIV, the first Pope from North America.pptx
Pope Leo XIV, the first Pope from North America.pptxPope Leo XIV, the first Pope from North America.pptx
Pope Leo XIV, the first Pope from North America.pptx
Martin M Flynn
 
How to Change Sequence Number in Odoo 18 Sale Order
How to Change Sequence Number in Odoo 18 Sale OrderHow to Change Sequence Number in Odoo 18 Sale Order
How to Change Sequence Number in Odoo 18 Sale Order
Celine George
 
IMPACT_OF_SOCIAL-MEDIA- AMONG- TEENAGERS
IMPACT_OF_SOCIAL-MEDIA- AMONG- TEENAGERSIMPACT_OF_SOCIAL-MEDIA- AMONG- TEENAGERS
IMPACT_OF_SOCIAL-MEDIA- AMONG- TEENAGERS
rajaselviazhagiri1
 
Rebuilding the library community in a post-Twitter world
Rebuilding the library community in a post-Twitter worldRebuilding the library community in a post-Twitter world
Rebuilding the library community in a post-Twitter world
Ned Potter
 
How to Share Accounts Between Companies in Odoo 18
How to Share Accounts Between Companies in Odoo 18How to Share Accounts Between Companies in Odoo 18
How to Share Accounts Between Companies in Odoo 18
Celine George
 
PUBH1000 Slides - Module 12: Advocacy for Health
PUBH1000 Slides - Module 12: Advocacy for HealthPUBH1000 Slides - Module 12: Advocacy for Health
PUBH1000 Slides - Module 12: Advocacy for Health
JonathanHallett4
 
Peer Assesment- Libby.docx..............
Peer Assesment- Libby.docx..............Peer Assesment- Libby.docx..............
Peer Assesment- Libby.docx..............
19lburrell
 
UPSA JUDGEMENT.pdfCopyright Infringement: High Court Rules against UPSA: A Wa...
UPSA JUDGEMENT.pdfCopyright Infringement: High Court Rules against UPSA: A Wa...UPSA JUDGEMENT.pdfCopyright Infringement: High Court Rules against UPSA: A Wa...
UPSA JUDGEMENT.pdfCopyright Infringement: High Court Rules against UPSA: A Wa...
businessweekghana
 
How to Add Button in Chatter in Odoo 18 - Odoo Slides
How to Add Button in Chatter in Odoo 18 - Odoo SlidesHow to Add Button in Chatter in Odoo 18 - Odoo Slides
How to Add Button in Chatter in Odoo 18 - Odoo Slides
Celine George
 
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
parmarjuli1412
 
How to Use Upgrade Code Command in Odoo 18
How to Use Upgrade Code Command in Odoo 18How to Use Upgrade Code Command in Odoo 18
How to Use Upgrade Code Command in Odoo 18
Celine George
 
MCQS (EMERGENCY NURSING) DR. NASIR MUSTAFA
MCQS (EMERGENCY NURSING) DR. NASIR MUSTAFAMCQS (EMERGENCY NURSING) DR. NASIR MUSTAFA
MCQS (EMERGENCY NURSING) DR. NASIR MUSTAFA
Dr. Nasir Mustafa
 
Search Matching Applicants in Odoo 18 - Odoo Slides
Search Matching Applicants in Odoo 18 - Odoo SlidesSearch Matching Applicants in Odoo 18 - Odoo Slides
Search Matching Applicants in Odoo 18 - Odoo Slides
Celine George
 
Chemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptxChemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptx
Mayuri Chavan
 
PUBH1000 Slides - Module 11: Governance for Health
PUBH1000 Slides - Module 11: Governance for HealthPUBH1000 Slides - Module 11: Governance for Health
PUBH1000 Slides - Module 11: Governance for Health
JonathanHallett4
 
Module_2_Types_and_Approaches_of_Research (2).pptx
Module_2_Types_and_Approaches_of_Research (2).pptxModule_2_Types_and_Approaches_of_Research (2).pptx
Module_2_Types_and_Approaches_of_Research (2).pptx
drroxannekemp
 
Classification of mental disorder in 5th semester bsc. nursing and also used ...
Classification of mental disorder in 5th semester bsc. nursing and also used ...Classification of mental disorder in 5th semester bsc. nursing and also used ...
Classification of mental disorder in 5th semester bsc. nursing and also used ...
parmarjuli1412
 
How to Manage Manual Reordering Rule in Odoo 18 Inventory
How to Manage Manual Reordering Rule in Odoo 18 InventoryHow to Manage Manual Reordering Rule in Odoo 18 Inventory
How to Manage Manual Reordering Rule in Odoo 18 Inventory
Celine George
 
How To Maximize Sales Performance using Odoo 18 Diverse views in sales module
How To Maximize Sales Performance using Odoo 18 Diverse views in sales moduleHow To Maximize Sales Performance using Odoo 18 Diverse views in sales module
How To Maximize Sales Performance using Odoo 18 Diverse views in sales module
Celine George
 
Pope Leo XIV, the first Pope from North America.pptx
Pope Leo XIV, the first Pope from North America.pptxPope Leo XIV, the first Pope from North America.pptx
Pope Leo XIV, the first Pope from North America.pptx
Martin M Flynn
 
How to Change Sequence Number in Odoo 18 Sale Order
How to Change Sequence Number in Odoo 18 Sale OrderHow to Change Sequence Number in Odoo 18 Sale Order
How to Change Sequence Number in Odoo 18 Sale Order
Celine George
 
Ad

Routing table and routing algorithms

  • 1. Routing table and routing algorithms
  • 2. 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
  • 3. 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
  • 4. 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
  • 5. 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
  • 6. 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
  • 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 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
  • 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 route rtget procedure - searches the routing table and returns a pointer to the entry for that route Route.ri_valid – specifies whether
  翻译: