Skip to main content

routing table information

More
20 years 6 months ago #1645 by praveen
I wanted to know what are the information stored in the routing table of a router/host.

pls any one could explain me on this and also how the IP look up is done are there any standard algorithms for IP look up???

thanks in advance
More
20 years 6 months ago #1646 by Chris
Replied by Chris on topic Re: routing table information
Praveen,

Here is a sample of our Cisco router's routing table:

212.205.250.0/32 is subnetted, 1 subnets
C 212.205.250.210 is directly connected, BRI0
C 192.168.1.0/24 is directly connected, Ethernet0
62.0.0.0/32 is subnetted, 1 subnets
C 62.103.2.251 is directly connected, BRI0
S* 0.0.0.0/0 is directly connected, BRI0


The above routing table shows the networks the router is aware of. In this case it knows that its directly connected to a few networks, meaning that one of the router's interfaces is connected to the relative network.

For example, the router's Ethernet0 interface is directly connect the network 192.168.1.0/24.

Since this particular router is setup for Dial on Demand Routing (DDR) the IP addresses on the BRI0 interface will change everytime a new call is initiated.

It's also important to note the last entry:

S* 0.0.0.0/0 is directly connected, BRI0


This entry is a static router, indicated by the 'S'. This route was entered by myself in the router's configuration. It tells the router that if an incoming packet has a destination other than the networks you are aware of, then forward it out the BRI0 interface, which in its turn is connected to our ISP.

This is also called "Gateway of last resort".

The distance vector page has some good information and examples on how routers populate their routing tables. I suggest you take a look at it and post any further questions you might have right here!

Cheers,

Chris Partsenidis.
Founder & Editor-in-Chief
www.Firewall.cx
More
20 years 6 months ago #1658 by tfs
Replied by tfs on topic Re: routing table information
If you do a route print on a host, you will get something like this:

[code:1]
C:\WINNT\system32>route print
===========================================================================
Interface List
0x1 ........................... MS TCP Loopback interface
0x2 ...44 45 53 54 42 00 ...... NOC Extranet Access Adapter
0x1000004 ...00 02 b3 5c ec 0a ...... Intel(R) PRO/100+ Management Adapter
===========================================================================
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.122.1 192.168.122.7 1
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
192.168.122.0 255.255.255.0 192.168.122.7 192.168.122.7 1
192.168.122.7 255.255.255.255 127.0.0.1 127.0.0.1 1
192.168.122.255 255.255.255.255 192.168.122.7 192.168.122.7 1
224.0.0.0 224.0.0.0 192.168.122.7 192.168.122.7 1
255.255.255.255 255.255.255.255 192.168.122.7 2 1
Default Gateway: 192.168.122.1
===========================================================================
Persistent Routes:
None
[/code:1]

Information on the Route command, which is how you display and manually manipulate the Routing table, can be found at:

www.microsoft.com/technet/treeview/defau...o/proddocs/route.asp

You can play with the table yourself using "route add" and "route delete" and then look at the routing table. This table is built using information put in during the configuration of your NIC. For example, looking at the above table you will see a Network Destination of 0.0.0.0. This is the default gateway. If you go to your NIC configuration and take this entry out and reissue the command. You will find the 0.0.0.0 entry gone.

To get a full explanation on what is in the table, go to:

www.microsoft.com/technet/treeview/defau...mp_routing_table.asp

In essence, the way you look at this table is to say:

To get to the Network Destination, according to the Netmask, you go to the gateway address via the interface and it will take you x hops to get there.

An interesting thing I noticed when playing with setting up the same gateway on 2 network cards on my NT. I got the following table:

[code:1]
C:\WINNT\system32>route print
===========================================================================
Interface List
0x1 ........................... MS TCP Loopback interface
0x2 ...44 45 53 54 42 00 ...... NOC Extranet Access Adapter
0x1000004 ...00 02 b3 5c ec 0a ...... Intel(R) PRO/100+ Management Adapter
===========================================================================
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.122.1 192.168.122.7 1
0.0.0.0 0.0.0.0 192.168.122.1 192.168.120.7 1
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
192.168.122.0 255.255.255.0 192.168.122.7 192.168.122.7 1
192.168.122.7 255.255.255.255 127.0.0.1 127.0.0.1 1
192.168.122.255 255.255.255.255 192.168.122.7 192.168.122.7 1
224.0.0.0 224.0.0.0 192.168.122.7 192.168.122.7 1
255.255.255.255 255.255.255.255 192.168.122.7 2 1
Default Gateway: 192.168.122.1
===========================================================================
Persistent Routes:
None
[/code:1]

