Routing Information Protocol number of hops - networking

Can anyone explain me, why is the subnet z seven hops away from the router D (and not 3 hops)? Which ones are counted? Please see picture below:

I believe the 'break' in the image means "any number of routers exist here."

Related

Understanding format of RIB dumps from Oregon Route-views

I am working on a project in which I need to analyse the rib-dumps from the Oregon Routeviews Project.
I download the .bz2 file from here for a specific time and date for a specific node. These files are generated every 2 hours.
Then I unzipped and parsed using a zebra parser.
In the end, I get a text file with almost a million entries in the following format
194.33.63.0/24 58511 8468 31493 31493
There are also a lot of entries with the same last number but different IP in the beginning.
For example
194.28.28.0/22 58511 31500 50911
194.28.28.0/23 58511 31133 50911
My inference is that these numbers are Autonomous System numbers and they somehow denote BGP Hops, but I am not clear how they relate to the IP address in the starting. And what exactly is the source/destination AS?
I really think you should go and do some reading on how BGP works and what the routeing information carried by the BGP messages you are looking at is and means.
To get you started...
...a route in BGP speak is a prefix and some attributes. Key among the attributes are the next-hop and the AS-Path. In announcing a route to a BGP peer (neighbour) the BGP router is saying that it can reach the prefix and if packets with destinations in the prefix are forwarded to the next-hop, they will be forwarded on towards their destination. The AS-PATH lists the ASes through which packets are (expected to) travel on their way to the destination.
So what you are seeing is reachable prefixes and the AS-PATH attribute for each one. I'm guessing you left out the next-hop (for eBGP, that will generally be the/an address of the BGP router which is advertising the route -- but in any case all eBGP routes will generally have the same next-hop).
The AS-PATH can be read from left to right: the first AS is the one from whom the route was learnt, the last AS is the one that contains the prefix. Packets forwarded to the next-hop are (currently) expected to travel through those ASes, in that order, on their way to their destination. So the first AS would be the source -- the immediate source of the route. The last AS can be called the destination, but is also known as the origin -- the origin of the route.
[Technically, the AS-Path should be read from right to left, and lists the ASes which the route has traversed this far. Most of the time that's the same as reading left to right for packets traversing the network towards their destination.]
as-50911 origin or destination,
as-58511 source
194.28.28.0/22 should be the owner of as-50911 origin
I think you are confused about /23 or /22. 194.28.28.0/23 its not different IP. Its actually the same IP with different prefix length, i.e., /23. The autonomous systems registered their IP addresses with prefix lengths in IRR. Less specific, i.e., /22 means more end node. More specific, i.e., /23 means less end node. Moreover, You should read about prefix length.

Subnetting: correct address for router interface?

This is a portion of a larger network, but I've simplified it for the sake of the question.
Here is the network.
Adresses in it are as follows:
Server: 192.168.0.97/30
Router to server IF0: 192.168.0.98/30
Network with 8 pcs: 172.16.40.144/28
The 8th pc: 172.16.40.152/28
Router to the network with 8 pcs IF1: 172.16.40.158/28
Now, I've been told that last one is incorrect, but I can't figure out why. As far as I understand it, it should be the last available adress of the .144 network, thus .158
The teacher figured out it was wrong looking at this table.
But looking at it now I can't find his reason.
Any help appreciated.
The last 4 bits of the 0th pc on the network would be 0000, which converts to 172.168.40.144. The last 4 bits of the highest possible value is 1111, which converts to 172.168.40.159. I'm not sure if that would be the broadcast address though.

Get Hop-count between 2 peers

I know I should be asking this question on Network Engineering section of Stack Exchange but it feels like it's a desert there.
I'm trying to build an application that requires the distance between 2 hosts (represented by IP).
I used many methods: one of them is to get the distance at the internet layer of the TCP/IP model; i.e: the hop count between the 2 networks or better to get the bandwidths of the path but I think this information can't be measured because it's a real time info.
I figured out that there should be a graph representing the internet graph which its nodes are the routers (or autonumus systems or sub-networks (I really don't know exactly what type of nodes it should be) and the edges of the graph should be the cables between the nodes which have the bandwidth to be the wieght of the edge.
My Question:
Where can I find this information; whether the full graph or parts of it or something like an API to get 2 IPs and return the shortest path between the 2 IPs.
There is a tool named "Tracert"
You could have it try.
It will represent the routines of peer to peer in internet.
Hope that it make

Calculating IP address from the following statement

I would like to not be so specific with my question, but I do not understand it and would like to get some help. The statement says:
The interface should be addressed in the next (upwards) available /27
subnet in the 192.168.20.0/24 address space.
I do not understand what it means. I understand that:
192.168.20.0/24 would mean a subnet mask of 255.255.255.0, and the address range would be 192.168.20.0 - 192.168.20.255. But what does the statement mean with the next upward available /27 subnet in that address space?
The next /27 that's not used by something else. If 192.168.20.0/27 is available, take it. Otherwise, if 192.168.20.32/27 is available, take it. Otherwise, if 192.168.20.64/27 is available... etc. Which address within that subnet you should use, and how you determine what is "available" are both unclear from the context you gave, but probably provided somewhere.

Is it possible that in a network,delay from router A to B is different from delay from router B to A

considering that metric is delay in distance vector routing algorithm,
is it possible that delay from router A to B is different from router B to A.
if yes, under which conditions??
thanks.
The algorithm assumes the graph is bidirectional. Of course, it's possible for the delays to be different in each direction in practice: for example, if B is transmitting heavily to A, then traffic from A to B is likely to be faster than from B to A, since traffic from B will have to get in line at the end of a queue.
Delay and metric are two different things.
Delay is the time it takes for a packet to traverse the network. If a link is heavily utilized in one direction and there is some kind of buffering device (such as a switch) on the link you might have different delays in the network traffic depending on direction.
Metrics are values associated with entries in a routing table that indicates "costs" of different routes. If A and B have static routing entries they can definitely be configured with different metrics for each direction of the same link.
Are you assuming both hypothetical circumstances run at the exact same time? If not I suppose there could be a spike on the traffic for one of the routers at any given time that bogs down your 'wanted' traffic.
Certainly this is possible, but to give you more details you probably need to be more specific with the question.
With regards to your specific question about Metrics and Distance Vector routing algorithms, yes, A can be configured to think that B is further away than B thinks A is, although as mentioned by one of the other answers, that doesn't necessarily mean the delay is different although it may in fact be.
In practice though, there are lots of questions to consider:
Is router A adjacent to router B? If not, then you certainly could have different delays because inbound packets may take a different path than outbound packets.
If they are adjacent, what kind of connectivity do they have? Are they the same kind of router? Imagine a router at the end of an aysymmetric DSL line. Of course the propagation delay wouldn't be aysymmetric, but delay could be higher in one direction as a result of traffic congestion. (This scenario also gives a concrete example of why you might want A to think the link to B has a higher cost than B thinks the link to A has.)
In practice, the definition of delay makes a big difference too. Are you thinking of just the computed cost? Or just propagation delay? Or just the link cost? If router B is sending more traffic than router A, it may take longer for responding packets from B to A to be processed by B than A takes when sending the packets (the same may apply for intermediary switches, especially in the case of things like multicast packets--some routers and/or switches take longer to process multicast and other "special" packets). So in this scenario the actual delay may be different, but the cost the DVP is using thinks it is the same.
Hope this answer helps. Good luck,
--jed

Resources