You are on page 1of 100

IP addressing

IP addressing

Contents
1 Internet Protocol (IP) 3
1.1 Basic features 4
1.2 IP properties 6
1.3 IP header fields 8
2 IP addressing 11
2.1 Addressing on the network layer 12
2.2 Class based IP addressing 16
2.3 Reserved IP addresses 18
2.4 Private IP addresses 20
2.5 Publicly used IP addresses 22
2.6 Allocation of IP addresses 24
2.7 Classless IP addressing 27
2.8 Subnet and subnet mask 28
2.9 IP Host address versus IP Subnet address 36
2.10 Binary to Decimal conversation table 39
2.11 Case study No. 1( classroom) 41
2.12 Case study No.2 ( classroom) 43
2.13 Subnetmasks 50
2.14 Subnetmasks for Class A (2 Byte) 50
2.15 Subnetmasks for Class B (3Byte 51
2.16 Subnetmasks for Class C (4Byte) 53
2.17 Variable Length Subnet Masks (VLSM) 54
2.18 Classless Inter-Domain Routing (CIDR) 56
2.19 Route aggregation 58
2.20 CIDR Address Blocks 60
3 IP Fragmentation 63
4 Internet Control Message Protocol (ICMP) 69
4.1 ICMP characteristics 71
4.2 ICMP messages 72

TG70113EN02GLA2
2010 Nokia Siemens Networks
1
IP addressing

4.3 ICMP queries 74


4.4 ICMP error reports 76
4.5 ICMP applications 78
4.6 Requests for Comments 82
4.7 Glossary 85
5 Exercise 87
6 Solution 93

TG70113EN02GLA2
2 2010 Nokia Siemens Networks
IP addressing

1 Internet Protocol (IP)

Fig. 1 IP

TG70113EN02GLA2
2010 Nokia Siemens Networks
3
IP addressing

1.1 Basic features


Some Basic features
1. IP is a connectionless packet delivery service that provides independence from
the physical network (virtual network view).
2. The IP network routes each datagram (packet) independently.
3. The IP protocol offers no reliability, no flow control and no error recovery.
It is up to higher protocol layers to provide reliability, flow control and
connections.
4. Datagrams may arrive out of order, may be lost, or even duplicated.
5. IP has no provision for re-transmitting lost or damaged packets.
The IP protocol offers a kind of service that is often called a best-effort service.

Important fields of an IP packet


An IP packet consists of two parts, the IP header and a part for the data to be
transmitted. The IP packet header has a minimum length of 20 bytes.
Among other parts of the header the most important fields to understand how IP
works are the fields: destination IP address and source IP address.
The address field contains the Layer 3 address - the IP address. More information is
in the next paragraph "IP addressing".
The IP address is a logical address and has to be configured. That can be done
manually or dynamically with the help of protocols, e.g. Bootstrap Protocol (BOOTP)
or Dynamic Host Configuration Protocol (DHCP).
Each router to make a forwarding decision uses the destination address field. More
information about the forwarding decision is in the following paragraph "Routing".
In a case of an error what ever this could be (let assume the buffers are full, the
router has to discard the IP packet in the case of congestion) the router has the
possibility to inform the source station using the source address field. That is done
with the help of another protocol - the Internet Control Message Protocol (ICMP).
More information is in the paragraph "Internet Control Message Protocol".

TG70113EN02GLA2
4 2010 Nokia Siemens Networks
IP addressing

Properties of the Internet Protocol (IP)

IP is a connectionless protocol
Layer 3 protocol Network Layer
The IP protocol offers
no reliability
no flow control
no error recovery.
IP packets may arrive
out of order
may be lost

best-effort service

Fig. 2 IP properties

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

TG70113EN02GLA2
2010 Nokia Siemens Networks
5
IP addressing

1.2 IP properties
Internet protocol requirements
IP is a network layer protocol. From the layer model point of view, it is located
between the protocols of layer 2 (OSI) and the protocols of layer 4 (OSI). That's why
a lot of features have to be supported by IP.

Fragmentation
On layer 2, different transmission methods can be used that stipulate different
maximum lengths for the transmission of a packet. This is taken into account by the
capability of IP to fragment datagram's.
The fields Identification, the flags DF (dont fragment), MF (more fragments) and
fragment offset belong to fragmentation. For a detailed description of fragmentation
please refer to the appendix.

Addressing terminals
IP provides a datagram transmission service. It must be possible to transmit both
originator and destination addresses.
The source IP address field (IP address of the transmitting station) and destination
IP address field (IP address of the destination station) are used to address terminals.

Addressing higher protocols


In the higher layers (layer 4 of the OSI model), there may also be several protocols
that use IP transmission services. IP must therefore be able to address higher
protocols.
In the protocol field, a higher protocol code is specified to which the IP is to deliver
the transmitted data.

Transmission integrity
If you look at an IP packet as a pure means of transport, like a container, it should be
ensured that the container arrives correctly at its destination. The recipient must
determine whether the content was destroyed during transit.
The checksum field serves this purpose. This checksum involves the header fields
only; data are not checked. If the header is correct, the correct transmission of the
packet is ensured.

Quality of service
Different applications can have different requirements as regards quality of service.
IP should be able to take such requirements into consideration during transmission.
In the type of service field, different quality of service requirements can be coded.

TG70113EN02GLA2
6 2010 Nokia Siemens Networks
IP addressing

Further requirements:
Integrity: Delivery to the correct destination

Quality of Service: Sometimes best effort is not enough

Transport Layer TCP UDP

Addressing of higher
layer protocols

Addressing of stations
Network Layer IP S
N
N
M
IE
R
O
D
X
S
F M
E
S
O
D
IX
N
S
N
E
F
R

Frag men tation

Data Link Layer Ethernet Ethernet Ethernet

Fig. 3 Tasks of the internet protocol

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

TG70113EN02GLA2
2010 Nokia Siemens Networks
7
IP addressing

1.3 IP header fields

Field bits Description


Version 4 Version of the IP protocol. The current version is 4 (IPv4).
LEN 4 Length of the IP header counted in 32-bit quantities (4 bytes)
Type of 8 Indication of the quality of service (precedence, delay,
Service throughput and reliability) requested for the IP datagram. IP
cannot guarantee availability of the selected service.
Total Length 16 Total length of the datagram, header and data, in bytes
Identification 16 A unique number assigned by the sender to aid in
reassembling a fragmented datagram. Fragments of a
datagram will have the same identification number.
Flags 3 Control flags (DF for dont fragment, MF for more fragments)
Fragment 15 Position of fragment relative to original datagram (unit is 8
Offset bytes)
Time to Live 8 Specifies the hop count of this datagram is allowed to travel
(TTL) on the Internet before being discarded. Each router passed is
supposed to decrease this field. By reaching the value 0 the
IP packet is discarded.
Protocol 8 Code number for the higher-level protocol to which IP should
Number deliver the data: e.g. 01=ICMP, 06=TCP, 17=UDP
Header 16 Checksum on the header only. If the header checksum does
Checksum not match the contents, the datagram is discarded because at
least one bit in the header is corrupt, and the datagram may
even have arrived at the wrong destination.
Source IP 32 32-bit IP address of the host sending this datagram
Address
Destination 32 32-bit IP address of the destination host for this datagram
IP Address
Options Include Internet Timestamp, Record Route, and Stream ID.
This field is used for network testing and debugging.
Padding Variable field that is used to ensure that the IP header length
is a multiple of 32 bits. If an option is used, the datagram is
padded with all-zero up to the next 32-bit boundary
Data The data contained in the datagram is passed to a higher-
level protocol, as specified in the protocol field. The amount of
data that can be transmitted in one datagram varies
depending on the MTU value for the physical network layer.

TG70113EN02GLA2
8 2010 Nokia Siemens Networks
IP addressing

IP Header

32 Bits

0 4 8 16 31

Version LEN Type of Service Total Lengt h


D M
Identif ication 0 Fragment Offs et
F F

IP T ime t o Live (TTL) Prot ocol Header Chec ksum


Header
Sourc e IP Addres s

Destination I P Address

O ptions Padding

Data

Fig. 4 IP Header

IP Trace Example

Fig. 5 IP trace example

TG70113EN02GLA2
2010 Nokia Siemens Networks
9
IP addressing

TG70113EN02GLA2
10 2010 Nokia Siemens Networks
IP addressing

2 IP addressing

Fig. 6 IP addressing

TG70113EN02GLA2
2010 Nokia Siemens Networks
11
IP addressing

2.1 Addressing on the network layer


Network addresses are logical addresses
The physical addresses of the data link layer clearly identify each device within a
network. In larger networks, it is impractical to deliver data based exclusively on the
physical address. To reduce network traffic and minimize delivery times in larger
networks, transfer and packet filtering methods are required. The network layer uses
logical network addresses to transfer packets to specific subnets within a complex
network system. The devices that evaluate this and transfer packets according to
their logical addresses are referred to as routers.
Logical network addresses are allocated during network configuration. The person
setting up the network must ensure that each address within the overall network is
unique.

MAC addresses and networks addresses


For the physical transmission of data only the MAC address is used. Each physical
port of a device therefore has a MAC address and a network address. There are
mechanisms to find a MAC address if one knows the network address and vice
versa.
One example of allocating a logical network name to a MAC address is:

Network address MAC address


192.52.200.51 08-00-14-35-67-32

TG70113EN02GLA2
12 2010 Nokia Siemens Networks
IP addressing

Network addresses.
They have a logical structure

Laye r 2 Switch ing is u sed


Subne twork address
Su bnetwork addre ss
Bro adcast Domain
Router Broadcast Domai n
Laye r 2 Switching is u sed

Router
Route r Router

Su bnetwork add ress


Layer 2 Switching is used
Router Broadcast Domai n
Subn etwork address Laye r 2 Switching is u sed
Broadcast Domain

Fig. 7 Network addresses

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

TG70113EN02GLA2
2010 Nokia Siemens Networks
13
IP addressing

2.1.1 Structured addresses

Network addresses are logical addresses


Networksimplify
greatly layer addresses are as
data delivery logical
well addresses, and unlike
as considerably reduceMAC addresses,
expenditure they aretable
for routing not permanently
organization stored on the hardware
and administration but
within can be allocated by the administration at will. This can be used to create a logical, hierarchical addressing scheme, which can
a router.

2.1.2 Decimal and binary notation of IP addresses


An IP address consists of 32 bits, means 4 octets or 4 bytes. To make Internet
addresses easier for human users to read and write, IP addresses are often
expressed as four decimal numbers, each separated by a dot. This format is called
"dotted-decimal notation." It is this type of notation that you are probably most familiar
with.
Dotted-decimal notation divides the 32-bit Internet address into four 8-bit (byte) fields
and specifies the value of each field independently as a decimal number with the
fields separated by dots. The figure bellow shows how a typical Internet address can
be expressed in dotted decimal notation.
It can, however, also be useful to represent individual bytes in binary format, for
example when working with subnet masks.

2.1.3 IP address properties


For the reasons cited, the Internet also uses logical structured addresses, so-called
IP addresses.

IP addresses consist of a network part (network prefix) and a host part...


IP addresses are structured addresses; i.e. one part identifies the network and one
part a certain host within a network. This contributes to better handling of message
transmission through networks.

... which makes life easier for routers


Routers can deliver an IP packet by only evaluating the network part of the address
in the respective local network. By evaluating the complete IP address, the last router
can then locate the destination station in the local network. It is therefore sufficient if
the local network knows the complete address, or, alternatively, if it can be
determined to which computer it belongs.
The current version of IP, IP version 4 (IPv4), defines a 32-bit address which means
that there are only 232 (4.294.967.296) IPv4 addresses available. This might seem
like a large number of addresses, but as new markets open and a significant portion
of the world's population becomes candidates for IP addresses, the finite number of
IP addresses will eventually be exhausted.

TG70113EN02GLA2
14 2010 Nokia Siemens Networks
IP addressing

32 Bit IP
IP Addres
Addre ss
s

Netw ork
Ne twork Host
Host
The
Th ehost
ho stpart
p art ofofthe
th eaddress
add ressi dentifi
ident ifes
ies
The
T henetwork
n et workpart partofofththe
e addre ss
ad dress a cert ain host
idi dent
en tif ifi
iesesaacertain a cert ai n ho st
cert ai nnetwork
n et work wiwit
thihin
n the n etw ork
the net work
The
Th esisize
ze oof f netw orkp art will
networkpart wil lbe
be The size of hostp art will be def ined by
ddefi
efinned
ed bbyy tht he
e num Th e size of hostpart wil l b e de fined by
numberberofof t he
th enum
number
ber ofofHostbi ts(0) i ninthe
Hostbits(0) th e
networkbit
networkbitss(1)in (1)i nt the
he subn etm ask
su bnetm ask sub netmmask
subnet ask

Router R outer

Fig. 8 Network and host part of an IP address

Binary and decimal Notation of IP Address

Byte
Byte
Byte
Byte
Dotted Decimal
Notation 85
11
117
4
Binary
Notation 01010101 00001011 01110101 00000100

Fig. 9

TG70113EN02GLA2
2010 Nokia Siemens Networks
15
IP addressing

2.2 Class based IP addressing


IP addresses were initially strictly organized into class A, B and C addresses. The
difference between these classes is the number of bytes used for network
identification. In addition address classes D and E are also defined.

Class A (/8 Prefixes) 1 byte for the network part


Each Class A network address has an 8-bit network-prefix with the highest order bit
set to 0 and a seven-bit network number, followed by a 24-bit host-number. Class A
networks are also referred to as "/8s" (pronounced "slash eight" or just "eighths")
since they have an 8-bit network-prefix.
A maximum of 126 (27 -2) /8 networks can be defined. Each /8 supports a maximum
of 16,777,214 (224 -2) hosts per network. Since the /8 address block contains 2 31
(2,147,483,648) individual addresses and the IPv4 address space contains a
maximum of 2 32 (4,294,967,296) addresses, the /8 address space is 50% of the total
IPv4 unicast address space.

Class B (/16 Prefixes) 2 bytes for the network part


Each Class B network address has a 16-bit network-prefix with the two highest order
bits set to 1-0 and a 14-bit network number followed by a 16-bit host-number. Class B
networks are also referred to as"/16s" since they have a 16-bit network-prefix.
A maximum of 16,384 (214) /16 networks can be defined with up to 65,534 (216 -2)
hosts per network. Since the entire /16 address block contains 2 30 (1,073,741,824)
addresses, it represents 25% of the total IPv4 unicast address space.

Class C (/24 Prefixes) 3 bytes for the network part


Each Class C network address has a 24-bit network-prefix with the three highest
order bits set to 1-1-0 and a 21-bit network number, followed by an 8-bit host-
number. Class C networks are also referred to as "/24s".
A maximum of 2,097,152 (221) /24 networks can be defined with up to 254 (28 -2)
hosts per network. Since the entire /24 address block contains 2 29 (536,870,912)
addresses, it represents 12.5% (or 1/8th) of the total IPv4 unicast address space.

Class D
Class D addresses are used for multicast groups. The four most significant bits are
always set to 1-1-1-0. Multicast addresses operate in a range from 224.0.0.0 to
239.255.255.255.

Class E
Class E addresses are used for experimental purposes and are not available for
general use. The four most significant bits are always set to 1-1-1-1.
TIP
Class D and Class E addresses are never used for addressing end user devices.

TG70113EN02GLA2
16 2010 Nokia Siemens Networks
IP addressing

Class based IP Ad dressing

C la ss A
N H H H
0 7 B its 2 4 B its
Ra ng e: (1-12 6)

C l ass B
N N H H
10 14 Bi ts 1 6 Bi ts
Ra ng e: (12 8-191 )

C las s C
N N N H
110 21 B its 8 B its
Ra ng e: (19 2-223 )

Fig. 10 IP addresses of classes A, B and C

Class based IP Addressing

Class A
Bit# 0 1 7 8 31
0
Network-
Host-Number
Prefix

Class B
Bit# 0 2 15 16 31
10
Network-Prefix Host-Number

Class C

Bit# 0 3 23 24 31

110

Network-Prefix Host-
Number

Fig. 11 Class A, B and C

TG70113EN02GLA2
2010 Nokia Siemens Networks
17
IP addressing

2.3 Reserved IP addresses


Some IP network and host numbers are reserved for special aspects of TCP/IP
communication and may not be used for any other purpose.
The following addresses have special meanings:
A host number 0 is reserved for reference to a certain network ID. This means that
in the network with the network address 192.16.1.0 the IP address 192.16.1.1 is
the first class C host address that could be allocated, for example.
The host number consisting exclusively of ones is reserved for directed broadcast
messages to all hosts of a certain network. It can only be used as a destination
address. These directed broadcast messages should not be forwarded via routers.
Loopback address: 127.x.x.x. (x can be a random number. This all bits 1 Class A
address is used as a loopback address and, if implemented, must be used
correctly to point back at the originating host itself. In many implementations, this
address is used to provide test functions. By definition, the IP datagram's never
actually leave the host.
The network ID consisting exclusively of zeros is classless and signifies "the
current network whose number is not known". This address is therefore only
transferred within the local network.
The address 0.0.0.0 is reserved and used in two cases:
a) As the originator address if the host does not know its actual address, for
example, when powering up a workstation without hard disk. This would relate
only to situations where the source IP address appears as part of an
initialization procedure when a host is trying to determine its own IP address.
The Bootstrap Protocol (BootP) is an example of such a scenario.
a) Routers use it to specify default routes in address lists, i.e. the route to all
networks not explicitly listed.
The network ID of a certain class consisting exclusively of ones.
A limited IP broadcast address is defined to be all-ones: {-1, -1} or
255.255.255.255. The address 255.255.255.255 is reserved as destination
address for local broadcast messages to all the hosts of a network.

