Skip to main content

Computer Networks | IP Address and Network Address Classification

Sending a data packet between to different entities can be classified into two major categories.

  1. Unicasting : A one to one data transmission between a single sender and receiver.
  2. Broadcasting : Where there is only a single sender but multiple number of receivers are participating in data transmission.

IP(Internet Protocol) address is the unique identity allocated to each and every machine on internet.

IP version 4 (IPv4) address is a 32bit number, which is combination of Network ID and Host ID. Usually represents using dotted decimal notation (example: 172.27.172.27).

There IP address are grouped into five classes, based on the size of sub-networks possible under each network group.

The first octet of a IP address means 8 bits starting from most significant bit.

The value of fist octet decides the class of IP address as shown.

Class Name Range of First Octet Reserved bits for Network ID Reserved bits for Host ID
A 0 - 126 8 bits | 0xxx xxxx 24 bits
B 128 - 191 16 bits | 10xx xxxx 16 bits
C 192 - 223 24 bits | 110x xxxx 8 bits
D 224 - 239 - -
E 240 - 255 - -

A IP with the whole Host ID part is zero represents Network ID of a groups of hosts.

Let IP of a computer P is 1011 1010. 1110 0110. 1000 0110. 1110 0110, which is belongs to class B.

Since class B uses Host ID of 16 bit, by assigning third and fourth octet of IP to zero, we can obtain the ID of network to which P belongs.

Here ID of network will be 1011 1010. 1110 0110. 0000 0000. 0000 0000

Major components of a data packet will be source IP, destination IP and the data.

There are two kind of of broadcasting.

  1. Limited Broadcasting
  2. Broadcasting of a data to all hosts of network in which the sender resides.

  3. Directed Broadcasting
  4. Broadcasting of a data to all hosts of a remote network , where the sender resides in different network.

The IP address 255.255.255.255 used as destination IP for limited broadcasting.

IP 255.255.255.255 is known as Limited Broadcast Address(LBA).

The Directed broadcast address is formated by raising all the bits of Host ID part of any network to one(1).

For example 12.255.255.255 is directed broad can address of the network 12.0.0.0

By setting destination IP as 12.255.255.255 as host a different network can send data to all the hosts in the network 12.0.0.0

Since every network has a Network ID and Directed Broadcast ID, the there will be a reduction of two IPs form total available IPs of netwrok.

Example :

IP Address Class Network ID Limited Broadcast Address Directed Broadcast Address
27.172.27.172 A 27.0.0.0 27.255.255.255 255.255.255.255
197.32.37.32 C 197.32.37.0 197.32.37.255 255.255.255.255
252.10.192.1 E - - -

Comments

Popular posts from this blog

Operating Systems | Scheduling Algorithms : Round Robin

Round RobinFeatures : Most popular algorithm of allPractically implementableImplementable with basic data structures like queueExtremely lesser starvationOptimum efficiency can be set by controlling time quantumThe round robin algorithm will continuously switch between processes if a process in CPU (under execution) exceeds a time limit set by OS called time quantum.Flow Chart :Scheduler allocated process to for execution.CPU starts monitoring the execution time right after from allocation.If the process completes its execution before exceeding time quantum, OS forwards the process to termination state.else, the processes gets preempted once the time quantum limit exceeded and if the process finished at this moment, OS moves the process to termination state, else it moves to ready queue and iterates over the whole process listed above.Example : Consider the following table of processes and calculate completion time, turn around time and waiting time using Round Robin algorithm.Assumpt…

Operating Systems | Scheduling Algorithms : SJF

Shortest Job First(SJF)SJF algorithm schedules the shortest job(low burst time) available on main memory at the time of context switching in ready state . It can be either preemptive or non-preemptive depending on the nature of scheduler.Since the SJF select the job which is shorted among available jobs on main memory, Non-preemptive SJF algorithm will have larger waiting time if a job with longer burst time get scheduled first. In short SJF is also vulnerable to Convoy EffectTo find shortest process among min-heap would be the best data structure to be usedExample : Consider the following table of processes and calculate completion time, turn around time and waiting time using SJF algorithm with the following assumptions. No preemption.No I/O request will be there from any process.Arrival time is relative to CPU on time.Process NumberATBT103222324442View Answer

The execution of processes can be visualized as follows : By analyzing above representation completion time, turn around ti…

Operating Systems | Concept of shared memory and critical section

While printing your document opened in Adobe Acrobat Reader, if you gave a same command for document opened in Microsoft Word! How will it be?These are the real time situations where two processes competing together for same resources due to improper process synchronization. An unstructured access approval to these resources may lead to a abnormal output or a breach in information security or even it may cause for data loss. In the above case which might be a bunch of over-written papers coming out of the printer connected to that system.

Shared Memory and Critical Section Resources or memory spaces where different processes have access to read, write or update at same time are known as shared memory.And the piece of program which tries to access the shared memory is known as Critical Section. There are situations where an operating system need to handle multiple request from critical sections of various processes in a machine, in order to maintain data consistency in resources