You are on page 1of 100

Appendix - The Network Layer

Appendix - The Network Layer

Contents
1 Introduction to IP 3
1.1 The Properties of the IP Protocol 4
1.2 Structure of an IP Packet 4
2 IP Addressing 5
2.1 Addressing on the Network Layer 6
2.2 Structured Addresses 8
2.3 Subnetworks and Subnetwork Masks 22
3 The ARP Protocol Family 33
3.1 The Address Resolution Protocol ARP 34
3.2 The Reverse Address Resolution Protocol RARP 34
3.3 Proxy-ARP 36
4 Routing 39
4.1 What is Routing? 40
4.2 Routing Principles 42
4.3 Routing Protocols 48
5 The IP Packet Revisited 75
5.1 Internet Protocol (IP) 76
6 Internet Control Message Protocol (ICMP) 83
6.1 ICMP Characteristics 84
6.2 ICMP Messages 86
6.3 ICMP Queries 88
6.4 ICMP Error Reports 90
6.5 ICMP Applications 92
7 Appendix 97
7.1 IP 98

TG7020XEN02GLA1
2009 Nokia Siemens Networks
1
Appendix - The Network Layer

TG7020XEN02GLA1
2 2009 Nokia Siemens Networks
Appendix - The Network Layer

1 Introduction to IP

Fig. 1 Introduction to IP

TG7020XEN02GLA1
2009 Nokia Siemens Networks
3
Appendix - The Network Layer

1.1 The Properties of the IP Protocol

1.2 Structure of an IP Packet

TG7020XEN02GLA1
4 2009 Nokia Siemens Networks
Appendix - The Network Layer

2 IP Addressing

Fig. 2IP Addressing

TG7020XEN02GLA1
2009 Nokia Siemens Networks
5
Appendix - The Network Layer

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 subnetworks 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 network addresses


For the physical transmission of data only the MAC address is used. Every station
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:
192.52.200.51 --> 08-00-14-35-67-32

TG7020XEN02GLA1
6 2009 Nokia Siemens Networks
Appendix - The Network Layer

Problem: MAC addresses are distributed randomly all over the network,
there is no logical structure.

MAC MAC
MAC MAC

Bridge MAC
MAC

Bridge Bridge
Bridge

MAC MAC
MAC MAC Bridge
MAC

Fig. 3 MAC addresses in a network

Solution: Network addresses. They have a logical structure


and can be used for the delivery of data even in big networks

Network address
Network address
MAC address
MAC address

Network address Network address


Router
MAC address MAC address

Router Router
Router

Network address
Network address Router
MAC address
MAC address

Every station
has a MAC address
and a network address

Fig. 4 Network addresses

TG7020XEN02GLA1
2009 Nokia Siemens Networks
7
Appendix - The Network Layer

2.2 Structured Addresses


If an address is unstructured, it is often very complicated to determine the receiver.
We can see this very clearly when we look at the example of a telephone network.

Hardware addresses in a telephony network - no good idea


Imagine all telephones have a serial number permanently stipulated on the hardware
and callers would have to use these serial numbers (corresponding to the hardware
addresses) as telephone numbers.
The telephone network faces the same problem as a network that uses bridging. How
does an exchange know where a call to the number 72-87-54-72-55-96 should be
transferred to. An enormous database would have to be created.

Hierarchical addresses make routing decisions easier


The telephone numbers we use every day already illustrate the advantages of
hierarchical addresses. The organization of the digits in e.g. international or local
codes makes routing decisions in the exchange far easier. The numbers currently
used are not even very well structured. Within the international address space of the
ISDN, the maximum length of a telephone number is defined as 15 decimal digits.
The organization of these 15 digits can vary (country code 1-3 digits, national
destination code 1-n digits). Additional information must be stored for evaluation
purposes.
The effort required to evaluate an address can be reduced further if it is divided
according to strict rules. This is referred to as class formation. If it is clear from the
outset how many digits of an address designate, e.g. a country, a schematic (and
therefore easy to implement) address evaluation procedure can be used.

TG7020XEN02GLA1
8 2009 Nokia Siemens Networks
Appendix - The Network Layer

CC
CC NDC
NDC SN
SN

1 to 3 digits Max (15-n) digits


National (significant) number
Max
Max 15
15 digits
digits

International public telecommunication


number for geographic areas

CC Country Code for geographic areas


NDC National Destination Code (optional)
SN Subscriber Number
n Number of digits in the country code

Fig. 5Hierarchical Addresses

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

TG7020XEN02GLA1
2009 Nokia Siemens Networks
9
Appendix - The Network Layer

2.2.1 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.

TIP
This can for example be compared with a central directory number for a Siemens
branch office and the subsequent extension to the individual telephone.

TG7020XEN02GLA1
10 2009 Nokia Siemens Networks
Appendix - The Network Layer

32 Bit IP Address

Network
Network Host
Host
The
Thehost
hostpart
partofofthe
theaddress
address
The
Thenetwork
networkpart
partofofthe
theaddress
address identifies
identifies identifies a certainhost
a certain host
identifies a certainnetwork
a certain network within
withinthe
thenetwork
network

Router Router

Fig. 6 Network and host part of an IP address

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

TG7020XEN02GLA1
2009 Nokia Siemens Networks
11
Appendix - The Network Layer

2.2.2 Decimal and Binary Notation of IP Addresses


An IP address consists of 4 bytes. For their representation, the individual bytes are
separated by dots, and are mostly in decimal format ("dotted decimal notation"). It is
this type of notation that you are probably most familiar with. It can, however, also be
useful to represent individual bytes in binary format, for example when working with
subnetwork masks.

TG7020XEN02GLA1
12 2009 Nokia Siemens Networks
Appendix - The Network Layer

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

Fig. 7 IP address structure

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

TG7020XEN02GLA1
2009 Nokia Siemens Networks
13
Appendix - The Network Layer

2.2.3 Address Classes


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 "eights") 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 1110. 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 1111.
TIP
Class D and Class E addresses are never used for addressing end user devices.

TG7020XEN02GLA1
14 2009 Nokia Siemens Networks
Appendix - The Network Layer

Structuring of the 4 Address Octets

Class A N H H H
0 7 Bits 24 Bits
Range: (1-126)

Class B N N H H
10 14 Bits 16 Bits
Range: (128-191)

Class C N N N H
110 21 Bits 8 Bits
Range: (192-223)

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

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

TG7020XEN02GLA1
2009 Nokia Siemens Networks
15
Appendix - The Network Layer

2.2.4 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 are reserved:
Network ID 127.x.x.x. (x can be a random number). These numbers are used for
local software feedback tests.
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 network ID of a certain class consisting exclusively of ones.
A host number 0 is reserved for reference to a certain network ID. This means that
in the network with the network address 192.0.1.0 the IP address 192.0.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.
The address 0.0.0.0 is reserved and used in two cases:
as the originator address if the host does not know its actual address, for example,
when powering up a workstation without hard disk.
Routers use it to specify default routes in address lists, i.e. the route to all
networks not explicitly listed.
The address 255.255.255.255 is reserved as destination address for local
broadcast messages to all the hosts of a network. 0.0.0.0 as a destination address
is an obsolete version of this address. Packets destined to this address must not
be forwarded by a router.

TG7020XEN02GLA1
16 2009 Nokia Siemens Networks
Appendix - The Network Layer

Application
Destination
127.0.0.1
TCP
IP
Data Link Layer

Directed
Directed Broadcast
Broadcast to
to
SIEMENS
NIXDORF

DA=201.3.3.255
DA=201.3.3.255 network
network 201.3.3.0
201.3.3.0 by
by default
default disabled
disabled

192.16.1.1
192.16.1.1
Router

Network
Network addr.
addr. 192.16.1.0
192.16.1.0
DA=255.255.255.255
DA=255.255.255.255

Fig. 9 Reserved addresses

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

TG7020XEN02GLA1
2009 Nokia Siemens Networks
17
Appendix - The Network Layer

2.2.5 Private Address Ranges:


The Internet Assigned Numbers Authority (IANA) has reserved the following three IP
address blocks for private networks (Intranets). These ranges are not forwarded via
any Internet router.
Address 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 class B networks
192.168.0.0 192.168.255.255 256 class C networks

2.2.6 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 three regional registries
that handle world-wide IP address assignments:

APNIC (Asia-Pacific Network Information Center)


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

ARIN (American Registry for Internet Numbers)


Handles 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

RIPE NCC (Rseaux IP Europens)


Handles 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 IANA and other groups.
Specifically, ICANN coordinates the assignment of the following identifiers that must
be globally unique for the Internet to function:
Internet domain names
IP address numbers
Protocol parameter and port numbers
ICANN can be contacted at the following URL: http://www.icann.org