TG70113EN02GLA2
18 2010 Nokia Siemens Networks
IP addressing

R e s er ve d IP A dd r es s es

h ost nu mbe r a ll 0 s a certa in n etw ork ID

h ost nu mbe r a ll1s b ro a dcast, d ire cte d b ro ad ca st

C la ss A ad dress: lo o pb ack a dd re ss
1 27 .x.x.x

0 .0.0.0 so urce ad dress (this ho st in th is n etw ork)


or
d e fa ult ro ute (in the ro uting ta ble )

2 55 .25 5.25 5 .2 55 lo cal b ro ad ca st a dd re ss

Fig. 12 Reserved IPAddresses

Applic ation
Destination
127.0.0.1
TCP
IP
Data Link Layer

Direc
Dire ctete dd Broa
Broadcdcaas
stt tto
o
S E
IE MS
IX D
N
N
OR F
DA=2
DA=20011.3.3.2
.3 .3.2555
5 net work
ne tw ork 220
0 1.3.3.0
1.3 .3 .0 bby
y defa ult dis
def ault able
disa d
bled

1192.1
92 .16.1.1
6 .1 .1

Router

Ne tw ork
Netw ork addr.
a ddr. 19 2.166.1.0
1 92.1 .1 .0
DA=25 5.2555
DA=2 55.2 5.2 55.2
.255 555
.25

Fig. 13 Reserved addresses

TG70113EN02GLA2
2010 Nokia Siemens Networks
19
IP addressing

2.4 Private IP addresses


When building their networks, many organizations do not have the requirement to
route outside of their own network. Under these circumstances the network can be
assigned any IP address that the local network administrator chooses. This practice
has now been formalized in RFC 1918 - "Address Allocation for Private Internets".
This RFC details the following three ranges of addresses, which the Internet
Assigned Numbers Authority (IANA) has reserved for private networks that do not
require connectivity to the Internet:
These ranges are not forwarded via any Internet router.

Range from to Amount of private network addresses


10.0.0.0 10.255.255.255 1 class A network
172.16.0.0 172.31.255.255 16 contiguous class B networks
192.168.0.0 192.168.255.255 256 contiguous class C networks

These addresses may be used by any organization without reference to any other
organization, including the Internet authorities. However, they must not be referenced
by any host in another organization, nor must they be defined to any external routers.
All external routers should discard any routing information regarding these
addresses, and internal routers should restrict the advertisement of routes to these
private IP addresses.
Any organization that elects to use addresses from these reserved blocks can do so
without contacting the IANA or an Internet registry. Since these addresses are never
injected into the global Internet routing system, the address space can
simultaneously be used by many different organizations.
The disadvantage to this addressing scheme is that it requires an organization to use
a Network Address Translator (NAT) for global Internet access. However, the use of
the private address space and a NAT make it much easier for clients to change their
ISP without the need to renumber. The benefits of this addressing scheme to the
Internet are that it reduces the demand for IP addresses so large organizations may
require only a small block of the globally unique IPv4 address space.

TG70113EN02GLA2
20 2010 Nokia Siemens Networks
IP addressing

2 32 (4,294,967,296) IP addresses

16,384 (2 14 )
Class B
networks -
0 .0
126 (27 -2) 6.
. 1
Class A 2 0.0
17 2 .31.
networks 17

19
19 2 .16
2.1 8.0
0 68 .0 -
. 0 .0. .25 2,097,152 (2 21)
10 5.0 Class C

Fig. 14 Addresses reserved for private use

Address Range Netw ork s Address Class

10.0 .0.0 -
1 A
10 .255.255.255

172.16.0.0 -
16 B
17 2.31.255.255

192.168.0.0 -
25 6 C
192.168.25 5.255

These addresses will not be


forwarded b y public routers!

Fig. 15 Addresses reserved for private use

TG70113EN02GLA2
2010 Nokia Siemens Networks
21
IP addressing

2.5 Publicly used IP addresses


Each publicly used IP address can occur only once in the network. To ensure, that
each network address is unique worldwide, today there are five regional registries
that handle worldwide IP address assignments:

African Network Information Center (AfricNIC)


IP address allocation for Africa. AfricNIC can be contacted at the following URL:
http://www.afrinic.net

Latin American and Caribbean Network Information Center (LACNIC)


IP address allocation for Latin American and Caribbean region. LACNIC can be
contacted at the following URL: http://www.lacnic.net

Asia-Pacific Network Information Center (APNIC)


IP address allocation for Asia-Pacific. APNIC can be contacted at the following URL:
http://www.apnic.net

American Registry for Internet Numbers (ARIN)


IP address allocation for North and South America, the Caribbean and sub-Saharan
Africa. ARIN can be contacted at the following URL: http://www.arin.net

Rseaux IP Europens Network Coordination Centre (RIPE NCC)


IP address allocation for Europe and surrounding areas. RIPE NCC can be contacted
at the following URL: http://www.ripe.net
The top-level technical coordination body for the Internet is the Internet Corporation
for Assigned Names and Numbers (ICANN). Created in October 1998 by a broad
coalition of the Internet's business, technical, academic, and user communities,
ICANN is assuming responsibility for a set of technical functions previously
performed under U.S. government contract by Internet Assigned Numbers Authority
(IANA) and other groups.
Specifically, ICANN coordinates the assignment of the following identifiers that must
be globally unique for the Internet to function:
1. Internet domain names
2. IP address numbers
3. Protocol parameter and port numbers
ICANN can be contacted at the following URL: http://www.icann.org

TG70113EN02GLA2
22 2010 Nokia Siemens Networks
IP addressing

IANA
IANA / ICANN
ICANN

ARIN
ARIN APNIC
APNIC RIPE
RIPE NCC
NCC LACNIC
LACNIC AfriNIC

Local
Local IR
IR Enterprise Local
Local IR
IR
Enterprise
Local
Local IR
IR

LIR.........Local Internet Registry ARIN.......... Americ an Registry for Int ernet Numbers
IAN A......Internet As signed Numbers Authority RIPE NCC.. Rseaux IP Europens Network
ICANN...Internet Corporation for Assigned Coordination Centre
Names and Numbers APNIC........ Asia-Pacific Network Information Center
LACNIC ..Latin Americ an and Carribbean NIC AfriNIC........ Afric an NIC

Fig. 16 Regional registry structure

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

TG70113EN02GLA2
2010 Nokia Siemens Networks
23
IP addressing

2.6 Allocation of IP addresses


2.6.1.1 Manual allocation of addresses
Generally, a computer has a fixed address that can be allocated manually. Below you
will find examples of how addresses can be set up manually. However, there are
cases when permanent addresses are not useful. If computers are only temporarily
connected to the Internet, they do not need to be allocated a permanent IP address
that would then be unavailable for other computers.

2.6.1.2 Dynamic allocation of addresses


Due to the shortage of addresses, so-called dynamic address allocation can be used,
e.g. for dial-up connections to the Internet. As soon as a computer logs in with a
service provider, it is allocated a free IP address. As soon as the connection is
terminated, the address is then available for other computers.
Dynamic address allocation can also be used to simplify administration within a
network. An IP address can, for example, be allocated to a station when it first logs
on. This function as well as others is supported by the Dynamic Host Configuration
Protocol (DHCP).

Examples
The following diagram shows the input of an IP address under Windows
For a CISCO router the command would be:
cisco# conf t
cisco-conf-t# interface e0
cisco config-t-interface e0# ip address 132.76.250.55 255.255.192.0

On a SUN Solaris Workstation the command would be as follows:


# ifconfig le0 132.76.250.55 netmask 255.255.192.0

TG70113EN02GLA2
24 2010 Nokia Siemens Networks
IP addressing

Allocation of IP addresses (PC)

v ia
Dynamic
Host
Configuration
Protocol
(DHCP)

Fig. 17 Configuration of an IP address

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

TG70113EN02GLA2
2010 Nokia Siemens Networks
25
IP addressing

2.6.2 Problems with Class Based Addressing


The IP address, which provides universal addressing across all networks of the
Internet, is one of the great strengths of the TCP/IP protocol suite. However, the
structure of the IP address does have some problems. The TCP/IP designers did not
envision the enormous scale of today's network. When TCP/IP was being designed,
networking was limited to large organizations that could afford substantial computer
systems. The idea of a powerful system on every desktop did not exist. At that time, a
32-bit address seemed so large that it was divided into classes to reduce the
processing load on routers.
However, the allocation of addresses was not disciplined and the class structure did
not deliver the intended efficiency. The somewhat static classification of an
organization was defeated by chaotic growth. Class B numbers were allocated to
organizations that did not grow sufficiently to make use of 64,000 host numbers and,
conversely, organizations that were not in time to obtain a free class B number
quickly outgrew class C and needed multiples to make up the required number of
host numbers. Assigning a medium sized network, a single class B address, instead
of six class C addresses, reduces the load on the router because the router only
needs to keep one route for that entire organization's network. However, the
organization that was given the class B address probably does not have 64,000
computers, so most of the host addresses available to the organization will never be
assigned.
In the early 1990s, it was obvious that the rapid growth of the Internet meant that
there would soon be a critical shortage of available addresses. This is referred to as
the IP Exhaustion Problem.
The Internet community suggested several possible courses of action to solve this
problem, four of which were:
Recovering addresses which were allocated but not in use
Network Address Translation
A new version of IP and
Classless address allocation, known also as CIDR

