Rakesh Jain
Rakesh Jain

@devops_tech

28 Tweets 15 reads Mar 01, 2023
Network Fundamentals -
Basics of Network IP Addressing
A Detailed Thread 👇
Basics of IP Addressing in Linux -
Each device connected to the internet has a unique identifier knows as an IP Address.
An IP address is a 32-bit binary number that is assigned to a computing device such as a PC, Tablet, or smartphone in an IP network.
Most of the networks today, including all computers on the internet uses the TCP/IP as a standard to communicate with each other.
In the TCP/IP protocol, this unique identifier is the IP Address. The two kinds of IP Addresses are IPv4 and IPv6.
When devices communicate with each other over a local area nw, or "LAN", or across the internet, the message transmitted is ultimately directed to the target device's nw hw address that is programmed into the device by the manufacturer.
Unfortunately, MAC's r not helpful 4 routing comm'n msgs outside of a small no. of locally interconnected devices bcz dey r randomly scattered arnd d world, i.e, a device wid a MAC addr of 10:20:30:40:50:60 cud be in Delhi & anthr wid mac addr of 10:20:30:40:50:61 cud be in Seoul
To enable devices to find each other easily no matter where dey r in d world, d creators of d Internet came up wid a logical addressing scheme dat made it much easier for devices to find each other. These logical, Internet Protocol, addresses r commonly referred to as "IP addrs".
IP Terminologies -
Bit - This is a single digit, represented either as 1 or 0
Byte - This is a collection or series of 8 bits. 1 byte = 8 bits
Octet - An octet comprises 8 bits or 1 byte
An IP address is segmented into 4 octets or bytes. Each octet has 8 bits.
As IP address can be depicted in the following ways:
Dotted-decimal form -
For example 192.168.1.5
Binary form - 11000000.10101000.00000001.00000101.
Hexadecimal form -
c0.a8.01.05.
All the above notations represent the same IP address.
The hexadecimal format is rarely used.
Classful Routing -
Message routing devices or "routers" that transfer messages from one organization to another use a highly structured method of IP addressing called "classful routing", where IP address ranges are grouped into five classes.
IP Classes -
Typically, the IPv4 space allows us to hv addrs b/n 0.0.0.0 to 255.255.255.255. Hwevr, some no's in dat range r reserved 4 specific purposes on TCP/IP nw's.
These reservations r recognized by TCP/IP addressing Authority the Internet Assigned Numbers Authority IANA
0.0.0.0 — This represents the default network, which is the abstract concept of just being connected to a TCP/IP network.
255.255.255.255 — This address is reserved for network broadcasts, or messages that should go to all computers on the network.
127.0.0.1 - This is called d loopback addr, meaning ur device's way of identifying itself, whether or not it has an IP addr.
169.254.0.1 to 169.254.255.254 - This is d Automatic Private IP Addressing (APIPA) range of addr's assigned automatically wen a device doesn't get dhcp ip
IPv4 address can be categorized into 5 classes:
Class A
Class B
Class C
Class D
Class E
Class A, B, and C which are mostly used in host systems.
Class D is used for multicast and E is mostly for research and experimental purposes.
Class A. This is the biggest class boasting of 16,777,216 IP addresses that can be assigned to hosts and the least number of assignable networks which are 126 by default.
Use-
Class A is used by organizations requiring very large size networks like NASA, Pentagon etc.
Class B which has the second-highest number of possible IP addresses which are 65,534 and 16,384 assignable networks by default.
Use -
Class B is used by organizations requiring medium size networks like IRCTC, banks etc.
Class C which is the smallest class yielding only 254 possible IP addresses and 2,097,152 assignable networks by default.
Use-
Class C is used by organizations requiring small to medium size networks.
For example- engineering colleges, small universities, small offices etc.
All the classes of IP Address are summarized in the following table-
Classless Inter-Domain Routing (CIDR) -
D no. of class "A", "B" and "C" IP addr ranges is severely limited, so wen an org obtains an IP addr range, dey usually obtain a number of class "C" ranges, or if dey r lucky, a class "B". Obtaining a class "A" addr range is highly unlikely
Fortunately, the development of d Classless Inter-Domain Routing (CIDR) method of IP addressing & routing gave org's d opportunity to easily segregate any of their classful IP addr ranges or "networks" into a number of sub-ranges or "subnets" through d use of "subnet masks".
Subnet masks -
Each Internet router dat uses classful routing knows dat any IP addr starting with 0-127 is a class "A" addr with a nw identifying component 1 byte in length. Any IP addr beginning wid 128-191 is a class "B" addr, so d nw component is two bytes in length, etc.
But when an org'n needs to break up its class "A" or class "B" nw into a number of class "C"- or other smaller-sized subnets, its routers cannot rely on the initial byte of d IP addr to tell it anything about the length of the network identifying component of the subnetted addrs.
To provide the routers with this information when using classless routing, you must specify the length of the network identifying component of the subnet's IP addresses through the use of a "subnet mask".
CIDR notation -
Since many of us r not very efficient binary calculators, CIDR provides a simpler method of expressing d mask merely by indicating the nw addr (i.e d first addr in d IP addr range) followed by a slash & d no of bits dat r in d nw identifying component of d IP addr
Routable address vs. Non-routable addresses -
Were we to give every device in the world its own unique IP addr, we would have run out of addresses a long time ago.
So Internet Engineering Task Force (IETF) decided dat, since most devices only need to be accessed within their org & never need to be accessed remotely, dey would reserve ranges of addrs dat every org can use for their internal device-to-internal device communication traffic.

Loading suggestions...