TG7020XEN02GLA1
18 2009 Nokia Siemens Networks
Appendix - The Network Layer

Address Range Networks Address Class

10.0.0.0
1 A
10.255.255.254

172.16.0.0
16 B
172.31.255.254

192.168.1.0
256 C
192.168.255.254

These addresses are intended for


private use only!
Fig. 10 Addresses reserved for private use

IANA / ICANN

ARIN RIPE NCC APNIC

Local IR Local IR

Enterprise
Local IR

Fig. 11 Regional registry structure

TG7020XEN02GLA1
2009 Nokia Siemens Networks
19
Appendix - The Network Layer

2.2.7 The Allocation of IP Addresses

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.

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 DHCP protocol (DHCP =
Dynamic Host Configuration Protocol).

Examples
The following diagram shows the input of an IP address under Windows NT,
Windows 9x or Windows 2000
For a CISCO router the command would be:
cisco# conf t
cisco# interface e0
cisco# ip address 132.76.250.55 255.255.255.0

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


# ifconfig le0 132.76.250.55 netmask 255.255.255.0

TG7020XEN02GLA1
20 2009 Nokia Siemens Networks
Appendix - The Network Layer

Fig. 12 Configuration of an IP address for a popular operating system

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

TG7020XEN02GLA1
2009 Nokia Siemens Networks
21
Appendix - The Network Layer

2.3 Subnetworks and Subnetwork Masks


2.3.1 Reasons for Introducing Subnetworks
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: subnetwork
addressing.

What's the purpose of subnetworks?


Subnetworks and subnetwork masks allow the network administrator to divide a large
network into smaller subnetworks. In order to make the best possible use of the
limited address space available, subnetworks 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 subnetworks is an internal matter


Division into subnetworks 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 subnetworks thus simplifies network administration and
allows internal restructuring of a network without affecting larger network units or
even the entire Internet.

Subnetworks 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 subnetwork must be
accessible by one dedicated router interface. The address of this interface must be
part of the subnetwork address space. Subnetworks are often based on physical
network structures. This way it is possible, for example, to treat individual Ethernet-
based LANs as subnetworks and use routers to link them.

The technical solution: subnetmasks


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.
Subnetmasks allow the assignment of certain bits of the host part of the class A, B, C
address to be part of the subnet address

TG7020XEN02GLA1
22 2009 Nokia Siemens Networks
Appendix - The Network Layer

Example: Class A Address

0 8 16 24 31
Network part Host part

Subnetwork part Host part

Fig. 13 Example of the subdivision of a class A address

Net ID (Class A, B or C) Host ID

Net ID Subnet Number Host Number

IP Address

Subnet Router SIEMENS


NIXDORF

Subnet

Host
Routers are used to
connect subnetworks. Router
Router

Subnet The subnet structure


Each interface requires
is only visible within
a specific subnet address.
the network.

Fig. 14 Net ID, subnets and hosts

TG7020XEN02GLA1
2009 Nokia Siemens Networks
23
Appendix - The Network Layer

2.3.2 The Subnetwork Mask


A subnetwork mask allows us to divide an IP address at random into the network part
and the computer part. As with the IP address, the subnetwork mask consists of four
bytes, separated by dots in its written representation.
The mode of operation of the subnetwork mask can, however, best be understood by
choosing the binary format of the mask. Each bit that is set to "1" in the subnetwork
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".

TIP
The subnetwork mask contains a contiguous number of "1" followed by a contiguous
number of "0". The number of bits set to "1" is also referred to as "prefix length".

Example:
Filtering the IP address 85.139.117.4 with the subnetwork mask 255.192.0.0
produces the network address 85.128.0.0.
In the example below, the subnetwork mask 255.192.0.0 is used to create
subnetwork 85.128.0.0. Using this mask, a second subnetwork can be created
(85.64.0.0). A router may be used to link both subnetworks.

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 subnetwork mask is always used when no subnetworks 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 Subnetwork Mask Decimal


Class Subnetwork 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

TG7020XEN02GLA1
24 2009 Nokia Siemens Networks
Appendix - The Network Layer

IP Address 85 z139z117 z 4 01010101z10 001011z01110101z00000100

Subnetwork
Mask 255z192z 0 z 0 11111111z11 000000z00000000z00000000

Network Part
of the Address 85 z128z 0 z 0 01010101z10 000000z00000000z00000000

Computer Part of
the Address 0 z 11 z117 z 4 00000000z00 001011z01110101z00000100

Fig. 15 Mode of operation of a subnetwork mask

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

TG7020XEN02GLA1
2009 Nokia Siemens Networks
25
Appendix - The Network Layer

2.3.3 IP Address, Subnetwork Mask and Default Gateway


All TCP/IP components must support subnetwork masks. The subnetwork mask is
controlled by the network administrator and is the "digit" that determines the structure
of the subnetworks.

Default Gateway
When a host is willing to send it has to decide whether the destination host is in the
same subnetwork or in another one. In the latter case the default gateway must be
used to forward the IP packet. This creates interaction between IP addresses,
subnetwork mask and the so-called default gateway.

Example
Let us assume that station 85.128.0.1 wants to send an IP packet to a station that is
not part of the same subnetwork. Station 85.128.0.1 determines its own subnetwork
address by filtering its own IP address through the configured subnetwork mask.
It then determines the network address of the destination station by filtering
destination IP address using the locally configured subnetwork mask. If the two
network addresses do not match, the packet cannot be transmitted locally, but must
be forwarded to the default gateway for further transmission.
When you look at your computers network settings, the TCP/IP settings will generally
be the value pair IP address, subnetwork mask and default gateway.

TG7020XEN02GLA1
26 2009 Nokia Siemens Networks
Appendix - The Network Layer

Router
Router
The router isislinked
The router linkedtotoall
all Nextrouter
Next router
subnets and, in this instance,
subnets and, in this instance,
alsoforms
also formsthe
thedefault
defaultgateway
gateway
for both networks
for both networks Router

85.128.0.3
1. Subnet 85.128.0.0; Mask 255.192.0.0
Router
85.64.0.1

85.128.0.1 85.128.0.2

2. Subnet 85.64.0.0; Mask 255.192.0.0

OriginalNetwork
Original Network
85.x.x.x
85.x.x.x 85.64.0.3 85.64.0.2

Fig. 16 The division of a large network into two subnetworks

Fig. 17 Input mask with IP address, subnetwork mask and default gateway for a popular operating system

TG7020XEN02GLA1
2009 Nokia Siemens Networks
27
Appendix - The Network Layer

2.3.4 Creating a Subnetwork Mask


The most significant bits of the host part of an IP address is used to create
subnetworks by defining a subnetwork mask:
The definition of a subnetwork mask involves three 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?
2. Determine the number of bits required to define the necessary number of subnets
and hosts. E.g. for six subnetworks we need three bits (23-2)for the subnetwork
part; for 8000 hosts we need 13 bits (213-2>8000) for the host part of the IP
address.
3. Set the calculated number of bits required for the network and subnetwork part to
"1" and fill up the remaining part of the subnetwork mask with "0".
4. Convert this number to dotted decimal notation.

NOTE
When defining subnetwork masks, it must be taken into consideration that some digit
combinations are reserved, for example, for broadcast addresses and are therefore
not available. This reduces the number of possible subnetworks and hosts.
The available address space must be large enough, to cover the required number of
subnets and hosts.

TG7020XEN02GLA1
28 2009 Nokia Siemens Networks
Appendix - The Network Layer

1. Number of subnets 6

4+2=
2. Establishing the 0 0 0 0 0 1 1 0 (3Bits)
necessary bits

3. Set to most
significant digit 11111111 11111111 11100000 00000000

Convert into decimal format

4. Subnet mask 255 . 255 . 224 . 0

Fig. 18 Defining a subnetwork mask

255 . 255 . 224 . 0


11111111 11111111 11100000 00000000

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

Fig. 19 Defining a valid subnetwork ID

TG7020XEN02GLA1
2009 Nokia Siemens Networks
29
Appendix - The Network Layer

2.3.5 Standard Class Conversion Tables

Class A conversion table

Number of Required Subnetwork Number of Hosts


Subnetworks Bits Mask per Subnetwork
Reserved 1 Reserved Reserved
2 2 255.192.0.0 4.194.302
6 3 255.224.0.0 2.097.150
14 4 255.240.0.0 1.048.574
30 5 255.248.0.0 524.286
62 6 255.252.0.0 262.142
126 7 255.254.0.0 131.070
254 8 255.255.0.0 65.534

