Vous êtes sur la page 1sur 46

Chapter six

Introduction to IP Addressing and Subnetting


IP addressing
• Every host connected to an internet must have a unique IP address on that
network.
• An IP (Internet Protocol) address is a unique identifier for a node or host
connection on a network.
• There are two versions of IP addressing IPv4 and IPv6.
• The address in IPv4 is a 32 bit number. But for IPV6 has 128-bit address length.
• Example:
• IPv4: 12.244.233.165
• IPv6: 2001:0db8:0000:0000:0000:ff00:0042:7879
• IPv4 is a numeric address, and its binary bits are separated by a dot (.)
• IPv6 is an alphanumeric address whose binary bits are separated by a
colon (:). It also contains hexadecimal.
Cont..
• Number of classes:
• IPv4 offers five different classes of IP Address. Class A to E.
• lPv6 allows storing an unlimited number of IP Address.
• Network Configuration
• Networks need to be configured either manually or with DHCP.
• IPv6 support auto configuration capabilities using Internet Control Message
Protocol version 6 (ICMPv6) or DHCPv6
• Security
• Security is dependent on applications – IPv4 was not designed with security in
mind.
• IPSec(Internet Protocol Security) is built into the IPv6 protocol, usable with
a proper key infrastructure.
Cont.…
• Mapping:
• Uses ARP(Address Resolution Protocol) to map to MAC address
• Uses NDP(Neighbour Discovery Protocol) to map to MAC address
• There are four octets in an IP address. It is very important to understand
that the four octets in an IP address are divided into two parts—a network ID and
a host ID.
• The subnet mask determines the number of bits that make up the network ID and
the number of bits that make up the host ID
• Example: 192.168.1.2
• 192.168.1. Network
• .2 Host
• 192.168.1.0 - network address. 0.0.0.2 - host address.
Cont..
IPv4
• It is usually represented as 4, 8 bit numbers separated by dots
• An IP address looks similar in appearance to 192.168.1.2
• Each decimal value is made up of 8 bits (1s and 0s), and there are four
decimal values. The range 0 to 255 (known as octets) separated by
decimal points.
• Since each of the decimal values is made up of 8 bits for example, the
192 - 11000000.
Address Classes
• Every IP address belongs to a distinct address class.
• The Internet community defined these classes to accommodate networks of
various sizes.
• The class to which the IP address belongs initially determines the network ID
and host ID portions of the address, along with the number of hosts that are supported
on that network.
• The different class addresses are named class A, class B, class C, class D, and class E.
Class A Addresses
• Class A network number values begin at 1 and end at 126.
• A class A address has a default subnet mask of 255.0.0.0, which means that the first
octet is the network ID and the last three octets belong to the host ID portion of the
address
• Each octet can contain 256 possible values (0–255), so a class A address supports
16,777,216 hosts on the network (256 × 256 × 256)
Cont….
Class B Addresses
• Class B network number values begin at 128 and end at 191.
• Class B addresses have a default subnet mask of 255.255.0.0, which
means that the first two octets are the network ID and the last two
octets are the host ID portion of the address
• This means that we can have 65,536 hosts (256 × 256) on the network
Class C Addresses
• Class B network number values begin at 192 and end at 223.
• Class C addresses have a subnet mask of 255.255.255.0, which means
that the first three octets are the network ID and the last octet is the
host ID. Having only one octet as the host ID means that a class C
address can support only 254 hosts (256-2) on the network
Cont…
Class D Addresses
• Class D addresses are used for special types of applications on the network known as
multicasting applications.
• Multicast means sending some information to some predefined group of
users/networks.
• The range is between 224-239.
Class E Addresses
• The funny thing about class E addresses is that they were designed for
experimental purposes only, so you will never see a class E address on a network.
• The range is between 240-255
• 127.0.0.0 for loopback
Subnet Mask
• Used to define which part of the host address will be used as the
subnet address
• A 32-bit value that allows the recipient of IP packets to distinguish the
network ID portion of the IP address from the host ID portion
Cont.…
• When looking at a subnet mask, if there is a 255 in an octet, then the
corresponding octet in the IP address is part of the network ID
• For example, if I had an IP address of 192.168.1.15 and a
subnet mask of 255.255.255.0, the first three octets would make up
the network ID and the last octet would be the host ID
• The network ID assigns a unique address to the network itself,
while the host ID uniquely identifies the system on the network
Cont.…
Private address
• Another type of address you need to be aware of is what is known as a private
address.
• A private IP address is the address space that allow organizations to create their own
private network
• A private address is an address that can be assigned to a system but cannot be used for
any kind of Internet connectivity.
• The private addresses are non routable addresses, so any system using them will not
be able to function off the network.
• The computers, tablets and smartphones sitting behind your home, and the personal
computers within an organizations are usually assigned private IP addresses.
• A network printer residing in your home is assigned a private address so that only
your family can print to your local printer.
Cont.…
• The following are the three address ranges that are private:
• 10.0.0.0–10.255.255.255
• 172.16.0.0–172.31.255.255
• 192.168.0.0–192.168.255.255
Classless Inter-Domain Routing (CIDR)
• It also improved the efficiency of IP address assignments, and overall
significantly improved the availability.
• Used to allocate an amount of IP address space to a given entity
(company, home, customer, etc).
• Example: 192.168.10.32/28
• The slash notation (/) means how many bits are turned on (1s) and tells
you what your subnet mask is.
• Tells you how many bits are used to define the network.
Class A subnets
• In Class A, only the first octet is used as Network identifier and rest of three octets
are used to be assigned to Hosts (i.e. 16,777,214 Hosts per Network).
• To make more subnet in Class A, bits from Host part are borrowed and the subnet
mask is changed accordingly.
• For example, if one bit is borrowed from host bits of second octet and added to
network address, it creates two Subnets (21=2) with (223-2) 8,388,606 Hosts per
Subnet.
Class B Subnets
• By default, using Classful Networking, 16 bits are used as Network bits providing
and (216-2) 65534 Hosts.
• Class B IP Addresses can be subnetted the same way as Class A addresses, by
borrowing bits from Host parts.
Class C Subnets
• Class C IP addresses are normally assigned to a very small size network because it
can only have 254 hosts in a network.
• Given below is a list of all possible combination of subnetted Class B IP address
Exercise
1. Write the IP address 222.1.1.20 mask 255.255.255.192 in CIDR
notation.
2. Write the IP address 135.1.1.0/25 mask in CIDR notation.
Subnetting
• Subnetting is the strategy used to partition a single physical network
into more than one smaller logical sub-networks (subnets).
• An IP address includes a network segment and a host segment.
• Subnets are designed by accepting bits from the IP address's host part
and using these bits to assign a number of smaller sub-networks inside
the original network.
• Subnetting allows an organization to add sub-networks without
the need to acquire a new network number via the Internet
service provider (ISP).
Cont….
• Subnetting is essential when a single network number has to be
allocated over numerous segments of a local area network (LAN).
Benefits of subnetting include:
• Reduced network traffic
• Optimized network performance
• Simplified management
Gateway
• The gateway is a network device that acts as an entry point from one
network to others.
• The host sends all packets directed to other hosts outside the local
network to the default gateway (specifically to the gateway IP
address), which means that a host without the default gateway address
can only exchange packets with computers in the same local network.
• The concept of a gateway has become virtually parallel with a router.
• When setting an IP address for a gateway, the first available address in
the pool of host addresses in the given network is usually used.
Cont….