Another unrelated problem is referred to as routing table explosion. Routers have to


know about all the networks connected to it. They store Network IDs in their routing
table. As the number of networks grows, so does the size of the routing table. This
problem can be minimized by summarizing a number of networks into one Network
ID, as we shall see later in this module.

TG70113EN02GLA2
26 2010 Nokia Siemens Networks
IP addressing

2.7 Classless IP addressing


In Classless IP addressing no static boundaries between Net ID and Host ID are
used. Classless IP Addressing allows the assignment of a block of addresses that is
much closer in size to the actual number of addresses needed on a network. For
example, if an organization will only have 1,000 hosts, they can be assigned a Host
ID having 10 bits for hosts that will give them a block of 210 = 1,024 addresses.
In Classless addressing the number of bits for Net ID and Host ID is not static.
Therefore we cannot identify it based on some first bits in the address. Identification
is done by subnet mask or netmask. The Netmask consists of a series of ones
corresponding to the network number followed by zeros.

Class Based / Classless IP Addressing


Class Start NetID HostID Smallest Largest Purpose
Bits IP Address IP Address
A 0 7 bits 24 bits 0.0.0.0 127.255.255.255 Large Networks
B 10 14 bits 16 bits 128.0.0.0 191.255.255.255 Medium Networks
C 110 21 bits 8 bits 192.0.0.0 223.255.255.255 Small Networks
D 1110 NA NA 224.0.0.0 239.255.255.255 Multicasting
E 1111 NA NA 240.0.0.0 255.255.255.255 Reserved

32 bits

Network ID (Net ID) Host ID

n bits 32-n bits

Fig. 18 Classless IP addressing

TG70113EN02GLA2
2010 Nokia Siemens Networks
27
IP addressing

2.8 Subnet and subnet mask


The increased demand for computer and network connections meant that the IP
addressing schema with its strict organization into class A, B and C addresses were
exhausted. In the mid 80s, a solution to this problem was found: subnetaddressing.

The purpose of subnets


Subnets and subnetmasks allow the network administrator to divide a large network
into smaller subnets. In order to make the best possible use of the limited address
space available, subnets do not use any of the predefined network classes, e.g.
several officially registered class C addresses. Externally, only one registered
address should be used.

Division into subnets is an internal matter


Division into subnets is an internal matter and is carried out by the respective network
administrator. It is often important to pass on the responsibility of IP address
administration to individual departments to give them better control over their
networks. The creation of subnets thus simplifies network administration and allows
internal restructuring of a network without affecting larger network units or even the
entire Internet.

Subnets and routers


Routers are used to link networks on the network layer. Routers are network devices
that are simultaneously connected to several (sub-) networks via a number of
interfaces. This means that for interconnectivity purposes each subnet must be
accessible by one dedicated router interface. The address of this interface must be
part of the subnet address space. Subnets are often based on physical network
structures. This way it is possible, for example, to treat individual Ethernet-based
LANs as subnets and use routers to link them.

Subnet masks
Since a router needs to discriminate between (sub-) network part and host part,
standard class A, B, C network addresses cannot be used to differentiate between
individual subnets. In order to do this differentiation, subnet masks are used. Subnet
masks allow the assignment of certain bits of the host part of the class A, B, C
address to be part of the subnet address.

TG70113EN02GLA2
28 2010 Nokia Siemens Networks
IP addressing

Subnetting

Example: Original Class A address

0 8 16 24 31
Orignal Host part
Network part

Subnetwork part Host part

After subnetting

Fig. 19

Subnetting

Subnet ID H ost ID

N et ID Sub net N umb er H ost N umbe r

IP A dd ress

Su bn et Ro ute r M
E
S
NS
N
E
IX
F
R
O
D
Sub net

H o st
R outers are used to Ro uter
c onnect s ubnet Ro uter

Su bn et The subnet s truc ture


may only be vi sible
w ith in the network .

Fig. 20 Net ID, subnets and hosts

TG70113EN02GLA2
2010 Nokia Siemens Networks
29
IP addressing

TG70113EN02GLA2
30 2010 Nokia Siemens Networks
IP addressing

The classical IP addressing architecture used addresses and subnet masks to


discriminate the host number from the network prefix. Like the IP address, the subnet
mask consists of four bytes, separated by dots in its written representation.
With network prefixes, it is sufficient to indicate the number of bits in the prefix. Both
representations are in common use. Architecturally correct subnet masks are capable
of being represented using the prefix length description. They comprise that subset of
all possible bits patterns that have:
A contiguous string of ones at the more significant end (The number of bits set to
"1" is also referred to as "prefix length".),
A contiguous string of zeros at the less significant end, and
No intervening bits.
The mode of operation of the subnet mask can, however, best be understood by
choosing the binary format of the mask. Each bit that is set to "1" in the subnet mask
belongs to the network part of the IP address; the other bits of the IP address remain
for the host part and are set to "0".

Example:
Filtering the IP address 132.76.250.55 with the subnet mask 255.255.192.0 produces
the network address 132.76.192.0. The prefix notation in this example is
132.76.250.55 /18.
In the example below, the subnet mask 255.255.192.0 is used to create subnet
132.76.192.0 of the class B network address 132.76.0.0. Using this mask an other
subnet can be created (132.76.128.0). A router may be used to link both subnets.

Address classes are linked to default address masks


The standard address classes A, B, C and E are linked to default address masks.
The default subnet mask is always used when no subnets are involved. All network
ID bits are set to 1 and all host ID bits to 0. The following table shows the default
masks for the different address classes.

Address Binary Subnet Mask Decimal Subnet


Class Mask
Class A 11111111 00000000 00000000 00000000 255.0.0.0
Class B 11111111 11111111 00000000 00000000 255.255.0.0
Class C 11111111 11111111 11111111 00000000 255.255.255.0

TG70113EN02GLA2
2010 Nokia Siemens Networks
31
IP addressing

Subnet Mask

Is used to:
discriminate the host number from the network number.
indicate the number of bits in the prefix.

Must have:
a contiguous string of ones at the more significant end,
a contiguous string of zeros at the less significant end, and
no intervening bits.

Fig. 21 Subnet mask

Subnet Mask

Host
P Addr ess
13 2 76 250 55 100001000 100110 011111010 00110111

Sub net Mask 25 5 255 192 0 111111111 111111 111000000 00000000


P refix Notation Netw ork part Host-part
/ 18

Networ k Part
of the Ad dress 132 76 192 0 1000010001001100110 00000 00000000

Fig. 22 Subnet mask

TG70113EN02GLA2
32 2010 Nokia Siemens Networks
IP addressing

TCP/IP Properties (windows)

IP_Host address

-Routerport

Fig. 23 Input mask with IP address, subnet mask and default gatewa

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

TG70113EN02GLA2
2010 Nokia Siemens Networks
33
IP addressing

2.8.1 Defining the subnet mask / extended-prefix length


The most significant bits of the host part of an IP address is used to create subnets
by defining a subnet mask:
The definition of a subnet mask involves four steps.
1. Planning the network:
a) How many total subnets does the organization need today?
b) How many total subnets will the organization need in the future?
c) How many hosts are there on the organization's largest subnet today?
d) How many hosts will there be on the organization's largest subnet in the
future?
The first step in the planning process is to take the maximum number of subnets
required and round up to the nearest power of two. For example, if a organization
needs 9 subnets, 23 (or 8) will not provide enough subnet addressing space, so
the network administrator will need to round up to 24 (or 16). When performing this
assessment, it is critical that the network administrator always allow adequate
room for future growth.
For example, if 14 subnets are required today, then 16 subnets might not be
enough in two years when the 17th subnet needs to be deployed. In this case, it
might be wise to allow for more growth and select 25 (or 32) as the maximum
number of subnets.

TG70113EN02GLA2
34 2010 Nokia Siemens Networks
IP addressing

IP subnetting design steps

Net ID Host ID

Net ID Subnet Number Host Number

IP Address
? ?

Subnet Router M
E
S
O
D
IX
N
F
R
how many subnets ? Subnet
...today?
...in the future? Host
Router
Router
how many hosts ? Subnet
...today?
...in the future?

Fig. 24 Planning the network

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

TG70113EN02GLA2
2010 Nokia Siemens Networks
35
IP addressing

2.9 IP Host address versus IP Subnet address


With the introduction of subnets, a new way of ascertaining the network part of an
address must be found.

Subnet Masks
Technically this task is implemented through the introduction of a subnet mask. The
length of the IP address and subnet mask match, both consisting of a 32-bit
sequence of figures. A simple rule for determining the network part of the address is
that each bit in the subnet mask that is set to 1 belongs to the network part of the IP
address.
If you specify that bits set to 1 in the subnet mask must always be in succession (a
sequence of ones must not be interrupted by a zero), it is sufficient to indicate the
length of a subnet mask to describe it completely. This is used in prefix length
notation discussed below.

IP Host address v.s Subnet address

IP Host address IP Host address

Logical AND Subnet mask


Subnet mask
---------------------
=Subnet address

Subnet address

Default Gateway

Fig. 25 IP Host and Subnet Address

TG70113EN02GLA2
36 2010 Nokia Siemens Networks
IP addressing

Use of subnet mask


IP_Host address = 1 1 0 0 1 1 0 0 204
192.168.109.204
Logical AND
Subnet mask =
255.255.255.248 1 1 1 1 1 0 0 0 =248

1 1 0 0 1 00 0 0 =200

Subnet address = 168.198.109.200 Red=Networkbits


Green=Hostbits

only look for


e.g. 4. Byte

= . 248
subnet mask 1 1 1 1 1 0 0 0

N N N N N H H H
Interpretation of bits

Network bits Host bits

Fig. 26 Use of Subnet Mask

IP Address Notation methods

N o ta t io n M e t h o d s

C o m b in a tio n IP A d d r e s s & S u b n e t M a s k
e .g .
1 3 2 .7 6 .2 5 0 .5 5 , 2 5 5 .2 5 5 .1 9 2 .0

P r e fix L e n g th N o ta t io n (n u m b e r o f n e tw o rk + s u b n e t b its )
e .g .
1 3 2 .7 6 .2 5 0 .5 5 /1 8

Fig. 27

TG70113EN02GLA2
2010 Nokia Siemens Networks
37
IP addressing

2.9.1 Notation methods


There are different methods of writing the network part of an IP address.
Combination IP address & subnet mask
One option is to indicate the combination of the IP address and subnet mask. The
network part of the address can be ascertained by representing the subnet mask
in binary form.
Prefix Length Notation
A second common method is prefix length notation. Here the length of the network
part is indicated directly, separated from the IP address by a slash. NB the
specified length here also relates to the number of bits in the binary
representation.

TG70113EN02GLA2
38 2010 Nokia Siemens Networks
IP addressing

2.10 Binary to Decimal conversation table

I , -
0000 0001 0010 0011

0 0000 0000 16 0001 0000 32 0010 0000 48 0011 0000

1 0000 0001 17 0001 0001 33 0010 0001 49 0011 0001

2 0000 0010 18 0001 0010 34 0010 0010 50 0011 0010


3 0000 0011 19 0001 0011 35 0010 0011 51 0011 0011
4 0000 0100 20 0001 0100 36 0010 0100 52 0011 0100

5 0000 0101 21 0001 0101 37 0010 0101 53 0011 0101


6 0000 0110 22 0001 0110 38 0010 0110 54 0011 0110
7 0000 0111 23 0001 0111 39 0010 0111 55 0011 0111

8 0000 1000 24 0001 1000 40 00101000 56 0011 1000


9 0000 1001 25 0001 1001 41 0010 1001 57 0011 1001

10 0000 1010 26 0001 1010 42 00101010 58 0011 1010

11 0000 1011 27 0001 1011 43 00101011 59 0011 1011

12 00001100 28 0001 1100 44 00101100 60 0011 1100

13 0000 1101 29 0001 1101 45 00101101 61 0011 1101

14 0000 1110 30 0001 1110 46 00101110 62 0011 1110

15 0000 1111 31 0001 1111 47 00101111 63 0011 1111

0100 0101 0110 0111


64 0100 0000 80 0101 0000 96 0110 0000 112 0111 0000
65 0100 0001 81 0101 0001 97 0110 0001 113 0111 0001

66 0100 0010 82 010i 0010 98 0110 0010 114 0111 0010

67 0100 0011 83 0101 0011 99 01100011 115 0111 0011


68 0100 0100 94 0101 0100 100 0110 0100 116 0111 0100
69 0100 0101 85 0101 0 i 0 i 101 0110 0101 117 0111 0101

