Subnetting

advertisement
Subnetting




Subnetting is another method of managing IP
addresses.
This method of dividing full network address
classes into smaller pieces
Has prevented complete IP address exhaustion.
It is impossible to cover TCP/IP without
mentioning subnetting.
It is not always necessary to subnet a small
network. However, for large or extremely large
networks, subnetting is required.


Subnetting a network means to use the subnet
mask to divide the network and break a large
network up into smaller, more efficient and
manageable segments, or subnets.
With subnetting, the network is not limited to the
default Class A, B, or C network masks and
there is more flexibility in the network design.
Subnet addresses include the network
portion, plus a subnet field and a host
field.
 The subnet field and the host field are
created from the original host portion for
the entire network.




To create a subnet address, a network administrator
borrows bits from the host field and designates them as
the subnet field.
The minimum number of bits that can be borrowed is
two. When creating a subnet, where only one bit was
borrowed the network number would be the .0 network.
The broadcast number would then be the .255 network.
The maximum number of bits that can be borrowed can
be any number that leaves at least two bits remaining,
for the host number.
Addresses in a network with and without subnetting
Subnet mask
Example
Subnet mask 255.255.255.192 will create 4 subnet



Many hosts in different networks may use the
same private space addresses. Packets using
these addresses as the source or destination
should not appear on the public Internet.
The router or firewall device at the perimeter of
these private networks must block or translate
these addresses.
Even if these packets were to make their way to
the Internet, the routers would not have routes to
forward them to the appropriate private network.
Who hold the address?
NAT (Network Address Translation)
Private addresses (others are called Public IP or Global address) :
Range
Total
10.0.0.0
to
10.255.255.255
224
172.16.0.0
to
172.31.255.255
220
192.168.255.255
216
192.168.0.0 to

NAT can be implemented on a device at the
edge of the private network.

NAT allows the hosts in the network to "borrow"
a public address for communicating to outside
networks. While there are some limitations and
performance issues with NAT, clients for most
applications can access services over the
Internet without noticeable problems.
Address translation
Translation Using One IP address
Another types of translations are :
- Using a Pool of IP address : several private hosts can communicate with the
same external host at the same time
- Using both IP address and Port Numbers  PAT (Port address translation)
Using both IP address and Port Numbers
e.g. Five-column
translation table
Private
Address
Private
Port
External
Address
External
Port
Transport
Protocol
172.18.3.1
1400
25.8.3.2
80
TCP
172.18.3.2
1401
25.8.3.2
80
TCP
...
...
...
...
...
Reduce the ambiguity of the previous type of translation.
ARP (Address Resolution Protocol)
Know the IP, ask hardware address (MAC address)
Mapping a logical address with the physical layer
ARP packet
Mapping Physical address to
Logical address
RARP
 BOOTP
 DHCP

Mapping Physical address to
Logical address
RARP
 BOOTP
 DHCP

RARP




Reverse Address Resolution Protocol (RARP)
associates a known MAC addresses with an IP
addresses.
This association allows network devices to encapsulate
data before sending the data out on the network.
A network device, such as a diskless workstation, might
know its MAC address but not its IP address. RARP
allows the device to make a request to learn its IP
address.
Devices using RARP require that a RARP server be
present on the network to answer RARP requests.


the source initiates a process called a RARP
request. This request helps the source device
detect its own IP address.
RARP requests are broadcast onto the LAN
(within a network) and are responded to by the
RARP server which is usually a router.
In RARP request (sent by the workstation which needs an IP address):





Operation code : 3
Source MAC address : its own MAC address
Destination MAC address : FF:FF:FF:FF:FF:FF (makes an RARP
request broadcast)
Source IP address : undefined
Destination IP address : undefined
In RARP reply (sent by an RARP server):



Operation code : four
Source MAC address : MAC address of the RARP server
Destination MAC address : MAC address of the workstation that sends
the RARP request
 Source IP address : IP address of the RARP server
 Destination IP address :given IP address
BOOTP


The bootstrap protocol (BOOTP) operates in a clientserver environment and only requires a single packet
exchange to obtain IP information. However, unlike
RARP, BOOTP packets can include the IP address, as
well as the address of a router, the address of a server,
and vendor-specific information.
One problem with BOOTP, however, is that it was not
designed to provide dynamic address assignment.

In BOOTP request (sent by the workstation which needs an IP
address):





Source MAC address : its own MAC address
Destination MAC address : FF:FF:FF:FF:FF:FF (makes an BOOTP
request broadcast)
Source IP address : undefined
Destination IP address : 255.255.255.255
In BOOTP reply (sent by an BOOTP server):


Source MAC address : MAC address of the BOOTP server
Destination MAC address : MAC address of workstation sends the
BOOTP request
 Source IP address : - IP address of the BOOTP server
 Destination IP address :- given IP address
- IP broadcast
DHCP



Dynamic host configuration protocol (DHCP) is
the successor to BOOTP.
Unlike BOOTP, DHCP allows a host to obtain an
IP address dynamically without the network
administrator having to set up an individual
profile for each device.
All that is required when using DHCP is a
defined range of IP addresses on a DHCP
server. As hosts come online, they contact the
DHCP server and request an address.



The DHCP server chooses an address and
leases it to that host. With DHCP, the entire
network configuration of a computer can be
obtained in one message.
The major advantage that DHCP has over
BOOTP is that it allows users to be mobile.
The importance to this DHCP advancement is its
ability to lease an IP address to a device and
then reclaim that IP address for another user
after the first user releases it.
In DHCP request (sent by the workstation which needs an IP address):




Source MAC address : its own MAC address
Destination MAC address : FF:FF:FF:FF:FF:FF (makes an DHCP
request broadcast)
Source IP address : undefined
Destination IP address : 255.255.255.255
In DHCP reply (sent by an DHCP server):


Source MAC address : MAC address of the DHCP server
Destination MAC address : MAC address of workstation sends the
BOOTP request
 Source IP address : - IP address of the DHCP server
 Destination IP address :- given IP address
- IP broadcast
 Gateway information
Comparison
RARP:



RARP server and its client are in each network
Static assignment of the IP address and manually configuration by
admin
RARP request is broadcast
BOOTP :



Application-layer process
The BOOTP server and its client can be in different networks with an aid
of a relay agent
Still static assignment of IP address and manually configuration
DHCP

Provide both static address allocation and dynamic address allocation
 Automatically assignment of IP address and configuration
 Mobile user can be supported
Download