You'll notice 2 default gateways (0.0.0.0). If I were to use this table and wanted to go to 66.218.71.86, I would check all the routes and find that I could not get to this destination, using any of the normal routes. This means I would go to the default gateway route.

Whether this would work or not depends on which default gateway the system looks at first. If I were to look at the 1st gateway, it would work fine. The 2nd would not.

I would, in essence, be saying: To get to 66.218.71.86 go to 192.168.122.1 through interface 192.168.120.7. The problem here is that they are on different subnets, so the packet would not get routed correctly. This is why you can only have one default gateway.

Tom.

Thanks,

Tom
More
20 years 6 months ago #1660 by sahirh
Basically the routing table is the list of networks that the router knows how to communicate with. It can be filled up automatically using a routing protocol (such as RIP, IGRP, OSPF etc) or by the admin manually configuring routes.

If you want to see an example of a routing table, then do this
Go to a DOS prompt when you're online and type 'route print'. Here's a sample of mine



[code:1]

C:\WINDOWS>route print
===========================================================================
Interface List
0x1 ........................... MS TCP Loopback interface
0x2 ...00 50 56 c0 00 08 ...... VMware Virtual Ethernet Adapter for VMnet8
0x20004 ...00 53 45 00 00 00 ...... WAN (PPP/SLIP) Interface
===========================================================================
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 203.94.231.157 203.94.231.157 1
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
169.254.0.0 255.255.0.0 169.254.218.201 169.254.218.201 20
169.254.218.201 255.255.255.255 127.0.0.1 127.0.0.1 20
169.254.255.255 255.255.255.255 169.254.218.201 169.254.218.201 20
203.94.230.147 255.255.255.255 203.94.231.157 203.94.231.157 1
203.94.231.157 255.255.255.255 127.0.0.1 127.0.0.1 50
203.94.231.255 255.255.255.255 203.94.231.157 203.94.231.157 50
224.0.0.0 240.0.0.0 169.254.218.201 169.254.218.201 20
224.0.0.0 240.0.0.0 203.94.231.157 203.94.231.157 1
255.255.255.255 255.255.255.255 169.254.218.201 169.254.218.201 1
Default Gateway: 203.94.231.157
===========================================================================
Persistent Routes:
None[/code:1]

The basic format of any routing table entry is
<destination network> <dest network subnet mask> <next hop to that network>

for example say you needed to reach the 192.168.10.0 network (subnet mask 255.255.255.0) and the next router on the way was 192.168.5.1, then the entry might look like

192.168.10.0 255.255.255.0 192.168.5.1

Ok now question number 2, when you say 'how are IP lookups done ?' I'm assuming you're talking about when you type something like www.hotmail.com how does it get resolved to an IP or vice versa ? This is not based on an algorithm, its done through DNS (Domain Naming Service) which is a protocol and a service.

To explain it VERY simply, there are nameservers that are responsible for keeping the list of names to ips for parts of the internet (called a domain). When you ask for a name, the nameserver that is responsible for that particular domain will give you the reply. Chris has done a very good section on DNS you can find it under
Networking >> Protocols >> DNS
in the top bar of the site.

Sahir Hidayatullah.
Firewall.cx Staff - Associate Editor & Security Advisor
tftfotw.blogspot.com
More
20 years 6 months ago #1664 by tfs
Replied by tfs on topic Re: routing table information
Pretty funny Sahirh. :lol:

I notice that you pressed you submit button a few seconds after I did.

Thanks,

Tom
More
20 years 6 months ago #1668 by sahirh
OMG I don't believe this ! I probably clicked it before you, but yours registered first because you have a faster connection ! I don't have the heart to delete my post, you do it !

So now we don't just answer the same questions, we answer them more or less identically -- you stole the ]code[ tags trick from me you.. you.. you.. dirt-biking, systems architecting, forum moderating swine hehe !!

Lol either way, Praveen gets two worthwhile answers.

Sahir Hidayatullah.
Firewall.cx Staff - Associate Editor & Security Advisor
tftfotw.blogspot.com
Time to create page: 0.143 seconds