Class B conversion table

Number of Required Subnetwork Number of Hosts


Subnetworks Bits Mask per Subnetwork
Reserved 1 Reserved Reserved
2 2 255.255.192.0 16.382
6 3 255.255.224.0 8.190
14 4 255.255.240.0 4.094
30 5 255.255.248.0 2.046
62 6 255.255.252.0 1.022
126 7 255.255.254.0 510
254 8 255.255.255.0 254

TG7020XEN02GLA1
30 2009 Nokia Siemens Networks
Appendix - The Network Layer

Class C conversion table

Number of Required Subnetwork Number of Hosts


Subnetworks Bits Mask per Subnetwork
Reserved 1 Reserved Reserved
1- 2 2 255.255.255.192 62
3- 6 3 255.255.255.224 30
7 - 14 4 255.255.255.240 14
15 - 30 5 255.255.255.248 6
31 - 62 6 255.255.255.252 2
Reserved 7 Reserved Reserved
Reserved 8 Reserved Reserved

TG7020XEN02GLA1
2009 Nokia Siemens Networks
31
Appendix - The Network Layer

TG7020XEN02GLA1
32 2009 Nokia Siemens Networks
Appendix - The Network Layer

3 The ARP Protocol Family

TG7020XEN02GLA1
2009 Nokia Siemens Networks
33
Appendix - The Network Layer

3.1 The Address Resolution Protocol ARP


Each TCP/IP-based host computer on a local area network (LAN) has two
addresses:
A unique data link address that is built into the network interface (e.g. Ethernet
controllers are manufactured with a built-in 48-bit address.).
An IP address assigned by the network administrator to the particular host
computer.
The ARP protocol uses a lookup table (ARP cache) to determine the exact data link
layer address corresponding to the IP address in a packet being routed into the LAN.
When the address is not found in the ARP cache, an ARP request message is
broadcast on a particular subnetwork. If one of the hosts recognizes its own IP
address, it sends an ARP reply message to the requesting host. The ARP reply
contains the physical hardware address of the host and source route information (if
the packet has crossed bridges on its path). The requesting host will store the
destination hosts address and the source route information in the ARP cache. All
subsequent datagrams to this destination IP address can now be translated to a
physical address.
RFC 1577 extends ARP to support ATM subnetworks.

Try it
With the command:
arp -a
you will get the ARP cache table, which contains the relation between MAC
addresses and IP addresses.

3.2 The Reverse Address Resolution Protocol RARP


Some network hosts, such as diskless workstations, do not know their own IP
address when they are booted. To determine their own IP address, they use a
mechanism similar to ARP, but now the hardware address of the host is the known
parameter, and the IP address the queried parameter.
It differs more fundamentally from ARP in the fact that a RARP server must exist on
the network that maintains that a database of mappings from hardware address to
protocol address must be pre-configured.

TIP
Today RARP is seldom used. It has been replaced by other protocols like DHCP and
BOOTP.

TG7020XEN02GLA1
34 2009 Nokia Siemens Networks
Appendix - The Network Layer

Host A
ARP Request - Broadcast to all hosts
SIEMENS
NIXDORF
What is the hardware address for IP address 128.0.10.4?

ARP Reply

SIEMENS
NIXDORF
SIEMENS
NIXDORF

Host B
IP Address: 128.0.10.4
HW Address: 080020021545

Fig. 20 How does ARP work?

Fig. 21 The ARP command

TG7020XEN02GLA1
2009 Nokia Siemens Networks
35
Appendix - The Network Layer

3.3 Proxy-ARP
If an existing network is split up into several subnets Proxy ARP is method to avoid a
modification to the existing IP routing algorithm in the existing hosts, but with
modifications to the routers that interconnect the subnets.

Proxy-ARP Concept
Consider one IP network that is divided into subnets and interconnected by routers.
We use the existing IP routing algorithm, which means that no host knows about the
existence of multiple physical networks.
Consider hosts A and B, which are on different physical networks within the same IP
network, and a router R between the two subnetworks:
When host A wants to send an IP datagram to host B, it first has to determine the
physical network address of host B through the use of the ARP protocol. As host A
cannot differentiate between the physical networks, its IP routing algorithm thinks that
host B is on the local physical network and sends out a broadcast ARP request. Host
B doesn't receive this broadcast, but router R does.
Router R understands subnets, that is, it runs the subnet version of the IP routing
algorithm and it will be able to see that the destination of the ARP request (from the
target protocol address field) is on another physical network. If router R's routing
tables specify that the next hop to that other network is through a different physical
device, it will reply to the ARP as if it were host B, saying that the network address of
host B is that of the router R itself.
Host A receives this ARP reply, puts it in its cache and will send future IP packets for
host B to the router R. The router will forward such packets to the correct subnet.
The result is transparent subnetting:
Normal hosts (such as A and B) don't know about subnetting, so they use the old
IP routing algorithm.
The routers between subnets have to:
1. Use the subnet IP routing algorithm.
2. Use a modified ARP module, which can reply on behalf of other hosts.

TG7020XEN02GLA1
36 2009 Nokia Siemens Networks
Appendix - The Network Layer

A
B

Router R

I take care, to forward


IP packets to B

Broadcast Message to all:


If your IP address matches B Yes, I know the destination
then please tell me your network, let me give you my
Ethernet address Ethernet address

Fig. 22 Proxy-ARP concept

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

TG7020XEN02GLA1
2009 Nokia Siemens Networks
37
Appendix - The Network Layer

TG7020XEN02GLA1
38 2009 Nokia Siemens Networks
Appendix - The Network Layer

4 Routing

Router
Switch

Router Router

Router
Router
Switch
Which
Which way
way
to
to go ??
go

Fig. 23

TG7020XEN02GLA1
2009 Nokia Siemens Networks
39
Appendix - The Network Layer

4.1 What is Routing?


Routing is the core of layer 3 functionality
The network layer (layer 3 of the OSI reference model) uses routing for the
forwarding of data. This requires the introduction of additional protocols and network
layer addresses.

Network addresses are logical addresses


Network layer addresses are logical addresses, and unlike MAC addresses, they are
not permanently stored on the hardware but can be allocated by the administration at
will. This can be used to create a logical, hierarchical addressing scheme, which can
greatly simplify data delivery as well as considerably reduce expenditure for routing
table organization and administration within a router. This is illustrated very well by
the following example:

An example for the use of logical addresses


For the transmission of data from a computer with the (fictitious) network address
usa.texas.houston.host_1 to another computer with the (fictitious) address
europe.france.paris.host_1, the routers in the USA must merely know the way to the
router that knows the way to Europe. Even within Europe, the higher layer routers do
not need to know the detailed structure of the smaller networks below. You can see
that dividing large networks into smaller ones (subnetting) and establishing a
hierarchical addressing scheme (based on the topology) can be a very useful method
to reduce the burden of network administration.
This example does, however, not explain how message transfer works in practice.
This will be explained in the next section.

TG7020XEN02GLA1
40 2009 Nokia Siemens Networks
Appendix - The Network Layer

Network:
Netz USA.x.x.x
usa.x.x.x Network:
Netz Europe.x.x.x
europe.x.x.x

Router

Router Router
Network:
Netz Europe.France.x.x
europe.france.x.x
Router
Router Network:
Netz USA.Texas.x.x
usa.texas.x.x

Network:
Netz Europe.France.Paris.x
europe.france.paris.x
Network:
Netz USA.Texas.Houston.x
usa.texas.houston.x

Computer 1 Computer 2
Network address: Network address:
usa.texas.houston.host_1 europe.france.paris.host_1

Fig. 24 Addressing on the network layer the advantages of the routing concept

NOTE
Please do not confuse the names used here with symbolic names. They merely
indicate a hierarchical structure and could also be replaced by numerical values, e.g.
IP addresses. We will look at symbolic names later.

TG7020XEN02GLA1
2009 Nokia Siemens Networks
41
Appendix - The Network Layer

4.2 Routing Principles


First of all, routing means to find an available path towards a given destination
network based on the destination network address of a packet. There are two basic
types: "direct routing" and "indirect routing".

TIP
To explain the routing principles, in the following we will use the IP protocol as an
example.

Direct or Indirect Routing?


When a host is willing to send it has to decide whether the destination host is in the
same subnetwork or in another one. It then determines the network address of the
destination station by consulting the local host's routing table:
If two network addresses match, the packet can be delivered locally. This is called
"direct routing".
If the two network addresses do not match, the packet cannot be transmitted
locally, but must be forwarded to the default gateway for further transmission. This
is called "indirect routing".