70 0100 0110 86 0101 0110 102 0110 0110 118 0111 0110
71 0100 0111 87 0101 0111 103 0110 0111 119 01110111
72 0100 1000 88 0101 1000 104 0110 1000 120 0111 1000

73 0100 1001 89 0101 1001 105 0110 1001 121 0111 1001

74 0100 1010 90 0101 1010 106 01101010 122 0111 1010

75 01001011 91 0101 1011 107 01101011 123 0111 1011

76 01001100 92 0101 1100 108 0110 1100 124 0111 1100

77 01001101 93 0101 1101 109 01101101 125 0111 1101

78 01001110 94 0101 1110 110 01101110 126 0111 1110

79 01001111 95 0101 1111 111 01101111 127 0111 1111

TG70113EN02GLA2
2010 Nokia Siemens Networks
39
IP addressing

1000 1001 1010 1011


128 1000 0000 144 1001 0000 160 1010 0000 176 1011 0000
129 1000 0001 145 1001 0001 161 1010 0001 177 1011 0001
130 1000 0010 146 1001 0010 162 1010 0010 178 1011 0010
131 1000 0011 147 1001 0011 163 1010 0011 179 1011 0011

132 1000 0100 148 1001 0100 164 1010 0100 180 1011 0100

133 1000 0101 149 1001 0101 165 1010 0101 181 1011 0101
134 1000 0110 150 1001 0110 166 1010 0110 182 1011 0110

135 1000 0111 151 1001 0111 167 1010 0111 183 1011 0111
136 1000 1000 152 1001 1000 168 1010 1000 184 1011 1000

137 10001001 153 1001 1001 169 1010 1001 185 1011 1001

138 1000 1010 154 1001 1010 170 10101010 186 1011 1010

139 1000 1011 155 1001 1011 171 10101011 187 1011 1011

140 1000 1100 156 1001 1100 172 10101100 188 1011 1100

141 1000 1101 157 1001 1101 173 10101101 189 1011 1101

142 1000 1110 158 1001 1110 174 10101110 190 1011 1110
143 10001111 159 1001 1111 175 1010 1111 191 1011 1111

1100 1101 1110 1111


192 1100 0000 208 1101 0000 224 1110 0000 240 1111 0000
193 1100 0001 209 1101 0001 225 1110 0001 241 1111 0001

194 1100 0010 210 1101 0010 226 1110 0010 242 1111 0010
195 1100 0011 211 1101 0011 227 1110 0011 243 1111 0011
196 1100 0100 212 11010100 228 1110 0100 244 1111 0100

197 1100 0101 213 1101 0101 229 1110 0101 245 1111 0101
198 1100 0110 214 1101 0110 230 1110 0110 246 1111 0110
199 1100 0111 215 1101 0111 231 1110 0111 247 1111 0111
200 11001000 216 1101 1000 232 11101000 248 1111 1000
201 1100 1001 217 1101 1001 233 11101001 249 1111 1001

202 1100 1010 218 1101 1010 234 11101010 250 1111 1010

203 1100 1011 219 1101 1011 235 11101011 251 1111 1011

204 1100 1100 220 1101 1100 236 11101100 252 1111 1100

205 1100 1101 221 1101 1101 237 11101101 253 1111 1101
206 11001110 222 1101 1110 238 11101110 254 1111 1110

207 1100 1111 223 1101 1111 239 11101111 255 1111 1111

TG70113EN02GLA2
40 2010 Nokia Siemens Networks
IP addressing

2.11 Case study No. 1( classroom)

Case stud y No 1 (classroom )


IP Subnetting
Determine Maj or network- a nd Subne t address
IP Host Address Subnet Mask Major network address Subnet address

201.222.10.60 255.255.255.248

15.16.193.6 255.255.248.0

128.16.32.13 255.255.255.252

190.13.132.7 255.192.0.0

153.50.6.27 255.255.255.128

256.30.5.1 255.255.255.0

Fig. 28

Your solution

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

TG70113EN02GLA2
2010 Nokia Siemens Networks
41
IP addressing

TG70113EN02GLA2
42 2010 Nokia Siemens Networks
IP addressing

2.12 Case study No.2 ( classroom)


An organization has been assigned the network number 195.1.1.0 /24 and it needs to
define six subnets. The largest subnet is required to support 25 hosts.
2. Determine the number of bits required to define the necessary number of
subnets and hosts.
The first step is to determine the number of bits required to define the six subnets.
Since a network address can only be subnetted along binary boundaries, subnets
must be created in blocks of powers of two [ 2 (21 ), 4 (22 ), 8 (23), etc. ]. Thus, it is
impossible to define an IP address block such that it contains exactly six subnets.
For this example, the network administrator must define a block of 8 (23) and have
two unused subnets that can be reserved for future growth. Since 8 = 23, three bits
are required to enumerate the eight subnets in the block. E.g. for six subnets we
need three bits (23 = 8 and 22 = 4) for the subnet part; for 25 hosts we need 5 bits
(25-2 = 30) for the host part of the IP address.
3. Set the bits.
Set the calculated number of bits required for the network and subnet part to "1"
and fill up the remaining part of the subnet mask with "0".
4. Convert this number into dotted decimal notation.
In this example, the organization is subnetting a /24 so it will need three more bits,
or a /27, as the extended-network-prefix. A 27-bit extended-network-prefix can be
expressed in dotted-decimal notation as 255.255.255.224.

Defining Each of the Subnet Numbers


The eight subnets will be numbered 0 through 7. The 3-bit binary representation of
the decimal values 0 through 7 is: 0 (0002), 1 (0012), 2 (0102), 3 (0112), 4 (1002), 5
(1012), 6 (1102), and 7 (1112).
In general, to define Subnet #n, place the binary representation of n into the bits of
the subnet-number field. For example, to define Subnet #6, simply place the binary
representation of 6 (1102) into the 3-bits of the subnet-number field.
NOTE
The All-0s Subnet and the All-1s Subnet
In the history, when subnetting was first defined in RFC 950, it prohibited the use of
the all-0s and the all-1s subnet. The reason for this restriction was to eliminate
situations that could potentially confuse a classful router. This had reduced the
number of possible subnets and hosts. Note that today a router can be both classless
and classful at the same time - it could be running RIP-1 (a classful protocol) and
BGP-4 (a classless protocol) at the same time.

TG70113EN02GLA2
2010 Nokia Siemens Networks
43
IP addressing

Case study No2. IP Addressing

1. Number of subnets 6

2. Establishing the 1 1 1 (3Bits) because 2 =8 possibilities


necessary bits

3. Set to most
significant digit 11111111 11111111 11111111 11100000

Convert into decimal format

4. Subnet mask 255 . 255 . 255 . 224

An organization has been assigned the network number 195.1.1.0 /24


and it needs to define six subnets.
The largest subnet is required to support 25 hosts.

Fig. 29

TG70113EN02GLA2
44 2010 Nokia Siemens Networks
IP addressing

Case study No2. IP Addressing

255 . 255 . 255 . 224 Subnet mask


1111 1111 1111 1111 1111 1111 1110 0000

Subnet 0 00000000 = 0
Subnet 1 00100000 = 32
Subnet 2 01000000 = 64
Subnets
Subnet 3 01100000 = 96
Subnet 4 10000000 = 128
Subnet 5 10100000 = 160
Subnet 6 11000000 = 192
Subnet 7 11100000 = 224

Subnet address
195 . 1 . 1 . X / 27
structure

Fig. 30

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

TG70113EN02GLA2
2010 Nokia Siemens Networks
45
IP addressing

2.12.1 Defining host addresses for each subnet


According to Internet practices, the host-number field of an IP address cannot contain
all 0-bits or all 1-bits. The all-0s host-number identifies the subnet number, while the
all-1s host-number represents the broadcast address for the subnet.
In our current example, there are 5 bits in the host-number field of each subnet
address. This means that each subnet represents a block of 30 host addresses (25 -2
= 30, note that the 2 is subtracted because the all-0s and the all-1s host addresses
cannot be used).
The hosts on each subnet are numbered 1 through 30. In general, to define the
address assigned to Host #n of a particular subnet, the network administrator places
the binary representation of n into the subnet's host-number field. For example, to
define the address assigned to Host #15 on Subnet #2, the network administrator
simply places the binary representation of 15 (011112) into the 5-bits of Subnet #2's
host-number field.

2.12.2 Defining the broadcast address for each subnet


The broadcast address for Subnet #2 is the all 1's host address or:
11000011.00000001.0000001.010 11111 = 195.1.1.95
TIP
The broadcast address for Subnet #2 is exactly one less than the base address for
Subnet #3 (195.1.1.96). This is always the case - the broadcast address for Subnet
#n is one less than the base address for Subnet #(n+1).

2.12.3 Benefits of subnetting within a private network


Subnetting overcame the registered number issue by assigning each organization
one network number from the IPv4 address space. The organization was free to
assign a distinct subnet number for each internal network. This allows deploying
additional subnets without needing to obtain a new network number from the Internet.
In the figure below, a site with several logical networks uses subnet addressing to
cover them with a single /24 network address. The router accepts all traffic from the
Internet addressed to network 195.1.1.0 and forwards traffic to the interior subnets.
The deployment of subnetting within the private network provides several benefits:
1. The size of the global Internet routing table does not grow because the site
administrator does not need to obtain additional address space and the routing
advertisements for all of the subnets are combined into a single entry.
2. The local administrator has the flexibility to deploy additional subnets without
obtaining a new network number from the Internet.
3. Route flapping (i.e., the rapid changing of routes) within the private network does
not affect the Internet routing table since Internet routers do not know about the
reachability of the individual subnets - they just know about the reachability of the
parent network number.

TG70113EN02GLA2
46 2010 Nokia Siemens Networks
IP addressing

Case study No2. IP Addressing

OriginalNetwork
Original Network
195.1.1.0
195.1.1.0

subnets
195.1.1.0 195.1.1.0 /27
195.1.1.32 /27
195.1.1.64 /27
Internet Router 195.1.1.96 /27
195.1.1.128 /27
195.1.1.160 /27
195.1.1.192 /27
195.1.1.224 /27

Fig. 31

Case study No2. I P A ddressing

Defi
Definning
ing Host
Host A ddresses for
Addresses forSSubnet
ubnet #2
#2
(195.1.1. 0 is
(195. 1.1.0 i s origi nal class
original cl ass C
C ))

Subnet
S ubnet #2:
#2: 11000011. 00000001. 00000001. 010 00000
11000011.00000001.00000001.010 195.1. 1. 64 //27
00000 = 195.1.1.64 27

Host
Host #1:
#1: 11000011. 00000001. 00000001.010
11000011.00000001.00000001. 00001 = 195.
010 00001 1. 1. 65 //27
195.1.1.65 27
Host
Host #2:
#2: 11000011. 00000001. 00000001.010
11000011.00000001.00000001. 00010 =
010 00010 = 195. 1. 1. 66 //27
195.1.1.66 27
Host
Host #3:
#3: 11000011. 00000001. 00000001. 010 00011
11000011.00000001.00000001.010 00011 == 195.
195.1.1.
1.1.6767 //27..
27. .
Host
Host #28:
#28: 11000011.00000001.00000001. 010 11100
11000011. 00000001. 00000001.010 11100 == 195.1.1.92
195. 1. 1. 92 //27
27
Host
Host #29:
#29: 11000011.00000001.00000001. 010 11101
11000011. 00000001. 00000001.010 11101 == 195.1.1.93
195. 1. 1. 93 //27
27
Host
Host #30:
#30: 11000011.00000001.00000001. 010 11110
11000011. 00000001. 00000001.010 11110 == 195.1.1.94
195. 1. 1. 94 //27
27

B roadcast
Bro adcast #2:
#2: 11000011.00000001. 00000001. 010 11111
11000011.00000001.00000001.010 11111 == 195.1.1.95
195. 1. 1. 95 //27
27

Subnet
S ubnet #3:
#3: 11000011. 00000001. 00000001. 011 00000
11000011.00000001.00000001.011 00000 = 195.1. 1. 96 //27
195.1.1.96 27

Fig. 32 Defining host addresses for subnet #2

TG70113EN02GLA2
2010 Nokia Siemens Networks
47
IP addressing

2.12.4 Subnetting for an ISP


For more demanding example of subnetting, we will look at an ISP who needs to
create subnets out of a classless IP address (i.e. an address already subnetted from
a class-based point of view). Let us assume that an ISP, for example, was allocated
a Network Address that had a Net ID that was two-and-a-half octets (20 bits) long.
Their Host ID would be one-and-a-half octets (12 bits), which they may in turn subnet
as a one octet Subnet ID and allocate to each of their clients. Their clients would then
have a range of Host IDs represented by a half octet. Typically, such a short Host ID
would be allocated to hosts on a small clients LAN. If the host ISP in this example is
allocating a subnet to a client as described, the mask associated with the clients LAN
would be 255.255.255.240 (which is 28 1s followed by four 0s) while the ISPs mask
would be 255.255.240.0 (20 1s followed by 12 0s). In this example, if the ISPs
address is 10.2.112.0 mask 255.255.240.0 then their broadcast address is
10.2.127.255. And if the clients Net ID is 10.2.116.16 mask 255.255.255.240, then
their broadcast address is 10.2.116.31.
Notice how the respective masks cover the Net ID with 1s and the Host ID with 0s in
each case. Gateways only deal with Net IDs and as far as the ISPs gateways are
concerned this means the first 20 bits of an IP address, and as far as the ISPs
Clients gateways are concerned its the first 28 bits of the address.
The addresses in the example would never be allocated by an address registry
because they are within the range of RFC 1918 addresses.

