3 IPv4 Part2
3 IPv4 Part2
Shortage
IP Addresses
• To be able to identify a host on the internet, each host is assigned an
address, the IP address, or Internet Address.
• The standards for IP addresses are described in RFC 1166 -- Internet
Numbers.
• When the host is attached to more than one network, it is called
multi-homed and it has one IP address for each network interface.
2
IP Addresses
• An IP Address is a 32 bit binary number.
• IP addresses are used by the IP protocol to uniquely identify a host on
the internet.
• IP datagrams (the basic data packets exchanged between hosts) are
transmitted by some physical network attached to the host and each
IP datagram contains a source IP address and a destination IP address.
3
The Dotted Decimal Notation
• IP addresses are usually represented in a dotted decimal form (as the
decimal representation of four 8-bit values concatenated with dots).
• For example 128.2.7.9 is an IP address with 128.2 being the network
number and 7.9 being the host number.
• The rules used to divide an IP address into its network and host parts
are explained below.
4
IP Address Example
• The binary format of the IP address 128.2.7.9 is:
• 10000000 00000010 00000111 00001001
• IP address is made of four groups of decimal numbers between 0 -
255 separated by dots.
• Some of the numbers are special (like 0.0.0.0 or 255.255.255.255) and
are used to designate the default gateway, a broadcast or multicast
address, or some reserved numbers for the developers to play with.
5
Parts of an IP Address
• A part of the address designates the network numbers, and the
remaining part designates the host number. So, we may say an IP
address has the format NETWORK.HOST.
• The network number part of the IP address is centrally administered
by the Internet Network Information Centre (the InterNIC) and is
unique throughout the Internet.
• The IP address consists of a pair of numbers:
• IP address = <network number><host number>
6
Parts of an IP Address
7
Network Number Assignment
• One point to note about the split of an IP address into two parts
is that this split also splits the responsibility for selecting the IP
address into two parts. The network number is assigned by the
InterNIC, and the host number by the authority which controls
the network.
• The host number can be further subdivided: this division is
controlled by the authority which owns the network, and not by
the InterNIC.
8
IP Address Classes
• Traditionally, the conventions are that there are three main types of IP
networks.
• Class A
• Class B
• Class C
• There are also:
• Class D
• Class E
9
Assigned Classes of Internet Addresses
• The first bits of the IP address
specify how the rest of the
address should be separated
into its network and host part.
• The terms network address and
netID are sometimes used
instead of network number, but
the formal term, used in RFC
1166, is network number.
Similarly, the terms host
address and hostID are
sometimes used instead of host
number.
10
Class A Network Addresses
• Class A networks use the first octet (8 bits) to designate
the network, with the first (high-order) bit set to 0.
• The last three octets designate the host.
• So the Class A network addresses are 1.H.H.H to
127.H.H.H, where H is used to designate the host address
octets.
• Class A addressing allows for 127 networks.
• Class A addresses use 7 bits for the network number giving 126
possible networks (out of every group of network and host
numbers, two have a special meaning). The remaining 24 bits are
used for the host number, so each networks can have up to 224 -
minus 2 (16,777,214) hosts.
11
Class B Network Addresses
• Class B networks use two octets to designate the network and
two to designate the host.
• The network part must begin with 10. The Class B networks are
128.x.H.H to 191.x.H.H, where x is any number between 0 and
255.
• Class B addresses use 14 bits for the network number, and 16
bits for the host number giving 16,382 Class B networks each
with a maximum of 65534 hosts.
12
Class C Network Addresses
• Class C networks use three octets to designate the network and only
one to designate the host.
• The network part begins with 110.
• The Class C networks are 192.x.x.H to 223.x.x.H, which allows for
2,097,152 networks.
• Class C addresses use 21 bits for the network number and 8 for the host number
giving 2,097,150 networks each with up to 254 hosts.
13
IP Address Class’ Host Accommodation
• As you can see, there are very few Class A networks, but
each of them can accommodate millions of hosts. A
Class B network supports only 65,534 hosts, while Class
C only 254 hosts (all 0 and 1 combinations are not
allowed).
14
Other Address Classes
• There is also a Class D address (starts with 1110) used for
multicasting, which is used to address groups of hosts in a limited
area.
• Class E addresses are reserved for future use. Class E (1111) addresses
are reserved for the nerds.
15
Special Addresses
• IP Address Notation
• {<network>, <host>}
• {<network>, <subnet>, <host>}
• -1 value means a component consisting of all 1’s
• {0,0} = This host on this network
• {0,<host>} = Specific host on this network
• {-1, -1} = Local broadcast
• Broadcast to all hosts on this network
• {<network>, -1} = Directed broadcast
• Broadcast to all hosts on <network>
16
Special Addresses Cont.
• {<network>, <subnet>, -1} = Directed broadcast
• Broadcast to all hosts on <subnet> of <network>
• {<network>, -1, -1} = Directed broadcast
• Broadcast to all hosts on all subnets of <network>
• {<127>, <any>} = Loopback address
• Packet never leaves the NIC
• Should never appear on the network
17
IP Address Space Shortage
• It is clear that a class A address will only be assigned to networks with a huge
number of hosts, and that class C addresses are suitable for networks with a
small number of hosts. However, this means that medium-sized networks (those
with more than 254 hosts or where there is an expectation that there may be
more than 254 hosts in the future) must use Class B addresses. The number of
small- to medium-sized networks has been growing very rapidly in the last few
years and it was feared that, if this growth had been allowed to continue
unabated, all of the available Class B network addresses would have been used by
the mid-1990s. This is termed the IP Address Exhaustion problem. The problem
and how it is being addressed are discussed in The IP Address Exhaustion
Problem.
18
IP Address Space Shortage
• Over the next few years, conventional computers will be joined by
Personal Digital Assistants, Mobile Phones with data processing
capability, smart set-up boxes with integrated web browsers, and
from copy machines to kitchen appliances.
• With the production of PCs and the Internet growing like bread with
too much yeast, they are running out of addresses - and therefore
some solutions are proposed to conserve address space, and even to
change the system. But - so far - most existing routers work on 'Class'
assumption.
19
IPv4 - Problems
• The decision to standardize on a 32 bit address space meant that
there were only 232 (4,294,967,296) IPv4 addresses available.
• During the early days of the Internet, the seemingly unlimited address
space allowed IP addresses to be allocated based on requests rather
than its actual need.
20
IPv4 - Problems
• The class A, B, and C octet boundaries were easy to understand and
implement, but they did not foster efficient allocation of addresses.
21
IPv4 - Problems
• Class C, which supports 254 hosts, is too small.
• Class B, which supports 65534 hosts is too large.
• In the past, sites with several hundred hosts have been assigned as
single Class B address rather than couple of Class C addresses.
• Unfortunately, this has resulted in a premature depletion of the Class
B network address space.
22
Classless Inter-Domain Routing
• CIDR was officially documented in September 1993 in RFC 1517, 1518,
1519, 1520
• Eliminates the traditional concept of Class A, B and C networks and
replaces it with concept of “network prefix”
• CIDR supports the deployment of arbitrary size networks rather than
the standard 8-bit, 16-bit, or 24 bit network numbers associated with
classful addressing.
23
Private Internets
• Another approach to conservation of the IP address space is
described in RFC 1597 - Address Allocation for Private Internets.
Briefly, it relaxes the rule that IP addresses are globally unique by
reserving part of the address space for networks which are used
exclusively within a single organization and which do not require IP
connectivity to the Internet. There are three ranges of addresses
which have been reserved by IANA(Internet assigned Numbers
Authority) for this purpose:
· 10.0.0.0 A single Class A network
· 172.16 through 172.31 16 contiguous Class B networks
· 192.168.0 through 192.168.255 256 contiguous Class C networks
24
Private Internets
• Any organization may use any addresses in these ranges without
reference to any other organization. However, because these
addresses are not globally unique, they cannot be referenced by hosts
in another organization and they are not defined to any external
routers.
• Routers in networks not using private addresses, particularly those
operated by Internet service providers, are expected to quietly discard
all routing information regarding these addresses.
25
Private Internets
• Routers in an organization using private addresses are expected to limit all
references to private addresses to internal links; they should neither advertise
routes to private addresses to external routers nor forward IP datagrams
containing private addresses to via external routers.
• Hosts having only a private IP address do not have IP-layer connectivity to the
Internet. This may be desirable and may even be a reason for using private
addressing. All connectivity to external Internet hosts must be provided with
circuit level gateways or application gateways.
26
IP Configuration Parameters
• IP Address
• Subnet Mask
• Default Gateway
• DNS Server
27
IP Address
• Identifies the computer/host
• Either assigned/configured statically by the administrator or
• May be assigned dynamically through DHCP
28
Subnet Mask
• 32 bit integer, like the IP address
• Indicates the size of the subnet
• Used to generate Network Address
• IP address and Subnet Mask are logically ANDed to produce the
Network ID of the source and detination
29
Default Gateway
• The Way Out of the Subnet
• Router
30
How IP Operates at a Host
31
How IP Operates at a Host
32
Subnetting
• Subnetting -
• In 1985, RFC 950 defined a standard procedure to support the subnetting, or
division, of a single Class A, B, or C network number into smaller pieces.
33
Subnets and Subnet Masks
• Allow arbitrary complexity of internetworked LANs within organization
• Insulate overall internet from growth of network numbers and routing
complexity
• Site looks to rest of internet like single network
• Each LAN assigned subnet number
• Host portion of address partitioned into subnet number and host number
• Local routers route within subnetted network
• Subnet mask indicates which bits are subnet number and which are host
number
34
Routing Using Subnets
35
Practice with Subnets - 1
• The IP address of a host is 140.128.34.79. The subnet mask is 255.255.255.192. What is
the IP broadcast address for the network that this host is attached to?
36
Practice with Subnets - 2
• Acme Incorporated, a fictional company that you work for, has been allocated a class B network
by the InterNIC. Acme's network number is 135.48.0.0. You are the network administrator for
Acme's WAN. Acme has offices in 12 different cities with the head office located in Utopia. Each
of the 11 branch offices is connected to the head office with a leased line with IP routers on both
ends. The maximum number of computers in any branch office or head office is 1500. Show how
you would subnet the Class B IP address space of Acme to accommodate all the offices. Indicate,
for each of the subnet, IP address range for subnet, the subnet network number, the broadcast
address and the subnet mask to be used.
37
IP Packet R eceived
H eader No
Checksum
V alid?
Y es
D ecrem ent TT L No
TT L > 0
Y es
No D efault Route No
R oute F ound? S end IC M P E rror D iscard P acket
A vailable?
M essage to Source
Y es Y es
M A C Address No
A vailable? S end AR P Request
Y es
Y es A RP R esponse No
R eceived?