Direct Routing
If two computers are located within the same (sub-) network, a packet can be
delivered without a router. The destination hardware address corresponding to the
destination IP address is determined. Afterwards, the IP packet is embedded in an
appropriate layer 2 transmission frame. In IP-based LANs, the mechanism of
determining the hardware address is implemented by the so-called ARP protocol.

TG7020XEN02GLA1
42 2009 Nokia Siemens Networks
Appendix - The Network Layer

Direct routing allows the local delivery of an IP packet without using a router

IP address IP address

MAC MAC MAC

MAC MAC

The destination host is identified based on its IP


The layer 2 transmission method address. For addressing the destination host on
is used for transfer. layer 2, the sending host uses the destinations
MAC address.

Fig. 25 Direct routing

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

TG7020XEN02GLA1
2009 Nokia Siemens Networks
43
Appendix - The Network Layer

Indirect Routing
We speak of "indirect routing" when the destination host is not located within the
same (sub-) network:
The default gateway's layer two address is determined using the ARP protocol
(see below)
The IP packet is embedded in an appropriate layer 2 transmission frame and sent
to the default gateway
The default gateway decapsulates the IP packet from the layer two frame and
makes its routing decision based on the (sub-) network part of the packet's
"destination address"
The router's interface towards the destination (sub-) network is determined and the
packet is forwarded through it using the next router's layer 2 address
Each router repeats this process. This principle is also referred to as hop-by-hop
routing.

Indirect routing also includes direct routing


The last router on the packet's way towards the destination (sub-)network must
deliver the packet to the destination host. Once again, direct routing is used in this
case.

TG7020XEN02GLA1
44 2009 Nokia Siemens Networks
Appendix - The Network Layer

This host only needs to


know the destinations The destination host is identified
and the default gateways by its IP and its MAC address
IP addresses

Router
Router

Router Router Router

Router

Each router decides on which


Routers are used for connections This principle is called hop-by-
interface to forward the packet on the
across network borders hop routing
next hop

Fig. 26 Indirect routing

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

TG7020XEN02GLA1
2009 Nokia Siemens Networks
45
Appendix - The Network Layer

Routing tables
A routers stored knowledge is located within its routing table. An entry in a routing
table contains at least three items:
The destination (sub-) network address (this is also called a "prefix")
The IP address of the next router (next hop)
The egress port
Mostly the costs to the destination (sub-) network is included as well (dynamic routing
see below)
The following commands can be used to read the contents of a routing table:

Command Operating System


netstat r[n] Windows or Unix systems.
show ip route CISCO IOS

TIP
Generally, in a multiprotocol router each network layer protocol uses its own routing
process and its own routing table. This is also called "ships in the night" routing.

TG7020XEN02GLA1
46 2009 Nokia Siemens Networks
Appendix - The Network Layer

Routing IP Packet
Process
Routing
Table
IP Packets DA

SA

DA

SA
DA DA

SA SA

192.16.3.0
192.16.3.0

Router

Router 192.16.4.0
192.16.4.0

192.16.1.0
192.16.1.0

192.16.2.0
192.16.2.0

Fig. 27 Routing tables and routing decision

All addresses starting with ...have to be delivered via the router with
132.76.250 (Prefix).... IP address 132.76.250.55 (next hop).

Fig. 28 A look into a routing table

TG7020XEN02GLA1
2009 Nokia Siemens Networks
47
Appendix - The Network Layer

4.3 Routing Protocols


4.3.1 Static and Dynamic Routing

Static Routing
Manual configuration is used to establish entries into the routing tables

Dynamic Routing
Routing protocols are used for dynamic establishment and update of entries into a
routing table.

4.3.2 Static Routing

Example
In the example below, host A has direct routes to host B and routers D and F, and an
indirect route to host C. Router D is located between networks 128.10.0.0 and
128.15.0.0. Router D has two interfaces with an IP address allocated to each. Router
F is a located between networks 128.15.0.0 and 129.7.0.0. Router F has also two
interfaces with an IP address allocated to each.
The IP routing table of host D will contain the following entries:

Destination Subnet mask Outgoing Interface Route via


128.10.0.0 255.255.0.0 eth0 directly connected
128.15.0.0 255.255.0.0 eth1 directly connected
129.7.0.0 255.255.0.0 eth1 128.15.1.2

TIP
It is quite obvious that manually maintained routing tables can only be used for small
networks, and even then the burden that may result from reconfiguring a network is
considerable.

Configuration examples:
Command Operating System
route add 129.7.0.0 mask 255.255.0.0 Windows
128.15.1.2 metric 1
ip route 129.7.0.0 255.255.0.0 CISCO IOS
128.15.1.2

TG7020XEN02GLA1
48 2009 Nokia Siemens Networks
Appendix - The Network Layer

E C Net
128.10.0.0

Eth0:128.10.1.1 / 255.255.0.0

Router D

Net
Eth1: 128.15.2.4 / 255.255.0.0
128.15.0.0

Eth0:128.15.1.2 / 255.255.0.0
A B

Router F
Net
Eth1: 129.7.1.80 / 255.255.0.0 129.7.0.0

G H

Fig. 29 Network scenario

Fig. 30 The 'route add' command

TG7020XEN02GLA1
2009 Nokia Siemens Networks
49
Appendix - The Network Layer

4.3.3 Dynamic Routing


Dynamic creation of entries in routing tables minimizes the administrative burden of
the operator. Dynamic routing uses routing protocols to exchange network
reachability and topology state information. Based on this information, routers
determine the optimal route through a network towards the destination.

4.3.3.1 Dynamic Routing Protocols


The dynamic routing protocols can be divided into two groups:
Interior Gateway Protocols (IGPs): Examples of these protocols are Open Short
Path First (OSPF) and Routing Information Protocol (RIP).
Exterior Gateway Protocols (EGPs): An example of these routing protocols is
Border Gateway Protocol Version 4 (BGP-4).
Gateway protocols are referred to as interior or exterior depending on whether they
are used within or between autonomous systems (ASs).

What is an Autonomous System?


An Autonomous System (AS) is a group of IP networks operated by one or more
network operator/s, which has a single and clearly defined external routing policy.
Exterior routing protocols are used to exchange routing information between ASes.

When should an Autonomous System be created?


An AS needs to be created if a network connects to more than one AS with different
routing policies.

What is an Autonomous System Number?


A public AS has a globally unique number, an Autonomous System number (ASN),
associated with it; this number is used in both the exchange of exterior routing
information (between neighboring ASes), and as an identifier of the AS itself. There
are two types of Autonomous System numbers; Public AS numbers and Private AS
numbers.

When is a Public Autonomous System Number Required?


A Public AS number is required only when an AS is exchanging routing information
with other ASes on the public Internet. That is, all routes originating from an AS is
visible on the Internet.

When can I use a Private Autonomous System Number?


A Private AS number should be used if an AS requires doing BGP with a single
provider. As the routing policy between the AS and the provider will not be visible in
the Internet, a Private AS Number can be used for this purpose. The AS numbers
64512 through to 65535 are reserved to be used as private ASes.

TG7020XEN02GLA1
50 2009 Nokia Siemens Networks
Appendix - The Network Layer

The Internet

Autonomous
AS System
AS Exterior Gateway
Protocols are used
for routing between
autonomous systems

AS
AS
Interior Gateway Protocols are
used for routing decisions
within an autonomous system.

IGP examples EGP examples


RIP EGP (name of a protocol)
OSPF BGP

Fig. 31 The use of IGP and EGP protocols

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

TG7020XEN02GLA1
2009 Nokia Siemens Networks
51
Appendix - The Network Layer

Basic types of dynamic routing protocols


There are two basic types of dynamic routing protocols:
Distance vector routing
Link state routing
Both types of protocols attempt to find an optimal route through the network.

What is an optimal route?


A route can be optimal if it uses the smallest possible metric. A metric may be:
The number of hops between the current router and the destination network
The shortest physical distance
The fastest or possibly the cheapest lines
For each physical link between routers an individual metric is implicitly or explicitly
assigned. The lower the overall metric of a route, the better.

4.3.3.2 Distance Vector Routing


Using distance vector routing, neighboring routers exchange destination network
information and the respective metric extracted from their routing tables. They use
local broadcasts for this type of information transfer.
The router compares its current routing table with the information received from its
neighbors and can thus determine whether there is a better route to the destination. If
this is the case, it can modify its routing table accordingly.

TG7020XEN02GLA1
52 2009 Nokia Siemens Networks
Appendix - The Network Layer

A
A specific
specific value
value for
for the
the
metric
metric is
is valid
valid for
for
aa connection.
connection.

