2. Subnetting
Subnetting is a method of dividing a single physical network into
logical sub-networks (subnets).
Subnetting allows a business to expand its network without requiring
a new network number from its Internet service provider.
Advantages
• Subnetting helps to reduce the network traffic and also conceals network complexity.
• Reallocating IP Addresses:- A limited number of host allocations are available for each class; so
to allocate more ip adreesses ,we can do subnetting.
• Improves Network Speed:- It reduces traffic so increases speed.
• Improving Network Security:- Subnetting helps network administrators to reduce network-wide
threats
• Reliving Network Congestion:- Without a subnet, data packets from every other computer on
the network would be visible to all computers and servers.
• Efficiency:- Subnetting is used to simplify network traffic by eliminating the need for
additional routers.
3. Subnetting
Two level of hierarchy(No Subnetting)
Each address in the block can be considered as
a two-level hierarchical structure:
the leftmost n bits (prefix) define the
network;
the rightmost 32 - n bits define the host.
Three-Levels of Hierarchy: Subnetting
An organization that is granted a large block
of addresses may want to create clusters of
networks (called subnets) and divide the
addresses between the different subnets. The
rest of the world still sees the organization as
one entity; however, internally there are
several subnets
4. Example of subnetwork
suppose an organization is given the block 17.12.40.0/26, which
contains 64 addresses.
The organization has three offices and needs to divide the
addresses into three subblocks of 32, 16, and 16 addresses. We can
find the new masks
by using the following arguments:
1. Suppose the mask for the first subnet is n1, then 2 32- n1 must
be 32, which means
that n1 = 27.
2. Suppose the mask for the second subnet is n2, then 2 32- n2 must
be 16, which
means that n2 = 28.
3. Suppose the mask for the third subnet is n3, then 232- n3 must
be 16, which means
that n3 = 28.
5.
6. Finding Subnet address
find the subnet addresses from one of the addresses in
the subnet.
a) In subnet 1, the address 17.12.14.29/27 can give us the subnet address if we
use the
mask /27 because
Host: 00010001 00001100 00001110 00011101
Mask: /27
Subnet:00010001 00001100 00001110 00000000 .... (17.12.14.0)
b) In subnet 2, the address 17.12.14.45/28 can give us the subnet address if we
use the
mask /28
Host: 00010001 00001100 00001110 00101101
Mask: /28
Subnet: 00010001 00001100 00001110 00100000 .... (17.12.14.32)
c) In subnet 3, the address 17.12.14.50/28 can give us the subnet address if we
use the
mask /28 because
Host: 00010001 00001100 00001110 00110010
Mask: /28
Subnet: 00010001 00001100 00001110 00110000 .... (17.12.14.48)
7. IPv4
An IPv4 address consists of four bytes (32 bits).
These bytes are also known as octets.
Ex: 234.5.67.190.
Each sub area can vary from 000 to 255
(2power8 = 256)
--- . --- . --- . ---
0.0.0.0 through 255.255.255.255
total of 32 bits
2 power32 4 billion addresses
8. IPv6
IPv6 addresses are 16 bytes (128 bits) long
2 power 128 unique addresses
Typically written as:
each byte in turns is represented as a pair of
hexadecimal numbers, like in the following
example:
E3D7:0000:0000:0000:51F4:9BC8:C0A8:6420
9.
10. length
32 bits
data
(variable length,
typically a TCP
or UDP segment)
header
checksum
time to
live
32 bit source IP address
ver head. type of
len service
16-bit identifier flgs
fragment
offset
upper
layer
32 bit destination IP address
options (if any)
IPv4 datagram format
total datagram
length (bytes)
for
fragmentation/
reassembly
IP protocol version
number
header length
(bytes)
“type” of data
max number
remaining hops
(decremented at
each router)
upper layer protocol
to deliver payload to e.g. timestamp,
record route
taken, specify
list of routers
to visit.
how much overhead?
20 bytes of TCP
20 bytes of IP
= 40 bytes + app
layer overhead
4-10
Network Layer
11. IPv4 datagram
VERSION: Version of the IP protocol (4 bits), which is 4 for
IPv4
HLEN: IP header length (4 bits), which is the number of 32 bit
words in the header. The minimum value for this field is 5 and
the maximum is 15.
Type of service: Low Delay, High Throughput, Reliability (8
bits)
Total Length: Length of header + Data (16 bits), which has a
minimum value 20 bytes and the maximum is 65,535 bytes.
Identification: Unique Packet Id for identifying the group of
fragments of a single IP datagram (16 bits)
Flags: 3 flags of 1 bit each : reserved bit (must be zero), do
not fragment flag, more fragments flag (same order)
Fragment Offset: Represents the number of Data Bytes ahead
of the particular fragment in the particular Datagram.
Specified in terms of number of 8 bytes, which has the
maximum value of 65,528 bytes.
12. IPv4 datagram
Time to live: Datagram’s lifetime (8 bits), It prevents the
datagram to loop through the network by restricting the
number of Hops taken by a Packet before delivering to the
Destination.
Protocol: Name of the protocol to which the data is to be
passed (8 bits)
Header Checksum: 16 bits header checksum for checking
errors in the datagram header
Source IP address: 32 bits IP address of the sender
Destination IP address: 32 bits IP address of the receiver
Option: Optional information such as source route, record
route. Used by the Network administrator to check whether
a path is working or not.
13. IPv6: motivation
initial motivation: 32-bit address space soon to be
completely allocated.
additional motivation:
header format helps speed processing/
forwarding
header changes to facilitate QoS
IPv6 datagram format:
fixed-length 40 byte header
no fragmentation allowed
4-13
Network Layer
14. IPv6 datagram format
priority: identify priority among datagrams in flow
flow Label: identify datagrams in same “flow.”
(concept of“flow” not well defined).
next header: identify upper layer protocol for data
ver pri flow label
payload len next hdr hop limit
source address
(128 bits)
destination address
(128 bits)
data
32 bits
4-14
Network Layer
15. Other changes from IPv4
4-15
Network Layer
checksum:removed entirely to reduce processing
time at each hop
options: allowed, but outside of header
, indicated
by “Next Header” field
ICMPv6: new version of ICMP
additional message types,e.g.“Packet Too Big”
multicast group management functions