Will ospf and eigrp share the 10 network on the right to their
neighbors?
As per my understanding link state protocols like ospf do so while
eigrp being a distance vector protocol will share only one of the
routes, but this case let's say both the routes are exactly same, how
will this be handled then?
By default, the router will install the route learned via EIGRP into the routing table. This is because EIGRP has a lower Administrative Distance than OSPF.
It should also be noted that both learned routes will remain in their respective routing processes. Thus, the router knows about both but will only select one route when routing.
Routers select routes in the following order:
- Prefix Length - The longest-matching route is preferred first.
Prefix length trumps all other route attributes.
- Administrative Distance - In the event there are multiple routes to
a destination with the same prefix length, the route learned by the
protocol with the lowest administrative distance is preferred.
- Metric - In the event there are multiple routes learned by the same
protocol with same prefix length, the route with the lowest metric
is preferred. (If two or more of these routes have equal metrics,
load balancing across them may occur.)
Jeremy Stretch does a great job going into deep details and examples of route selection here.
EDIT:
I am asking the question in two separate scenarios using a single
protocol at a time and not running both protocols at once.
In the event of all things equal and the routing process supports it, equal-cost load balancing will occur.
Exactly how the router handles the load-balancing depends on your configuration, version of IOS and potentially your router platform. Cisco dives into the matter with the following documents.
What does it look like in the routing table?
The following is an example output of EIGRP speaking routers with an equal-cost route for 10.1.1.0/24
:
ROUTER2#show ip route
[...omitted text...]
10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
D 10.1.1.0/24 [90/30720] via 10.1.3.2, 00:00:17, FastEthernet1/0
[90/30720] via 10.1.2.2, 00:00:17, FastEthernet0/0
C 10.1.2.0/24 is directly connected, FastEthernet0/0
L 10.1.2.1/32 is directly connected, FastEthernet0/0
C 10.1.3.0/24 is directly connected, FastEthernet1/0
L 10.1.3.1/32 is directly connected, FastEthernet1/0
Here is an example for OSPF:
ROUTER2#show ip route
[...omitted text...]
10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
O 10.1.1.0/24 [110/2] via 10.1.3.2, 00:00:02, FastEthernet1/0
[110/2] via 10.1.2.2, 00:00:02, FastEthernet0/0
C 10.1.2.0/24 is directly connected, FastEthernet0/0
L 10.1.2.1/32 is directly connected, FastEthernet0/0
C 10.1.3.0/24 is directly connected, FastEthernet1/0
L 10.1.3.1/32 is directly connected, FastEthernet1/0
Best Answer
There are a bunch of confusions here. Let's start with the last one.
It does not(!!!!!). In link state routing neighbors do not share routes of its neighbors, their share topology of their neighbors. Link state routing protocol takes this topology, reconstructs a network graph and computes routes. This is fundamentally different from distance vector, where neighbors share their computed routes.
Now about the rest.
No it does not. (1) flooding is used to reach all routers (2) these messages may use multicast (on a single hop). (2) is not that relevant to understand basic principles.
If there is only one router on the same subnet, then it does not share routing information on the same subnet. It could try, but none else can receive it.
You are missing the concepts here. On the edge of Internet we usually have organizations that use Layer-2 within their local network. This network is assigned a block of IP addresses and is usually called subnet. In order to be connected to the Internet it does need to have at least one router. This is not the only think subnet can refer to.
In the context of routing protocols we are talking about point-to-point and broadcast links. Point-to-point link is equivalent to a cable between two devices. Broadcast link means that (1) there are more than one device connected to this link (2) the layer 2 has broadcast capabilities, i.e., it is possible to use special broadcast address to deliver packets to all connected devices. The consequence is that it is possible to send a separate packet to each other router, but it is more efficient to send on broadcast packet. There are more consequences coming from the nature of such networks.
This is taken into account in order to answer the question: how to most efficiently transmit routing information over a single hop. It is not related to the question on how to transmit routing information between all routers in the network.
So, as i said, in theory it can very well send a unicast to each router specifically. Here, by saying broadcast we usually mean that the packet has to reach all neighbors on the same link.
Also it is worth noting, that you can use multicast on point-to-point links connected directly (by a cable). On such a link one device can only send packet to the other device, so addressing does not matter.
From what I know, and I saw this confusion in a number of university courses about RIP, RIP actually does assume that all routers are connected by broadcast links. And the way it works makes sense for broadcast links. I am however not 100% sure about this.
and also
DVR which presumably stands for distance vector routing is a class of protocols which work based on distributed Bellman-Ford algorithm. Everyone teaches RIP, but RIP is not the only DVR and the way RIP uses broadcast does not have to apply to any other distance vector routing protocol. OSPF is an example of link state routing. Again not the only example, there are at least two. You can't compare them together. What you ask in your last question does ask for the difference between distance vector and link state.
If you are trying to understand the basics, i recommend to assume that all routers are connected by direct point-to-point links (i.e., by a cable). In this context, the word broadcast w.r.t. a single hop will be - send message to all direct neighbors.
I would also recommend this open online book. It is written by a university professor with lot of experience.