33 Router C
Router E
11 11
10
10
Router A
Router D
192.16.8.0
192.16.8.0
22
192.16.1.0
192.16.1.0
11
Router B
The
The best
best way
way from
from network
network 192.16.1.0
192.16.1.0
to
to network
network 192.16.8.0
192.16.8.0 is
is via
via
Router
Router A,
A, B,
B, D,
D, and
and EE because
because
the
the overall-metric
overall-metric is
is minimal.
minimal.

Fig. 32 A metric influences routing decisions

Destination Distance Routing table contains the addresses


of destinations and the distance
192.16.1.0 1 of the way to this destination.
192.16.5.0 1
192.16.7.0 2

2 Hops

1 Hop 1 Hop

Router A Router B Router C Router D

192.16.1.0
192.16.1.0 Flow
Flow of
of routing
routing 192.16.7.0
192.16.7.0
information
information

192.16.5.0
192.16.5.0

Fig. 33 The principle of a distance vector routing protocol using hopcount as a metric

TG7020XEN02GLA1
2009 Nokia Siemens Networks
53
Appendix - The Network Layer

Slow convergence
The limited amount of information leads to a problem that is referred to as "slow
convergence". Convergence time is the time required to pass information on topology
changes throughout the network. Distance vector routing protocols show a long
convergence time. The following examples show why this is the case:

Example 1:
Assume a network scenario as shown in the diagram below:
When the network is turned on, each router only knows the directly connected
networks
Routing updates are sent periodically
After the first update each router is also informed about networks which are
reachable via the next hop
After the second update each router is additionally informed about networks which
are reachable via 2 hops
After the third update router A and router D finally know about the distant networks
which are reachable via 3 hops
Therefore several cycles are required until the presence of all networks is known
throughout the entire network.

TG7020XEN02GLA1
54 2009 Nokia Siemens Networks
Appendix - The Network Layer

192.16.3.0
192.16.3.0

192.16.2.0
192.16.2.0 192.16.6.0
192.16.6.0

Router A Router B Router C Router D

192.16.4.0
192.16.4.0
192.16.1.0
192.16.1.0 192.16.7.0
192.16.7.0

192.16.5.0
192.16.5.0

192.16.1.0
192.16.1.0 00 LL 192.16.2.0
192.16.2.0 00 LL 192.16.4.0
192.16.4.0 00 LL 192.16.6.0
192.16.6.0 00 LL

192.16.2.0
192.16.2.0 00 LL 192.16.3.0
192.16.3.0 00 LL 192.16.5.0
192.16.5.0 00 LL 192.16.7.0
192.16.7.0 00 LL

192.16.4.0
192.16.4.0 00 LL 192.16.6.0
192.16.6.0 00 LL

192.16.1.0
192.16.1.0 00 LL 192.16.2.0
192.16.2.0 00 LL 192.16.4.0
192.16.4.0 00 LL 192.16.6.0
192.16.6.0 00 LL

192.16.2.0
192.16.2.0 00 LL 192.16.3.0
192.16.3.0 00 LL 192.16.5.0
192.16.5.0 00 LL 192.16.7.0
192.16.7.0 00 LL

192.16.3.0
192.16.3.0 11 B
B 192.16.4.0
192.16.4.0 00 LL 192.16.6.0
192.16.6.0 00 LL 192.16.5.0
192.16.5.0 11 C
C
192.16.4.0
192.16.4.0 11 B
B 192.16.1.0
192.16.1.0 11 A
A 192.16.3.0
192.16.3.0 11 B
B 192.16.4.0
192.16.4.0 11 C
C
192.16.5.0
192.16.5.0 11 C
C 192.16.2.0
192.16.2.0 11 B
B

LL Locally 192.16.6.0
192.16.6.0 11 C
C 192.16.7.0
192.16.7.0 11 D
D
Locally connected
connected

Fig. 34 Distribution of routing information with distance vector routing protocol

192.16.1.0
192.16.1.0 00 LL 192.16.2.0
192.16.2.0 00 LL 192.16.4.0
192.16.4.0 00 LL 192.16.6.0
192.16.6.0 00 LL

192.16.2.0
192.16.2.0 00 LL 192.16.3.0
192.16.3.0 00 LL 192.16.5.0
192.16.5.0 00 LL 192.16.7.0
192.16.7.0 00 LL
192.16.3.0
192.16.3.0 11 B
B 192.16.4.0
192.16.4.0 00 LL 192.16.6.0
192.16.6.0 00 LL 192.16.5.0
192.16.5.0 11 C
C
192.16.4.0
192.16.4.0 11 B
B 192.16.1.0
192.16.1.0 11 A
A 192.16.3.0
192.16.3.0 11 B
B 192.16.4.0
192.16.4.0 11 C
C
192.16.5.0
192.16.5.0 22 B
B 192.16.5.0
192.16.5.0 11 C
C 192.16.2.0
192.16.2.0 11 B
B 192.16.3.0
192.16.3.0 22 C
C
192.16.6.0
192.16.6.0 22 B
B 192.16.6.0
192.16.6.0 11 C
C 192.16.7.0
192.16.7.0 11 D
D 192.16.2.0
192.16.2.0 22 C
C
192.16.7.0
192.16.7.0 22 C
C 192.16.1.0
192.16.1.0 22 B
B

192.16.1.0
192.16.1.0 00 LL 192.16.2.0
192.16.2.0 00 LL 192.16.4.0
192.16.4.0 00 LL 192.16.6.0
192.16.6.0 00 LL
192.16.2.0
192.16.2.0 00 LL 192.16.3.0
192.16.3.0 00 LL 192.16.5.0
192.16.5.0 00 LL 192.16.7.0
192.16.7.0 00 LL

192.16.3.0
192.16.3.0 11 B
B 192.16.4.0
192.16.4.0 00 LL 192.16.6.0
192.16.6.0 00 LL 192.16.5.0
192.16.5.0 11 C
C
192.16.4.0
192.16.4.0 11 B
B 192.16.1.0
192.16.1.0 11 A
A 192.16.3.0
192.16.3.0 11 B
B 192.16.4.0
192.16.4.0 11 C
C
192.16.5.0
192.16.5.0 22 B
B 192.16.5.0
192.16.5.0 11 C
C 192.16.2.0
192.16.2.0 11 B
B 192.16.3.0
192.16.3.0 22 C
C
192.16.6.0
192.16.6.0 22 B
B 192.16.6.0
192.16.6.0 11 C
C 192.16.7.0
192.16.7.0 11 D
D 192.16.2.0
192.16.2.0 22 C
C
192.16.7.0
192.16.7.0 33 B
B 192.16.7.0
192.16.7.0 22 C
C 192.16.1.0
192.16.1.0 22 B
B 192.16.1.0
192.16.1.0 33 C
C

Fig. 35 Distribution of routing information with distance vector routing protocol (cont.)

TG7020XEN02GLA1
2009 Nokia Siemens Networks
55
Appendix - The Network Layer

In the case of a failing network, the convergence time may be exceptionally long:

Example 2
Assume a network scenario as shown in the diagram below:
Theoretically there are two possible paths from each source network towards
network "alpha"
Routers C chooses a route via 2 hops to network "alpha" via router B
Routers D chooses a route via 2 hops to network "alpha" via router B
Router C propagates its route towards network "alpha" to router D
Router D propagates its route towards network "alpha" to router C
However, this announcement has no effect since both routers have already a
better direct route via router B

Example 2 in case of a failure


Assume a network scenario as shown in the diagram below:
Router B fails
This is detected by routers C and D but not necessarily at the same point of time
Assuming router C detects this failure first and therefore removes its direct route
towards network "alpha" via router B from its routing table
Router D still assumes the reachability of network "alpha" via router B and
therefore still propagates this information to router C
Router C concl. an alternative route to network "alpha" with 3 hops via router D
Routers D detects later on the outage of network "alpha" caused by the failure of
router B
Router D removes its direct route towards network "alpha" via router B from its
routing table
In the meantime router C announces the availability of network "alpha" towards
router D with 3 hops
Router D concl. an alternative route to network "alpha" with 4 hops via router C
It is easy to see what happens next.

Count-to-Infinity
With each exchange of routing information, the number of hops associated with the
route towards network "alpha" is increased until a threshold value is reached and the
route is detected as unusable. Without these thresholds, the routers would continue
to count indefinitely (count-to-infinity problem).

TG7020XEN02GLA1
56 2009 Nokia Siemens Networks
Appendix - The Network Layer

Router C
metric=1
SIEMENS
NIXDORF

metric=1
metric=1 Router B

metric=1
Router A
Router D

Network name:
alpha

Fig. 36 Distance vector routing protocol behavior in converged network scenario

