0:00
This class continues on IP addressing
and the focus is on subnet addressing
that efficiently utilize IP addresses.
The basic idea of subnetting is to add another hierarchical level called a subnet,
as shown in the figure.
The beauty of subnet addressing is that it is
oblivious to the network outside of the organization.
That is a host on outside of this organization would still
see the original address structure with two levels.
The inside of the organization,
the local network administrator is free to choose
any combination of LANs for the subnet and host ID fields.
It simplifies the management of multiple LANs within the organization.
But when a packet comes into the main router,
how does it know which subnet to give the packet to?
IP address masking is used to find a subnet ID.
Let's look at the subnetting scheme.
Consider an organization that has a class B address with network ID 150.100.0.0.
So, a network has 16 bits for host IDs.
Suppose an organization has many local area networks,
each consisting of no more than 100 hosts in each subnet.
Then, 7 bits in host IDs are sufficient to uniquely identify each host in
the subnet and it has suppose 2+7-2 that is 126 hosts.
The other 9 bits can be used to identify the subnets within the organization,
which can identify 2+9-2 subnets.
The question is, if a packet with a destination IP address,
say 150.100.12.176 arrived at the site from the outside network,
which subnet should the router forward this packet to?
To find the subnet number,
a router needs to store an additional quantity called a subnet mask,
which consists of binary ones for every bit position
of the address except in the host ID field where binary zeros are used.
As 7 bits are used for host ID,
the subnet mask in binary string is given inside,
which corresponds to 250.250.250.128 in dotted decimal notation.
The router can determine the subnet number by performing a perfect logic and
operation between the subnet mask and its IP address bit by bit.
Therefore, the resulted subnet number is shown in the slide that corresponds
to 150.100.12.128 in dotted decimal notation.
This number is used to forward the packet to the correct subnet inside the organization.
Note that if a subnet has to support more hosts,
then the host ID would need more bits but will leave fewer bits for the subnet ID.
In a subnet 150.100.12.128,
the IP address 150.100.12.128 is used to
identify this subnet while IP address
150.100.12.250 is used to broadcast packets in the subnet.
The range of the subnet IP address is given in the slide that corresponds
to 150.100.12.129 to 150.100.12.254.
Lets look at example of address assignment with subnetting.
Consider a site that has been assigned a Class B IP address of 150.100.0.1.
The site has a number of subnets and many hosts denoted in
each connected routers denoted in R.
The figure only shows three subnets and five hosts for simplicity.
Three subnets are 150.100.12.108, 150.100.12.0 and 150.100.15.0.
Assume that subnet field in
9 bits long and the host ID field in 7 bits long.
When a host located outside the network wants to send a packet to a hosting network,
all the external routers have to know is how to get to network address 150.100.0.1.
So the subnetting concept is very
powerful as internal network configuration details are hidden from outside.
The IP layer in the end system hosts and in
the routers work together to route packets from IP network source to destination.
The IP layer in each host and the router maintains
a routing table that is used to determine how to handle each IP packet.
Considers action of an originating host to send an IP packet,
it consults its routing table.
If the destination host is in the same network,
it sends the packet directly using a appropriate network interface.
Otherwise, the routing table typically specifies that the packet is to be
sent to a default router that is directly connected to the originating host.
Now consider the action of a router.
When a router receive an IP packet,
it examines the IP destination address in
the arriving packet by consulting its routing table.
If the packet is destined to itself,
it delivers the packet to the appropriate higher layer protocol.
If the destination IP address is not the router's own address,
router consults the routing table to determine the next hub and
associated network interface and then forwards the packet.
This concludes today's lesson.