How to discover a directly connected device
-
Hi all, I am developing an application that uses SNMP to draw a topological view of a network (currently only layer 3). However, I have hit a very hard stone wall and i fear the answer may be so obvious I am overlooking it. Basically, how can i find the IP address of a router interface that is directly connected to another router? (I am using cisco 2600 series in my lab) My initial idea was to view the routing table to get a next hop address. This is fine if the routing table contains a next hop address. But, i have found that in many instances the routing table just says "Go out Serial 0/0". It is as if i need to send a probe packet out the interface to say "Hi, who is connected to me and what is your IP" Here is a scenario of what I am trying to do. I have 2 routers, router A and router B. A work station is running my application on fa0/0 of router A. the two routers are connected using their serial 0/0 interfaces. My app jumps to router A (the workstations DFG) and gathers all it needs. It now needs to jump to router B to gather info about that device. but the routing table on router A contains the exit interface, NOT the next hop address. So how would i find the address of router B's S0/0 interface to allow my app toconnect to it. Any help is greatly appreciated and let me know if you need a clearer explanation Kind Regards,
-
Hi all, I am developing an application that uses SNMP to draw a topological view of a network (currently only layer 3). However, I have hit a very hard stone wall and i fear the answer may be so obvious I am overlooking it. Basically, how can i find the IP address of a router interface that is directly connected to another router? (I am using cisco 2600 series in my lab) My initial idea was to view the routing table to get a next hop address. This is fine if the routing table contains a next hop address. But, i have found that in many instances the routing table just says "Go out Serial 0/0". It is as if i need to send a probe packet out the interface to say "Hi, who is connected to me and what is your IP" Here is a scenario of what I am trying to do. I have 2 routers, router A and router B. A work station is running my application on fa0/0 of router A. the two routers are connected using their serial 0/0 interfaces. My app jumps to router A (the workstations DFG) and gathers all it needs. It now needs to jump to router B to gather info about that device. but the routing table on router A contains the exit interface, NOT the next hop address. So how would i find the address of router B's S0/0 interface to allow my app toconnect to it. Any help is greatly appreciated and let me know if you need a clearer explanation Kind Regards,
Not familiar with the Cisco 2600 MIB, (though I'm certain that the info is in there somewhere :-) ). An alternative is to send an echo request to a destination beyond the first router (like traceroute does: http://en.wikipedia.org/wiki/Traceroute[^] Note that the second router can be configured to not answer echo requests, in which case you're still in the dark. What you don't say of course, is what protocol the routers are running on their S0/0 interface. It's probably not IP, bit some sort of frame-relay, which means that the info will be meaningless on level 3. The routers will map IP routing on top of frame-relay, through a virtual interface, which will contain the IP address. Some more details on the exact setup would be welcome...
-
Not familiar with the Cisco 2600 MIB, (though I'm certain that the info is in there somewhere :-) ). An alternative is to send an echo request to a destination beyond the first router (like traceroute does: http://en.wikipedia.org/wiki/Traceroute[^] Note that the second router can be configured to not answer echo requests, in which case you're still in the dark. What you don't say of course, is what protocol the routers are running on their S0/0 interface. It's probably not IP, bit some sort of frame-relay, which means that the info will be meaningless on level 3. The routers will map IP routing on top of frame-relay, through a virtual interface, which will contain the IP address. Some more details on the exact setup would be welcome...
Hi There Michel, Thanks for your response, i was hoping i could gather some interest just for a discussion. :) I have virtually solved the problem and have a nice working piece of software. Basically i turned to neighbor discovery protocols. In this Case The Cisco Discovery Protocol (CDP). There is a CDP MIB that provides me with a lot of information about what devices are connected to each interface and therefore, I am able to hop between devices because i know connected IP's. Basically, my prgram jumps to the device the user specifies as the start IP, entering in the SNMP information and the network address they wish to map. My program then goes to that device, gathers all system information about the device, then gathers information about each local interface. Then my program looks into CDP MIB and looks at the CDP Cache (where neighbor details are stored), creates an entry in the database for each connected IP address, then assigns the connected interface entry to the local interface entry. My program then hops to the next device and does the same, so on and so forth. I have parameters in my code to make sure all IPs visited are noted, and a list of IPs to visit to prevent the oprogram from needlessly visiting the same device twice. This way i can track the hop count and limit it if required. At the end of the data collection, my program then analyses the data and draws a network map and listens for traps :) its a bit like a very basic network management system (extremley basic) but it works sweetly :) Obviously this is not a perfect solution because CDP only operates on cisco devices and in some cases, CDP is disabled. There does exist a little protocol called the Link Layer Discovery Protocol (LLDP, refered to as 802.1ab i think). This is a vendor neutral neighbor discovery protocol and operates very much like CDP, but on any vendors device (Cisco, HP etc) providing the device supports it (my Catalyst 2950s do not, but the 2960's do). However, due to my limited budget the equipment i have does not support LLDP *sigh* Since doing this for my uni project i have become particulary interested in network mapping and management. It really is quite a variedand detailed topic :) Comments and thoughts are welcomed :)