You are on page 1of 9

Q:-difference between network address and broadcast address?

Ans:-

In the context I believe you are looking for, the network address is the first address in a subnet, which
along with the number of significant bits or netmask, determines the range of the network. The network
address is not actually used for any devices.

The broadcast address is the last IP in that range, not used by any one device, but used to broadcast a
message to all IP addresses in the range. For example Windows peer to peer file/printer sharing
determines the names of other computers on the subnet by broadcasting to the entire subnet.

So for a 192.168.1.0 network address with either /24 for significant bits or 255.255.255.0 netmask, the
broadcast address is 192.168.1.255.

Q: difference between network address and host address:-

Ans:-

A host is a computer or other device that other devices can connect to for access to resources (files) or
services (web site/email/database/etc). A network is a collection of computers, cables, routers, switches
and other devices that are connected together to access and share resources.

OK here it goes, Host = device on NETWORK - i.e. Host=Computer1 = 192.168.1.1 - the NETWORK that
this is on is 192.168.1.0, now depending on the subnet mask is how far the HOSTS can go - for this
example lets assume that the subnet mask is 255.255.255.0 - that is the whole Class "C" range...so you
HOSTS are 192.168.1.1 - through 192.168.1.254, The broadcast net is 192.168.1.255 all on NETWORK
192.168.1.0. The REASON they have to be separate are the rules for IP- you cannot have devices on the
actual network as that how IP brodcasts out to others that it is a network.

ip add 192.168.100.2 and subnet mask 255.255.255.0 now 192.168.100.X is network id which is
used to identify from which network u belongs to and x is host id which is unique for every node
on network

The Network address identifies the specific network to which host is attached, and Host address
uniquely identifies a host within a network.

The distinction is important because router routes the packet according to a network address and
don't care about host address.
Are you talking about the network identifier IP? Each subnet has two IP addresses that can't be assigned
to an actual device (a host), which include the first and last IP addresses in the subnet range. The last IP
(.255 in your example) is called the broadcast address. Basically, if a host sends something to this
address, the router will forward it to everything else on that subnet, and that subnet only. The first IP (.0
in your example) is called the network identifier and is used to identify the subnet. You can't actually
give a host on the network that IP though.

192.168.1.7 would be the host IP (,i.e. of an individual device). The next figure you listed is a subnet
mask, which denotes which bytes comprise the network and which comprise the hosts. Your subnet
mask is of a /24 network, meaning that of the 32 bytes used used in an IPv4 address, 16 identify the
network and 8 identify the host.

The Network IP would really be 192.168.1.0. You've identified the router's IP address.

If you are referring to IPv4, then a host IP address would refer to a specific device on a specific network.
And an IP address that had the host number set to 0 would refer to that specific network.

For example assume a private class C space. The IP number for my computer might be something like
192.168.1.104 with a subnet mask of 255.255.255.0.

Then, you could say that my computer was on network 192.168.1.0 ....

Note:- Host address is the address of the device specific when we put the Zero(0) to the host part of ip
address it becomes the network address. Every ip address has the network part and the host part that
can be identified through subnet mask. In subnet mask all zero denotes the host part and others
denotes the network part. So when you put zero in in host part of ip address which can be identified by
the subnet mask it becomes network address.

An IP address is an numerical address assigned to a device on the network. Sort of like a house address
on a house in a city. A subnet is part of an IP that tells what area of the network it is assigned to sort of
like a Zip code, and the default gateway is a router on a network, and it allows access to other networks,
we could consider it the post man.

IP address - The number assigned to your computer, so it can communicate with other computers

Subnet Mask - Determines how many IP addresses you can use for your network. For example,
255.255.255.0 would allow you to use 254 IP addresses for your network.

Default Gateway - Think of this as the door to the outside world (internet). Without this, you cannot
communicate with any computers outside of your network.

what is the difference between net ID and host ID??


in a class C IP address say, 192.52.56.8 the first 3 octets denote the net ID while the last octet shows the
host ID. what are the 2 used for ?
again in a class B IP address say, 172.52.36.5 the first 2 octets show the net ID while the last 2 denote
the host ID.... what is the significance of the netID and hostID???

Its very simple mate.The network id is the id of the network & resembles the network.The host id is the
identification of the host in the network.

Class A:Network.Node.Node.Node
Class B:Network.Network.Node.Node
Class C:Network.Network.Network.Node

The above is the way upon which its classified depending upon which Class the IP address belongs to.

If there is a network with a number of subnetted networks.How will a packet arriving at the default
gateway/router determine where it should go?
It all comes down to the "network id"[net id] portion which makes it possible to locate the network.The
packet would then traverse its way through a switch/hub to the appropriate host with the help of the
host id.
Always remember routers dont care about hosts,all they care about is segmented networks.
I hope this helps.

Edit Article

How to Calculate Network and Broadcast


Address
For Classful NetworkFor CIDR

Edited by Kanhu, Sarah Eliza, Teresa, VC and 1 other