Before starting, you need to do is answer five simple questions:


1. How many subnets does the chosen subnet mask produce?
2. How many valid hosts per subnet are available?
3. What are the valid subnets?
4. What’s the broadcast address of each subnet?
5. What are the valid hosts in each subnet?
Cont..
• How many subnets?
• 2x = number of subnets. x is the number of masked bits, or the 1s.
• For example, given a class C subnet mask of 255.255.255.192, the number of
ones gives us 22 = 4 subnets.
• Note that we only count the number of ones that are found in the host part of
the subnet mask.
• For class C address 255.255.255.0 is the default subnet, 192=11000000 in
binary, so there are only 2 ones.
Cont…
• How many hosts per subnet?
• 2y – 2 = number of hosts per subnet. y is the number of unmasked bits, or the
0s. For example, in 11000000, the number of zeros gives us 26 – 2 = 62 hosts
per subnet.
• You need to subtract two for the subnet address and the broadcast address,
which are not valid hosts.
• What are the valid subnets?
• First calculate the block size.
• 256 – subnet mask = block size, or increment number.
• An example would be 256 – 192 = 64. The block size of a 192 mask is always
64.
• Second, start counting at zero in blocks of 64 until you reach the subnet mask
value and these are your subnets. 0, 64, 128, 192.
Cont….
• What’s the broadcast address for each subnet?
• Since we counted our subnets in the last section as 0, 64, 128, and 192, the
broadcast address is always the number right before the next subnet.
• For example, the 0 subnet has a broadcast address of 63 because the next
subnet is 64. The 64 subnet has a broadcast address of 127 because the next
subnet is 128, etc.
• And remember, the broadcast of the last subnet is always 255 for Class C.
• What are the valid hosts?
• Valid hosts are the numbers between the subnets
• For example, if 64 is the subnet number and 127 is the broadcast address, then
65–126 is the valid host range—it’s always the numbers between the subnet
address and the broadcast address.
• These are the addresses you assign to nodes.
Example for subnetting
We’re going to subnet the network address 192.168.10.0/24
1. How many subnets?
• 224 is 11100000, so our equation would be 23 = 8.
2. How many hosts/valid hosts?
• 25 – 2 = 30.
3. What are the valid subnets?
• 256 – 224 = 32. We just start at zero and count to the subnet mask value in
blocks (increments) of 32: 0, 32, 64, 96, 128, 160, 192, 224.
4. What’s the broadcast address for each subnet?
• always the number right before the next subnet
5. What are the valid hosts for each subnet?
• the numbers between the subnet number and the broadcast address
Cont…
• To answer questions 4 and 5, first just write out the subnets, then write out the
broadcast addresses—the number right before the next subnet. Lastly, fill in the
host addresses.

