Jump to content

How to calculate the broadcast address?

Go to solution Solved by Nuh_,
13 minutes ago, GamerGry123 said:

But as the last octet is 132, why is the broadcast address 135?

the subnet is 255.255.255.252  or /30 meaning each network has only 4 ip addresses

only 2 bits missing so 2^2=4 ips. then 4-2 =2 usable IPs

 

 

the ip 70.195.99.132 is the network address; hence the first IP

the first usable IP in this network is 70.195.88.133

the last usable IP in this network is 70.195.99.134

and the broadcast is 70.195.99.135

 

I hope this is what you were asking for

I do fine with the network address, and the first host address is fine too.

To determine the address of the last host, you need a broadcast address and from it you need to subtract 1 in the 4th octet and then the address of the last host will come out.

 

As in the address octet there are all 0, it always types 255 and it comes out fine.

But as the last octet is 132, why is the broadcast address 135?

 

Or the second task as in the 3rd octet is 128, why is there 255 in the broadcast address instead of 128? The 4th octet is 255 because it is 0, I know why.

 

1.png

2.jpg

3.jpg

Link to comment
Share on other sites

Link to post
Share on other sites

13 minutes ago, GamerGry123 said:

But as the last octet is 132, why is the broadcast address 135?

the subnet is 255.255.255.252  or /30 meaning each network has only 4 ip addresses

only 2 bits missing so 2^2=4 ips. then 4-2 =2 usable IPs

 

 

the ip 70.195.99.132 is the network address; hence the first IP

the first usable IP in this network is 70.195.88.133

the last usable IP in this network is 70.195.99.134

and the broadcast is 70.195.99.135

 

I hope this is what you were asking for

Link to comment
Share on other sites

Link to post
Share on other sites

Your mask is /30, so only the last 2 bits are IPs, i.e. you have 4 IPs

70.195.99.132

70.195.99.133

70.195.99.134

70.195.99.135

 

The last one being broadcast.

F@H
Desktop: i9-13900K, ASUS Z790-E, 64GB DDR5-6000 CL36, RTX3080, 2TB MP600 Pro XT, 2TB SX8200Pro, 2x16TB Ironwolf RAID0, Corsair HX1200, Antec Vortex 360 AIO, Thermaltake Versa H25 TG, Samsung 4K curved 49" TV, 23" secondary, Mountain Everest Max

Mobile SFF rig: i9-9900K, Noctua NH-L9i, Asrock Z390 Phantom ITX-AC, 32GB, GTX1070, 2x1TB SX8200Pro RAID0, 2x5TB 2.5" HDD RAID0, Athena 500W Flex (Noctua fan), Custom 4.7l 3D printed case

 

Asus Zenbook UM325UA, Ryzen 7 5700u, 16GB, 1TB, OLED

 

GPD Win 2

Link to comment
Share on other sites

Link to post
Share on other sites

18 minutes ago, GamerGry123 said:

Or the second task as in the 3rd octet is 128, why is there 255 in the broadcast address instead of 128? The 4th octet is 255 because it is 0, I know why.

again has to do with the subnet mask, the subnet for 142.34.128.0 is 255.255.128.0 or /17

