Finding the broadcast address from a random IP addy + mask

Tricon7Tricon7 Posts: 238Inactive Imported Users
Can someone show me the practical way to get the answer to this question? (The answer is a.)

What is the broadcast address for the subnet that IP address 192.168.26.12 255.255.255.248 is a member of?

a. 192.168.26.15
b. 192.168.26.255
c. 192.168.26.16
d. 192.168.26.8

Comments

  • EdTheLadEdTheLad Posts: 2,112Member ■■■■□□□□□□
    256-248 = 8
    subnets 0,8,16,24,32 etc
    ip address given is 192.168.26.12, so 12 falls in the middle of the .8 subnet, the last address in the .8 subnet is .15, this has been explained 1756 times on this forum, use the search engine or just browse the forum to learn more.
    Networking, sometimes i love it, mostly i hate it.Its all about the $$$$
  • tech-airmantech-airman Posts: 953Member
    Tricon7 wrote:
    Can someone show me the practical way to get the answer to this question? (The answer is a.)

    What is the broadcast address for the subnet that IP address 192.168.26.12 255.255.255.248 is a member of?

    a. 192.168.26.15
    b. 192.168.26.255
    c. 192.168.26.16
    d. 192.168.26.8

    Tricon7,

    I've developed a "subnetting problem worksheet" system that works for me that might work for you. The steps are as follows:
    1. What is the class of the IP address?
    2. What is the default mask for the IP address?
    3. What is the subnet number of the IP address?
    4. What is the first valid IP address for the IP address?
    5. What is the last valid IP address for the IP address?
    6. What is the broadcast address for the IP address?

    So using this checklist, let's work this problem.
    Q: What is the class of the IP address?
    A: Since the first octet is 192. , it is a Class C address.

    Q: What is the default mask for the IP address?
    A: Since it is a Class C address, the default mask is 255.255.255.0

    Q: What is the subnet number of the IP address?
    A: Since the default mask is 255.255.255.0 , the subnetting is occuring in the fourth octet. Since the subnet mask is 255.255.255.248, let's translate the last octect into binary.

    .248/2 = .124 0
    .124/2 = .62 0
    .62/2 = .31 0
    .31/2 = .15 1
    .15/2 = .7 1
    .7/2 = .3 1
    .3/2 = .1 1
    .1/2 = .0 1

    So ...
    .248 is
    .11111000

    The IP address given is 192.168.26.12 so the subnet number so far is 192.168.26.x . What is the .x? Let's find out.

    .12 is
    .00001100

    Now compare that with the fourth octet of the subnet mask

    .00001100 (Fourth octet of IP address)
    .11111000 (Fourth octet of Subnet Mask)
    .00001000 (Fourth octet of IP address with Subnet Mask applied).

    That translates to subnet number 192.168.26.8 .

    Q: What is the broadcast address for the subnet?
    A: This is when all of the host bits are '1's. So in this case...

    192.168.26.00001000
    +0.0.0.00000111
    192.168.26.00001111

    Translated that's 192.168.26.15.

    There's the answer to your question.

    The trick with multiple choice questions with subnetting is that in this case, three of them are wrong. By going through each step in the "subnetting problem worksheet", you calculate the exact answer then look for that exact answer among the multiple choices.

    I hope this helps.
  • milliampmilliamp Posts: 135Member
    Why do you confuse the issue by going back and forth from classful and CIDR addressing like they are interchangable?

    The default classful address makes no difference in this scenario.

    If you have an IP address of 10.10.10.45/25 is the broadcast 10.255.255.255 becasue it is a "Class A" IP address? No, it is 10.10.10.127 becasue this is CIDR and not alphabet soup.

    The fact that so few texts bother to make the distinction between classful and CIDR addressing is a huge pet peeve of mine.

    I thought EdTheLad had it summed up pretty well.
  • tech-airmantech-airman Posts: 953Member
    milliamp wrote:
    Why do you confuse the issue by going back and forth from classful and CIDR addressing like they are interchangable?

    Classful addressing is used by:
    1. RIP v1
    2. IGRP
    3. EIGRP with auto-summary

    Therefore, understanding the classful fundamentals is a good thing to know.
    milliamp wrote:
    The mask is not 255.255.255.0, it is 255.255.255.248 and was given right in the question.

    Yes, but by acknowledging what the "default mask", you can separate the network bits and the host bits. By separating the "default mask" and the "subnet mask", you can clearly see which bits in the host bits section were "borrowed" to subnet the network.
    milliamp wrote:
    Lets say I have an IP address of 10.10.10.45/25, what is my broadcast address? Is it 10.255.255.255 becasue it is a "class A" IP address? No, it is 10.10.10.127 becasue this is CIDR and not alphabet soup.

    Ok, let's go with that.

    Q1: What is the class of the address?
    A1: Since the first octet is 10. , it is a Class A address.

    Q2: What is the default mask for the address?
    A2: Since it is a Class A address, the default mask is 255.0.0.0

    Q3: What is the subnet number for the address?
    A3: Since the subnet mask is /25 or 255.255.255.128 , the host bits start in the fourth octet. What this means is that you don't have to waste any time converting the second or third octets from decimal to binary. That means you can keep the first three octets in decimal like 10.10.10. then just work on the fourth octet in binary. Since .45 is less than .128 , the subnet number is 10.10.10.0 .

    Q4: What is the broadcast address for this IP address?
    A4: It is where all the host bits are '1's. In this case, in binary, that's .01111111 , or .127. Therefore the broadcast address will be 10.10.10.127.

    By the way, CIDR stands for "Classless InterDomain Routing." That is when multiple Classful IP address blocks are consoldiated so that only one network is advertised by the dynamic routing protocol, also known as "supernetting." Supernetting involves "borrowing network bits" arrive at the supernetted address. However, we're talking about subnetting, or "borrowing host bits." Therefore, "CIDR" doesn't apply here.
    milliamp wrote:
    "Since the default mask is 255.255.255.0 , the subnetting is occuring in the fourth octet. "

    The default classful mask has nothing to do with it, take for example the above host (10.10.10.45/25). Since it is a "class A" IP address does the subnetting take place in the first octet?

    No, the subnetting does not take place in the first octet because the default mask for a Class A address is 255.0.0.0 . Therefore, the host bits start in the second octet not the first octet. By comparing the default mask with the subnet mask, you can figure out which octets to "leave alone in decimal." In this case, the subnet mask of 255.255.255.128 - 255.0.0.0 equals 0.255.255.128 . What that means is that you can keep the first three octets in decimal, in this case 10.10.10.0 and not waste time converting to binary. If you want to convert the first three octets into binary, be my guest, I will not stop you. However, I think it would be a waste of time, that's all.
    milliamp wrote:
    When we break our subnet mask down into binary we get 11111111.11111111.11111111.10000000

    That does not look like the first octet to me.

    I agree, that looks like all four octets of the subnet mask in binary. However, if you're going to convert the entire subnet mask to binary, then we'll have to convert the entire IP address, in this case 10.10.10.45 into binary too. That's....

    10/2 = 5 0
    5/2 = 2 1
    2/2 = 1 0
    1/2 = 0 1
    0
    0
    0
    0

    10/2 = 5 0
    5/2 = 2 1
    2/2 = 1 0
    1/2 = 0 1
    0
    0
    0
    0

    10/2 = 5 0
    5/2 = 2 1
    2/2 = 1 0
    1/2 = 0 1
    0
    0
    0
    0

    45/2 = 22 1
    22/2 = 11 0
    11/2 = 5 1
    5/2 = 2 1
    2/2 = 1 0
    1/2 = 0 1
    0
    0

    So the IP address is in binary...
    00001010.00001010.00001010.00101101
    Apply the subnet mask
    11111111.11111111.11111111.10000000
    Results in...
    00001010.00001010.00001010.00000000
    Convert to decimal...
    10.10.10.0

    So it's up to you. Do you really want to waste lots of time converting the entire IP address and the entire subnet mask to binary, then apply the subnet mask to find the subnet number, then convert the subnet number back to decimal? Or simply compare the default mask with the subnet mask to figure out which octet needs to be converted from decimal to binary, then binary back to decimal? It's your choice.

    Remember, subnetting, or the "process of creating subordinate networks from the classful network", a 10. IP address is a Class A network therefore default mask of 255.0.0.0 . Using your example of IP address 10.10.10.45, and recognizing the subnet mask is /25 or 255.255.255.128, you can keep the first, second, and third octets in decimal. That's because the "subnet bits" are the entire second octet, the entire third octet, and the highest order bit in the fourth octet.
    milliamp wrote:
    In short,
    Classful addressing = old and busted
    CIDR = New hotness.

    The fact that so few texts bother to make this distinction is a huge pet peeve of mine.

    My text makes the clear distinction between CIDR and Classless/VLSM subnetting and addressing. By understanding classful IP addressing, you also understand RIP v1. By understanding RIP v1, you learn the problems with RIP v1 and so other routing protocols such as IGRP, EIGRP, OSPF, IS-IS, and BGP were born. The next generation of routing protocols help solve some of the problems with classful IP addressing, but as long as non-proprietary routing protocols like RIP v1 still exists, I think it's still important to understand classful IP addressing. RIPv1 is alive and kicking in my Linksys BEFSR41 router.

    I hope this helps.
  • milliampmilliamp Posts: 135Member
    Which brings us to our next lesson kids...

    Don't smoke crack.
  • EdTheLadEdTheLad Posts: 2,112Member ■■■■□□□□□□
    milliamp wrote:
    Which brings us to our next lesson kids...

    Don't smoke crack.

    The simple fact is some people like to make things complicated and other like the straight forward approach.If i subnet i use the approach previously mentioned as its simple and it works 100% of the time.If i use classful routing protocols like ripv1,igrp,eigrp i still use subnetting as i showed previously, as it works 100% of the time.If my classful routing protocol is used on the boundary between two major networks i realize auto-summary will take place automatically and my network will be modified and advertised on the classful boundary /8,/16,/24 but what has this to do with learning to subnet?
    Networking, sometimes i love it, mostly i hate it.Its all about the $$$$
  • malwethmalweth Posts: 42Member ■■□□□□□□□□
    last octet (/25 through /32):
    128  64  32  16  |   8   4   2   1
    128 192 224 240  | 248 252 254 255
     25   26  27  28  |  29  30  31  32
    

    your subnet mask is 255.255.255.248 (/29)
    you have 8 addresses per subnet (6 hosts)
    your address is 192.168.26.12
    starting at 0, that's 0-7 (12 is not in here)
    next is 8-15 (12 IS in here).

    The first number is your network (icon_cool.gif
    The second number is your broadcast (15).

    It's important not to get confused as to which is which. Your problem's bad answers:

    b. ...255 is the broadcast for the class (or for the last subnet in the class). Not choosing this ensures you understand the basic concept of VLSM.

    c. ...16 is the next network's network number... if you started counting at 1 (most often happens if you're multiplying this out) you might get this number.

    d. ...8 is your network number. If you're figuring out the problem, this is usually the first number you find. They're hoping you'll choose your answer too early :)
    128  64  32  16  |   8   4   2   1
    128 192 224 240  | 248 252 254 255
     25  26  27  28  |  29  30  31  32
    
  • kafifi13kafifi13 Posts: 259Member
    Tricon7 wrote:
    Can someone show me the practical way to get the answer to this question? (The answer is a.)

    What is the broadcast address for the subnet that IP address 192.168.26.12 255.255.255.248 is a member of?

    a. 192.168.26.15
    b. 192.168.26.255
    c. 192.168.26.16
    d. 192.168.26.8


    I just take the last octet of both the Mask and ip address and do binary.

    11111000 - 248
    00001100 - 12
    ________________
    00001000 - 8 - subnet number
    00001111 - 15 - Broadcast

    For the broadcast just change were all the Mask's 0's are to 1's and that's how you come up with the number

    Kareem
  • MrfixitRightMrfixitRight Posts: 61Member ■■□□□□□□□□
    Suddenly the fog has lifted!!! :)

    Great thread, very informative.
    last octet (/25 through /32):
    Code:
    128 64 32 16 | 8 4 2 1
    128 192 224 240| 248 252 254 255
    25 26 27 28 | 29 30 31 32


    Where did you get this? Good to have.
    Keyboard not functioning, Press F1 to continue

    Anything that goes up, must come down. Ask any Systems Admin.

    dell.jpg
  • CiscopimpenatorCiscopimpenator Posts: 134Inactive Imported Users
    EdTheLad wrote:
    256-248 = 8
    subnets 0,8,16,24,32 etc
    ip address given is 192.168.26.12, so 12 falls in the middle of the .8 subnet, the last address in the .8 subnet is .15, this has been explained 1756 times on this forum, use the search engine or just browse the forum to learn more.

    This is the most efficient method I have seen! I'm using this for now on.


    Here was my method

    x.x.x.248 = /29 prefix
    32 - 29 = 3 host bits
    2^3 hosts = 8 hosts

    Therefore 0-7, 8-15, 16-23, etc....etc....etc.............

    Same thing as saying 256-248 = 8......Ed's method is more compact...use it.
    -Ciscopimpenator
  • iprouteiproute Posts: 269Member
    Suddenly the fog has lifted!!! :)

    Great thread, very informative.
    last octet (/25 through /32):
    Code:
    128 64 32 16 | 8 4 2 1
    128 192 224 240| 248 252 254 255
    25 26 27 28 | 29 30 31 32


    Where did you get this? Good to have.

    This is the chart I use to subnet as well, but I also include some lower CIDR numbers:
    Block: 128  64  32  16  8   4   2   1 
    Mask:  128 192 224 240 248 252 254 255
    CIDR:  /25 /26 /27 /28 /29 /30 /31 /32
    CIDR:  /17 /18 /19 /20 /21 /22 /23 /24
    CIDR:  /9  /10 /11 /12 /13 /14 /15 /16
    

    When necessary, I bust out the 2^N and 2^H-2. You can use the above chart to count host/network bits. For example, if it's a /27, you can see that there are 3 network bits and 5 host bits. If it's a /22, you can see that there are 6 network bits and 10 host bits.
    CCNP Progress
    ROUTE [X] :: SWITCH [X] :: TSHOOT [X]
  • MrfixitRightMrfixitRight Posts: 61Member ■■□□□□□□□□
    iproute wrote:
    Suddenly the fog has lifted!!! :)

    Great thread, very informative.
    last octet (/25 through /32):
    Code:
    128 64 32 16 | 8 4 2 1
    128 192 224 240| 248 252 254 255
    25 26 27 28 | 29 30 31 32


    Where did you get this? Good to have.

    This is the chart I use to subnet as well, but I also include some lower CIDR numbers:
    Block: 128  64  32  16  8   4   2   1 
    Mask:  128 192 224 240 248 252 254 255
    CIDR:  /25 /26 /27 /28 /29 /30 /31 /32
    CIDR:  /17 /18 /19 /20 /21 /22 /23 /24
    CIDR:  /9  /10 /11 /12 /13 /14 /15 /16
    

    When necessary, I bust out the 2^N and 2^H-2. You can use the above chart to count host/network bits. For example, if it's a /27, you can see that there are 3 network bits and 5 host bits. If it's a /22, you can see that there are 6 network bits and 10 host bits.

    Sorry, just a bit confused again. The top line is the block, 2nd the mask, got that. What I guess I'm not seeing is the bits, or at least how you arrive at the number of network/host bits by using this chart. /22 would be 255.255.252.0? 6 network bits and 10 host bits, right? So, a /9 mask would be 23 host bits and 9 network bits? Right? I just don't see that in the chart. I just count up the network bits and what is left are host bits. Now I have to get VLSM down, and route sumarization! (3 subnets into 1. /27, /27, /28 = /25?)
    Keyboard not functioning, Press F1 to continue

    Anything that goes up, must come down. Ask any Systems Admin.

    dell.jpg
  • iprouteiproute Posts: 269Member
    iproute wrote:
    Suddenly the fog has lifted!!! :)

    Great thread, very informative.
    last octet (/25 through /32):
    Code:
    128 64 32 16 | 8 4 2 1
    128 192 224 240| 248 252 254 255
    25 26 27 28 | 29 30 31 32


    Where did you get this? Good to have.

    This is the chart I use to subnet as well, but I also include some lower CIDR numbers:
    Block: 128  64  32  16  8   4   2   1 
    Mask:  128 192 224 240 248 252 254 255
    CIDR:  /25 /26 /27 /28 /29 /30 /31 /32
    CIDR:  /17 /18 /19 /20 /21 /22 /23 /24
    CIDR:  /9  /10 /11 /12 /13 /14 /15 /16
    

    When necessary, I bust out the 2^N and 2^H-2. You can use the above chart to count host/network bits. For example, if it's a /27, you can see that there are 3 network bits and 5 host bits. If it's a /22, you can see that there are 6 network bits and 10 host bits.

    Sorry, just a bit confused again. The top line is the block, 2nd the mask, got that. What I guess I'm not seeing is the bits, or at least how you arrive at the number of network/host bits by using this chart. /22 would be 255.255.252.0? 6 network bits and 10 host bits, right? So, a /9 mask would be 23 host bits and 9 network bits? Right? I just don't see that in the chart. I just count up the network bits and what is left are host bits. Now I have to get VLSM down, and route sumarization! (3 subnets into 1. /27, /27, /28 = /25?)

    While I've been testing this method for about 2 weeks now with 100% accuracy, I'm still not 100% confident in it, so I'll try to explain and we'll let the more experienced individuals identify any flaws.

    First, each CIDR row is like a reference to the octet that you're subnetting in. If you're in the top row, you're dealing with a mask value in the last octet, if you're in the second row you're dealing with a mask value in the third octet, and so on. Each CIDR number is simply a reference to a number of network bits. For example, a /27's (taking place in the first row, thus the last octet) would look like this in binary: NNNHHHHH. You can count the number of network bits by counting the /27, and the numbers to the left (so, /27, /26, /25 - there are 3 in total). You can then count the host bits by counting all numbers to the right of the /27 (/28, /29, /30, /31, and /32 - there are 5 in total).

    For a /22, it would look more like this:

    NNNNNNHH.HHHHHHHH
    CCNP Progress
    ROUTE [X] :: SWITCH [X] :: TSHOOT [X]
  • MrfixitRightMrfixitRight Posts: 61Member ■■□□□□□□□□
    iproute wrote:
    While I've been testing this method for about 2 weeks now with 100% accuracy, I'm still not 100% confident in it, so I'll try to explain and we'll let the more experienced individuals identify any flaws.

    First, each CIDR row is like a reference to the octet that you're subnetting in. If you're in the top row, you're dealing with a mask value in the last octet, if you're in the second row you're dealing with a mask value in the third octet, and so on. Each CIDR number is simply a reference to a number of network bits. For example, a /27's (taking place in the first row, thus the last octet) would look like this in binary: NNNHHHHH. You can count the number of network bits by counting the /27, and the numbers to the left (so, /27, /26, /25 - there are 3 in total). You can then count the host bits by counting all numbers to the right of the /27 (/28, /29, /30, /31, and /32 - there are 5 in total).

    For a /22, it would look more like this:

    NNNNNNHH.HHHHHHHH

    By George I think I've got it! :D Felt like a Tropical Rain Forest for a while there. (Dense) But after reading previous post and this one, the light bulb finally went on! As EdtheLad wrote:
    The simple fact is some people like to make things complicated and other like the straight forward approach.

    I was "making" it complicated, making it appear harder than it really is. I guess I was thinking that it couldn't possibly be THAT easy! Thanks to everyone who took time to post their various formulas on this, it really helped.
    Keyboard not functioning, Press F1 to continue

    Anything that goes up, must come down. Ask any Systems Admin.

    dell.jpg
  • mwgoodmwgood Posts: 293Member
    Subnetting is simple :D
Sign In or Register to comment.