If you are going to set up a network, then you have to know how to distribute them. For this to
know network and broadcast addresses is very essential. So to know how to calculate network
and broadcast addresses if you have IP address and sub-net mask, see below steps.

EditMethod 1 of 2: For Classful Network

1. 1
For a classful network total bits is 8. So Total bits = Tb = 8.

o Sub-net mask can be 0, 128, 192, 224, 240, 248, 252, 254 and 255.
o Below table gives you the "Number of bits used for subnetting"(n) to their
corresponding subnet mask.

Subnet Mask 0 128 192 224 240 248 252 254 255
No. of bits used for Subnetting (n) 0 1 2 3 4 5 6 7 8

o For subnet mask 255 is default, so it'll not consider for subnet masking.
o For example: Let, IP address = 210.1.1.100 and Sub-net mask = 255.255.255.224

Total bits = Tb = 8

Number of bits used for subnetting = n = 3


(as subnet mask = 224 and its corresponding "No. of bits used for Subnetting" is 3
from above table)
2. 2

From the previous step, you got the "Number of bits used for subnetting"(n) and
you know the "Tb", then you can get "Number of bits left for host"(m) = Tb - n as
total bits is the summation of number of bits used for subnetting and number bits
left for host i.e. Tb = m+n.

o Number of bits left for host = m = Tb - n = 8 - 3 = 5


3. 3

Now you have to calculate "Number of subnets" = 2n and "Value of last bit used for
subnet masking"() = 2m. Number of host per subnet = 2m - 2.

o Number of subnets = 2n = 23 = 8

Value of last bit used for subnet masking = = 2m = 25 = 32


4. 4

Now you can find previously calculated number of subnets by separating subnets
each having "Value of last bit used for subnet masking" or addresses.

o The 8 subnets (as calculated in previous step) are

210.1.1.96 -
210.1.1.0 - 210.1.1.31 210.1.1.32 - 210.1.1.63 210.1.1.64 - 210.1.1.95
210.1.1.127
210.1.1.128 - 210.1.1.160 - 210.1.1.192 - 210.1.1.224 -
210.1.1.159 210.1.1.191 210.1.1.223 210.1.1.255
o Each of them has 32 addresses.
5. 5

Now you have to find that your IP address is in which subnet, that subnet's first
address is network address and last address is broadcast address.

o Here the taken IP address is 210.1.1.100 . 210.1.1.100 comes in 210.1.1.96 -


210.1.1.127 subnet (see the previous step table). So 210.1.1.96 is network address
and 210.1.1.127 is broadcast address for the taken IP address i.e. 210.1.1.100 .

EditMethod 2 of 2: For CIDR

1. 1

In CIDR, you have a IP address followed by bit-length prefix separated by slash(/).


Now you have to convert bit-length prefix to quad-dotted decimal representation. To do
this follow below steps.

1. Write the the bit-prefix in below format.


If it's 27, then write it as 8 + 8 + 8 + 3 .
If it's 12, then write it as 8 + 4 + 0 + 0 .
Default is 32, which is 8 + 8 + 8 + 8.
2. Convert the corresponding bit according to the below table and represent in quad-
dotted decimal format.

Quad-dotted
decimal 0 128 192 224 240 248 252 254 255
Representation
Bit-length prefix 0 1 2 3 4 5 6 7 8

Let IP address is 170.1.0.0/26 . Using above table, you can write:

26 = 8 + 8 + 8 + 2
255 . 255 . 255 . 192


Now the IP address is 170.1.0.0 and subnet mask in quad-dotted decimal
format is 255.255.255.192 .
2. 2

Total bits = Tb = 8.

o Sub-net mask can be 0, 128, 192, 224, 240, 248, 252, 254 and 255.
o Below table gives you the "Number of bits used for subnetting"(n) to their
corresponding subnet mask.

Subnet Mask 0 128 192 224 240 248 252 254 255
No. of bits used for Subnetting (n) 0 1 2 3 4 5 6 7 8

o For subnet mask 255 is default, so it'll not consider for subnet masking.
o From the previous step, you got IP address = 170.1.0.0 and Sub-net mask =
255.255.255.192

Total bits = Tb = 8

Number of bits used for subnetting = n = 2


(as subnet mask = 192 and its corresponding "No. of bits used for Subnetting" is 2
from above table)
3. 3

From the previous step, you got the "Number of bits used for subnetting"(n) and
you know the "Tb", then you can get "Number of bits left for host"(m) = Tb - n as
total bits is the summation of number of bits used for subnetting and number bits
left for host i.e. Tb = m+n.

o Number of bits left for host = m = Tb - n = 8 - 2 = 6


4. 4

Now you have to calculate "Number of subnets" = 2n and "Value of last bit used for
subnet masking"() = 2m. Number of host per subnet = 2m - 2.

o Number of subnets = 2n = 22 = 4

Value of last bit used for subnet masking = = 2m = 26 = 64


5. 5

Now you can find previously calculated number of subnets by separating subnets
each having "Value of last bit used for subnet masking" or addresses.

o The 4 subnets (as calculated in previous step) are