Status=down Router C

Status=up

metric=1 Router C

metric=1 metric=1
Router B

Router A metric=1
Router D

Network name: Status=up


alpha
Status=down
Router D

Fig. 37 The distance vector routing protocol "counting to infinity" problem

TG7020XEN02GLA1
2009 Nokia Siemens Networks
57
Appendix - The Network Layer

Approaches to reduce convergence times


There are several approaches to reduce convergence times and therefore increase
network stability:
split horizon
reverse poison
triggered updates

Split horizon reduces convergence times by preventing routers from returning


advertisements in the same direction in which they received information about the
networks.
Reverse poison does return advertisements in the same direction in which they
were received, but sets the metric to its maximum value in these responses. This
indicates that the path is unusable. In more recent distance vector routing protocol
implementations, reverse poison is used in standard operation.
Triggered updates considerably improve distance vector routing protocol
convergence. A router can send advertisements as soon as a problem occurs or the
metric is changed. It need not therefore wait for the next advertising interval. This
way, convergence can be established quickly. However, it also means that as soon
as a fault occurs, a large number of broadcast messages have to be transmitted
within the network. In large distance vector routing protocol networks, this volume of
data can lead to certain problems.

TG7020XEN02GLA1
58 2009 Nokia Siemens Networks
Appendix - The Network Layer

1 1
Router A Router B Router C

1 B informs A about a connection to C with length = 1

2 A calculates a route to C with length = 2

3 a) Standard RIP
A informs B about a connection to C with length = 2
Distance to C = 2

b) Split horizon
A does not inform B about the connection to C via B

c) Reverse poison
A informs B about a connection to C with length = 16

Distance to C = 16

Fig. 38 Approaches to improve distance vector routing protocols

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

TG7020XEN02GLA1
2009 Nokia Siemens Networks
59
Appendix - The Network Layer

4.3.3.3 Link State Routing

General
The growth in the size of internetworks in recent years has necessitated the
replacement of distance vector routing protocols with alternatives that address the
shortcomings of those. These new protocols have been based on link state or
shortest path first algorithms. The best example is the OSPF Protocol.

The principle of link state routing


The principle behind link state routing is straightforward, although its implementation
can be complex:
Routers are responsible for contacting neighbors and learning their identities.
Routers construct link state packets which contain lists of network links and their
associated metric.
Link state packets are transmitted to all routers in a network.
All routers therefore have an identical list of links in a network, and can construct
identical topology maps.
The maps are used to compute the best routes to all destinations.

Hello packets
Routers contact neighbors by sending hello packets on their network interfaces. Hello
packets are sent directly to neighbors on point-to-point links and non-broadcast
networks. On LANs, hello packets are sent to a group or multicast IP address that
can be received by all routers. Neighbors who receive hellos from a router should
reply with hello packets that include the identity of that originating router.

Link state information


Once neighbors have been contacted in this way, link state information can be
exchanged. Link state information is sent in the form of link state packets (LSPs),
also known as link state advertisements. LSPs provide the database from which
network topology maps can be calculated at each router. LSPs are normally sent only
under the following specific circumstances:
When a router discovers a new neighbor
When a link to a neighbor goes down
When the cost of a link changes
Basic refresh packets are sent every 30 minutes
Once a router has generated an LSP it is critical that it is received successfully by all
other routers in a network. If this does not happen, routers on the network will
calculate network topology based on incorrect link state information.

TG7020XEN02GLA1
60 2009 Nokia Siemens Networks
Appendix - The Network Layer

SPF

My links to My links to R1 and R3 are up.


R2 and R4 are up Routing My link to R2 is down.
Tabelle

Router 1 Router 4

Router 2 Router 3

My links to My links to
R1 and R3 are up, R2 and R4 are up.
my link to R4 is down.

Fig. 39 Principle of a link state algorithm

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

TG7020XEN02GLA1
2009 Nokia Siemens Networks
61
Appendix - The Network Layer

Flooding
Distribution of LSPs would normally be on the basis of each router's routing tables.
However, this leads to a chicken and egg situation. Routing tables would rely on
LSPs for their creation and LSPs would rely on routing tables for their distribution. A
simple scheme called flooding overcomes this, and ensures that LSPs are
successfully distributed to all routers in a network.
Flooding requires that a router that receives an LSP transmits it to all neighbors
except the one from which it was received. All LSPs must be explicitly acknowledged
to ensure successful delivery, and they are sequenced and time stamped to ensure
duplicates are not received and retransmitted.
When a router receives an LSP it looks into its database to check the sequence
number of the last LSP from the originator. If the sequence number is the same as, or
earlier than, the sequence number of the LSP in its database, then the LSP is
discarded. Otherwise the LSP is added to the database.
The flooding process ensures that all routers in a network have the same link state
information. All routers are then able to compute the same shortest path tree
topology map for the network, and hence select best routes to all destinations.

Shortest-Path First (SPF)


SPF is an algorithm that each router in the same AS has an identical link-state
database, leading to an identical graphical representation by calculating a tree of
shortest paths with the router itself as root. The tree is called the shortest-path tree
giving an entire path to any destination network or host. The figure below shows the
shortest-path tree example from router A. Each router, A, B, C, D and E has an
identical link-state database as shown. Router A generates its own shortest-path tree
by calculating a tree of shortest paths with router A itself as root.

TG7020XEN02GLA1
62 2009 Nokia Siemens Networks
Appendix - The Network Layer

11
Router A Router C 33

22 11 Router E

33
44
Router B Router D

Link State Database


B
B -- 22 A
A -- 22 A
A -- 11 C
C -- 11 C
C -- 33
C
C -- 11 D
D -- 44 D
D -- 11 B
B -- 44 D
D -- 33
E
E -- 33 E
E -- 33

Router A Router B Router C Router D Router E

A
A C

B D

Fig. 40 Shortest path first example

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

TG7020XEN02GLA1
2009 Nokia Siemens Networks
63
Appendix - The Network Layer

4.3.4 RIP

4.3.4.1 RIPv1
RIP (= Routing Information Protocol) is now a somewhat old distance vector protocol.
It was developed at a time when networks were still rather small and trunks with
different speeds were rather rare. Bearing these facts in mind, it is easier to
understand some of RIPs peculiarities.

Forwarding of routing tables via broadcasts


With RIP, each router sends its routing table to its adjacent routers (i.e. the ones it is
directly linked to). The tables are fully updated every 30 seconds. These updates are
often forwarded as broadcast messages (e.g. in Ethernet broadcast frames). The
transmission of routing information can result in a considerable network load, which is
one of the reasons why RIP should not be used in larger networks.

Hop count metric


RIP uses a very simple metric to create routing tables, namely the number of routers
up to a certain destination (hop count). An entry in the routing table generally consists
of the IP address (or address range) of a certain destination network and the number
of routing hops to this destination. Only the first router involved along this route is
known.
The use of the hop count metric is particularly disadvantageous if connections within
a network have different throughputs. A fast connection via two routers, for example,
would never be used if there were a slow one via one router.

Slow convergence
The fact that the receiving router does not know which stations are part of the route
to a certain destination can lead to so-called routing loops and very slow
convergence in the event of faults. This manifests itself in the fact that a fault within a
route only becomes known with considerable delay in the network.
RIP is a distance vector protocol, which means that the count to infinity problem may
occur. As already discussed in the section dealing with slow convergence, affected
routers increment the metric entries in their routing tables until a certain threshold
value is reached. This value is 16. Since updates are only sent every 30 seconds, up
to 15*30 seconds may pass until the affected routers realize that a certain physical
connection is no longer available.
The infinity threshold value does however also determine the maximum extent of a
network. For networks with connections of more than 15 hops, RIP is not suitable.
TIP
When using RIP-1, subnet masks have to be uniform across the entire network-
prefix. RIP-1 allows only a single subnet mask to be used within each network
number because it does not provide subnet mask information as part of its routing
table update messages.

TG7020XEN02GLA1
64 2009 Nokia Siemens Networks
Appendix - The Network Layer

RIPv1
Distribution of Routing Tables
to adjacent routers

Distribution of the routing


information via broadcast

Only one kind of metric:


Number of Hops

Connections with different


bandwidth can not be weighted

Routing loops can occur


-> bad convergence in case of a failure

Count to infinity problem


(infinity = 16)

Maximum network size is limited


by the number of hops

Fig. 41 Properties of RIPv1

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

TG7020XEN02GLA1
2009 Nokia Siemens Networks
65
Appendix - The Network Layer