TG70113EN02GLA2
48 2010 Nokia Siemens Networks
IP addressing

IS P exam pl e

1 s t O ctet 2 nd O cte t 3 rd O ctet 4th Octet

IS P N et ID allocat ed to I SP IS P s Ho st ID s

Ne t ID 10.2 .112.0 00000 110 0000 0010 0111 000 0 000 0 0 000

Ma sk 25 5.255. 240.0 11111 111 1111 1111 1111 000 0 000 0 0 000

N et ID alloca ted by IS P to C lient

IS P s C lie nt N et ID alloca ted to ISP ISP S ubnet Ho st id

Ne t ID 10.2 .116.1 6 00000 110 0000 0010 0111 010 0 000 1 0 000

Ma sk 25 5.255. 255.24 0 11111 111 1111 1111 1111 111 1 111 1 0 000

Fig. 33 ISP example

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

TG70113EN02GLA2
2010 Nokia Siemens Networks
49
IP addressing

2.13 Subnetmasks

2.14 Subnetmasks for Class A (2 Byte)


Subnetting in Byte No.2 for A Class

Num ber of Required Subnet Number of Hosts


Subnets Bits Mask per Subnet

2 1 255.128.0.0 2(8+8+7) -2 = 8.388.606

4 2 255.192.0.0 2(8+8+6) -2 = 4.194.302

8 3 255.224.0.0 2(8+8+5) -2 = 2.097.150

16 4 255.240.0.0 2(8+8+4) -2 = 1.048.574

32 5 255.248.0.0 2(8+8+3)-2 = 524.286

64 6 255.252.0.0 2(8+8+2)-2 = 262.142

128 7 255.254.0.0 2(8+8+1)-2 = 131.070

256 8 255.255.0.0 2(8+8+0) -2 = 65.534

Fig. 34 Class A conversion table

TG70113EN02GLA2
50 2010 Nokia Siemens Networks
IP addressing

