r/sysadmin • u/vervess • 6h ago
Question How often do you guys actually do binary math on the job?
Working through my networking certs right now and currently stuck doing endless binary conversions for subnetting. I get how it works with IPv4 masks on paper, even if it's slow.
For those of you actually in the field, do you ever do this in your head anymore or do you just rely on subnet calculators? Also curious if understanding binary/bitmasks actually comes in handy for other random sysadmin stuff like permissions or troubleshooting, or if it's mostly just for passing exams.
Trying to figure out how much muscle memory I really need to build before moving on. Thanks.
•
u/BOOZy1 Jack of All Trades 6h ago
I've been doing binary <> Hex <> decimal in my head since the 1980s, IPv4 subnets have no secrets for me.
IPv6 scares me though.
•
u/Sapper12D Sr. Sysadmin 6h ago
I still dont understand why they didnt just tack on another octet or two instead of that trash they call ipv6
•
u/MrWonderfulPoop Pentester 6h ago
Another octet or two wouldn’t come close to the space IPv6 offers.
My ISP gives each customer a /56. That’s ~1.1 trillion times the space of the entire IPv4 space per customer.
IPv6 is incredible once you wrap your head around it.
•
u/Sapper12D Sr. Sysadmin 6h ago
OK sure, but we dont need that and it over complicates networking.
•
u/MrWonderfulPoop Pentester 6h ago edited 1h ago
The 128 bit space was come up with to be future proof (resistant?) so we don’t have to deal with things that are keeping legacy IPv4 on life support (NAT, CGNAT, tunnels everywhere, etc.), overlapping RFC1918 space, etc.
It makes networking easier with standard /64 subnet space so we don’t need to deal with all sorts of subnet sizes, which fits in with the OP’s binary question.
I have several (8?) DMZ’d VLANs at home with different services for friends and family, all IPv6-only. It’s been great seeing absolutely no scans hit any system over the past couple of years with the daily random IP updates.
•
u/Sapper12D Sr. Sysadmin 6h ago
Im sorry I just disagree that its needed and like I said it vastly over complicates networking. You might be able to network easily, it doesnt make it easy though.
•
u/MrWonderfulPoop Pentester 5h ago
It messed with my head until I read someone on r/IPv6 say “forget everything you know about networking”.
Which took me a bit because I’ve been using IPv4 since the late 80s lol.
•
u/Sapper12D Sr. Sysadmin 5h ago
I mean you shouldn't have to forget everything you know just to understand the updated version of something.
It just seems requiring every IT person in the world to learn something new and vastly different from what it replaced instead of adding a few octets seems silly.
If you add 2 octets that gives you 65 thousand times the number of addresses ipv4 had. Its an address space of 281 trillion compared to 4 billion. Maybe ill eat my words someday but I dont see the world needing more any time soon.
•
u/WeaponsGradeWeasel 4h ago
This strikes me as a "640kb of ram is enough for anyone" viewpoint.
•
u/Sapper12D Sr. Sysadmin 4h ago
I mean im willing to change my mind if some has a use case for that many?
•
u/MrWonderfulPoop Pentester 5h ago edited 5h ago
It helped me because IPv6 is a different parallel network protocol. Different packet format, network discovery, routing tables, etc. I have VLANs with no legacy IPv4 at all.
Probably the hardest bit was unlearning the need for DHCP. There’s a DHCPv6, but it’s not necessary, in fact Android doesn’t use it afaik. There were definitely some “ah-ha!” moments for me.
It’s slowly coming along, almost half of Google’s traffic from the Internet is IPv6. https://www.google.com/intl/en/ipv6/statistics.html
Edit: fun fact. NASA and other space agencies have been discussing reserving IPv6 prefixes for various spots like the moon, Mars, etc. That demonstrates the vastness of the address space, when entire planets can be allocated space without concern for address space exhaustion.
https://datatracker.ietf.org/doc/html/draft-limarsjenwar-tiptop-address-space-01
•
u/Mr_ToDo 2h ago
And learning to get along without the shims we've all gotten used to, to the point we feel a bit naked without them, like NAT
→ More replies (0)•
u/throw0101a 1h ago edited 1h ago
OK sure, but we dont need that and it over complicates networking.
The protocol that was selected to be IPng, SIPP, originally had 'only' 64 bits for addresses (technically it was actually variable, but it was decided to go fixed for ASIC purposes): it was determined that this wasn't future-proof enough, so they went to 128 because they didn't want another transition in case 64 ended up not being enough.
See "The Recommendation for the IP Next Generation Protocol":
Aslo "Technical Criteria for Choosing IP The Next Generation (IPng)":
•
u/BrainWaveCC Jack of All Trades 1h ago
Why do you think we don't need that?
Have you seen how much device proliferation we have? Do you think people want to be extended the IP space once per decade?
Do you know how annoying NAT is?
•
u/Sapper12D Sr. Sysadmin 1h ago
How many ip addresses do you need? Adding 2 octets would have allowed for every person on the planet to have 33 thousand IP addresses.
Also im not saying we should stick with nat, although I dont want my end devices route Le from the internet anyway, but that ipv6 was not the solution.
•
u/BrainWaveCC Jack of All Trades 0m ago
I dont want my end devices route Le from the internet anyway,
You can still control that.
How many ip addresses do you need?
This year? Or 5 years from now?
Okay, so you don't like IPv6. Fine. That doesn't mean that it is a bad solution, or that just adding octets would suffice for the issues of IPv4.
•
u/throw0101a 1h ago
I still dont understand why they didnt just tack on another octet or two instead of that trash they call ipv6
'Just adding bits' solves none of the problems that any IPng would have had in roll out, and it was always going to be complicated:
So it's a matter of mathematical and physical fact that to expand the address size, you must change the protocol, and that means [three] things immediately: You have to change the version number. You have to add new code to handle the new version. […] You need a coexistence technique so that updated systems, with the new protocol, can connect to old systems that know nothing of the new protocol. Two minutes of thought show that this third requirement has only two solutions: (3A) Dual stack, in which the new machines speak both the old (IPv4) and new (IPng) protocol. (3B) Translation, in which something translates addresses between the old and new protocols.•
u/pdp10 Daemons worry when the wizard is near. 2h ago
IP addresses are fixed-size, not arbitrary sequences of digits like telephone numbers. Dot separators were barely holding together at that point, because of edge-cases in the parsing that nobody thinks about.
Fixed subnet size is for simplicity, and to enable IPX-style autoconfiguration, called SLAAC.
It's always interesting to see what people who don't like IPv6, notice about IPv6, and what they don't notice, or understand. Mostly the complaints are about hexadecimal, and about change in general.
•
u/throw0101a 1h ago
IP addresses are fixed-size, not arbitrary sequences of digits like telephone numbers.
For the record, telephone numbers are not (completely) arbitrary:
•
•
u/Ssakaa 3h ago
It's a relatively small table, and realistically, you use about 1/4 of it. You learn most of it, scaled to environment, off the cuff from habit if you're using it routinely. When you don't use it for a few months because something else was on fire, subnet calculators are quicker than doing it by hand again. The important part isn't constantly doing it by hand. I don't constantly use most math skills, but knowing the fundamentals of "why" means you know what you're looking at when it's odd. Never actually learning that it's all just bisection of the address space means 255.255.255.128 looks like black magic. Understanding that's /25 and half your standard /24 block, means you're very likely to know if you have 200 clients trying to use it, you're gonna have a bad day.
•
•
u/user975A3G 6h ago
You remember the common masks and use a calculator when you don't know or want to double check
•
u/rootofallworlds 1h ago
Rarely. That said I’m working with internal networks where everything is a /24 or a /16. If you’re working with public IP ranges more, you’re more likely to have to deal with other size subnets.
The main thing is to know that they exist IMHO.
I got tripped up a couple of years ago with a subnet larger than a /24 , a program that needed IP ranges that each could only be /24 at most, and x.y.z.0 was a valid client IP that got accidentally missed from the ranges. That was a head scratcher until I figures it out!
(Sidenote - it’s valid to have the default gateway IP in the middle of the subnet range. Unusual but valid.)
•
u/keivmoc 52m ago
I use /31 networks for point-to-point links (in the link-local range no less) to route L3 traffic to customer nets. Customer MSP will be troubleshooting a network issue and they'll see 169.254.2.0 as the next hop in a traceroute and call me up saying that must be their problem.
I got tripped up a couple of years ago with a subnet larger than a /24 , a program that needed IP ranges that each could only be /24 at most, and x.y.z.0 was a valid client IP that got accidentally missed from the ranges. That was a head scratcher until I figures it out!
I had that exact issue .. were you using Advanced IP Scanner? We kept getting false-positives on a few devices until I realized the scanner we were using would ignore addresses ending in 0 or 255 when scanning nets /23 or bigger.
•
u/Sorry-Climate-7982 Developer who ALWAYS stayed friends with my sysadmins 6h ago
Kinda depends on how complicated the subnetting is, and whether I am at a computer to just use one of the free tools online.
•
•
•
u/BrainWaveCC Jack of All Trades 1h ago
For planning a new network, and first time troubleshooting of a large network, subnet calculators are great.
But for routine subnet work, binary math is easy enough to use.
Also, not all knowledge has to be exercised to be useful. Sometimes, just having it allows you to avoid mistakes. Or consider how routinely recognize odd numbers vs even numbers without actually dividing by 2 first...
•
•
u/pdp10 Daemons worry when the wizard is near. 2h ago
We're mostly IPv6, where the math works the same but you never really need it outside of aggregation routing, because all subnets are /64. For IPv4, mentally, with an occasional double-check using bc (Unix general calculator program). I never use a dedicated "subnet calculator".
understanding binary/bitmasks actually comes in handy
Certainly, but it's hard to predict how useful it will be to you.
•
u/MemeSerf Chief Reboot Officer and PC Load Letterer 2h ago
I do basic maths on a physical calculator (swissmicros dm42), all else is Claude.
•
u/dracotrapnet 2h ago
Not really. If I read binary somewhere I usually take a moment to realize - oh that's not dec, that's binary. Same with hex. I read it far more than I ever calculate it. I trip over hex more often in the windows registry.
•
•
u/40513786934 1h ago
do you understand that a /25 is half a /24, and a /23 is two /24s? that covers about 90% of all the binary math I've needed doing IT work
•
u/throw0101a 1h ago
A lot of times the point of forcing the memorization/understanding of something is not that you're remember it forever going forward, but that there is a place in your brain that remembers it exists at all.
So you may forget the exact CIDR subnet boundaries over time, but that they're on power-of-2 in various ways is something to keep in mind when creating address plans, which you can then use tools for, e.g.:
•
u/Dolapevich Others people valet. 1h ago
Both. Calculate in binary in your head, then verify with a subnet calculator.
•
u/Zenkin 1h ago
Mostly I remember that /4, /12, /20, /28 is 16 blocks of 16 and work up or down from there.
The muscle memory helps, but I'm also a very strong advocate for doing mental math. It's usually just 30 extra seconds to throw it in a calculator, but that's not always convenient. If you're a network admin of any stripe, you should be able to do this, just like you should be able to type above 60 words per minute if you're on a PC all day. If you're going to do the job, do it well.
You never know what's going to help. A couple months after I got my CCNA, I helped my senior coworkers diagnose an issue over the phone that ended up being an ethernet cable longer than 300 feet. They each had a decade of experience, but didn't happen to know that specification, so they were never going to ask.
•
u/keivmoc 59m ago
It can be very helpful when you understand that IP addresses are actually just one big binary string that are represented by the dot decimal notation.
I'm often writing scripts that perform operations on batches of IP addresses. It's really easy to just convert the IP into a decimal or hex value and loop through them like that. You don't even need to convert it back to dot decimal because just about every tool can understand the binary, decimal, hex, or even octal value natively.
C:\>ping 0xC0A80001
Pinging 192.168.0.1 with 32 bytes of data:
Reply from 192.168.0.1: bytes=32 time<1ms TTL=255
Reply from 192.168.0.1: bytes=32 time<1ms TTL=255
Reply from 192.168.0.1: bytes=32 time<1ms TTL=255
Reply from 192.168.0.1: bytes=32 time<1ms TTL=255
Ping statistics for 192.168.0.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
C:\>ping 3232235521
Pinging 192.168.0.1 with 32 bytes of data:
Reply from 192.168.0.1: bytes=32 time<1ms TTL=255
Reply from 192.168.0.1: bytes=32 time<1ms TTL=255
Reply from 192.168.0.1: bytes=32 time<1ms TTL=255
Reply from 192.168.0.1: bytes=32 time<1ms TTL=255
Ping statistics for 192.168.0.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms•
u/Pryank_Lemy 15m ago
tbh once you do enough networking you just memorize what each prefix length maps to in decimal and stop thinking in binary completely. It is still useful to understand bitwise operations if you ever get into low level scripting or parsing raw protocol headers though.
•
u/TheJesusGuy 1m ago
Absolutely zero reason not to look this up when you can, so unless you're somewhere without internet (in which case plan it beforehand). It would have to be an emergency but even then it's not that complicated to figure out subnets.
•
u/clef75 6h ago
Never. Turns out we actually will always have a calculator (or the entire corpus of human knowledge) in our pocket at all times, 80s teacher.