4.3.4.2 RIPv2
RIP Version 2 was defined to overcome some of the limitations of RIP Version 1
without impacting on the advantages of RIP, i.e. its simplicity and easy
administration. RIP Version 2 has the following new features:
Transmission subnetwork masks
Authentication
Route Tag
Use of multicast addresses.

Subnetwork masks
RIPv2 allows the transmission of subnetwork masks and thus supports improved
network structuring.

Authentication
Authentication offers protection from unauthorized routing advertising that could
impair the security of a network. The original specification only envisages the use of a
plain text password, but for future specifications, other more complex mechanisms
could be considered.

Route Tag
Is a field intended for communicating additional information about the origin of the
route information? It is intended for interoperation between RIP and other routing
protocols. RIP-2 implementations must preserve this tag, but RIP-2 does not further
specify how it is to be used.

Multicast addresses
RIP Version 1 uses broadcast messages to forward routing information. RIP Version
2 can optionally use multicast messages to update tables so those devices that do
not implement RIP are also not subject to a load.

TG7020XEN02GLA1
66 2009 Nokia Siemens Networks
Appendix - The Network Layer

RIPv2

Support of subnet masks

Authentication

Use of Route Tag

Usage of multicast addresses

Fig. 42 Properties of RIPv2

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

TG7020XEN02GLA1
2009 Nokia Siemens Networks
67
Appendix - The Network Layer

4.3.5 OSPF

Hierarchies in OSPF
In addition to the weaknesses already mentioned, a further drawback of RIP is that it
does not permit simple network structuring. This situation can be improved
considerably with the OSPF protocol, which we will discuss now.

Autonomous systems and areas


OSPF is a link state routing protocol for autonomous systems. The network operator
can define any structure for his network by introducing areas. One area comprises
one or more IP network addresses that can in turn be divided into subnetworks. One
particular area is the so-called backbone area, which links all the areas of an
autonomous system. If an autonomous system consists of one area only, this must
be the backbone area.

OSPF properties
OSPF is based on a link state algorithm. All routers of a particular area inform each
other about which connected routers or networks they can access. In OSPF these
messages are referred to as LSAs (link state advertisements). Link state
advertisements contain information on known network addresses as well as the
subnetwork mask used in conjunction with the relevant address. OSPF supports
subnetworks and subnetwork masks of different lengths. Various metrics can be
used to evaluate the connections.
OSPF supports three types of connections and networks:
point-to-point connections between two routers,
multiconnected networks that allow broadcasts (usually LANs),
multiconnected networks that do not allow broadcasts (e.g. packet-switched
WANs).
Link status-oriented protocols take into consideration the status of the connections
and report the failure of a connection in the area. The convergence of OSPF is
therefore much quicker than that of RIP.

Topology and routing information


Each router within a particular area knows the areas topology in detail and
administers a topological database, which records the networks and other routers
within the particular area. A router that is linked to several areas has a separate
topological database for each one.
Routing information from other areas (in particular from the backbone area) can be
incorporated in an area in summarized form. Moreover, OSPF can import external
routes from other routing protocols, convert them into OSPF representations and
advertise them within the autonomous system.

TG7020XEN02GLA1
68 2009 Nokia Siemens Networks
Appendix - The Network Layer

Autonomous System
AS

Backbone
Backbone Area
Area
Router
Router
Router Router

Router
Router

Router Router Router


Router
Area
Area 11 Area
Area 22

Fig. 43 Structure of an autonomous system

This router knows Router B informs other


the topology of backbone routers
area 1 and of about destinations
the backbone in area 1
area in detail Backbone Area

Router B

Router B informs area 1


about aggregate routing
information of other
Router A areas and about router
to destinations outside
of the autonomous system.
This router knows
the topology
of area 1 in detail. Area 1

Fig. 44 Flow of routing information in OSPF

TG7020XEN02GLA1
2009 Nokia Siemens Networks
69
Appendix - The Network Layer

Communication inside and outside an autonomous system


Different types of routers are required for stations within an autonomous system to be
able to communicate with each other and with stations outside the autonomous
system. These different types of routers are
internal routers: routers located within one area.
area border routers: routers located at the borders of an area.
backbone routers: routers that are connected by at least one interface with the
backbone area.
AS boundary routers: routers that are located at the border of the autonomous
system and are linked to other autonomous systems.

Routing levels
There are also conceptual differences within the scope of the so-called routing levels.
OSPF knows three routing levels:
routes within one area (intra-area). If two stations within one area want to
communicate with each other they can use internal routers.
routes between areas (inter-area). If two stations within different areas want to
communicate with each other they choose a route that leads via an area border
router (which is also the backbone router) via the backbone area to the destination
area and its border area router.
Autonomous system external routes. If a station within one area wants to
communicate with the station of another autonomous system it selects a route via
an area border router to an AS boundary router that knows the route to the
destination autonomous target system.

Identification of autonomous systems


Autonomous systems are uniquely identified by their registered numbers. Similar to
the DNS zones, which will be discussed at a later stage, these registered numbers
allow conclusions to be drawn as to the operator of an autonomous system
(educational institute, commercial companies, government agencies, military, etc.).
This information can be used for policy based routing, for example.

TG7020XEN02GLA1
70 2009 Nokia Siemens Networks
Appendix - The Network Layer

AS Boundary
Autonomous
Autonomous System
System Router
AS
AS

Backbone
Backbone Area
Area Router AS
AS
External
External Route
Route
Backbone
Backbone Router Router
Router
Router

Area
Area Border
Border
Router
Router Router Router Inter
Inter Area
Area
Route
Route
Internal
Internal Router
Router
Router Router Router
Router Area
Area 22
Area
Area 11
Intra
Intra Area
Area
Route
Route

Fig. 45 Routers and routes in an autonomous system

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

TG7020XEN02GLA1
2009 Nokia Siemens Networks
71
Appendix - The Network Layer

4.3.6 BGPv4 (Border Gateway Protocol Version 4)


In contrast to the protocols we have seen so far, BGP is an exterior gateway protocol,
i.e. intended for routing between autonomous systems.

When to use BGP?


BGP is most appropriate when at least one of the following conditions exist:
An AS allows packets to transit through it to reach other autonomous systems
(E.g. ISP)
An AS has multiple connections to other autonomous systems
The flow of traffic entering and leaving your AS must be manipulated (policy based
routing

When not to use BGP?


BGP is not always appropriate. Don't use BGP if you have one of the following
conditions:
Single connection to the Internet or another AS
Routing policy and route selection are not a concern for your AS
Not enough resources to handle the BGP processing and bandwidth requirements

TIP
Use static routing instead

TG7020XEN02GLA1
72 2009 Nokia Siemens Networks
Appendix - The Network Layer

AS:10 Backbone networks AS:50


No
No policy
policy based
based
Router Router Router routing
routing used
used here
here
Static
Static route
route
used
used here
here

Router Router Router Router

Default
Default route
route
AS: 20 used
used here
here AS: 40
AS: 30
Router Router

Router
Router Router Router Router
Router
Router
Router Router
Stub network Stub network
Multiconnected
network
Between
Between networks,
networks,
The
The AS
AS numbers
numbers (1-65535
(1-65535 )) are
are used
used to
to policy
policy based
based routing
routing
detect
detect routing
routing loops
loops The
The AS
AS numbers
numbers can
can be
be used
used
64512
64512 to
to 65535
65535 are
are reserved
reserved for
for private
private ASes
ASes

Fig. 46 The environment of BGP

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

TG7020XEN02GLA1
2009 Nokia Siemens Networks
73
Appendix - The Network Layer

TG7020XEN02GLA1
74 2009 Nokia Siemens Networks
Appendix - The Network Layer

5 The IP Packet Revisited

Fig. 47 IP

TG7020XEN02GLA1
2009 Nokia Siemens Networks
75
Appendix - The Network Layer

5.1 Internet Protocol (IP)


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

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 datagrams.

Addressing terminals
IP provides a datagram transmission service. It must be possible to transmit both
originator and destination addresses.

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.

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.

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.

TG7020XEN02GLA1
76 2009 Nokia Siemens Networks
Appendix - The Network Layer

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 SIEMENS


NIXDORF
SIEMENS
NIXDORF

Frag men tation

Data Link Layer Ethernet 802.5 X.25

Fig. 48 Tasks of the internet protocol

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

TG7020XEN02GLA1
2009 Nokia Siemens Networks
77
Appendix - The Network Layer

5.1.1 IP Datagram

IP packet structure
An IP packet consists of two parts, the IP header and a part for the data to be
transmitted. The IP datagram header has a minimum length of 20 bytes.
The structure of the IP header will not be discussed in detail. Without burdening you
with too much information, one orientation aid is that the previously mentioned IP
protocol requirements must also be discernible in the structure of the header .

Fragmentation
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
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 protocol field, a higher protocol code is specified to which the IP is to deliver
the transmitted data.

32 Bits
0 4 8 16 32

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 Address

Options Padding

Data

Fig. 49 Fields used for fragmentation

TG7020XEN02GLA1
78 2009 Nokia Siemens Networks
Appendix - The Network Layer

32 Bits
0 4 8 16 32

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 Address

Options Padding

Data

Fig. 50 Fields for addressing stations

32 Bits
0 4 8 16 32

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 Address

Options Padding

Data

Fig. 51 Fields for addressing protocols

TG7020XEN02GLA1
2009 Nokia Siemens Networks
79
Appendix - The Network Layer

Transmission integrity
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
In the type of service field, different quality of service requirements can be coded.
This option is currently not used much. As the course progresses, you will learn of
other approaches to ensure quality of service.

Additional fields
For a list of all header fields, including the ones not described here, please refer to
this chapters appendix.

5.1.2 Fragmentation
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) Typical Frame Size (bytes)


