IPv4 and Subnetting
IPv4 and Subnetting
5 hrs
Start at 7:30
- Ethernet and Token Rings were competing Layer 2 protocols (data link layer) that
were both
founded on the idea that a bunch of devices all connected to some common network
media
and able to communicate with each other.
- A broadcast domain is a collection of devices connected to a common network
media. If one
of the device starts transmitting voltage all the other devices in that media are
privy to that.
- The devices connected to a broadcast domain could see the unicast, multicast or
broadcast addresses
of any frame.
- Now we also needed the addresses because of multiple recievers. This led to
unique MAC addresses
being built which was a layer 2 address into the ethernet. MAC is 48 bits.
- Ethernet can carry hundreds of different protocols not just IPs.
- IPv4 addresses are comprised of 4 octets. Because we can't remember a raw binary
string,
we cut it into 4 parts, convert them into decimals and seperate them by .'s This
is the
dotted decimal notation.
- An 8 bit network address was not able to accomodate the increasing number of
networks
hence the IPv4 addresses were split into classes.
- To indentify classes, the device looked into the starting bits of a 32 bit binary
number.
- Class D address are reserved for multicast, starts with 1110 - 224.x.x.x through
239.x.x.x
- Class E address are experimental, starts with 11110 - 240.x.x.x through
255.x.x.x, will
never utilized.
- For two devices to be in the same network, for class A inital number is same, for
class B
two initial numbers are same etc. For example, 192.102.23.4 is a class C address
so for a
device to be in the same network as it, it would have to have an IPv4 of
192.102.23.x
- As networks have grown and grown, we need a high level governing body that
allocates IPv4s
to organizations such that there is no conflict and each organization is
allocated a unique
IP address.
- Even the classfull networks were found to be not enough to fulfill the growing
demand for
networks
- ISPs don't care what you do with your host bits, but you are not allowed to
modify your
network bits.
- Subnetting is taking one network and dividing into many networks keeping the
original bit
pattern of the original network same. Certain host bits are changed into subnet
bits which
work as "network" bits.
- Given an Ipv4 and a subnet mask, the number of 1s in the subnet mask correspond
to the
number of bits that should be unchanged. The remaining bits are either set to 0
(for
network) or 1 (for broadcast)
- /x represents that x digits in the ipv4 address is to be unchanged. (Short
notation)
7. Same-length Subnetting:
- For every host bit you convert to a subnet bit, you get two subnets.
- 2 ^ (subnet_bits) >= # Networks required
- (2 ^ (host_bits)) - 2 = # Hosts available per subnet
- Each network utilizes the same mask
- Subnet mask is constant for all subnets.
8. Variable-length Subnetting:
- What if some subnets require more hosts than other subnets? Same-length
subnetting ignores
host requirements which is why the need of variable-length subnetting arises.
- VLSM = Variable-length Subnet Masking - creating subnet masks on variable sizes
that are
finely tuned based on host requirements and NOT quantity of networks required
- Start with the largest host required. find subnet mask for that subnet (/x) and
repeat
for the subnets in descending order.
- Subnet mask may be variable depending on the host requirements.
- CIDR = Classless Interdomain Routing, Classful networks are irrelevant and the
subnet
mask is responsible for separating the IPv4 into network bits and host bits.