the /17 means you will use half the 3rd block in each network (notice the 3rd block isn't 255) that means it isn't all network portion, but a part of it is IPs.

network on this subnet would go like this 142.34.0.0-142.34.127.255

142.34.128.0-142.34.255.255

142.35.0.0-142.34.127.255 and so on.

 

 

in this scenario the network address is 142.34.128.0

the first IP is 142.34.128.1

but when you reach 142.34.128.255 you go to 142.34.129.255 that's how big the /17 network  is.

you keep going until you get to the end which is 142.34.255.255 and that's your broadcast

Link to comment
Share on other sites

Link to post
Share on other sites

20 minutes ago, Nuh_ said:

again has to do with the subnet mask, the subnet for 142.34.128.0 is 255.255.128.0 or /17

the /17 means you will use half the 3rd block in each network (notice the 3rd block isn't 255) that means it isn't all network portion, but a part of it is IPs.

network on this subnet would go like this 142.34.0.0-142.34.127.255

142.34.128.0-142.34.255.255

142.35.0.0-142.34.127.255 and so on.

 

 

in this scenario the network address is 142.34.128.0

the first IP is 142.34.128.1

but when you reach 142.34.128.255 you go to 142.34.129.255 that's how big the /17 network  is.

you keep going until you get to the end which is 142.34.255.255 and that's your broadcast

I did it a different way, but the result is the same.

I changed the mask the other way around, i.e. in the mask where 1 I changed to 0 and vice versa.

Then I changed the binary mask to decimal and added it to the network address.

Same for the second example.

Thanks for the help.

1.jpg

2.jpg

Link to comment
Share on other sites

Link to post
Share on other sites

27 minutes ago, Nuh_ said:

znowu ma do czynienia z maską podsieci, podsieć dla 142.34.128.0 to 255.255.128.0 lub /17

/17 oznacza, że użyjesz połowy trzeciego bloku w każdej sieci (zauważ, że trzeci blok to nie 255), co oznacza, że nie jest to cała część sieci, ale jej część to adresy IP.

sieć w tej podsieci wyglądałaby tak: 142.34.0.0-142.34.127.255

142.34.128,0-142.34.255.255

142.35.0.0-142.34.127.255 i tak dalej.

 

 

w tym scenariuszu adres sieciowy to 142.34.128.0

pierwszy adres IP to 142.34.128,1

ale kiedy dojdziesz do 142.34.128.255, przejdziesz do 142.34.129.255, tak duża jest sieć /17.

idziesz dalej, aż dojdziesz do końca, czyli 142.34.255.255 i to jest twoja transmisja

1 to 4 octets are added to the first host address. And to know what the address of the last host is, subtract 1 from the 4th octet of the broadcast address, i.e. the address of the last host is 142.34.255.254?

 

Does this always add up and subtract 1 only on the 4th octet of the address?

Link to comment
Share on other sites

Link to post
Share on other sites

6 hours ago, GamerGry123 said:

I did it a different way, but the result is the same.

I changed the mask the other way around, i.e. in the mask where 1 I changed to 0 and vice versa.

Then I changed the binary mask to decimal and added it to the network address.

Same for the second example.

Thanks for the help.

1.jpg

2.jpg

the masks you used here

the 0.0.128.255 and 0.0.0.3 are called wildcard masks

Link to comment
Share on other sites

Link to post
Share on other sites

6 hours ago, GamerGry123 said:

1 to 4 octets are added to the first host address. And to know what the address of the last host is, subtract 1 from the 4th octet of the broadcast address, i.e. the address of the last host is 142.34.255.254?

 

Does this always add up and subtract 1 only on the 4th octet of the address?

yes, the last host is 142.34.255.254

if you meant the last usable IP is always attained by adding up the IPs and subtracting one from the last block, then yes

Link to comment
Share on other sites

Link to post
Share on other sites

16 hours ago, Nuh_ said:

tak, ostatni host to 142.34.255.254

jeśli miałeś na myśli, że ostatni użyteczny adres IP jest zawsze osiągany przez dodanie adresów IP i odjęcie jednego z ostatniego bloku, to tak

That's what I meant.

 

How do I do the last type of job where it checks which hosts are on the same network?

I do so that I change the mask from decimal to binary and if the octet where the mask ends is 1 1, then there are 2 subnets, if 2 1s 4 subnets, if 3 1s 8 subnets and so on.

 

mask
11111111.11111111.11111111.10000000 = 2 subnets
11111111.11111111.11111111.11000000 = 4 subnets

 

But this method doesn't always work.
Is there any other simpler one?

1.png

2.jpg

Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, GamerGry123 said:

That's what I meant.

 

How do I do the last type of job where it checks which hosts are on the same network?

I do so that I change the mask from decimal to binary and if the octet where the mask ends is 1 1, then there are 2 subnets, if 2 1s 4 subnets, if 3 1s 8 subnets and so on.

 

mask
11111111.11111111.11111111.10000000 = 2 subnets
11111111.11111111.11111111.11000000 = 4 subnets

 

But this method doesn't always work.
Is there any other simpler one?

1.png

2.jpg

well, you kinda have a mistake; the last block only has 7 bits, so you're missing a 0

the last block for /28 would be 11110000, and you can determine the size of the network by the value of first 1 after the 0s, in this case that's 16

 

networks will be 15.40.17.0

15.40.17.16

.

.

.

15.40.17.128

15.40.17.144

 

the last exercise is exaclty the same concept except that you're dealing with the 3rd block and not the 4th

Link to comment
Share on other sites

Link to post
Share on other sites

On 19.04.2022 at 17:21, Nuh_ said:

cóż, masz jakiś błąd; ostatni blok ma tylko 7 bitów, więc brakuje Ci 0

ostatni blok dla /28 to 11110000 i możesz określić rozmiar sieci przez wartość pierwszego 1 po zerach, w tym przypadku jest to 16

 

sieci będą 15.40.17.0

15.40.17.16

.

.

.

15.40.17.128

15.40.17.144

 

ostatnie ćwiczenie to dokładnie ta sama koncepcja, z wyjątkiem tego, że masz do czynienia z trzecim blokiem, a nie czwartym

How to count it? Why does your network change every 16th? And it turned out that every 32.

Could you write it out somehow to know where it came from?

Link to comment
Share on other sites

Link to post
Share on other sites

On 4/19/2022 at 6:21 PM, Nuh_ said:

well, you kinda have a mistake; the last block only has 7 bits, so you're missing a 0

the last block for /28 would be 11110000, and you can determine the size of the network by the value of first 1 after the 0s, in this case that's 16

 

networks will be 15.40.17.0

15.40.17.16

.

.

.

15.40.17.128

15.40.17.144

 

the last exercise is exaclty the same concept except that you're dealing with the 3rd block and not the 4th

so we know that the subnet mask is /28 which means you have 28 active bits out of 32, meaning

11111111.11111111.11111111.11110000

now, in the last block (11110000) each bit has a numerical value

0=1

0=2

0=4

0=8

1=16

1=32

1=64

1=128

its basically 2^position; position starting at 0

if all the bits are active the sum is 255

 

back to the matter at hand, to calculate the subnet mask for /28 we add the values of the active bits, which result in 255.255.255.240

 

from here you can use 2 methods to determine how many IPs the subnet can take (or the network)

1. the value of the last active bit, here that's 16

2. I gave up on explaining as it's basically useless.

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

18 hours ago, Nuh_ said:

więc wiemy, że maska podsieci to /28, co oznacza, że masz 28 aktywnych bitów z 32, co oznacza

11111111.11111111.11111111.11110000

teraz w ostatnim bloku (11110000) każdy bit ma wartość liczbową

0=1

0=2

0=4

0=8

1=16

1=32

1=64

1=128

jego zasadniczo 2^ pozycja; pozycja od 0

jeśli wszystkie bity są aktywne, suma wynosi 255

 

wracając do sprawy, aby obliczyć maskę podsieci dla /28 dodajemy wartości aktywnych bitów, co daje 255.255.255.240

 

stąd możesz użyć 2 metod, aby określić, ile adresów IP może przyjąć podsieć (lub sieć)

1. wartość ostatniego aktywnego bitu, tutaj to jest 16

2. Zrezygnowałem z wyjaśniania, ponieważ jest to w zasadzie bezużyteczne.

 

 

Now where did 16 come from.

If the mask were 25 that would be 255.255.255.128

binary:11111111.11111111.11111111.10000000

 

So in that case it would be 128 instead of 16? If so how do you calculate it?

 

Where did this range come from?

I know that adding 16, but why this range?

15.40.17.128

15.40.17.144

Link to comment
Share on other sites

Link to post
Share on other sites

8 hours ago, GamerGry123 said:

Now where did 16 come from.

If the mask were 25 that would be 255.255.255.128

binary:11111111.11111111.11111111.10000000

 

So in that case it would be 128 instead of 16? If so how do you calculate it?

yes, it is calculated with the value of the last 1; in this case you can see the last block has 10000000, so we take the value of the 1 which is 128 (8 bit numbering)

8 hours ago, GamerGry123 said:

Where did this range come from?

I know that adding 16, but why this range?

15.40.17.128

15.40.17.144

the range came from the subnet mask, it is what determines the size of the network

Link to comment
Share on other sites

Link to post
Share on other sites

On 4/18/2022 at 2:05 PM, GamerGry123 said:

To determine the address of the last host, you need a broadcast address and from it you need to subtract 1 in the 4th octet and then the address of the last host will come out.

I feel like you are trying to come up with shortcuts that sometimes work, but sometimes don't work. As a result, you get confused.

 

The network address is the address where all the host bits are set to 0.

The broadcast address is the address where all the host bits are set to 1.

 

It has nothing to do with a specific octet. It is usually in the 4th octet, but not always.

 

 

 

On 4/18/2022 at 2:05 PM, GamerGry123 said:

As in the address octet there are all 0, it always types 255 and it comes out fine.

There is no "address octet".

Not sure what you mean by "all 0, it always types 255". Again, I feel like this is one of your shortcuts that don't always work.

 

 

I don't know polish so I can't read the questions, but if you want to calculate the network address, host address range and broadcast, you should write everything down in binary (IP address and subnet mask) and then from there set the host part to all 0, calculate what that is, and then all 1 and calculate what that is.

 

 

Let's take question 3 as an example. I believe it says "can a host have this address: 43.187.105.124/28".

 

 

First let's write the IP in binary:

image.thumb.png.738b2ca2aac29770dd3498611c1b44c5.png

 

 

Now, the subnet mask determines which portion of the IP address is allocated to the network, and which is allocated to the host portion.

So the second step, just to make things more clear, is to mark all the bits that are part of the network portion in our IP address. I have marked the network portion yellow, and the host portion green. The subnet mask "marks" which bits of the IP address belongs to the network portion. 

The /28 means that the subnet mask consists of 28 bits set to 1.

28 out of our 32 bits are allocated to the network portion of the IP.

image.thumb.png.4b5433bcc6897ce54754ff8396c486bf.png

 

 

So we have 4 bits left for the host portion, since the other 28 are used by the network portion.

Now, let's set all the host address bits to 0 to calculate our network address, and all host address bits to 1 to calculate our broadcasts address:

image.thumb.png.066e718d8ed130ade1613fa2c94329e8.png

 

 

Now we just need to convert back to decimal.

Network address: 43.187.105.112

Broadcast address: 43.187.105.127

Usable host range (all addresses between the network address and broadcast address): 43.187.105.113 to 43.187.105.126

 

 

Since the question was "is 43.187.105.124/28 a valid host address" we can see that yes, it is. It is part of the range between 43.187.105.113 and 43.187.105.126.

 

 

From my experience, subnetting is one of those things that seem really complicated until one day you finally realize the logic behind it. Once you do that, it becomes obvious. I hope I helped make it a bit more clear.

Link to comment
Share on other sites

Link to post
Share on other sites

On 22.04.2022 at 03:12, Nuh_ said:

tak, jest liczony od wartości ostatniego 1; w tym przypadku widać, że ostatni blok ma 10000000, więc przyjmujemy wartość 1, która wynosi 128 (numeracja 8-bitowa)

zasięg pochodzi z maski podsieci, to ona decyduje o wielkości sieci

I already know where the 128 came from. And where did the 140 come from? If the network changes every 128?

Link to comment
Share on other sites

Link to post
Share on other sites

55 minutes ago, GamerGry123 said:

I already know where the 128 came from. And where did the 140 come from? If the network changes every 128?

I'm not entirely sure what you're referring to, by I'll assume it's the example.

the mask there is /28 meaning 255.255.255.240

meaning the network changes every 16 ips

Link to comment
Share on other sites

Link to post
Share on other sites

On 22.04.2022 at 12:12, LAwLz said:

Czuję, że próbujesz wymyślić skróty, które czasami działają, ale czasami nie działają. W rezultacie jesteś zdezorientowany.

 

Adres sieciowy to adres, w którym wszystkie bity hosta są ustawione na 0.

Adres rozgłoszeniowy to adres, w którym wszystkie bity hosta są ustawione na 1.

 

Nie ma to nic wspólnego z konkretnym oktetem. Zwykle jest w 4. oktecie, ale nie zawsze.

 

 

 

Nie ma „oktetu adresu”.

Nie wiem, co rozumiesz przez „wszystkie 0, zawsze wpisuje 255”. Ponownie, wydaje mi się, że jest to jeden z twoich skrótów, które nie zawsze działają.

 

 

Nie znam polskiego, więc nie umiem czytać pytań, ale jeśli chcesz obliczyć adres sieciowy, zakres adresów hosta i broadcast, powinieneś zapisać wszystko w systemie binarnym (adres IP i maska podsieci), a następnie stamtąd ustawić część hosta do wszystkich 0, oblicz, co to jest, a następnie wszystkie 1 i oblicz, co to jest.

 

 

Weźmy jako przykład pytanie 3. Uważam, że jest napisane „czy host może mieć ten adres: 43.187.105.124/28”.

 

 

Najpierw zapiszmy adres IP w postaci binarnej:

obraz.kciuk.png.738b2ca2aac29770dd3498611c1b44c5.png

 

 

Teraz maska podsieci określa, która część adresu IP jest przydzielona do sieci, a która jest przydzielana do części hosta.

Tak więc drugim krokiem, aby wszystko było bardziej jasne, jest zaznaczenie wszystkich bitów, które są częścią sieci w naszym adresie IP. Zaznaczyłem część sieciową na żółto, a część hosta na zielono. Maska podsieci „zaznacza”, które bity adresu IP należą do części sieci. 

/28 oznacza, że maska podsieci składa się z 28 bitów ustawionych na 1.

28 z naszych 32 bitów jest przydzielonych do sieciowej części adresu IP.

image.kciuk.png.4b5433bcc6897ce54754ff8396c486bf.png

 

 

Pozostały więc 4 bity dla części hosta, ponieważ pozostałe 28 jest używanych przez część sieciową.

Teraz ustawmy wszystkie bity adresu hosta na 0, aby obliczyć nasz adres sieciowy, a wszystkie bity adresu hosta na 1, aby obliczyć nasz adres rozgłoszeniowy:

obraz.kciuk.png.066e718d8ed130ade1613fa2c94329e8.png

 

 

Teraz wystarczy przekonwertować z powrotem na dziesiętny.

Adres sieciowy: 43.187.105.112

Adres rozgłoszeniowy: 43.187.105.127

Użyteczny zakres hostów (wszystkie adresy między adresem sieciowym a adresem rozgłoszeniowym): 43.187.105.113 do 43.187.105.126

 

 

Ponieważ pytanie brzmiało: „Czy 43.187.105.124/28 jest prawidłowym adresem hosta”, widzimy, że tak, tak. Jest to część zakresu od 43.187.105.113 do 43.187.105.126.

 

 

Z mojego doświadczenia wynika, że tworzenie podsieci jest jedną z tych rzeczy, które wydają się naprawdę skomplikowane, aż pewnego dnia w końcu zdasz sobie sprawę z logiki, która się za tym kryje. Gdy to zrobisz, stanie się to oczywiste. Mam nadzieję, że pomogłem to nieco wyjaśnić.

I do it in a different way.

The address is 164.30.125.179/28

 

Mask 28
binary: 11111111.11111111.11111111.11110000

 

So convert the 4th address octet to binary. The first 3 octets are networks.

Before that, from 32 to remove the mask:
32-28 = 4

So you need to select the last 4 bits of the address.

 

164.30.125.10110011

 

11 = broadcast address
00 = network address
01/10 = host address

So the host can have such an address.

Link to comment
Share on other sites

Link to post
Share on other sites

16 hours ago, Nuh_ said:

Nie jestem do końca pewien, o czym mówisz, założę, że to przykład.

maska tam jest /28 oznaczająca 255.255.255.240

co oznacza, że sieć zmienia się co 16 ips

At the top, you calculated this interval:
15.40.17.128
15.40.17.144

 

I just don't know where this particular address range came from. I know the network changes every 16.

Link to comment
Share on other sites

Link to post
Share on other sites

17 minutes ago, GamerGry123 said:

So convert the 4th address octet to binary. The first 3 octets are networks.

Yes, in this particular case the first 3 octets belong to the network so you can ignore those when calculating the host range, but that's not always the case. For example if the subnet mask is /22 then the third octet will partially belong to the host portion as well. 

 

 

19 minutes ago, GamerGry123 said:

Before that, from 32 to remove the mask:

32-28 = 4

So you need to select the last 4 bits of the address.

 

164.30.125.10110011

 

11 = broadcast address
00 = network address
01/10 = host address

So the host can have such an address.

Not sure if this is a typo, but it should be:

 

0000 = network address. 

0001 = host

0010 = host

0011 = host

0100 = host

0101 = host

0110 = host

0111 = host

1000 = host

1001 = host

1010 = host

1011 = host

1100 = host

1101 = host

1110 = host

1111 = broadcast address.  

 

 

But this does not really tell you anything unless you also take into consideration the 4 other bits of the last octet. You need to look at the entire octet, not just isolate a couple of bits. 

Link to comment
Share on other sites

Link to post
Share on other sites

11 minutes ago, LAwLz said:

Tak, w tym konkretnym przypadku pierwsze 3 oktety należą do sieci, więc możesz je zignorować podczas obliczania zakresu hostów, ale nie zawsze tak jest. Na przykład, jeśli maską podsieci jest /22, trzeci oktet będzie również częściowo należeć do części hosta. 

 

 

Nie jestem pewien, czy to literówka, ale powinno być:

 

0000 = adres sieciowy. 

0001 = host

0010 = host

0011 = gospodarz

0100 = host

0101 = host

0110 = host

0111 = host

1000 = host

1001 = gospodarz

1010 = gospodarz

1011 = gospodarz

1100 = gospodarz

1101 = gospodarz

1110 = gospodarz

1111 = adres rozgłoszeniowy.  

 

 

Ale to tak naprawdę nic ci nie mówi, chyba że weźmiesz pod uwagę również 4 inne bity ostatniego oktetu. Musisz spojrzeć na cały oktet, a nie tylko wyizolować kilka bitów. 

Yes, the last 4 bits, 4 octets.
If they are all 1, it is a broadcast address.
Same 0 network address.
10 or 01 is the host address

In this case, the last 4 bits are 0011
So the host address

Link to comment
Share on other sites

Link to post
Share on other sites

51 minutes ago, GamerGry123 said:

At the top, you calculated this interval:
15.40.17.128
15.40.17.144

 

I just don't know where this particular address range came from. I know the network changes every 16.

yes that's the network changing every 16 all the way to 160

one of the networks is 15.40.17.128

another is 15.40.17.144

the next is 15.40.17.160

Link to comment
Share on other sites

Link to post
Share on other sites

19 minutes ago, Nuh_ said:

tak, to sieć zmienia się co 16 aż do 160

jedna z sieci to 15.40.17.128

inny to 15.40.17.144

następny to 15.40.17.160

I already know, thanks for your help.

Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, GamerGry123 said:

Yes, the last 4 bits, 4 octets.

Ohh now I get it.

 

You're using "octet" to mean bit.

Octet actually means 8 bits. An IP address consists of 4 octets.

 

 

Take this IP as an example: 192.168.0.1

 

192 is one octet.

168 is one octet.

0 is one octet.

1 is one octet.

Link to comment
Share on other sites

Link to post
Share on other sites

57 minutes ago, LAwLz said:

Och, teraz to rozumiem.

 

Używasz "oktetu" w znaczeniu bitu.

Oktet faktycznie oznacza 8 bitów. Adres IP składa się z 4 oktetów.

 

 

Weźmy ten adres IP jako przykład: 192.168.0.1

 

192 to jeden oktet.

168 to jeden oktet.

0 to jeden oktet.

1 to jeden oktet.

that's what I meant, it's the second way and it works the same way, it's even easier.

 

Will you read my message about these switches routers?

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×