Ethernet 1500 1014
IEEE 802.5 (16 Mb/s) 17,756 1024/4096
X.25 4080 128

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
datagrams up to 576 bytes without fragmentation.

TG7020XEN02GLA1
80 2009 Nokia Siemens Networks
Appendix - The Network Layer

32 Bits
0 4 8 16 32

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 Address

Options Padding

Data

Fig. 52 Fields for error recognition

32 Bits
0 4 8 16 32

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 Address

Options Padding

Data

Fig. 53 Fields which support the quality of service

TG7020XEN02GLA1
2009 Nokia Siemens Networks
81
Appendix - The Network Layer

TG7020XEN02GLA1
82 2009 Nokia Siemens Networks
Appendix - The Network Layer

6 Internet Control Message Protocol (ICMP)

TG7020XEN02GLA1
2009 Nokia Siemens Networks
83
Appendix - The Network Layer

6.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 datagrams). 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. Datagrams 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 datagrams, 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 datagrams 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, not must. In practice, routers will almost always generate ICMP
messages for errors, but for destination hosts, the number of ICMP messages
generated is implementation dependent.

TG7020XEN02GLA1
84 2009 Nokia Siemens Networks
Appendix - The Network Layer

Router

ICMP
ICMP Error
Error Reports:
Reports: ICMP
ICMP Queries:
Queries:
-- Destination
Destination Unreachable
Unreachable -- Echo
Echo
-- Source
Source Quench
Quench -- Echo
Echo Reply
Reply
-- Redirect
Redirect -- ...
...
-- ...
...

Router

Fig. 54 Internet control message protocol

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

TG7020XEN02GLA1
2009 Nokia Siemens Networks
85
Appendix - The Network Layer

6.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 datagrams. The IP header will always have a Protocol
number of 1, 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 Codepoints


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 Traceroute
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.

TG7020XEN02GLA1
86 2009 Nokia Siemens Networks
Appendix - The Network Layer

IP Datagram

Physical
Physical Network
Network IP
IP ICMP
ICMP Data End
End
CRC
CRC
Frame
Frame Header
Header Header
Header Message
Message Frame
Frame Flag
Flag

ICMP
ICMP Header
Header
0 8 16 31
Type
Type Code
Code Checksum
Checksum Data

This
This field
field
describes
describes the
the This
This field
field contains
contains This
This field
field contains
contains
type
type of
of message,
message, additional
additional information,
information, This
This field
field is
is computed
computed information
information for
for aa
e.g.
e.g. destination
destination which
which describes
describes the
the based
based onon the
the complete
complete specific
specific ICMP
ICMP
unreachable
unreachable problem
problem in in more
more detail
detail ICMP
ICMP message
message message
message

Fig. 55 An ICMP message

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

TG7020XEN02GLA1
2009 Nokia Siemens Networks
87
Appendix - The Network Layer

6.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 receipt 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.
Time Stamps are the number of milliseconds elapsed since midnight UT (GMT).

TG7020XEN02GLA1
88 2009 Nokia Siemens Networks
Appendix - The Network Layer

ICMP Echo Reply


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

C
A

Router Router

D
B

ICMP
Time Stamp Request ICMP
to D: Time Stamp Reply
My current time is to B:
My current time is

Fig. 56 ICMP queries

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

TG7020XEN02GLA1
2009 Nokia Siemens Networks
89
Appendix - The Network Layer

6.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 datagrams for output to the next
network.
If this message is received from the destination host, it means that the incoming
datagrams 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 datagrams 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 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.

TG7020XEN02GLA1
90 2009 Nokia Siemens Networks
Appendix - The Network Layer

ICMP ICMP
Destination Unreachable Redirect
to A to C:
e.g. Destination Unknown I use the
other Router
C
A

Router

Router

Router

B D

ICMP
Source Quench ICMP
to B: Time Exceeded
e.g. Buffer Overrun to D:
TTL expired

Fig. 57 ICMP error reports

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

TG7020XEN02GLA1
2009 Nokia Siemens Networks
91
Appendix - The Network Layer

6.5 ICMP Applications


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.

TG7020XEN02GLA1
92 2009 Nokia Siemens Networks
Appendix - The Network Layer

Fig. 58 The PING command

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

TG7020XEN02GLA1
2009 Nokia Siemens Networks
93
Appendix - The Network Layer

Example:
ping 132.76.250.55

Fig. 59 A PING result

TG7020XEN02GLA1
94 2009 Nokia Siemens Networks
Appendix - The Network Layer

Traceroute
The Traceroute program can be useful when used for debugging purposes.
Traceroute enables determination of the route that IP datagrams follow from host to
host.
Traceroute 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. Traceroute actually sends
UDP datagrams to the destination host which reference a port number that is outside
the normally used range. This enables Traceroute to determine when the destination
host has been reached, that is, when an ICMP "Port Unreachable" message is
received.

ICMP
Destination Unreachable
to D
e.g. Destination Unknown

From D: C
A Traceroute to A

Router

Router Router

Router

B D
ICMP
Time Exceeded
to D: ICMP
ICMP TTL expired Time Exceeded ICMP
Time Exceeded to D: Time Exceeded
to D: TTL expired to D:
TTL expired TTL expired

Fig. 60 Traceroute

TG7020XEN02GLA1
2009 Nokia Siemens Networks
95
Appendix - The Network Layer

TG7020XEN02GLA1
96 2009 Nokia Siemens Networks
Appendix - The Network Layer

7 Appendix

TG7020XEN02GLA1
2009 Nokia Siemens Networks
97
Appendix - The Network Layer

7.1 IP
7.1.1 All IP Header Fields
Field Description
VERS Version of the IP protocol. The current version is 4 (IPv4).
LEN Length of the IP header counted in 32-bit quantities
Type of Service Indication of the quality of service (precedence, delay, throughput and
reliability) requested for the IP datagram. IP cannot guarantee availability of the
selected service.
Total Length Total length of the datagram, header and data, specified in bytes
Identification 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 Various control flags (e.g. DF for dont fragment, MF for more fragments)
Fragment Offset Position of fragment relative to original datagram
Time to Live Specifies the time in seconds this datagram is allowed to travel on the Internet
(TTL) before being discarded. Each router passed is supposed to subtract its
processing time.
Protocol Code number for the higher-level protocol to which IP should deliver the data:
Number e.g. 01 = ICMP, 06 = TCP, 17 = UDP
Header Checksum on the header only. If the header checksum does not match the
Checksum 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-bit IP address of the host sending this datagram
Address
Destination IP 32-bit IP address of the destination host for this datagram
Address
Options Options include Internet Timestamp, Record Route, and Stream ID. This field
is used for network testing and debugging.
Padding Variable length field that is used to ensure that the IP header length is an exact
multiple of 32 bits. If an option is used, the datagram is padded with all-zero
bytes 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.

TG7020XEN02GLA1
98 2009 Nokia Siemens Networks
Appendix - The Network Layer

32 Bits
0 4 8 16 32

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 Address

Options Padding

Data

Fig. 61

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

TG7020XEN02GLA1
2009 Nokia Siemens Networks
99
Appendix - The Network Layer

7.1.2 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 datagrams 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:
The DF flag bit is checked to see if fragmentation is allowed. If fragmentation is not
allowed, the datagram will be discarded.
Depending on the MTU value, the data field is split into two or more parts.
All data portions are placed in IP datagrams. The headers of the datagrams are
updated copies of the original one.
Each of the fragmented datagrams 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. The initial value of this
timer is called the IP datagram time-to-live (TTL) value.

TG7020XEN02GLA1
100 2009 Nokia Siemens Networks

You might also like