2.15 Subnetmasks for Class B (3Byte

Subnetting in Byte No.3 for B Class

Number of Required Subnet Number of Hosts


Subnets Bits Mask per Subnet

2 1 255.255.128.0 2(8+7)-2 = 32.766

4 2 255.255.192.0 2(8+6)-2 = 16.382

8 3 255.255.224.0 2(8+5)-2 = 8.190

16 4 255.255.240.0 2(8+4)-2 = 4.094

32 5 255.255.248.0 2(8+3)-2 = 2.046

64 6 255.255.252.0 2(8+2)-2 = 1.022

128 7 255.255.254.0 2(8+1)-2 = 510

256 8 255.255.255.0 28-2 = 254

Fig. 35

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

TG70113EN02GLA2
2010 Nokia Siemens Networks
51
IP addressing

TG70113EN02GLA2
52 2010 Nokia Siemens Networks
IP addressing

2.16 Subnetmasks for Class C (4Byte)

Subnetting in Byte No.4 for C Class

Number of Required Subnet Number of Hosts


Subnets Bits Mask per Subnet

2 1 255.255.255.128 126

4 2 255.255.255.192 62

8 3 255.255.255.224 30

16 4 255.255.255.240 14

32 5 255.255.255.248 6

64 6 255.255.255.252 2

- 7 not used 0

- 8 not possible -

Fig. 36

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

TG70113EN02GLA2
2010 Nokia Siemens Networks
53
IP addressing

2.17 Variable Length Subnet Masks (VLSM)


In 1987, RFC 1009 specified how a subnetted network could use more than one
subnet mask. When an IP network is assigned more than one subnet mask, it is
considered a network with "variable length subnet masks" since the extended-
network-prefixes have different lengths.
If a network consists of subnets with different sizes, it is a disadvantage to use a
uniform subnet mask. The utilization of the address space is inefficient. You are
forced to reserve the same number of addresses for all subnets, regardless of the
actual needs (point-to-point links or end-device segments).
The solution to this problem is in turn to break down individual subnets in a network
into subnets (you could also say sub-subnets). From the point of view of the technical
implementation this means that subnet masks of different lengths are used within the
same network. This principle is known as VLSM (Variable Length Subnet Masking).

2.17.1 The Hierarchical Structure of VLSM


VLSM describes how a subnet that has been defined is in turn broken down into even
smaller units. When VLSM is used, a network is first divided into subnets. This is
nothing new compared with the previous procedure. However, the resulting subnets
can now in turn be divided into several subnets independently of one another. The
resulting sub-subnets can themselves be broken down again and again until the
required networks have been created. By definition the use of this procedure results
in a hierarchical structure. In real use of VLSM a sufficient number of hierarchical
levels can practically always be supported.

2.17.2 Example of VLSM


In the example the address 10.0.0.0/8 is first divided into 256 subnets with a
network prefix of length /16.
From these subnets, network 10.254.0.0/16 is broken down into 8 subnets with a
network prefix of length /19.
At the same time network 10.1.0.0/16 is divided into 256 subnets with a network
prefix of length /24; it is not necessary for the same subnet masks to be used
everywhere in the next step of the sub-division.
From the subnets created in the last step, the network 10.1.254.0/24 is in turn
extracted and broken down into 8 subnets. A network prefix of length 27 is
required.
Therefore a total of four subnet masks of different lengths are used within the same
network.

TG70113EN02GLA2
54 2010 Nokia Siemens Networks
IP addressing

Variable Length Subnet Masks (VLSM)

Different prefix lengths are used in the network


IP address space is used more efficiently
VLSM requires classless routing protocols
VLSM results in a hierarchical address structure
/26

/25 /3 0 /30 /24

/30 /30
/26 /30 /2 6

Fig. 37 VLSM

VLSM Technique
10.0.0.0/8

/1 6

-0 - -1 - -2- -3- - 253 - - 2 54 - - 255 -


10.1.0.0/16 10.254.0.0/16

/1 9
/24

-0- -1 - -6- -7 -

-0 - -1 - - 2 54 - - 2 55 - 10.254.192.0/19
10.1.254.0/24
Re mark:
/27
a pplica tion of a
/x = ne twork prefix
with length x
-0- -1 - -6- -7 -
10.1.254.32/27

Fig. 38 VLSM technique

TG70113EN02GLA2
2010 Nokia Siemens Networks
55
IP addressing

2.18 Classless Inter-Domain Routing (CIDR)


CIDR was officially documented in September 1993 in RFC 1517, 1518, 1519, and
1520. CIDR supports two important features that benefit the global Internet routing
system:
1. CIDR eliminates the traditional concept of Class A, Class B, and Class C network
addresses. This enables the efficient allocation of the IPv4 address space, which
will allow the continued growth of the Internet until IPv6 is deployed.
2. CIDR supports route aggregation where a single routing table entry can
represent the address space of perhaps thousands of traditional classful routes.
This allows a single routing table entry to specify how to route traffic to many
individual network addresses. Route aggregation helps control the amount of
routing information in the Internet's backbone routers, reduces route flapping
(rapid changes in route availability), and eases the local administrative burden of
updating external routing information.

CIDR is an effective method to stem the tide of IP address allocation as well as


routing table overflow. Without CIDR having been implemented, the Internet would
not be functioning today.
In class based IP addressing, by looking at the higher order bits, one can determine
the class of an IP address and hence the number of network ID bits. But with the
introduction of CIDR, this is not true any more. The network mask is the only means
by which the network ID can be known. Thus every router will have to know the
Network mask corresponding to each network.
CIDR eliminates the concept of class A, B, and C networks and replaces this with a
generalized network prefix. In CIDR, network addresses are literally allocated a bit at
a time. A CIDR format network address is given as the base Net ID in dotted decimal
notation followed by a suffix, which is the number of bits that represent that Net ID.
For example, the range of the addresses 172.16.0.0 to 172.31.255.255 would be
represented as 172.16.0.0/12 (or 172.16/12), 12 bits is the length of the subnet mask.
This is sometimes referred to as a 20 bit block, 20 bits available for hosts. CIDR is a
variation of subnetting and therefore systems that use CIDR addressing are
automatically interoperable with systems using class-based allocation.

TG70113EN02GLA2
56 2010 Nokia Siemens Networks
IP addressing

Classless Inter-Domain Routing (CIDR)

CIDR eliminates the concept of Class A, B and C networks


and replaces these with a generalised prefix
CIDR allocates addresses a bit at a time
A CIDR format : Net ID address followed by a prefix
e.g. addresses 172.16.0.0 to 172.31.255.255
become 172.16.0.0 / 12 (172.16/12)
CIDR is a variation of Subnetting so it is interoperable with systems using
Class based addressing

Fig. 39 CIDR

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

TG70113EN02GLA2
2010 Nokia Siemens Networks
57
IP addressing

2.19 Route aggregation


Let us consider an example in which a Service Provider requiring 2000 IP addresses
has been assigned the following Class C addresses which are in a contiguous block:
192.128.192.0 /24 - 192.128.199.0 / 24
One option for the GPRS operator is to advertise that all of the above eight Class C
addresses belong to the operator's network. In this case, every router on the Internet
will have 8 entries added to it.
An alternative is to summarize all of the above IP addresses into one address. If you
look at the IP addresses carefully, you will notice that the first 21 bits (11000000
10000000 11000) of the addresses are the same. These IP addresses can be
summarized as 192.128.192.0 /21 or 192.128.192/21. The /21 notation indicates it is
only the first 21 bits of this IP address that should be used for routing. In order to
convey that only the first 21 are relevant, the concept of a Netmask is used. The
Netmask consists of a series of ones corresponding to the network number followed
by zeros. In this example, the netmask will consist of twenty one 1s followed by
eleven 0s, i.e.
11111111 11111111 11111000 00000000 = 255.255.248.0
Each router in the Internet will contain the following information about the Service
Providers network
Network Address = 192.128.192.0
Network Mask = 255.255.248.0
If a packet destined for a host in the Service Provider network (e.g. 192.128.199.205)
arrives at a router, it will be "ANDed" with the network mask. If the result of the
"ANDing" corresponds to the network address, it will be routed towards that
summarized network.

TG70113EN02GLA2
58 2010 Nokia Siemens Networks
IP addressing

Route Aggregation

Example: Service Provider requires 2000 IP addresses


Assigned the following contiguous Class C addresses:
192.128.192.0 = 11000000 10000000 11000 000 00000000
192.128.193.0 = 11000000 10000000 11000 001 00000000
192.128.194.0 = 11000000 10000000 11000 010 00000000
192.128.195.0 = 11000000 10000000 11000 011 00000000
192.128.196.0 = 11000000 10000000 11000 100 00000000
192.128.197.0 = 11000000 10000000 11000 101 00000000
192.128.198.0 = 11000000 10000000 11000 110 00000000
192.128.199.0 = 11000000 10000000 11000 111 00000000
Addresses can be summarised as 192.128.192 / 21
Network Address = 192.128.192.0
Network Mask = 255.255.248.0

Fig. 40 Route aggregation

CIDR is Similar to VLSM


CIDR appears to have the familiar look and feel of VLSM! CIDR and VLSM are
essentially the same thing since they both allow a portion of the IP address space to
be recursively divided into subsequently smaller pieces. The difference is that with
VLSM, the recursion is performed on the address space previously assigned to an
organization and is invisible to the global Internet. CIDR, on the other hand, permits
the recursive allocation of an address block by an Internet Registry to a high-level
ISP, to a mid-level ISP, to a low-level ISP, and finally to a private organization's
network.

TIP
More detail information about VLSM and CIDR you can get in the course: 'TCP/IP
Advanced'.

TG70113EN02GLA2
2010 Nokia Siemens Networks
59
IP addressing

2.20 CIDR Address Blocks


The CIDR Address Blocks table provides information about the most commonly
deployed CIDR address blocks. Referring to the table, you can see that a /15
allocation can also be specified using the traditional dotted-decimal mask notation of
255.254.0.0. Also, a /15 allocation contains a bitwise contiguous block of 128K
(131,072) IP addresses which can be classfully interpreted as 2 Class B networks or
512 Class C networks.

CIDR prefix-length Dotted-Decimal # Individual # of Classful


Addresses Networks
/13 255.248.0.0 512 K 8 Bs or 2048 Cs
/14 255.252.0.0 256 K 4 Bs or 1024 Cs
/15 255.254.0.0 128 K 2 Bs or 512 Cs
/16 255.255.0.0 64 K 1 B or 256 Cs
/17 255.255.128.0 32 K 128 Cs
/18 255.255.192.0 16 K 64 Cs
/19 255.255.224.0 8K 32 Cs
/20 255.255.240.0 4K 16 Cs
/21 255.255.248.0 2K 8 Cs
/22 255.255.252.0 1K 4 Cs
/23 255.255.254.0 512 2 Cs
/24 255.255.255.0 256 1C
/25 255.255.255.128 128 1/2 C
/26 255.255.255.192 64 1/4 C
/27 255.255.255.224 32 1/8 C

TG70113EN02GLA2
60 2010 Nokia Siemens Networks
IP addressing

CDIR Blocks

CIDR prefix-length Dotted-Decimal # Individual Addresses # of Classful Networks

/13 255.248.0.0 512 K 8 Bs or 2048 Cs


/14 255.252.0.0 256 K 4 Bs or 1024 Cs
/15 255.254.0.0 128 K 2 Bs or 512 Cs
/16 255.255.0.0 64 K 1 B or 256 Cs
/17 255.255.128.0 32 K 128 Cs
/18 255.255.192.0 16 K 64 Cs
/19 255.255.224.0 8K 32 Cs
/20 255.255.240.0 4K 16 Cs
/21 255.255.248.0 2K 8 Cs
/22 255.255.252.0 1K 4 Cs
/23 255.255.254.0 512 2 Cs
/24 255.255.255.0 256 1C
/25 255.255.255.128 128 1/2 C
/26 255.255.255.192 64 1/4 C
/27 255.255.255.224 32 1/8 C

Fig. 41

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

TG70113EN02GLA2
2010 Nokia Siemens Networks
61
IP addressing

TG70113EN02GLA2
62 2010 Nokia Siemens Networks
IP addressing

3 IP Fragmentation

TG70113EN02GLA2
2010 Nokia Siemens Networks
63
IP addressing

In transit from one host to another, an IP datagram can cross-different physical


networks. Physical networks have a limitation for the size of the transmitted data
units, called the Maximum Transmission Unit (MTU). The MTU limits the length of
a datagram that can be placed in one physical frame.

Network MTU (bytes)


Ethernet 1500
IEEE 802.3 / 802.2 1492
X.25 576
ATM (AAL5) 65535

IP is responsible for dividing messages to fit into the MTU of the transmission
medium. The fragments are re-assembled at the destination host. The Internet
standards suggest that networks, routers and hosts should be able to handle
datagram's up to 576 bytes without fragmentation.

The Mode of Operation of Fragmentation


Fragments of a datagram all have a header, basically copied from the original
datagram, and data following it. They are treated as normal IP datagram's while
being transported to their destination. If one of the fragments gets lost, the complete
datagram is considered lost since IP does not provide any acknowledgment
mechanism, so the remaining fragments will simply be discarded by the destination
host.
When fragmentation is done, the following steps are performed:
1. The DF flag bit is checked to see if fragmentation is allowed. If fragmentation is
not allowed, the datagram will be discarded.
2. Depending on the MTU value, the data field is split into two or more parts.
3. All data portions are placed in IP datagram's. The headers of the datagram's are
updated copies of the original one.
4. Each of the fragmented datagram's is independently routed to the destination.
At the receiving side, the incoming fragments are identified based on the
identification field and the source and destination IP addresses in the datagram.
To reassemble the fragments, the receiving host allocates a buffer in storage when
the first fragment arrives and a timer is started. When the timer times out and not all
the fragments have been received, the datagram is discarded.

TG70113EN02GLA2
64 2010 Nokia Siemens Networks
IP addressing

Fragmentation

data header

Router Router

Fragment Offset

Fig. 42 Fragmentation

Three fields are used in fragmentation control:


1. Packet Identifier: A16-bit value used to identify all the fragments of a packet,
allowing the destination host to perform packet reassembly.
2. Fragmentation Flags:
The first bit flag is reserved and set to zero.
The second bit is the "Don't Fragment" flag. When a router attempts to fragment
an IP packet with this flag set, no fragmentation occurs, and an ICMP error
message is sent back to the sender to inform of the delivery error, and the packet
is discarded.
The third bit flag is the "More Fragments" flag. When a packet is fragmented, all
packets except the final fragment have the "More Fragments" flag set. Even when
a fragment is further fragmented, this rule remains in force.
3. Fragmentation offset value: This field indicates where in the datagram this
fragment belongs. The fragmentation offset is measured in units of 8 octets,
implying that fragmentation must align to 64-bits boundaries. The first fragment
has offset zero.

TG70113EN02GLA2
2010 Nokia Siemens Networks
65
IP addressing

# of the first byte in the data field

32 Bits
0 4 8 16 31

Version LEN Type of Service Total Length


D M
Identification 0 Fragment Offset
F F

IP Time to Live (TTL) Protocol Header Checksum


Header
Source IP Address

Destination IP
Destination IP Address

Options Padding

Data

LEN...internal header length unit: 4 bytes


Total Length ........................unit: 1 bytes
Fragment Offset...................unit: 8 bytes

Fig. 43 Fields used for fragmentation

TG70113EN02GLA2
66 2010 Nokia Siemens Networks
IP addressing

Original IP Packet

bit 0 4 8 16 31
Version
Version LEN
LEN == 55 TOS Total
Total Length=1300
Length=1300

Identification=1748
Identification=1748 00 00 00 Fragment
Fragment Offset=0
Offset=0

IP Time
Time to
to Live
Live (TTL)
(TTL) Protocol
Protocol Header
Header Checksum
Checksum
Header
Source
Source IP
IP Address
Address

Destination
Destination IP Address
Address

Data

Fragmentation Control Total Packet Length

Fig. 44 Original IP packet

First Fragment

bit 0 4 8 16 31

Version
Version LEN
LEN == 55 TOS Total
Total Length=532
Length=532

Identification=1748
Identification=1748 00 00 11 Fragment
Fragment Offset=0
Offset=0

IP Time
Time to
to Live
Live (TTL)
(TTL) Protocol
Protocol Header
Header Checksum
Checksum
Header
Source
Source IP
IP Address
Address

Destination
Destination
Destination IP
Destination IP
IP Address
Address
Address

512 Octets of Data

Fragmentation Control Total Packet Length

Fig. 45 First fragment

TG70113EN02GLA2
2010 Nokia Siemens Networks
67
IP addressing

Second Fragment

bit 0 4 8 16 31
Version
Version LEN
LEN = 55 TOS Total
Total Length=532
Length=532

Identification=1748
Identification=1748 00 00 11 Fragment
Fragment Offset=64
Offset=64

IP Time
Time to
to Live
Live (TTL)
(TTL) Protocol
Protocol Header
Header Checksum
Checksum
Header
Source
Source IP
IP Address
Address

Destination
Destination
Destination IP
IP Address
IP Address
Address

512 Octets of Data

Fragmentation Control Total Packet Length

Fig. 46 Second fragment

Third Fragment

bit 0 4 8 16 31
Version
Version LEN
LEN = 55 TOS Total
Total Length=276
Length=276

Identification=1748
Identification=1748 00 00 00 Fragment
Fragment Offset=128
Offset=128

Time
Time to
to Live
Live (TTL)
(TTL) Protocol
Protocol Header
Header Checksum
Checksum
IP
Header
Source
Source IP
IP Address
Address

Destination
Destination
DestinationIP
Destination IP
IP Address
IP Address
Address
Address

256 Octets of Data

Fragmentation Control Total Packet Length

Fig. 47 Third fragment

TG70113EN02GLA2
68 2010 Nokia Siemens Networks
IP addressing

4 Internet Control Message Protocol (ICMP)

Fig. 48 ICMP

TG70113EN02GLA2
2010 Nokia Siemens Networks
69
IP addressing

TG70113EN02GLA2
70 2010 Nokia Siemens Networks
IP addressing

4.1 ICMP characteristics


When a router or a destination host must inform the source host about errors in
datagram processing, it uses the Internet Control Message Protocol (ICMP). ICMP
can be characterized as follows:
ICMP uses IP as if ICMP were a higher-level protocol (that is, ICMP messages are
encapsulated in IP datagram's). However, ICMP is an integral part of IP and must
be implemented by every IP module.
ICMP is used to report some errors, not to make IP reliable. Datagram's may still
be undelivered without any report on their loss. Reliability must be implemented by
the higher-level protocols that use IP.
ICMP can report errors on any IP datagram with the exception of ICMP messages,
to avoid infinite repetitions.
For fragmented IP datagram's, ICMP messages are only sent about errors on
fragment zero. That is, ICMP messages never refer to an IP datagram with a non-
zero fragment offset field.
ICMP messages are never sent in response to datagram's with a destination IP
address that is a broadcast or a multicast address.
ICMP messages are never sent in response to a datagram that does not have a
source IP address that represents a unique host. That is, the source address
cannot be zero, a loopback address, a broadcast address or a multicast address.
ICMP messages are never sent in response to ICMP error messages. They can be
sent in response to ICMP query messages (ICMP types 0, 8, 9, 10 and 13 through
18).
RFC 792 states that ICMP messages can be generated to report IP datagram
processing errors. In practice, routers will almost always generate ICMP messages
for errors, but for destination hosts, the number of ICMP messages generated is
implementation dependent.

TG70113EN02GLA2
2010 Nokia Siemens Networks
71
IP addressing

4.2 ICMP messages


Most of the ICMP messages are described in RFC 792 and RFC 950 and are
mandatory.
ICMP messages are sent in IP datagram's. The IP header will always have the value
1 in the Protocol field, indicating ICMP and a type of service of zero (routine). The IP
data field will contain the actual ICMP message in the format shown in the figure
below.

Field Description Code points


Type Specifies the type of the message: 0 Echo reply
3 Destination unreachable
4 Source quench
5 Redirect
8 Echo
12 Parameter problem
13 Time Stamp request
14 Time Stamp reply
30 Trace route
Code Contains the error code for the datagram
reported on by this ICMP message. The
interpretation is dependent upon the
message type.
Checksum Contains the 16-bit one's complement of
the one's complement sum of the ICMP
message starting with the ICMP Type
field. For computing this checksum, the
checksum field is assumed to be zero
Data Contains information for this ICMP
message. Typically it will contain a part of
the original IP message for which this
ICMP message was generated. The
length of the data can be determined from
the length of the IP datagram that contains
the message less the IP header length.

TG70113EN02GLA2
72 2010 Nokia Siemens Networks
IP addressing

Encapsulation of an ICMP Message

20 bytes 4 bytes variable length

ICMP
ICMP
IP
IP Header
Header ICMP Parameter
Parameter
Header
Header

ICMP Message

IP Packet

Fig. 49 Encapsulation of an ICMP message

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

TG70113EN02GLA2
2010 Nokia Siemens Networks
73
IP addressing

4.3 ICMP queries


Echo and Echo Reply
Echo is used to detect if another host is active on the network. The sender initializes
the identifier and sequence number (which is used if multiple echo requests are
sent), adds some data to the data field and sends the ICMP echo to the destination
host. The ICMP header code field is zero. The recipient changes the type to Echo
Reply and returns the datagram to the sender. This mechanism is used by the Ping
command to determine if a destination host is reachable.

Time Stamp Request and Time Stamp Reply


These two messages are for performance measurements and for debugging. They
are not used for clock synchronization.
The sender initializes the identifier and sequence number (which is used if multiple
time stamp requests are sent), sets the originate time stamp and sends it to the
recipient.
The receiving host fills in the receive and transmit time stamps, changes the type to
time stamp reply and returns it to the recipient.
The receiver has two time stamps in case there is a perceptible time difference
between the receipts and transmit times, but in practice, most implementations will
perform the two (receipt and reply) in one operation and will set the two time stamps
to the same value.
The Originate Timestamp is the time the sender last touched the message before
sending it, the Receive Timestamp is the time the echoer first touched it on receipt,
and the Transmit Timestamp is the time the echoer last touched the message on
sending it.
Time Stamps are the number of milliseconds elapsed since midnight UT (GMT).

TG70113EN02GLA2
74 2010 Nokia Siemens Networks
IP addressing

ICMP Queries

ICMP Echo Reply


ICMP Echo to C: to A:
Are you alive I am still alive
C
A

Router Router

D
B

ICMP
ICMP
Time Stam p Request
Time Stamp Reply
to D: to B:
My cur rent time is
My current time is

Fig. 50 ICMP queries

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

TG70113EN02GLA2
2010 Nokia Siemens Networks
75
IP addressing

4.4 ICMP error reports


Destination Unreachable
If this message is received from an intermediate router, it means that the router
regards the destination IP address as unreachable.
If this message is received from the destination host, it means that the protocol
specified in the protocol number field of the original datagram is not active, or that
protocol is not active on this host or the specified port is inactive.

Source Quench
If this message is received from an intermediate router, it means that the router does
not have the buffer space needed to queue the datagram's for output to the next
network.
If this message is received from the destination host, it means that the incoming
datagram's are arriving too quickly to be processed.

Redirect
If this message is received from an intermediate router, it means that the host should
send future datagram's for the network to the router whose IP address is given in the
ICMP message. This preferred router will always be on the same subnet as the host
that sent the datagram and the router that returned the IP datagram. The router will
forward the datagram to its next hop destination. If the router IP address matches the
source IP address in the original datagram header it indicates a routing loop. This
ICMP message will not be sent if the IP datagram contains a source route.

Time Exceeded
If this message is received from an intermediate router, it means that the time-to-live
field of an IP datagram has expired.
If the gateway processing a datagram finds the time to live field is zero it must
discard the datagram. The gateway may also notify the source host via the time
exceeded message.
If this message is received from the destination host, it means that the IP fragment
reassembly time-to-live timer has expired while the host is waiting for a fragment of
the datagram.

TG70113EN02GLA2
76 2010 Nokia Siemens Networks
IP addressing

Too Big (ICMPv6 Error Message)


A Packet Too Big is sent by a router in response to a packet that it cannot forward
because the packet is larger than the MTU of the outgoing link. The Packet Too Big
message includes the MTU of the next-hop link. This next-hop link MTU value is used
as part of the Path MTU Discovery process, which is described later. The type field is
set to 2. The information in this message is used as part of the Path MTU Discovery
process (PMTU) for IP version 6 (RFC 1981).
When one IPv6 node has a large amount of data to send to another node, the data is
transmitted in a series of IPv6 packets. It is usually preferable that these packets be
of the largest size that can successfully traverse the path from the source node to the
destination node. This packet size is referred to as the Path MTU (PMTU), and it is
equal to the minimum link MTU of all the links in a path. IPv6 defines a standard
mechanism for a node to discover the PMTU of an arbitrary path.

What is Path MTU Discovery?


In IPv4 hop by hop fragmentation mechanisms are used when sending larger
packets
IPv6 implementations use source fragmentation
IPv6 nodes uses Path MTU Discovery procedure in order to discover the path
MTU (PMTU)
Path MTU is the minimum link MTU of all the links in a path between a source
node and a destination node
Path MTU Discovery supports multicast as well as unicast destinations

Path MTU Discovery Process


Initially, the PMTU value for a path is assumed to be the MTU of the first-hop link
If the packet is too large than a link MTU along a path, then the node returns ICMP
Packet Too Big message
The source node reduces its assumed PMTU for the path based on the value in
the MTU field of the returned ICMP Packet
Several iterations of this process may occur as there may be links with smaller
MTUs further along the path

TG70113EN02GLA2
2010 Nokia Siemens Networks
77
IP addressing

4.5 ICMP applications


4.5.1 PING (Packet Internet Groper) Utility
Every TCP/IP implementation must include the ability to respond to a ping. A ping
triggers ICMP echo/echo reply messages. The ping utility is used to determine if a
TCP/IP connection to a device is functioning. A source host transmits a ping to a
destination host. If the destination hosts TCP/IP software is functioning properly, it
will return the ping to the destination host. The ping command format is as follows
(optional parameters in brackets):

ping host [packetsize][count]


Option Explanation
host IP address or host name
packetsize size of the ping message (default size 64 bytes)
count number of pings to the host

Examples:
ping 144.19.74.201 (ping of a remote host)
ping 127.0.0.1 (host self-test - loopback)
This command is available in every possible environment (UNIX, Windows, routers,
switches, etc.). Depending on the operating system there may be other options
available.

TG70113EN02GLA2
78 2010 Nokia Siemens Networks
IP addressing

Fig. 51 PING command

Example:

Fig. 52 A PING result

TG70113EN02GLA2
2010 Nokia Siemens Networks
79
IP addressing

4.5.2 Trace route


The Trace route program can be useful when used for debugging purposes. Trace
route enables determination of the route that IP datagram's follow from host to host.
Trace route is based upon ICMP and UDP. It sends an IP datagram with a TTL of 1
to the destination host. The first router to see the datagram will decrement the TTL to
0 and return an ICMP "Time Exceeded" message as well as discarding the datagram.
In this way, the first router in the path is identified.
This process can be repeated with successively larger TTL values in order to identify
the series of routers in the path to the destination host. Trace route actually sends
UDP datagram's to the destination host, which reference a port number that is
outside the normally used range. This enables Trace route to determine when the
destination host has been reached, that is, when an ICMP "Port Unreachable"
message is received.

Trace route
ICMP
Destination Unreachable
to D
e.g. Destination Unknown

Fr om D: C
A Tr ace route to A

Router

Router
Router

Router

ICMP D
B
Tim e Exceeded
to D:
ICMP TTL expired ICMP
Tim e E xceeded ICMP
Tim e Exceeded Time Exceeded
to D: to D:
TTL expir ed to D:
TTL expired TTL expired

Fig. 53 Trace route

TG70113EN02GLA2
80 2010 Nokia Siemens Networks
IP addressing

Fig. 54 Tracert command

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

TG70113EN02GLA2
2010 Nokia Siemens Networks
81
IP addressing

4.6 Requests for Comments

RFC Author Title Date, other information


778 Mills, D., "DCNET Internet Clock Service," April 1981
791 Information INTERNET PROTOCOL September 1981
Sciences
(Updated by: RFC 1349)
Institute
University
of Southern
California
792 J. Postel INTERNET CONTROL MESSAGE September 1981
PROTOCOL (Updates: RFCs 777,
760)
950 J. Mogul, J. "Internet standard subnetting 08/01/1985. (Pages=18)
Postel, procedure"
985 National "Requirements for Internet gateways - 05/01/1986. (Pages=23)
Science draft" (Obsoleted by
Foundation, RFC1009)
Network
Technical
Advisory
Group
1009 R. Braden, "Requirements for Internet gateways" 06/01/1987 (Pages=55)
J. Postel (Obsoletes RFC985)
(Obsoleted by
RFC1716)
1245 J. Moy "OSPF Protocol Analysis" 08/08/1991. (Pages=12)
1246 J. Moy "Experience with the OSPF Protocol" 08/08/1991. (Pages=31)
1247 J. Moy "OSPF Version 2" 08/08/1991.
(Pages=189) (Obsoletes
RFC1131) (Obsoleted
by RFC1583)
1338 V. Fuller, T. "Supernetting: an Address Assignment 06/26/1992. (Pages=20)
Li, K. and Aggregation Strategy" (Obsoleted by
Varadhan, RFC1519)
J. Yu

