Subnetting: correct address for router interface? - subnet

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.

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.

Network mask unlogical response

I'm quite new a network learning, and when I was connected to a public network I was trying to play with the stuff that I learned.
So under mac OS X I tried the ifconfig command, and I looked closer to the eth0 response which returned at some point something like this "netmask 0xfffff000 broadcast 172.20.159.255".
My question is : if the mask is 0xfffff000 why the broadcast adress is not 172.20.15.255. Since the broadcast adress should be the one with only 1 in the part that is not associated to the mask (it should be 172.20.15.255).
Furthermore if we calculate the total number of adresses in our network according to the mask we get 16*16*16 which is 4096 but if we look at the broadcast adress returned we get 160*256 = 40 960 which is ten time more.
Thank you in advance for the ones who can help me.
Sorry if my english is not perfect I'm not a native english.
I just found my mistake after writing down the bits.
The answer you be 172.20.(15).255 if the bits in parenthesis are (00001111), but the part with the 0 can change and this is why our broadcast adress is the the one I expected to be is is in fact (1001|1111) which is 159 OK!

Routing Information Protocol number of hops

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."

How many addresses under each subnet

I'm studying IP classes and the topic of subnetting is confusing me.
I'm doing some practice questions and the question I'm stuck on requires me to find number of addresses under each subnet.
What I have so far is, a block 211.17.180.0/24 from which I was able to obtain subnet mask /24 = 255.255.255.0. And that there's 32 subnets. I'm not too sure how to proceed from this point. Normally, I would say there's 254 usable addresses (excluding 211.17.180.0 and 211.17.180.255) but I'm not sure how to deal with 32 subnets.
Ok, I may have figured out how to solve this problem
Since there are 32 subnets, I multiply by 2, getting 64 addresses(multiply because there are 2 unusable address per every subnet)
Then, 256-64=192/32=6, so, there are 6 addresses per every subnet in this block.
I'm not sure if this is the right way to solve this problem, some confirmation would be really appreciated!
From what I understand, the problem mentions that there are 32 subnets inside the /24 block.
Your answer is correct, here's an alternative way to think about it if you think this is confusing:
If there are 32 subnets, it means you'll need 5 bits to encode subnet identification (211.17.180.0/29 through 211.17.180.31/29), which leaves you with 3 usable bits for the host IP on each subnet; since 2 addresses are unusable on each subnet, we get at most 2^3-2 = 6 usable addresses per subnet.

Calculate Subnetmask from IP range

This was one task I had as homework I just can't seem to understand. And my teacher is having a hard time explaining it to class. So here I am:
The problem:
What is the subnet mask of following host-address range? 99.224.0.1 - 99.239.255.254
My solution (or as far as I got)
First i wrote down the IPs in binary:
99.224.0.1
01100011.11100000.00000000.00000001
99.239.255.254
01100011.11101111.11111111.11111110
What I know is this is a A class network. And I thought it must have something to do with the difference in the bits, so I started to compare. (highest first)
01100011.11101111.11111111.11111110
01100011.11100000.00000000.00000001 (diff)
-----------------------------------
00000000.00001111.11111111.11111111
I ignored the last bit, because of the network / broadcast address.
Now I can turn it around and have my subnet mask?:
11111111.11110000.00000000.00000000
255.240.0.0
My question is: Is my approach correct? Is there an easier way to do it (by hand, or calc)?
If I'm very far from the correct way to do it, could someone help me understand?
Thanks for any help.
Your answer is correct, except that classful addresses don't exist anymore. The internet moved to Classless Inter-Domain Routing (CIDR) in 1993 so your terminology is a bit outdated ;)
IP networking these days works with routing prefixes. A prefix is a range of IP addresses defined by the first address in that range and the number of fixed bits at the start of the address. Your example shows this nicely.
Your example range is 99.224.0.1 - 99.239.255.254. Actually it is 99.224.0.0 - 99.239.255.255 because when used on a subnet the first and last addresses are reserved (but still part of the subnet and prefix).
The first address in the prefix we already have: 99.224.0.0. You can see the prefix length from your binary calculation (slightly modified):
01100011.11101111.11111111.11111111
01100011.11100000.00000000.00000000
----------------------------------- (xor)
00000000.00001111.11111111.11111111
----------------------------------- (not)
11111111.11110000.00000000.00000000
Just count the number of 1s at the beginning: 12. So your prefix is 99.224.0.0/12. This prefix covers all addresses that match 01100011.1110****.********.********.
When writing the prefix length down as a subnet mask you indeed get 255.240.0.0.
A little off-topic here because it is about networking and not about the algorithm to calculate the subnet mask, but maybe helpful: an example of how you can plan network addressing:
Lets say that for my office building I get IP addresses 192.0.2.0/24 (that is 192.0.2.0 - 192.0.2.255, subnet mask 255.255.255.0, 256 addresses). I need 50 addresses for servers, 100 addresses for employee devices and 40 addresses for guests.
Because addressing works with prefixes everything you get is a power of 2. If you use a /24 you have a prefix with 256 addresses. The full address is 32 bits, the first 24 are fixed so you have 8 bits left to use. 28 = 256. If you use a /25 you have a prefix 128 addresses, a /26 has 64 addresses etc.
That way you can also split up a prefix. 192.0.2.0/24 can be split up into 192.0.2.0/25 and 192.0.2.128/25. And those can be split again and again until you have a prefix that covers only a single address: a /32.
back to the example. To get (at least) 50 addresses for the servers I need to round up to the next power of 2. That is 26 = 64. To have that many addresses I need a /26 prefix. For the client devices I need to round up to 128 (27) so we need a /25. For the guests the next power of 2 is 64 (26) so a /26.
So we need to split up out /24 into a /25 and two /26s. One possible solution is:
Client devices: 192.0.2.0/25
Servers: 192.0.2.128/26
Guests: 192.0.2.192/26
Once we configure these subnets on our devices the first and last address of each subnet become special (the network and broadcast address) so we can use these ranges for our devices:
Client devices: 192.0.2.1 - 192.0.2.126
Servers: 192.0.2.129 - 192.0.2.190
Guests: 192.0.2.193 - 192.0.2.254

Resources