Stripping/ Splitting up Parts of IP addresses
Background
IP Address
Each network running TCP/IP must have a unique network number, and every machine on it must have a unique IP address. It is important to understand how IP addresses are constructed before you register your network and obtain its network number.
The IP address is a 32-bit number that uniquely identifies a network interface on a machine. An IP address is typically written in decimal digits, formatted as four 8-bit fields separated by periods. Each 8-bit field represents a byte of the IP address. This form of representing the bytes of an IP address is often referred to as the dotted-decimal format. ( https://docs.oracle.com/cd/E19504-01...471/index.html )
That means in simple English that we have something somewhere actually like in this sketch below, which is 4 lots of similar 8 digit bits, and each bit, (called a Bit, in computing), can be in either of two states, 0 or 1. ( 8 Bits is often regarded as a fundamental unit in computing and is given the name Byte )
As is typical in computing, it is organised in a so called "binary" way , meaning that we can make/ realise bigger numbers than 1 or 0. There are a few conventions in how this is done, IP addresses use one of the historically most common
How that is done, perceptually speaking, demonstrating with emphasis on our IP address explanations, can be best seen with a simple example.
For example in the below example I am representing an IP address of 255.32.65.2 (I am trying to do it in a way that somehow gives an insight into the deep down 4 Byte 32 Bit representation form of a computer or it's software stuff We may not directly need to know that, but it can be useful indirectly as time goes on as we may get necessarily more into the subject )The series of 0s and 1s above is schematically somewhere close to what is actually going on somewhere deep down in the computer innardsCode:' 128 64 32 16 8 4 2 0 | 128 64 32 16 8 4 2 0 | 128 64 32 16 8 4 2 0 | 128 64 32 16 8 4 2 0 ' 1 1 1 1 1 1 1 1 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 1 0 ' 128+64+32+16+8+4+2+1=255 0+0+32+0+0+0+0+0=32 0+64+0++0+0+0+0+1=65 0+0+0+0+0+0+2+0=2 ' 255 32 65 2 ' ' 255.32.65.2
, and the 255.32.65.2 is how we as Humans choose to speak about it in an easy way….
IP Address Parts
I prefer to keep it easy in Laymen terms, especially as these things tend to change a bit and we are not always told accurately how etc., and that tendency is certainly increasing. (I think we all know that, but it is a question of whether we choose or are strong enough to believe it.
My explanation tries to give the general idea or facts that may likely not change too much and therefore come closest to the truth for as long as possible, So….
In the simplest terms:
_ Numbers towards the right may identify a specific device such as a computer, or individual;
_ The numbers towards the left are likely to somehow reveal the larger entity, such as an organisation, or some big thing that is trying to get at you.
For our purposes here we are wanting to get at the bigger entity, or at least to identify it. ( The final physical individual can easily change, be replaced, or subject to a lot of actual physical violence, possibly by me. I prefer to deal with that personally, usually physically as much as possible, in a more Human and if possible Humane way. )
So
I am wanting to develop some coding to help me get at the lefter parts of the IP address. Initially that is to see if it helps me get any useful information quickly.
Using the above example, getting something like
255.32.65
, or
255.32
, in an efficient way might be useful.
I will take a look at doing that in the next post, but here is an important aside
Aside: Dotty Excel Cells
We would normally from now on be playing around with numbers and dots in an Excel cell.
This gives problems, often bad ones. It is not a question of if, but when and how bad.
There is almost always ways to fix the problem, but it will simplify things a lot if from the start if, at the outset, I change all the dots,
.
to a pipe,
|
In all lists and analysis I will keep to this convention, or go over to it as it is convenient by updating or writing new codings and only convert back to dots if I have a specific need to.
It is annoying to have to go backwards and do this. I preferred not to do it, often in the past taking the advice of much smarter people than me, saying we should keep it simpler with the dots and things would be OK, and problems we could get over.
But this simplification, or rather the absence of and therefore saving of coding etc. for the extra conversions necessary, initially and possibly any thereafter, etc, that all finally turned out to be a false economy for me so far.
(For me personally this sort of problem of Excel changing formats on things looking somehow like numbers, dates, times etc. has proved never to be 100% possible to overcome fully, without taking some more drastic step such as I am doing from now on with IP address?




Reply With Quote
Bookmarks