TG70113EN02GLA2
82 2010 Nokia Siemens Networks
IP addressing

RFC Author Title Date, other information


1349 P. Almquist Type of Service in the Internet Protocol July 1992
Suite (Obsoleted by: 2474)
1366 E. Gerich "Guidelines for Management of IP 10/22/1992 (Pages=8)
Address Space" (Obsoleted by
RFC1466)
1466 E. Gerich "Guidelines for Management of IP 05/26/1993 (Pages=10)
Address Space" (Obsoletes RFC1366)
1517 R. Hinden "Applicability Statement for the 09/24/1993. (Pages=4)
Implementation of Classless Inter-
Domain Routing (CIDR)"
1518 Y. Rekhter, "An Architecture for IP Address 09/24/1993. (Pages=27)
T. Li Allocation with CIDR"
1519 V. Fuller, T. "Classless Inter-Domain Routing 09/24/1993. (Pages=24)
Li, J. Yu, K. (CIDR): an Address Assignment and (Obsoletes RFC1338)
Varadhan Aggregation Strategy"
1520 Y. Rekhter, "Exchanging Routing Information 09/24/1993. (Pages=9)
C. Topolcic Across Provider Boundaries in the
CIDR Environment"
1583 Moy "OSPF Version 2" 03/23/1994.
(Pages=212) (Obsoletes
RFC1247)
1700 J. Reynolds ASSIGNED NUMBERS October 1994
J. Postel
1716 P. "Towards Requirements for IP 11/04/1994.
Almquist, F. Routers" (Pages=186) (Obsoletes
Kastenholz RFC1009) (Obsoleted
by RFC1812)
1721 G. Malkin "RIP Version 2 Protocol Analysis" 11/15/1994. (Pages=4)
(Obsoletes RFC1387)
1722 G. Malkin "RIP Version 2 Protocol Applicability 11/15/1994. (Pages=5)
Statement"
1723 G. Malkin "RIP Version 2 Carrying Additional 11/15/1994 (Pages=9)
Information" (Updates RFC1058)
(Obsoletes RFC1388)

TG70113EN02GLA2
2010 Nokia Siemens Networks
83
IP addressing

RFC Author Title Date, other information


1724 G. Malkin, "RIP Version 2 MIB Extension" 11/15/1994 (Pages=18)
F. Baker (Obsoletes RFC1389)
1812 F. Baker "Requirements for IP Version 4 06/22/1995. (Pages=175)
Routers" (Obsoletes RFC1716,
RFC1009)
1900 B. "Renumbering Needs Work" 02/28/1996. (Pages=4)
Carpenter,
Y. Rekhter
H. "Enterprise Renumbering: 02/28/1996. (Pages=8)
Berkowitz, Experience and Information
1916
P. Solicitation"
Ferguson,
W. Leland,
P. Nesser
1917 P. Nesser "An Appeal to the Internet 02/29/1996. (Pages=10)
Community to Return Unused IP
Network (Prefixes) to the IANA"
1918 Y. Rekhter, "Address Allocation for Private 02/29/1996. (Pages=9)
R. Internets" (Obsoletes RFC1627)
Moskowitz,
D.
Karrenberg,
G. de
Groot, E.
Lear
2338 S. Knight, Virtual Router Redundancy Protocol April 1998
D. Weaver, (Obsoleted by: 3768)
D. Whipple,
R. Hinden,
D. Mitzel,
P. Hunt, P.
Higginson,
M. Shand,
A. Lindem
2474 K. Nichols, Definition of the Differentiated December 1998
S. Blake, F. Services Field (DS Field) in the (Updated by: 3168, 3260)
Baker, D. IPv4 and IPv6 Headers
Black

TG70113EN02GLA2
84 2010 Nokia Siemens Networks
IP addressing

4.7 Glossary

ARP Address Resolution Protocol


AS Autonomous System
BGP Border Gateway Protocol
BOOTP Bootstrap Protocol
DA Destination Address
DF Don't Fragment
DHCP Dynamic Host Configuration Protocol
DVR Distance Vector Routing
CIDR Classless Inter-Domain Routing
EGP Exterior Gateway Protocol
IANA Internet Assigned Numbers Authority
ICMP Internet Control Message Protocol
IGP Interior Gateway Protocol
IP Internet Protocol
LSP Link State Packet
LSR Link State Routing
MAC Media Access Control
MF more fragments (in IPv4 a flag that indicates that more IP
fragments with higher fragment offset values should follow)
MTU Maximum Transmission Unit
OSPF t Open Shortest Path First
PMTU Path MTU Discovery Process (RFC 1981)
RIP Routing Information Protocol
SPF Shortest Path First
TTL Time To Life, a field inside of the IP header
VLSM Variable Length Subnet Masks

TG70113EN02GLA2
2010 Nokia Siemens Networks
85
IP addressing

TG70113EN02GLA2
86 2010 Nokia Siemens Networks
IP addressing

5 Exercise

TG70113EN02GLA2
2010 Nokia Siemens Networks
87
IP addressing

Exercise 1
Title: Classful IP Addressing

Task
1. Complete the following table, which provides practice in converting a number
from binary notation to decimal format.
Binary 128 64 32 16 8 4 2 1 Decimal
11001100 1 1 0 0 1 1 0 0 128+64+8+4 = 204
10101010
11100011
10110011
00110101

2. Complete the following table, which provides practice in converting a number


from decimal notation to binary format.

Decimal 128 64 32 16 8 4 2 1 Binary


48 0 0 1 1 0 0 0 0 48=32+16=00110000
222
119
135
60

3. Express 145.32.59.24 in binary format and identify the address class:

__________________________________________________________________
4. Express 200.42.129.16 in binary format and identify the address class:

__________________________________________________________________
5. Express 14.82.19.54 in binary format and identify the address class:

__________________________________________________________________

TG70113EN02GLA2
88 2010 Nokia Siemens Networks
IP addressing

Exercise 2
Title: Subnetting I

Task
Assume that you have been assigned the 132.45.0.0/16 network block. You need to
establish eight subnets
1. __________ binary digits are required to define eight subnets.
2. Specify the extended-network-prefix that allows the creation of 8 subnets.
__________________________________________________________________
3. Express the subnets in binary format and dotted decimal notation:
#0 ________________________________________________________________
#1 ________________________________________________________________
#2 ________________________________________________________________
#3 ________________________________________________________________
#4 ________________________________________________________________
#5 ________________________________________________________________
#6 ________________________________________________________________
#7 ________________________________________________________________
4. List the range of host addresses that can be assigned to Subnet #3
(132.45.96.0/19).
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
5. What is the broadcast address for Subnet #3 (132.45.96.0/19).
__________________________________________________________________

TG70113EN02GLA2
2010 Nokia Siemens Networks
89
IP addressing

Exercise 3
Title: IP Addressing

Task
Defining the address space

1. Summarize the following private IP Address Ranges.


a) Range 10.0.0.0 to 10.255.255.255
___________________

a) Range 172.16.0.0 to 172.31.255.255


___________________

b) Range 192.168.0.0 to 192.168.255.255


___________________

2. An operator has two networks as shown below. Complete the following table

10.10.13.0 / 26 210.19.27.128 / 28
Network ID
Network Mask
Local Broadcast
Address
Network Directed
Broadcast Address
Smallest IP Address
Largest IP Address
Number of hosts in the
network.

TG70113EN02GLA2
90 2010 Nokia Siemens Networks
IP addressing

Exercise 4
Title: Subnetting II

Task
1. Assume that you have been assigned the 200.35.1.0/24 network block. Define an
extended-network-prefix that allows the creation of 20 hosts on each subnet.
__________________________________________________________________
2. What is the maximum number of hosts that can be assigned to each subnet?
__________________________________________________________________
3. What is the maximum number of subnets that can be defined?
__________________________________________________________________
4. Specify the subnets of 200.35.1.0/24 in binary format and dotted decimal
notation.
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
5. List range of host addresses that can be assigned to Subnet #6
(200.35.1.192/27)
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
6. What is the broadcast address for subnet 200.35.1.192/27?
__________________________________________________________________

