0

Sorry for newbie question for OSPF. I am in the process of learning the protocol, and there is some very basic thing I do not understand. In OSPF the routing is based on router id - which usually is one of its IP addresses. However what actually interests us, is the prefixes of the all the networks that router is directly attached to (that's the key to RIP routing tables if I am not mistake - and it really makes sense). So I am completely confused how given the destination packet IP we deduce the destination router (even before calculating the shortest path to it) without knowing network prefixes of all the networks that all routers in table are being attached to?

This link was very helpful:- https://supportforums.cisco.com/document/133976/reading-and-understanding-ospf-database

Boris
  • 173
  • 10

1 Answers1

1

without knowing network prefixes of all the networks that all routers in table are being attached to?

What makes you think, there is not a table of all the networks? OSPF is Link State routing protocol. So it has to know. (At least for networks inside an area. There are differences routing across areas.)

And by the way, usually (I am sure this is true for Linux/Unix based implementations, but there may be some other proprietary ways to implement it) the shortest path is not calculated when the packet is to be routed, but rather when the topology changes and is propagated to the routing table.

The difference between RIP and OSPF from this point of view is, that RIP sends the whole routing table periodically to all neighbours (which, when large, is quite a waste). OSPF only communicates the changes in topology.

There is a pretty good description of contents of OSPF packets.

LSA is a data structure that describe the network - it gets transferred in packet types 2 and 4(DBD and LSU). Packet type 3 (LSR) is used to request LSU from a router.

  • LSA type 1 contains information on the router itself and its neighbors.
  • LSA type 2 contains information on the networks connected to a router.

That contains enough information to reconstruct the topology of whole network.

Fox
  • 3,887
  • 16
  • 23
  • What makes me this is that structure of Router LSA normally exchnaged between routers (type 1, type2) does not have this information. – Boris May 20 '15 at 13:59
  • LSA type 3,4 is sent by ABR. The question is how ABR learns it form other LSA types? Or suppose you have only one OSPF area. Then how it happens? – Boris May 20 '15 at 14:35
  • My bad. Got packets and LSAs confused. LSAs type 1 and 2 definitely contain enough information to reconstruct topology of an area. (Removed my previous comment so it won't confuse anyone.) – Fox May 20 '15 at 15:01
  • Correct, LSA2 contains the subnet mask. Any ethernet network will eventually choose the DR which will flood the subnet information to other routers. – Boris May 20 '15 at 15:11