[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math


View post   

File: 148 KB, 640x427, Depreciation-Calculation.jpg [View same] [iqdb] [saucenao] [google]
6124820 No.6124820 [Reply] [Original]

How do I calculate the maximum possible number of combinations for this digit?
127.255.255.255

I googled the answer and it's:

(27-2) + (214 - 2) + (221 – 2) = 2,113,658

But I can't understand the reason why? Can somebody explain to me please?

>> No.6124825

>>6124820
my bad, I pasted the answer but it came out wrong, it shouuld be:

<span class="math">(2^{7} - 2) + (2^{14} - 2) + (2^{21} – 2) = 2.113.658.[/spoiler]

>> No.6124838

>>6124825
So, can somebody explain why this is the calculation?

>> No.6124907

what digit? 127.255.255.255 looks like a fucked up ip adress

>> No.6124917

>>6124907
an ip address is a number. and it's not a "fucked up ip", it's the maximum ip adress for a class a network. I need to calculate the max number of ip addresses for a network, but I don't understand the calculation.

>> No.6124924

>>6124917
Convert it the HEX first.

>> No.6124950

>>6124924
it alredy is ni hex, should I convert it to binary? or what system?

>> No.6124975

>>6124924
IP = 127.255.255.255
HEX = 7FFFFFFF
Decimal = 2147483647
Binary = 1111111111111111111111111111111

This is not helping much

>> No.6124985

>>6124950

He's just trolling. The equation is actually this:

256^3 -2 = 16,777,214

Look at it this way. You have your class A address, which is 127. You then have three octets each containing 256 addresses. 256 x 256 x 256 = 16,777,216

Why are there two numbers missing in the actual answer? Those are the network and broadcast addresses, which are reserved and don't "count" towards the total. Total number of usable addresses in 16,777,214

>> No.6124993 [DELETED] 

>>6124985
Thank you very much man!

>> No.6125000

>>6124985
wait, you calculated for 255.255.255, what about the 127? is it added or multiplied?

>> No.6125001

>>6124993

No problem.

>> No.6125009

>>6125000
256 * 256 * 256 * 128

use the multiplication principle

>> No.6125013

>>6125009
Oh now I see, so the final result is more or less 2,130,706,178. It seems a bit high... and the books says the answer is 2 million. Well, anyways, thanks

>> No.6125028

>>6125000

Neither. The 127 is left alone because it's the actual address you're using, if that makes sense. There are only 128 class A addresses in the world, and each one contains 16,777,214 usable host addresses. 127 is separate from other class A addresses.

Basically there are 8 network bits in a class A address with 24 host bits. Since bits are just ones and zeroes, and if you have all your bits on 1, you can do 2^24 and get 16,777,216. Again, two of those are reserved for network/broadcast so subtract two.

Another class A address, let's say 57.255.255.255, would have the same number of its own host bits and therefore ~16.8 million addresses of it own. To figure out the total number of addresses in the world, multiply 2^31 since you have to leave 1 bit for every address to share. It's around 2 billion or so.

>> No.6125030
File: 56 KB, 225x220, how_horrifying.jpg [View same] [iqdb] [saucenao] [google]
6125030

>not using IPv6

>> No.6125034

>>6125028
I got kinda confused.. But ok, thanks :)
>>6125030
lol, i'm learning the history if TCP, ofc it started with ipv4

>> No.6125040
File: 223 KB, 900x675, 1379906553165.jpg [View same] [iqdb] [saucenao] [google]
6125040

>>6125030

>using hex
>not just adding 16 more bits to the 32 bit IPv4 system to cover your bases for the next million years

>> No.6125046

>>6125034

Anytime. I think your book may be wrong about the number of addresses. Think of the IP address as two separate parts with spots for bits; one containing your eight network bits (01111111, which equals 127) and the other part containing your twenty-four host bits (11111111.11111111.11111111, or 255.255.255 or 16,777,216).

If you get confused you can always write out the address with a break between certain octets, like I did.

Class A:
_ _ _ _ _ _ _ _. | _ _ _ _ _ _ _ _. _ _ _ _ _ _ _ _. _ _ _ _ _ _ _ _.

127.255.255.255 would be this:
01111111.11111111.11111111.11111111

Class B:

_ _ _ _ _ _ _ _. _ _ _ _ _ _ _ _. | _ _ _ _ _ _ _ _. _ _ _ _ _ _ _ _.

Class C:

_ _ _ _ _ _ _ _. _ _ _ _ _ _ _ _. _ _ _ _ _ _ _ _. | _ _ _ _ _ _ _ _.

>> No.6125056

>>6125046
Now that's really helpful! Thanks a lot, I saved it into a txt file

>> No.6125062

>>6125056

Sure thing. I'll keep this thread open in my browser in case you have any other questions. Post away if you're wondering about something.

>> No.6125067

>>6125062
Yeah now that you mention it, a class B network starts at 128.0.0.0 and goes up to 223.255.255.255
If I'm not mistaken, it'd be 255^3, and multiplied byyyy... (223 - 128)?

>> No.6125094

>>6125067

Close, but you're going the opposite direction.

The exponent of 3 (as in 256^3) is only for class A addresses. It's the number of complete octets they have for host bits. One octet (eight bits) kept for the network address, and three octets (twenty-four bits) for the hosts. That's why it's to the third power.

Class B addresses have two octets for the network bits (a total of 16 bits), and two octets for host bits. Two octets means to the second power, so 256^2 equals 65,536.

You don't have to multiply by the range of network addresses. Since each one is unique to a network, you don't mess with them and only concentrate on the host bits because your network address is yours and can't be changed.

Another way to look at this is as a hierarchy.
Class A addresses each contain ~16.77 million hosts. They are the largest networks, and usually governments, large companies, and service providers have a class A address (again, there are only 128 of these addresses total so you have to be a big player to have one).

Class B addresses contain 65,534 hosts. Usually these are medium-sizes companies, universities, and sometimes local government. Many class B addresses make up a single class A address.

Class C addresses each contain 254 hosts. Local schools, apartment complexes, small businesses, and even homes have class C addresses (although a home would probably let most of those 254 hosts go unused). Many class C addresses make up a single class B address, which in turn make up a single class A address.

There are class D and E but they aren't used for networks. You can read about them if you want to. The reason I've subtracted two addresses from each class is because two of those potential address are always reserved for network and broadcast, so you subtract them.

>> No.6125100

>>6125094
Thanks again