Why TCP/IP?: All Devices On A Same Network Must've Their Network Id Same
Why TCP/IP?: All Devices On A Same Network Must've Their Network Id Same
Why TCP/IP?
Most widely/commonly used, all internet run/work on TCP/IP.
We will discuss what is TCP/IP, its addresses, classes, static/dynamic, sub netting, masking.
IP address: Any device in TCP/IP network that generates/receive/transmit data (it can be a core
device like router/gateway) is assigned a unique IP address (which is its identification in the
network). All devices (computer) in our class will come to TCP/IP network when it will be assigned
a unique IP address. IP address is of 32 bits (4 bytes), 1 byte has range between 0-255.
Standard written format
Some part of IP address show Network id (means a common id of a network, all devices on a same
network must’ve their network id same, a machine can ping to other machines if they both are in
sane network), some part show Host id(means a unique id of every system/device connected to
that network).
Example: 192.168.10.13
Let’s say yellow part is network id (means all devices on this network must have the same network
id)
Green part is host id (unique id of the system on this yellow network, we cannot assign same ip to
two different systems as there will be conflict, data packet will be confused to go on either system)
Example: 192.168.10.13 (here three bytes are used for network id, but we can also use only 2 bytes
e.g (192.168.10.13) for network id) Here is a question. How we/system come to know which part is
network id & which part is host id? This we know from subnet mask.
Practical example: When we enter IP in windows, its subnet mask automatically appears suddenly
in the below row. But we can change it if we want. It writes itself automatically on what bases & by
changing it what we can do. Discussed below
127 is missing in above addresses, it is used for loopback – loopback means if you will ping any
device from 127.0.0.1 it will refer to itself.
Note: we cannot use the first & last possible IP of any network. Because that is used for
broadcasting. All possible combinations minus 2 will be number of devices that be connected in the
network.
What is Ping?
Ping is a command that send a small data packet from source to destination to check if the
connection is established & second is if that machine is alive/active or not. One device can ping to
the other device. For e.g you are on 192.168.10.11 and your friend is on 192.168.10.12 so you both
can ping each other.
Two devices 192.168.15.19 (255.255.255.0) & 192.168.15.20(255.255.0.0) can’t ping each other as
they both are on different networks. Hence we can change subnet mask of the first device to bring
them on same network as below.
192.168.15.19 (255.255.0.0) & 192.168.15.20(255.255.0.0) now they both can ping each other.
That’s mean we can play with subnet mask.
Multiple switches can be part of one network. Or there can be multiple network within one switch.
All devices in class are connected to one switch now we can keep all devices in one network or in
multiple networks. (With previous reference in switches)
In our class we are using a network so every computer should’ve a unique IP address but we’ve
also to provide internet to every machine so we will use gateway. As these both are different
networks and gateway connects two networks.
Now for e.g I set an IP on my system which exists on internet already. So there will be conflict.
Hence a standard is made that we have to use only a reserved range of IP while creating a LAN.
These IPs are called private IPs.
Class A: 10.1.1.190 – IP address Range: (1.0.0.1 to 126.255.255.254)
IPs that starts with 10 are private IPs.
We can use same private IPs in different buildings. There will be no conflict now as there will be no
connection b/w them. When there is a chance of conflict? It’s when all these systems will come to
internet. So when our systems will go to internet it’ll switch to public IP so there is no chance of
conflict. Our ISP assign IP to our gateway will be different than those from other buildings.
All public IPs are divided by ITU in all countries, Pakistan has a range of public IPs and India has its
own range. Now every country divide that range in ISPs. ISPs divide that range in their customers.
Hence there is no chance of conflict. Netting is used to handle multiple servers using one public
IP.
Sub-netting
What if I buy 5 public IPs from brainnet.
& BOP also buy 5 public IPs from brainnet. So we can ping each other as we will be sharing same
network ID. If we are on a class c network then there will be other 249 user with which we have
same network id. So they can ping us sub netting was introduced to avoid this problem.