below routing table of router. need resolve outgoing interface entries outgoing interface --. theses entries in text file. need resolve outgoing interface solving nexthop (longes prefix match) . e.g. - finding outgoing interface 0.0.0.0/0.0.0.0 nexthop 172.20.20.57. take nexthop , in destination column find longest prefix match 172.20.20.56 , has outgoing interface fastethernet0. outgoing interface 0.0.0.0/0.0.0.0 fastethernet0. problem table can have 2000-3000 entries. 1 of data structure thought of trie. there existing api can use find longest prefix match or suggestion solve problem. using java.
destination network mask nexthop outgoinginterface 192.168.231.0 255.255.255.0 192.168.255.1 -- 172.20.20.56 255.255.255.252 11.11.11.11 fastethernet0 192.168.201.0 255.255.255.0 192.168.255.1 -- 0.0.0.0 0.0.0.0 172.20.20.57 -- 192.168.255.1 255.255.255.255 192.168.255.1 serial0
Comments
Post a Comment