• So now we have
192.168.10.1/27 – 192.168.10.30/27 ntk 1
192.168.10.33/27 - 192.168.10.62/27 ntk 2
upto …
192.168.10.225/27 - 192.168.10.254/27 ntk 8
Exercise
• You have been allocated a class A network address of 29.0.0.0. You need to
create at least 20 networks and each network will support of 1000 hosts. What
are the possible subnet masks?
• Subnet the Class C IP address 195.1.1.0. So that you have to create at least 4
subnets each subnet must have room for 48 hosts . What are the possible subnet
masks? Do full subnetting.
• Do full subnetting for the following addresses.
1. 192.168.10.0/28
2. 192.0.10.0/30
VLSM (Variable length subnet mask)
• In all of the previous examples of subnetting, notice that the same subnet mask
was applied for all the subnets.
• This means that each subnet has the same number of available host addresses.
• You can need this in some cases, but, in most cases, having the same subnet mask
for all subnets ends up wasting address space.
• For example, the Class C network of 204.15.5.0, subnet the network in to 5
subnets in order to create the network with the host requirements shown below:
• NetA :14 hosts
• NetB :28 hosts
• NetC :2 hosts
• NetD :7 hosts
• NetE :28 hosts
Cont.…
• The network was split into eight equal-size subnets; however, each
subnet did not utilize all available host addresses, which results in
wasted address space.
• The following figure illustrates this wasted address space.
Cont.…
Cont.…
• NetA, NetC, and NetD have a lot of unused host address space.
• It is possible that this was a deliberate design accounting for future growth, but in
many cases this is just wasted address space due to the fact that the same subnet
mask is used for all the subnets.
• Variable Length Subnet Masks (VLSM) allows you to use different masks for
each subnet, thereby using address space efficiently.
• Given the same network and requirements as in exercise above develop a
subnetting scheme with the use of VLSM, given:
• Net A: must support 14 hosts
• Net B: must support 28 hosts
• Net C: must support 2 hosts
• Net D: must support 7 hosts
• Net E: must support 28 hosts
Cont.…
• Determine what mask allows the required number of hosts.
• Net A requires a /28 (255.255.255.240) to support 14 hosts
• Net B requires a /27 (255.255.255.224) to support 28 hosts
• Net C requires a /30 (255.255.255.252) to support 2 hosts
• Net D requires a /28 (255.255.255.240) to support 7 hosts
• Net E requires a /27 (255.255.255.224) to support 28 hosts
Cont.…
• The easiest way to assign the subnets is to assign the largest first. For example,
you can assign in this manner:
• Net B 204.15.5.0/27 host address range 1 to 30
• Net E 204.15.5.32/27 host address range 33 to 62
• Net A 204.15.5.64/28 host address range 65 to 78
• Net D 204.15.5.80/28 host address range 80 to 87
• Net C 204.15.5.96/30 host address range 97 to 98
• The following figure show how VLSM helped to save more than half of the
address space
Cont.…
Exercise
Given the Class A network of 172.0.0.0, subnet the network in order to create the
network with the host requirements shown below using VLSM:
• Net1 :500 hosts
• Net2 :250 hosts
• Net3 :80 hosts
• Net4 :50 hosts
• Net5 :20 hosts
• Net6 :2 hosts
• Net7 :2 hosts
• Net8 :2 hosts
• Net9 :2 hosts
• Net10 :2 hosts
VLAN
• VLAN is a logical grouping of network users and resources connected to
administratively defined ports on a switch.
• It support smaller broadcast domain and is organized by location, function,
department and application or protocol.
• Virtual LANs (or VLANs) separate a Layer-2 switch into multiple broadcast
domains.
• Each VLAN is its own individual broadcast domain (i.e. IP subnet).
• Individual ports or groups of ports can be assigned to a specific VLAN.
• Only ports belonging to the same VLAN can freely communicate; ports assigned
to separate VLANs require a router to communicate.
• Broadcasts from one VLAN will never be sent out ports belonging to another
VLAN
Cont…
• Ports (interfaces) on switches can be assigned to one or more VLANs, enabling
systems to be divided into logical groups -- based on which department they are
associated with -- and establish rules about how systems in the separate groups are
allowed to communicate with each other.
• Data communications between VLANs is performed by routers. Modern switches
often incorporate routing functionality and are called Layer 3 switches.
Cont…
• Four computers are connected to a Layer-2 switch that supports VLANs.
Computers A and B belong to VLAN 1, and Computers C and D belong to
VLAN 2.
• Because Computers A and B belong to the same VLAN, they belong to the
same IP subnet and broadcast domain.
• They will be able to communicate without the need of a router
• Computers C and D likewise belong to the same VLAN and IP subnet.
• They also can communicate without a router. However, Computers A and B
will not be able to communicate with Computers C and D, as they belong
to separate VLANs, and thus separate IP subnets.
• Broadcasts from VLAN 1 will never go out ports configured for VLAN 2.
• A router will be necessary for both VLANs to communicate.
Benefits of VLANs
• Simplified administration for the network manager: One of the best things
about virtualization is that it simplifies management.
• By logically grouping users into the same virtual networks, you make it easy to set
up and control your policies at a group level.
• When users physically move workstations, you can keep them on the same
network with different equipment. Or if someone changes teams but not
workstations, they can easily be given access to whatever new VLANs they need.
• Improved security: Using VLANs improves security by reducing both internal
and external threats.
• Internally, separating users improves security and privacy by ensuring that users
can only access the networks that apply to their responsibilities. External threats
are also minimized.
• If an outside attacker is able to gain access to one VLAN, they’ll be contained to
that network by the boundaries and controls you have in place to segment it from
your others.
Cont…
• Easier fault management: Troubleshooting problems on the network can be
simpler and faster when your different user groups are segmented and isolated
from one another.
• If you know that complaints are only coming from a certain subset of users, you’ll
be able to quickly narrow down where to look to find the issue.
• Improved quality of service: VLANs manage traffic more efficiently so that
your end users experience better performance. You’ll have fewer latency problems
on your network and more reliability for critical applications.
• VLANs also make prioritizing traffic much easier, allowing you to make sure
critical application data keeps flowing even when lower priority traffic like web
browsing spikes.
In a Class C address, only 8 bits are available for defining the hosts. Remember that
subnet bits start at the left and go to the right, without skipping bits. This means that
the only Class C subnet masks can be the following
Exercise
• You are given an IP address from your ISP: 220.42.56.20
• Design a network having 4 subnets for
• Administrative staff,
• Academic staff and
• Postgraduate students,
• Undergraduate students
Exercise
• You are given two address /mask combinations, written with the
length notation, which have been assigned to two devices.
• Your task is to determine if these devices are on the same subnet or
different subnets.
• Device A: 172.16.17.30 /20
• Device B: 172.16.28.15 /20
• You can use the address and mask of each device in order to determine
to which subnet each address belongs and perform a logical "AND"
between the mask and address

Vous aimerez peut-être aussi