TG70113EN02GLA2
2010 Nokia Siemens Networks
91
IP addressing

Exercise 5
Title: Subnet III

Task
An organization has been assigned the network number 140.25.0.0/16 and it needs
to create a set of subnets that supports up to 60 hosts on each subnet.

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

TG70113EN02GLA2
92 2010 Nokia Siemens Networks
IP addressing

6 Solution

TG70113EN02GLA2
2010 Nokia Siemens Networks
93
IP addressing

Solution 1
Title: Classful IP Addressing

Task
1. Complete the following table, which provides practice in converting a number
from binary notation to decimal format.

Binary 128 64 32 16 8 4 2 1 Decimal


11001100 1 1 0 0 1 1 0 0 204
10101010 1 0 1 0 1 0 1 0 170
11100011 1 1 1 0 0 0 1 1 227
10110011 1 0 1 1 0 0 1 1 179
00110101 0 0 1 1 0 1 0 1 53

2. Complete the following table, which provides practice in converting a number


from decimal notation to binary format.
Decimal 128 64 32 16 8 4 2 1 Binary
48 0 0 1 1 0 0 0 0 0011 0000
222 1 1 0 1 1 1 1 0 1101 1110
119 0 1 1 1 0 1 1 1 0111 0111
135 1 0 0 0 0 1 1 1 1000 0111
60 0 0 1 1 1 1 0 0 0011 1100

3. Express 145.32.59.24 in binary format and identify the address class:


10010001.00100000.00111011.00011000 /16 or Class B
____________________________________________________________
4. Express 200.42.129.16 in binary format and identify the address class:
11001000.00101010.10000001.00010000 /24 or Class C
____________________________________________________________
5. Express 14.82.19.54 in binary format and identify the address class:
00001110.01010010. 00010011.00110110 /8 or Class A
__________________________________________________________________

TG70113EN02GLA2
94 2010 Nokia Siemens Networks
IP addressing

Solution 2
Title: Subnetting I

Task
Assume that you have been assigned the 132.45.0.0/16 network block. You need to
establish 8 subnets.
1. Three binary digits are required to define the eight subnets.

2. Specify the extended-network-prefix that allows the creation of 8 subnets.


/19 or 255.255.224.0

3. Express the subnets in binary format and dotted decimal notation:


Subnet #0: 10000100.00101101. 000 00000.00000000 = 132.45.0.0/19
Subnet #1: 10000100.00101101. 001 00000.00000000 = 132.45.32.0/19
Subnet #2: 10000100.00101101. 010 00000.00000000 = 132.45.64.0/19
Subnet #3: 10000100.00101101. 011 00000.00000000 = 132.45.96.0/19
Subnet #4: 10000100.00101101. 100 00000.00000000 = 132.45.128.0/19
Subnet #5: 10000100.00101101. 101 00000.00000000 = 132.45.160.0/19
Subnet #6: 10000100.00101101. 110 00000.00000000 = 132.45.192.0/19
Subnet #7: 10000100.00101101. 111 00000.00000000 = 132.45.224.0/19

4. List the range of host addresses that can be assigned to Subnet #3


(132.45.96.0/19).
Subnet #3: 10000100.00101101.011 00000.00000000 = 132.45.96.0/19
Host #1: 10000100.00101101.011 00000.00000001 = 132.45.96.1/19
Host #2: 10000100.00101101.011 00000.00000010 = 132.45.96.2/19
Host #3: 10000100.00101101.011 00000.00000011 = 132.45.96.3/19
:
Host #8190: 10000100.00101101.011 11111.11111110 = 132.45.127.254/19

5. What is the broadcast address for Subnet #3 (132.45.96.0/19)?


10000100.00101101.011 11111.11111111 = 132.45.127.255/19

TG70113EN02GLA2
2010 Nokia Siemens Networks
95
IP addressing

Solution 3
Title: IP Addressing

Task
Defining the address space

1. Summarize the following private IP Address Ranges.


a) Range 10.0.0.0 to 10.255.255.255
10.0.0.0 / 8

b) Range 172.16.0.0 to 172.31.255.255


172.16.0.0 / 12

c) Range 192.168.0.0 to 192.168.255.255


192.168.0.0 / 16

2. An operator has two networks as shown below. Complete the following table

10.10.13.0 / 26 210.19.27.128 / 28
Network ID 10.10.13.0 210.19.27.128
Network Mask 255.255.255.192 255.255.255.240
Local Broadcast 255.255.255.255 255.255.255.255
Address
Network Directed 10.10.13.63 210.19.27.143
Broadcast Address
Smallest IP Address 10.10.13.1 210.19.27.129
Largest IP Address 10.10.13.62 210.19.27.142
Number of hosts in the 62 14
network.

TG70113EN02GLA2
96 2010 Nokia Siemens Networks
IP addressing

Solution 4
Title: Subnetting II

Task
1. Assume that you have been assigned the 200.35.1.0/24 network block. Define an
extended-network-prefix that allows the creation of 20 hosts on each subnet.
A minimum of five bits are required to define 20 hosts so the extended-network-
prefix is a /27 (27 = 32-5).
2. What is the maximum number of hosts that can be assigned to each subnet?
The maximum number of hosts on each subnet is 2 5 -2, or 30.
3. What is the maximum number of subnets that can be defined?
The maximum number of subnets is 2 3, or 8.
4. Specify the subnets of 200.35.1.0/24 in binary format and dotted decimal
notation.
Subnet #0: 11001000.00100011.00000001. 000 00000 = 200.35.1.0/27
Subnet #1: 11001000.00100011.00000001. 001 00000 = 200.35.1.32/27
Subnet #2: 11001000.00100011.00000001. 010 00000 = 200.35.1.64/27
Subnet #3: 11001000.00100011.00000001. 011 00000 = 200.35.1.96/27
Subnet #4: 11001000.00100011.00000001. 100 00000 = 200.35.1.128/27
Subnet #5: 11001000.00100011.00000001. 101 00000 = 200.35.1.160/27
Subnet #6: 11001000.00100011.00000001. 110 00000 = 200.35.1.192/27
Subnet #7: 11001000.00100011.00000001. 111 00000 = 200.35.1.224/27
5. List range of host addresses that can be assigned to Subnet #6
(200.35.1.192/27)
Subnet #6: 11001000.00100011.00000001. 110 00000 = 200.35.1.192/27
Host #1: 11001000.00100011.00000001.110 00001 = 200.35.1.193/27
Host #2: 11001000.00100011.00000001.110 00010 = 200.35.1.194/27
Host #3: 11001000.00100011.00000001.110 00011 = 200.35.1.195/27
:
Host #29: 11001000.00100011.00000001.110 11101 = 200.35.1.221/27
Host #30: 11001000.00100011.00000001.110 11110 = 200.35.1.222/27
6. What is the broadcast address for subnet 200.35.1.192/27?
11001000.00100011.00000001.110 11111 = 200.35.1.223

TG70113EN02GLA2
2010 Nokia Siemens Networks
97
IP addressing

Solution 5
Title: Subnetting III

Task
An organization has been assigned the network number 140.25.0.0/16 and it needs
to create a set of subnets that supports up to 60 hosts on each subnet.
Defining the Subnet Mask / Extended-Prefix Length
The first step is to determine the number of bits required to define 60 hosts on each
subnet. Since a block of host address can only be assigned along binary boundaries,
host address blocks can only be created in powers of two. This means that it is
impossible to create a block that contains exactly 60 host addresses. To support 60
hosts, the network administrator must define a minimum address block of 62 (2 6 -2)
host addresses. However, this choice would only provide two unused host addresses
on each subnet for future growth. Since this does not appear to be adequate to
support additional growth, the network administrator elects to define a block of 126
(27 -2) host addresses and has 66 addresses on each subnet for future growth. A
block of 126 host addresses requires 7-bits in the host-number field.
The next step is to determine the subnet mask/extended-prefix length. Since 7-bits of
the 32-bit IP address are required for the host-number field, the extended-prefix must
be a /25 (25 = 32-7). A 25-bit extended-network-prefix can be expressed in dotted-
decimal notation as 255.255.255.128.
The 25-bit extended-prefix assigns 9-bits to the subnet number field. Since 29 = 512,
nine bits allow the definition of 512 subnets. Depending on the organization's
requirements, the network administrator could have elected to assign additional bits
to the host-number field (allowing more hosts on each subnet) and reduce the
number of bits in the subnet-number field (decreasing the total number of subnets
that can be defined).
Although this example creates a rather large number of subnets, it provides an
interesting example because it illustrates what happens to the dotted-decimal
representation of a subnet address when the subnet-number bits extend across an
octet boundary. It should be mentioned that the same type of confusion can also
occur when the host-number bits extend across an octet boundary.

TG70113EN02GLA2
98 2010 Nokia Siemens Networks
IP addressing

Defining Each of the Subnet Numbers


The 512 subnets will be numbered 0 through 511. The 9-bit binary representation of
the decimal values 0 through 511 are: 0 (0000000002 ), 1 (0000000012 ), 2
(0000000102 ), 3 (0000000112 ), ..., 511 (1111111112 ). To define subnet #3, the
network administrator places the binary representation of 3 (0000000112 ) into the 9-
bits of the subnet-number field.
The 512 subnet numbers for this example are given below. The underlined portion of
each address identifies the extended-network-prefix, while the bold digits identify the
9- bits representing the subnet-number field:
Base Net: 10001100.00011001 .00000000.00000000 = 140.25.0.0/16
Subnet #0: 10001100.00011001. 00000000 . 0 0000000 = 140.25.0.0/25
Subnet #1: 10001100.00011001. 00000000 . 1 0000000 = 140.25.0.128/25
Subnet #2: 10001100.00011001. 00000001 . 0 0000000 = 140.25.1.0/25
Subnet #3: 10001100.00011001. 00000001 . 1 0000000 = 140.25.1.128/25
Subnet #4: 10001100.00011001. 00000010 . 0 0000000 = 140.25.2.0/25
Subnet #5: 10001100.00011001. 00000010 . 1 0000000 = 140.25.2.128/25
Subnet #6: 10001100.00011001. 00000011 . 0 0000000 = 140.25.3.0/25
Subnet #7: 10001100.00011001. 00000011 . 1 0000000 = 140.25.3.128/25
Subnet #8: 10001100.00011001. 00000100 . 0 0000000 = 140.25.4.0/25
Subnet #9: 10001100.00011001. 00000100 . 1 0000000 = 140.25.4.128/25

Subnet #510: 10001100.00011001. 11111111 . 0 0000000 = 140.25.255.0/25


Subnet #511: 10001100.00011001. 11111111 . 1 0000000 = 140.25.255.128/25
Notice how sequential subnet numbers do not appear to be sequential when
expressed in dotted-decimal notation. This can cause a great deal of
misunderstanding and confusion since everyone believes that dotted-decimal
notation makes it much easier for human users to understand IP addressing. In this
example, the dotted-decimal notation obscures rather than clarifies the subnet
numbering scheme!

TG70113EN02GLA2
2010 Nokia Siemens Networks
99
IP addressing

Defining Hosts Addresses for Each Subnet


In this example there are 7 bits in the host-number field of each subnet address. As
discussed earlier, this means that each subnet represents a block of 126 host
addresses.
The hosts on each subnet will be numbered 1 through 126.
The valid host addresses for Subnet #3 are given below. The bold digits identify the
7-bit host-number field:
Subnet #3: 10001100.00011001.00000001.1 0000000 = 140.25.1.128/25
Host #1: 10001100.00011001.00000001.1 0000001 = 140.25.1.129/25
Host #2: 10001100.00011001.00000001.1 0000010 = 140.25.1.130/25
Host #3: 10001100.00011001.00000001.1 0000011 = 140.25.1.131/25
Host #4: 10001100.00011001.00000001.1 0000100 = 140.25.1.132/25
Host #5: 10001100.00011001.00000001.1 0000101 = 140.25.1.133/25
Host #6: 10001100.00011001.00000001.1 0000110 = 140.25.1.134/25

Host #62: 10001100.00011001.00000001.1 0111110 = 140.25.1.190/25


Host #63: 10001100.00011001.00000001.1 0111111 = 140.25.1.191/25
Host #64: 10001100.00011001.00000001.1 1000000 = 140.25.1.192/25
Host #65: 10001100.00011001.00000001.1 1000001 = 140.25.1.193/25

Host #123: 10001100.00011001.00000001.1 1111011 = 140.25.1.251/25


Host #124: 10001100.00011001.00000001.1 1111100 = 140.25.1.252/25
Host #125: 10001100.00011001.00000001.1 1111101 = 140.25.1.253/25
Host #126: 10001100.00011001.00000001.1 1111110 = 140.25.1.254/25

Defining the Broadcast Address for Each Subnet


The broadcast address for Subnet #3 is the all 1's host address or:
10001100.00011001.00000001.1 1111111 = 140.25.1.255
As is true in general, the broadcast address for Subnet #3 is exactly one less than
the base address for Subnet #4 (140.25.2.0).

TG70113EN02GLA2
100 2010 Nokia Siemens Networks