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 bigger numbers than 1 or 0.
How that is done, 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 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. My explanation tries to give the general idea or facts that may likely not change too much or come closest to the truth.
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 last 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




Reply With Quote
Bookmarks