Question one :
Show cdp neigh det will show you all the neighbouring Cisco hardware (routers and switches).. it uses a protocol called Cisco Discovery Protocol (CDP) to give you information on the type of device, what interface its connected to, how much RAM it has, etc etc.
sho ip route on the other hand shows you your routers internal routing table for the IP protocol. This will show you every single network it knows how to reach.. and it doesn't matter if the other routers it knows about are Cisco or not.
Furthermore CDP sends out information every few seconds to update its CDP database whereas show IP route relies on the routing protocol to build the routing entries.
They are two very very different concepts.. make sure you get the fundamentals correct. IP routing tables are the heart of the routing.. CDP is usually turned off because (IMNSHO) it just generates a bunch of traffic that you really don't need.
I've been nice enough to set up a lab in Boson router sim and show you the output from both the commands in a really simple setup (I'll expect the cheque within 15 days ):
Router#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
U - per-user static route
Gateway of last resort is not set
C 192.168.2.0/24 is directly connected, 192.168.2.2
R 192.168.1.0/24 [120/1] via 192.168.2.1, 00:03:21, Ethernet0
Router#sho cdp neigh det
Device ID: Router
IP address: 192.168.2.1
Platform: Boson 2516 , Capabilities: Router
Interface: Eth0, Port ID (outgoing port): 4
Holdtime: 161 sec
Boson Operating System Software
Software, Version 12.0(16), RELEASE SOFTWARE (fc2)
Copyright (c) 1986-2001 by Systems, Inc.
Compiled Fri 02-Mar-01 17:34 by dchih
See the difference ?
As far as question two is concerned :
65,536 possible IP's not excluding the ones you cant use.
The formula should be 2^8 * 2^8.. thats 256 into 256... the reason your formula is wrong is as follows :
lets say the IP is 172.16.x.y
your formula says that there can only be 256x + 256y = 512 possible IPs.. but in reality for every value of x you can have 256 possible y values.. if you get what I mean. Thus you multiply.
in other words :