170.1.0.0 - 170.1.0.63 170.1.0.64 - 170.1.0.127


170.1.0.128 - 170.1.0.191 170.1.0.192 - 170.1.0.255

o Each of them has 64 addresses.


6. 6
Now you have to find that your IP address is in which subnet, that subnet's first
address is network address and last address is broadcast address.

o Here the taken IP address is 170.1.0.0 . 170.1.0.0 comes in 170.1.0.0 - 170.1.0.63


subnet (see the previous step table). So 170.1.0.0 is network address and
170.1.0.63 is broadcast address for the taken IP address i.e. 170.1.0.0 .

Edit Examples
For Classful Network

IP address = 100.5.150.34 and subnet mask = 255.255.240.0


Total bits = Tb = 8

Subnet Mask 0 128 192 224 240 248 252 254 255
No. of bits used for Subnetting (n) 0 1 2 3 4 5 6 7 8

Number of bits used for subnetting for subnet mask 240 = n1 = 4


(as subnet mask = 240 and its corresponding "No. of bits used for Subnetting" is 4 from
above table)

Number of bits used for subnetting for subnet mask 0 = n2 = 0


(as subnet mask = 0 and its corresponding "No. of bits used for Subnetting" is 0 from
above table)

Number of bits left for host for subnet mask 240 = m1 = Tb - n1 = 8 - 4 = 4


Number of bits left for host for subnet mask 0 = m2 = Tb - n2 = 8 - 0 = 8

Number of subnets for subnet mask 240 = 2n1 = 24 = 16


Number of subnets for subnet mask 0 = 2n2 = 20 = 1

Value of last bit used for subnet masking for subnet mask 240 = 1 = 2m1 = 24 = 16
Value of last bit used for subnet masking for subnet mask 0 = 2 = 2m2 = 28 = 256

For subnet mask 240, addresses will be separated by 16 and for subnet mask 0, it'll be
256. Using 1 and 2 value, the 16 subnets are given below

100.5.0.0 - 100.5.16.0 - 100.5.32.0 - 100.5.48.0 -


100.5.15.255 100.5.31.255 100.5.47.255 100.5.63.255
100.5.64.0 - 100.5.80.0 - 100.5.96.0 - 100.5.112.0 -
100.5.79.255 100.5.95.255 100.5.111.255 100.5.127.255
100.5.128.0 - 100.5.144.0 - 100.5.160.0 - 100.5.176.0 -
100.5.143.255 100.5.159.255 100.5.175.255 100.5.191.255
100.5.192.0 - 100.5.208.0 - 100.5.224.0 - 100.5.240.0 -
100.5.207.255 100.5.223.255 100.5.239.255 100.5.255.255

IP address 100.5.150.34 comes in 100.5.144.0 - 100.5.159.255 and hence 100.5.144.0


is the network address and 100.5.159.255 is the broadcast address.

For CIDR

IP address in CIDR = 200.222.5.100/9

9 = 8 + 1 + 0 + 0
255 . 128 . 0 . 0

IP address = 200.222.5.100 and subnet mask = 255.128.0.0


Total bits = Tb = 8

Subnet Mask 0 128 192 224 240 248 252 254 255
No. of bits used for Subnetting (n) 0 1 2 3 4 5 6 7 8

Number of bits used for subnetting for subnet mask 128 = n1 = 1


(as subnet mask = 128 and its corresponding "No. of bits used for Subnetting" is 1 from
above table)

Number of bits used for subnetting for subnet mask 0 = n2 = n3 = 0


(as subnet mask = 0 and its corresponding "No. of bits used for Subnetting" is 0 from
above table)

Number of bits left for host for subnet mask 128 = m1 = Tb - n1 = 8 - 1 = 7


Number of bits left for host for subnet mask 0 = m2 = m3 = Tb - n2 = Tb - n3 = 8 - 0 = 8

Number of subnets for subnet mask 128 = 2n1 = 21 = 2


Number of subnets for subnet mask 0 = 2n2 = 2n3 = 20 = 1

Value of last bit used for subnet masking for subnet mask 128 = 1 = 2m1 = 27 = 128
Number of host per subnet = 2m1 - 2 = 27 - 2 = 126

Value of last bit used for subnet masking for subnet mask 0 = 2 = 3 = 2m2 = 2m3 = 28 =
256
Number of host per subnet for subnet mask 0 = 2m2 - 2 = 2m3 - 2 = 28 - 2 = 254
For subnet mask 128, addresses will be separated by 128 and for subnet mask 0, it'll be
256. Using 1, 2 and 3 value, the 2 subnets are given below

200.0.0.0 - 200.127.255.255 200.128.0.0 - 200.255.255.255

IP address 200.222.5.100 comes in 200.128.0.0 - 200.255.255.255 and hence


200.128.0.0 is the network address and 200.255.255.255 is the broadcast address.

Edit Tips
In CIDR, just after you convert the bit-length prefix to quad-dotted decimal format, you
can follow the same procedure as for Classful network.
This method is only for IPv4, not applicable for IPv6.