Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
7 views395 pages

Unit Iv BCN

The document discusses the layered architecture of network communication, focusing on the OSI model and its seven layers, which include the physical, data link, network, transport, session, presentation, and application layers. It also compares the OSI model with the TCP/IP protocol suite, detailing addressing methods used in internet communication, such as physical, logical, port, and specific addresses. Additionally, it covers subnetting, supernetting, and classless addressing, providing examples and explanations for each concept.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views395 pages

Unit Iv BCN

The document discusses the layered architecture of network communication, focusing on the OSI model and its seven layers, which include the physical, data link, network, transport, session, presentation, and application layers. It also compares the OSI model with the TCP/IP protocol suite, detailing addressing methods used in internet communication, such as physical, logical, port, and specific addresses. Additionally, it covers subnetting, supernetting, and classless addressing, providing examples and explanations for each concept.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 395

1

1 LAYERED TASKS

We use the concept of layers in our daily life. As an


example, let us consider two friends who communicate
through postal mail. The process of sending a letter to a
friend would be complex if there were no services
available from the post office.

Topics discussed in this section:


Sender, Receiver, and Carrier
Hierarchy

2
Figure 1.1 Tasks involved in sending a letter

3
2-2 THE OSI MODEL
Established in 1947, the International Standards
Organization (ISO) is a multinational body dedicated to
worldwide agreement on international standards. An ISO
standard that covers all aspects of network
communications is the Open Systems Interconnection
(OSI) model. It was first introduced in the late 1970s.

Topics discussed in this section:


Layered Architecture
Peer-to-Peer Processes
Encapsulation

4
Note

ISO is the organization.


OSI is the model.

5
Figure 1.2 Seven layers of the OSI model

6
Figure 1.3 The interaction between layers in the OSI model

7
Figure 1.4 An exchange using the OSI model

8
2-3 LAYERS IN THE OSI MODEL

In this section we briefly describe the functions of each


layer in the OSI model.

Topics discussed in this section:


Physical Layer
Data Link Layer
Network Layer
Transport Layer
Session Layer
Presentation Layer
Application Layer

9
Figure 1.5 Physical layer

10
Note

The physical layer is responsible for movements of


individual bits from one hop (node) to the next.

11
Figure 1.6 Data link layer

12
Note

The data link layer is responsible for moving


frames from one hop (node) to the next.

13
Figure 1.7 Hop-to-hop delivery

14
Figure 1.8 Network layer

15
Note

The network layer is responsible for the


delivery of individual packets from
the source host to the destination host.

16
Figure 1.9 Source-to-destination delivery

17
Figure 1.10 Transport layer

18
Note

The transport layer is responsible for the delivery


of a message from one process to another.

19
Figure 1.11 Reliable process-to-process delivery of a message

20
Figure 1.12 Session layer

21
Note

The session layer is responsible for dialog


control and synchronization.

22
Figure 1.13 Presentation layer

23
Note

The presentation layer is responsible for translation,


compression, and encryption.

24
Figure 1.14 Application layer

25
Note

The application layer is responsible for


providing services to the user.

26
Figure 1.15 Summary of layers

27
2-4 TCP/IP PROTOCOL SUITE

The layers in the TCP/IP protocol suite do not exactly


match those in the OSI model. The original TCP/IP
protocol suite was defined as having four layers: host-to-
network, internet, transport, and application. However,
when TCP/IP is compared to OSI, we can say that the
TCP/IP protocol suite is made of five layers: physical,
data link, network, transport, and application.

Topics discussed in this section:


Physical and Data Link Layers
Network Layer
Transport Layer
Application Layer
28
Figure 1.16 TCP/IP and OSI model

29
2-5 ADDRESSING

Four levels of addresses are used in an internet employing


the TCP/IP protocols: physical, logical, port, and specific.

Topics discussed in this section:


Physical Addresses
Logical Addresses
Port Addresses
Specific Addresses

30
Figure 1.17 Addresses in TCP/IP

31
Figure 1.18 Relationship of layers and addresses in TCP/IP

32
Example 1.1

In Figure 1.19 a node with physical address 10 sends a


frame to a node with physical address 87. The two nodes
are connected by a link (bus topology LAN). As the
figure shows, the computer with physical address 10 is
the sender, and the computer with physical address 87 is
the receiver.

33
Figure 1.19 Physical addresses

34
Example 1.2

Most local-area networks use a 48-bit (6-byte) physical


address written as 12 hexadecimal digits; every byte (2
hexadecimal digits) is separated by a colon, as shown
below:

07:01:02:01:2C:4B

A 6-byte (12 hexadecimal digits) physical address.

35
Example 1.3

Figure 1.20 shows a part of an internet with two routers


connecting three LANs. Each device (computer or
router) has a pair of addresses (logical and physical) for
each connection. In this case, each computer is
connected to only one link and therefore has only one
pair of addresses. Each router, however, is connected to
three networks (only two are shown in the figure). So
each router has three pairs of addresses, one for each
connection.

36
Figure 1.20 IP addresses

37
Example 1.4

Figure 1.21 shows two computers communicating via the


Internet. The sending computer is running three
processes at this time with port addresses a, b, and c. The
receiving computer is running two processes at this time
with port addresses j and k. Process a in the sending
computer needs to communicate with process j in the
receiving computer. Note that although physical
addresses change from hop to hop, logical and port
addresses remain the same from the source to
destination.

38
Figure 1.21 Port addresses

39
Note

The physical addresses will change from hop to hop,


but the logical addresses usually remain the same.

40
Example 1.5

A port address is a 16-bit address represented by one


decimal number as shown.

753

A 16-bit port address represented


as one single number.

41
Network Layer Services:

Packetizing, Routing and Forwarding

Network layer services could be


explained in the following list :

1.Guaranteed delivery
2.Guaranteed delivery with bounded
delay
3.In-order packet delivery
4.Guaranteed minimal bandwidth
5.Guaranteed maximum jitter
6.Security services
19.2 Addressing
Internet Address
Classful Addressing
Subnetting
Supernetting
Classless Addressing
Dynamic Address Configuration
Network Address Translation
43
Note:

An IP address is a 32-bit address.

44
Note:

The IP addresses are unique


and universal.

45
Figure 19.9 Dotted-decimal notation

46
Example 1
Change the following IP addresses from binary notation to dotted-
decimal notation.
a. 10000001 00001011 00001011 11101111
b. 11111001 10011011 11111011 00001111

Solution
We replace each group of 8 bits with its equivalent decimal
number (see Appendix B) and add dots for separation:
a. 129.11.11.239
b. 249.155.251.15

47
Example 2
Change the following IP addresses from dotted-decimal notation to
binary notation.
a. 111.56.45.78
b. 75.45.34.78

Solution
We replace each decimal number with its binary equivalent (see
Appendix B):

a. 01101111 00111000 00101101 01001110


b. 01001011 00101101 00100010 01001110

48
Note:

In classful addressing, the address


space is divided into five classes: A, B,
C, D, and E.

49
Figure 19.10 Finding the class in binary notation

50
Figure 19.11 Finding the address class

51
Example 3
Find the class of each address:
a. 00000001 00001011 00001011 11101111
b. 11110011
1111 10011011 11111011 00001111

Solution
See the procedure in Figure 19.11.

a. The first bit is 0; this is a class A address.


b. The first 4 bits are 1s; this is a class E address.

52
Figure 19.12 Finding the class in decimal notation

53
Example 4
Find the class of each address:
a. 227.12.14.87
b. 252.5.15.111
c. 134.11.78.56

Solution
a. The first byte is 227 (between 224 and 239); the class is D.
b. The first byte is 252 (between 240 and 255); the class is E.
c. The first byte is 134 (between 128 and 191); the class is B.

54
Figure 19.13 Netid and hostid

55
Figure 19.14 Blocks in class A

56
Note:

Millions of class A addresses are


wasted.

57
Figure 19.15 Blocks in class B

58
Note:

Many class B addresses are wasted.

59
Note:

The number of addresses in class C is


smaller than the needs of most
organizations.

60
Figure 19.16 Blocks in class C

61
Figure 19.17 Network address

62
Note:

In classful addressing, the network


address is the one that is assigned to
the organization.

63
Example 5
Given the address 23.56.7.91, find the network address.

Solution
The class is A. Only the first byte defines the netid. We can find the network
address by replacing the hostid bytes (56.7.91) with 0s. Therefore, the network
address is 23.0.0.0.

64
Example 6
Given the address 132.6.17.85, find the network address.

Solution
The class is B. The first 2 bytes defines the netid. We can find the network
address by replacing the hostid bytes (17.85) with 0s. Therefore, the network
address is 132.6.0.0.

65
Example 7
Given the network address 17.0.0.0, find the class.

Solution
The class is A because the netid is only 1 byte.

66
Note:

A network address is different from a


netid. A network address has both netid
and hostid,
with 0s for the hostid.

67
Figure 19.18 Sample internet

68
Note:

IP addresses are designed with two


levels of hierarchy.

69
Figure 19.19 A network with two levels of hierarchy

70
Figure 19.20 A network with three levels of hierarchy (subnetted)

71
Figure 19.21 Addresses in a network with and without subnetting

72
Figure 19.22 Hierarchy concept in a telephone number

73
Table 19.1 Default masks
In Dotted-
Class In Binary Using Slash
Decimal

A 11111111 00000000 00000000 00000000 255.0.0.0 /8

B 11111111 11111111 00000000 00000000 255.255.0.0 /16

C 11111111 111111111 11111111 00000000 255.255.255.0 /24

74
Note:

The network address can be found


by applying the default mask to any
address in the block (including itself).
It retains the netid of the block and sets
the hostid to 0s.

75
Example 8
A router outside the organization receives a packet with destination
address 190.240.7.91. Show how it finds the network address to
route the packet.

Solution
The router follows three steps:
1. The router looks at the first byte of the address to find the
class. It is class B.
2. The default mask for class B is 255.255.0.0. The router ANDs
this mask with the address to get 190.240.0.0.
3. The router looks in its routing table to find out how to route the
packet to this destination. Later, we will see what happens if
this destination does not exist.
76
Figure 19.23 Subnet mask

77
Example 9
A router inside the organization receives the same packet with
destination address 190.240.33.91. Show how it finds the
subnetwork address to route the packet.

Solution
The router follows three steps:
1. The router must know the mask. We assume it is /19, as shown in Figure
19.23.
2. The router applies the mask to the address, 190.240.33.91. The subnet
address is 190.240.32.0.
3. The router looks in its routing table to find how to route the packet to this
destination. Later, we will see what happens if this destination does not
exist.

78
Figure 19.24 DHCP transition diagram

79
Table 19.2 Default masks

Range Total

10.0.0.0 to 10.255.255.255 224

172.16.0.0 to 172.31.255.255 220

192.168.0.0 to 192.168.255.255 216

80
Figure 19.25 NAT

81
Figure 19.26 Address translation

82
Figure 19.27 Translation

83
Table 19.3 Five-column translation table
Private Private External External Transport
Address Port Address Port Protocol

172.18.3.1 1400 25.8.3.2 80 TCP

172.18.3.2 1401 25.8.3.2 80 TCP

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

84
Subnetting/Supernetting
and
Classless Addressing

85
CONTENTS
• SUBNETTING
• SUPERNETTING
• CLASSLESS ADDRSSING

86
5.1

SUBNETTING

87
IP addresses are designed with
two levels of hierarchy.

88
Figure 5-1
A network with two levels of
hierarchy (not subnetted)

89
Figure 5-2
A network with three levels of
hierarchy (subnetted)

90
Figure 5-3
Addresses in a network with
and without subnetting

91
Figure 5-4

Hierarchy concept in a telephone number

92
Figure 5-5
Default mask and subnet mask

93
Finding the Subnet Address
Given an IP address, we can find the
subnet address by applying the mask to the
address. We can do this in two ways:
straight or short-cut.

94
Straight Method
In the straight method, we use binary
notation for both the address and the
mask and then apply the AND operation
to find the subnet address.

95
Example 1

What is the subnetwork address if the


destination address is 200.45.34.56 and the
subnet mask is 255.255.240.0?

96
Solution

11001000 00101101 00100010 00111000


11111111 11111111 11110000 00000000
11001000 00101101 00100000 00000000

The subnetwork address is 200.45.32.0.

97
Short-Cut Method
** If the byte in the mask is 255, copy
the byte in the address.
** If the byte in the mask is 0, replace
the byte in the address with 0.
** If the byte in the mask is neither 255
nor 0, we write the mask and the address
in binary and apply the AND operation.
98
Example 2

What is the subnetwork address if the


destination address is 19.30.80.5 and the
mask is 255.255.192.0?
Solution

See Figure 5.6

99
Figure 5-6
Example 2

100
Figure 5-7

Comparison of a default mask and


a subnet mask

101
The number of subnets must be
a power of 2.

102
Example 3

A company is granted the site address


201.70.64.0 (class C). The company needs
six subnets. Design the subnets.
Solution

The number of 1s in the default


mask is 24 (class C).

103
Solution (Continued)

The company needs six subnets. This number


6 is not a power of 2. The next number that is
a power of 2 is 8 (23). We need 3 more 1s in
the subnet mask. The total number of 1s in
the subnet mask is 27 (24  3).
The total number of 0s is 5 (32  27). The
mask is

104
Solution (Continued)

11111111 11111111 11111111 11100000


or
255.255.255.224

The number of subnets is 8.


The number of addresses in each subnet
is 25 (5 is the number of 0s) or 32.
See Figure 5.8
105
Figure 5-8
Example 3

106
Example 4

A company is granted the site address


181.56.0.0 (class B). The company needs
1000 subnets. Design the subnets.
Solution

The number of 1s in the default mask is 16


(class B).

107
Solution (Continued)

The company needs 1000 subnets. This


number is not a power of 2. The next number
that is a power of 2 is 1024 (210). We need 10
more 1s in the subnet mask.
The total number of 1s in the subnet mask is
26 (16  10).
The total number of 0s is 6 (32  26).

108
Solution (Continued)

The mask is
11111111 11111111 11111111 11000000
or
255.255.255.192.
The number of subnets is 1024.
The number of addresses in each subnet is 26
(6 is the number of 0s) or 64.
See Figure 5.9
109
Figure 5-9
Example 4

110
Figure 5-10
Variable-length subnetting

111
5.2

SUPERNETTING

112
Figure 5-11
A supernetwork

113
Rules:
** The number of blocks must be a power of 2 (1,
2, 4, 8, 16, . . .).
** The blocks must be contiguous in the address
space (no gaps between the blocks).
** The third byte of the first address in the
superblock must be evenly divisible by the number
of blocks. In other words, if the number of blocks is
N, the third byte must be divisible by N.

114
Example 5

A company needs 600 addresses. Which of


the following set of class C blocks can be
used to form a supernet for this company?
198.47.32.0 198.47.33.0 198.47.34.0
198.47.32.0 198.47.42.0 198.47.52.0 198.47.62.0
198.47.31.0 198.47.32.0 198.47.33.0 198.47.52.0
198.47.32.0 198.47.33.0 198.47.34.0 198.47.35.0

115
Solution

1: No, there are only three blocks.


2: No, the blocks are not contiguous.
3: No, 31 in the first block is not divisible by 4.
4: Yes, all three requirements are fulfilled.

116
In subnetting,
we need the first address of the
subnet and the subnet mask to
define the range of addresses.

117
In supernetting,
we need the first address of
the supernet
and the supernet mask to
define the range of addresses.

118
Figure 5-12
Comparison of subnet, default,
and supernet masks

119
Example 6
We need to make a supernetwork out of 16
class C blocks. What is the supernet mask?
Solution
We need 16 blocks. For 16 blocks we need to
change four 1s to 0s in the default mask. So the
mask is
11111111 11111111 11110000 00000000
or
255.255.240.0
120
Example 7

A supernet has a first address of 205.16.32.0 and a


supernet mask of 255.255.248.0. A router receives three
packets with the following destination addresses:
205.16.37.44
205.16.42.56
205.17.33.76
Which packet belongs to the supernet?

121
Solution

We apply the supernet mask to see if we can find


the beginning address.
205.16.37.44 AND 255.255.248.0205.16.32.0
205.16.42.56 AND 255.255.248.0 205.16.40.0
205.17.33.76 AND 255.255.248.0 205.17.32.0
Only the first address belongs to this supernet.

122
Example 8
A supernet has a first address of 205.16.32.0 and a
supernet mask of 255.255.248.0. How many blocks are in
this supernet and what is the range of addresses?

Solution

The supernet has 21 1s. The default mask has 24


1s. Since the difference is 3, there are 2 3 or 8
blocks in this supernet. The blocks are 205.16.32.0
to 205.16.39.0. The first address is 205.16.32.0.
The last address is 205.16.39.255.
123
5.3
CLASSLESS
ADDRESSING

124
Figure 5-13

Variable-length blocks

125
Number of Addresses in a Block
There is only one condition on the number
of addresses in a block; it must be a power
of 2 (2, 4, 8, . . .). A household may be
given a block of 2 addresses. A small
business may be given 16 addresses. A large
organization may be given 1024 addresses.

126
Beginning Address
The beginning address must be evenly divisible
by the number of addresses. For example, if a
block contains 4 addresses, the beginning
address must be divisible by 4. If the block has
less than 256 addresses, we need to check only
the rightmost byte. If it has less than 65,536
addresses, we need to check only the two
rightmost bytes, and so on.

127
Example 9
Which of the following can be the beginning address of a
block that contains 16 addresses?
205.16.37.32
190.16.42.44
17.17.33.80
123.45.24.52
Solution

The address 205.16.37.32 is eligible because 32 is


divisible by 16. The address 17.17.33.80 is eligible
because 80 is divisible by 16.
128
Example 10
Which of the following can be the beginning address of a
block that contains 1024 addresses?
205.16.37.32
190.16.42.0
17.17.32.0
123.45.24.52

Solution
To be divisible by 1024, the rightmost byte of an
address should be 0 and the second rightmost byte
must be divisible by 4. Only the address 17.17.32.0
meets this condition. 129
Figure 5-14
Slash notation

130
Slash notation is also called
CIDR
notation.

131
Example 11
A small organization is given a block with the beginning
address and the prefix length 205.16.37.24/29 (in slash
notation). What is the range of the block?

Solution
The beginning address is 205.16.37.24. To find the
last address we keep the first 29 bits and change
the last 3 bits to 1s.
Beginning:11001111 00010000 00100101 00011000
Ending : 11001111 00010000 00100101 00011111
There are only 8 addresses in this block.
132
Example 12
We can find the range of addresses in Example 11 by
another method. We can argue that the length of the
suffix is 32  29 or 3. So there are 23  8 addresses in this
block. If the first address is 205.16.37.24, the last address
is 205.16.37.31 (24  7  31).

133
A block in classes A, B, and C
can easily be represented in slash
notation as
A.B.C.D/ n
where n is
either 8 (class A), 16 (class B), or
24 (class C).

134
Example 13
What is the network address if one of the addresses is
167.199.170.82/27?

Solution
The prefix length is 27, which means that we must
keep the first 27 bits as is and change the
remaining bits (5) to 0s. The 5 bits affect only the
last byte. The last byte is 01010010. Changing the
last 5 bits to 0s, we get 01000000 or 64. The
network address is 167.199.170.64/27.
135
Example 14
An organization is granted the block 130.34.12.64/26.
The organization needs to have four subnets. What are the
subnet addresses and the range of addresses for each
subnet?

Solution

The suffix length is 6. This means the total number


of addresses in the block is 64 (2 6). If we create
four subnets, each subnet will have 16 addresses.

136
Solution (Continued)
Let us first find the subnet prefix (subnet mask).
We need four subnets, which means we need to
add two more 1s to the site prefix. The subnet
prefix is then /28.
Subnet 1: 130.34.12.64/28 to 130.34.12.79/28.
Subnet 2 : 130.34.12.80/28 to 130.34.12.95/28.
Subnet 3: 130.34.12.96/28 to 130.34.12.111/28.
Subnet 4: 130.34.12.112/28 to 130.34.12.127/28.
See Figure 5.15 137
Figure 5-15
Example 14

138
Example 15
An ISP is granted a block of addresses starting with
190.100.0.0/16. The ISP needs to distribute these
addresses to three groups of customers as follows:

1. The first group has 64 customers; each needs 256 addresses.


2. The second group has 128 customers; each needs 128 addresses.

3. The third group has 128 customers; each needs 64 addresses .

Design the subblocks and give the slash notation for each
subblock. Find out how many addresses are still available
after these allocations.

139
Solution
Group 1
For this group, each customer needs 256 addresses.
This means the suffix length is 8 (2 8  256). The
prefix length is then 32  8  24.
01: 190.100.0.0/24190.100.0.255/24
02: 190.100.1.0/24 190.100.1.255/24
…………………………………..
64: 190.100.63.0/24190.100.63.255/24
Total  64  256  16,384 140
Solution (Continued)
Group 2
For this group, each customer needs 128 addresses.
This means the suffix length is 7 (2 7  128). The
prefix length is then 32  7  25. The addresses
are:
001: 190.100.64.0/25 190.100.64.127/25
002: 190.100.64.128/25 190.100.64.255/25
003: 190.100.127.128/25 190.100.127.255/25
Total  128  128  16,384
141
Solution (Continued)
Group 3
For this group, each customer needs 64 addresses.
This means the suffix length is 6 (2 6  64). The
prefix length is then 32  6  26.
001:190.100.128.0/26 190.100.128.63/26
002:190.100.128.64/26 190.100.128.127/26
…………………………
128:190.100.159.192/26 190.100.159.255/26
Total  128  64  8,192 142
Solution (Continued)

Number of granted addresses: 65,536


Number of allocated addresses: 40,960
Number of available addresses: 24,576

143
IP Fragmentation

144
Computer Networks
Network Layer
Part - I

145
Chapter Overview
The Network Layer is concerned about
getting packets from source to
destination, no matter how many hops it
may take. It’s all about routing.

1 Network Layer Design Issues


What do we need to think about in this layer?
2 Routing Algorithms
Strategies for getting from source to
destination.
3 Congestion Control Algorithms
How do we keep from bottlenecking from too
many packets?

4 Internetworking
Working with multiple networks and protocols
in order to deliver packets.

5 The Network Layer in the Internet


Gluing together a collection of subnets.

146
Network Layer Overview
Design Issues

1 Network Layer Design Issues Who does what with regard to:
2 Routing Algorithms
3 Congestion Control Algorithms 1. Routing issues.
2. Congestion
4 Internetworking 3. Internetworking
5 The Network Layer in the
Internet We also throw in a few definitions.

And examine differing views of the world.

147
Network Layer Overview
Design Issues
WHO-DOES-WHAT-ISSUES:

 The network layer is responsible for routing packets from the source to destination.
 The routing algorithm is the piece of software that decides where a packet goes next
(e.g., which output line, or which node on a broadcast channel).
 For connectionless networks, the routing decision is made for each datagram. For
connection-oriented networks, the decision is made once, at circuit setup time.

148
Network Layer Overview
Design Issues
ROUTING ISSUES:

The routing algorithm must deal with the following issues:

1. Correctness and simplicity: networks are never taken down; individual


parts (e.g., links, routers) may fail, but the whole network should not.

2. Stability: if a link or router fails, how much time elapses before the
remaining routers recognize the topology change? (Some never do..)

3. Fairness and optimality: an inherently intractable problem.


a) Definition of optimality usually doesn't consider fairness.
b) Do we want to maximize channel usage? Minimize average delay?

When we look at routing in detail, we'll consider both adaptive-those that take
current traffic and topology into consideration-and nonadaptive algorithms.

149
Network Layer Overview
Design Issues
CONGESTION (NOT CONTENTION):

The network layer also must deal with congestion:

When more packets enter an area than can be processed, delays increase and performance
decreases. If the situation continues, the subnet may have no alternative but to discard
packets.

If the delay increases, the sender may (incorrectly) retransmit, making a bad situation even
worse.

Overall, performance degrades because the network is using (wasting) resources processing
packets that eventually get discarded.

INTERNETWORKING:

When we consider internetworking, connecting different network technologies together, there


are the same problems, only worse:

1. Packets may travel through many different networks

2. Each network may have a different frame format

3. Some networks may be connectionless, other connection oriented.


150
Network Layer Services Provided to the
Design Issues Transport Layer
The network layer should shield the transport layer from having to know details
of the underlying subnet

The Transport layer should do exactly the same thing, whether sending across
LAN or across the country on the Internet.

Should the host or the subnet be responsible for the delivery of all packets in
order ?

151
Network Layer Services Provided to the
Design Issues Transport Layer
Review of Definitions:
Connection-Oriented Service: The subnet, with the help of the network layer,
should provide the following operations:

1. The sending side of the pair should open a connection with its peer.
2. This connection has properties negotiated by the pair.
3. Communication is bi-directional and packets are delivered in order.
4. Flow control is accomplished in the subnet.

Connectionless Service: The subnet has no state information. It does only


send_packet and receive_packet. Error control and flow control are done by
the host (network or higher layers.)

Virtual Circuit: Avoids choosing a new route for each packet. A virtual circuit is a
state -- it remembers how to send a packet from source to destination. This
state is held in the subnet, in the source DLL or in each of the DLL layers
along the route.

Datagrams: Each packet sent is routed independently of its predecessors.


Decisions are made "on the fly", so more computing required, however this
method is more robust.
152
Switching

Circuit Switching and Packet Switching

153
Overview
 Networks are used to interconnect many devices.
 We have checked with Local Area Networks.
 Now, wide area networks
 Since the invention of the telephone, circuit switching
has been the dominant technology for voice
communications.
 Since 1970, packet switching has evolved
substantially for digital data communications. It was
designed to provide a more efficient facility than circuit
switching for bursty data traffic.

Two types of packet switching:
 Datagram (such as today’s Internet)
 Virtual circuit (such as Frame Relay, ATM)

154
Switched Communications Networks

 Long distance transmission between stations (called “end


devices”) is typically done over a network of switching nodes.\

 Switching nodes do not concern with content of data. Their


purpose is to provide a switching facility that will move the
data from node to node until they reach their destination (the
end device).

 A collection of nodes and connections forms a communications


network.

 In a switched communications network, data entering the


network from a station are routed to the destination by being
switched from node to node.

155
Simple Switching Network

156
Switching Nodes
 Nodes may connect to other nodes,
or to some stations.
 Network is usually partially
connected
 However, some redundant connections
are desirable for reliability
 Two different switching technologies
 Circuit switching
 Packet switching
157
Circuit Switching
 Circuit switching:

There is a dedicated communication path between two
stations (end-to-end)

The path is a connected sequence of links between
network nodes. On each physical link, a logical channel is
dedicated to the connection.
 Communication via circuit switching has three
phases:

Circuit establishment (link by link)

Routing & resource allocation (FDM or TDM)

Data transfer

Circuit disconnect

Deallocate the dedicated resources
 The switches must know how to find the route to
the destination and how to allocate bandwidth
(channel) to establish a connection.
158
Circuit Switching Properties
 Inefficiency

Channel capacity is dedicated for the whole duration of a
connection

If no data, capacity is wasted
 Delay

Long initial delay: circuit establishment takes time

Low data delay: after the circuit establishment,
information is transmitted at a fixed data rate with no
delay other than the propagation delay. The delay at each
node is negligible.
 Developed for voice traffic (public telephone
network) but can also applied to data traffic.

For voice connections, the resulting circuit will enjoy a
high percentage of utilization because most of the time
one party or the other is talking.

But how about data connections?

159
Public Circuit Switched
Network

Subscribers: the devices that attach to the network.


Subscriber loop: the link between the subscriber and the network.
Exchanges: the switching centers in the network.
End office : the switching center that directly supports subscribers.
Trunks : the branches between exchanges. They carry multiple voice-frequency
circuits using either FDM or synchronous TDM.
160
Packet Switching Principles
 Problem of circuit switching
 designed for voice service
 Resources dedicated to a particular call
 For data transmission, much of the time
the connection is idle (say, web browsing)
 Data rate is fixed

Both ends must operate at the same rate during the entire
period of connection
 Packet switching is designed to address
these problems.
161
Basic Operation
 Data are transmitted in short packets
 Typically at the order of 1000 bytes
 Longer messages are split into series of packets
 Each packet contains a portion of user data plus some
control info
 Control info contains at least
 Routing (addressing) info, so as to be routed to the
intended destination
 Recall the content of an IP header!
 store and forward
 On each switching node, packets are received, stored
briefly (buffered) and passed on to the next node.

162
Use of Packets

163
Advantages of Packet Switching
 Line efficiency

Single node-to-node link can be dynamically shared by many packets over time

Packets are queued up and transmitted as fast as possible
 Data rate conversion

Each station connects to the local node at its own speed
 In circuit-switching, a connection could be blocked if there lacks free resources. On a
packet-switching network, even with heavy traffic, packets are still accepted, by
delivery delay increases.
 Priorities can be used

On each node, packets with higher priority can be forwarded first. They will
experience less delay than lower-priority packets.

164
Packet Switching Technique
 A station breaks long message into packets

 Packets are sent out to the network sequentially, one at a


time

 How will the network handle this stream of packets as it


attempts to route them through the network and deliver
them to the intended destination?
 Two approaches


Datagram approach

Virtual circuit approach

165
Datagram
 Each packet is treated independently, with no reference to
packets that have gone before.
 Each node chooses the next node on a packet’s path.

 Packets can take any possible route.


 Packets may arrive at the receiver out of order.
 Packets may go missing.
 It is up to the receiver to re-order packets and recover from
missing packets.
 Example: Internet

166
Datagram

167
Virtual Circuit
 In virtual circuit, a preplanned route is established before
any packets are sent, then all packets follow the same
route.
 Each packet contains a virtual circuit identifier instead of
destination address, and each node on the preestablished
route knows where to forward such packets.
 The node need not make a routing decision for each

packet.
 Example: X.25, Frame Relay, ATM

168
Virtual
Circuit
A route between stations is set up
prior to data transfer.
All the data packets then follow the
same route.
But there is no dedicated resources
reserved for the virtual circuit!
Packets need to be stored-and-
forwarded.

169
Virtual Circuits v Datagram
 Virtual circuits
 Network can provide sequencing (packets arrive at the same
order) and error control (retransmission between two nodes).
 Packets are forwarded more quickly

Based on the virtual circuit identifier

No routing decisions to make
 Less reliable

If a node fails, all virtual circuits that pass through that node fail.
 Datagram
 No call setup phase

Good for bursty data, such as Web applications
 More flexible

If a node fails, packets may find an alternate route

Routing can be used to avoid congested parts of the network

170
171
Comparison of
communication
switching
techniques

172
Network Layer TWO VIEWS OF THE WORLD
Design Issues
COMPARISON OF VIRTUAL CIRCUITS
AND DATAGRAMS:

Note that:
 Connection Oriented Service
generally use Virtual Circuits.

 Connectionless Service uses


Datagrams

 But can mix and match as


desired.

See the Figure for additional


properties.

173
Routing Algorithms Overview

5.1 Network Layer Design Issues What matters when doing routing?
5.2 Routing Algorithms
5.3 Congestion Control What are various techniques to do that
Algorithms routing?
5.4 Internetworking
5.5 The Network Layer in the
Internet Which is best?

174
Routing Algorithms Overview

Routing is concerned with the question: Which line should router J use when
forwarding a packet to router K ?

There are two types of algorithms:

Adaptive algorithms - use such dynamic information as current topology, load, delay,
etc. to select routes.

Nonadaptive algorithms - routes never change once initial routes have been
selected. Also called static routing.

Either of these algorithms can be applied to either datagrams or virtual circuits.

Obviously, adaptive algorithms are more interesting, as nonadaptive algorithms


don't even make an attempt to handle failed links.

175
Routing Algorithms Overview

Adaptive algorithms can be further divided in the following types:

1. Isolated: each router makes its routing decisions using only the local information it
has on hand. Specifically, routers do not even exchange information with their
neighbors.

2. Centralized: a centralized node makes all routing decisions. Specifically, the


centralized node has access to global information.

3. Distributed: algorithms that use a combination of local and global information.

Goals for any of these algorithms include:

1. Correctness, simplicity and minimality.


2. Robustness. During years of continuous operation, being able to handle all kinds of
hardware and software failures. Being able to handle changes in topology and
traffic patterns.
3. Stability. Of the algorithms. Can you get a mathematical and realistic answer.
4. Fairness and optimality. Often contradictory.

176
Routing Algorithms Optimality Principle

THE OPTIMALITY PRINCIPLE:

This simply states that if router J is on the optimal path from router I to router K,
then the optimal path from J to K also falls along this same path.

This means we can form a sink tree as in the Figure.

177
Routing Algorithms Shortest Path

Often used because simple and easy to understand.

What if we `know' the complete topology of the network? Can look at computing the optimal path.

What if we have the following network and we want to route a packet from node A to node G. What
is the shortest path (do not initially show distance).

Use Dijkstra's algorithm (or variation). Basic idea is:

 Choose the source, and put nodes connected to source in list to consider.

 From the list to consider choose the nearest node.

Non-Adaptive
Algorithm

178
Routing Algorithms Shortest Path

Let's do example in Figure 5.6.

Algorithm results:

nodes list to consider


----- ----------------
(A, 0, -)
(B, 2, A)
(C, 9, B)
(D, 10,H)
(E, 4, B)
(F, 6, E)
(G, 5, E)
(H, 8, F)

Guaranteed to get the shortest path? How to prove? If an alternate shorter path to a node then
we would have already tried the path.
Non-Adaptive
Algorithm
179
Routing Algorithms Flooding

Flooding is a form of isolated routing. Does not select a specific route. When a router
receives a packet, it sends a copy of the packet out on each line (except the one on
which it arrived):

To prevent packets from looping forever, each router decrements a hop count contained in
the packet header. Whenever the hop count decrements to zero, the router discards
the packet.

To reduce looping even further:


Non-Adaptive
Add a sequence number to each packet's header.
1.
Algorithm
2. Each router maintains a private sequence number. When it sends a new packet, it
copies the sequence number into the packet, and increments its private sequence
number.

3. For each source router S, a router:

a) Keeps track of the highest sequence number seen from S.


b) Whenever it receives a packet from S containing a sequence number lower than the one
stored in its table, it discards the packet.
c) Otherwise, it updates the entry for S and forwards the packet on

180
Routing Algorithms Flooding

Flooding has several important uses:

1. In military applications, the network must remain robust in the face of


(extreme) hostility

2. Sending routing updates, because updates can't rely on the correctness of a


router's routing table.

3. Theoretical-chooses all possible paths, so it chooses the shortest one.

In selective flooding, a router sends packets out only on those lines in the general
direction of the destination. That is, don't send packets out on lines that
clearly lead in the wrong direction.

Non-Adaptive
Algorithm

181
Routing Algorithms Flow Based Routing

Takes into account both the topology AND the load (BUT still static.)

Assumes:
1. Traffic flows remain constant over time.
2. We can estimate the flow between all pairs of routers.
3. We know the topology of the network and the capacity of each link.

Given the line capacity and the flow, we can determine the delay. From that, we can
calculate the delay for the whole subnet, and between any two nodes.

Use as an example figures Figure 5.8, 5.9.

Non-Adaptive

182
Algorithm
Routing Algorithms Adaptive Routing

In general, the methods are:

1. Centralized - uses a routing control center (RCC). Creates, modifies, and


distributes routing tables to other routers. Gathers information from the routers.

a) Good: adaptive routing, relieve burden on the routers of computing tables.

b) Problems: Does not adapt quickly.

c) Quicker the adaptation, the more overhead it causes.

d) Synchronization of updates (some routers change, but not others, so could


have situation where two routers send at each other).

e) If RCC crashes the network becomes stale.

f) Lines near the RCC are overloaded.

Adaptive
Algorithm
183
Routing Algorithms Adaptive Routing

2. Decentralized - Base decisions on local traffic and conditions.

Hot potato-choose output line with the shortest queue

Backward learning - each packet contains source address and number of hops so far.
Use this information to learn shortest path to each source. Will learn shortest
path to all routers. Only deal with good news, not bad. `Good' may no longer
be good due to down router or congestion.

Must periodically forget and start over (with sub optimal performance after a purge).

Adaptive
Algorithm
184
Routing Algorithms Distance Vector Routing

Distributed routing algorithm. Routers work together.

1. Each router maintains a table (vector) giving the best known distance to
a destination and the line to use for sending there. Tables are updated
by exchanging information with neighbors.

2. Each router knows the distance (cost) of reaching its neighbors (e.g.
send echo requests).

3. Routers periodically exchange routing tables with each of their


neighbors.

4. Upon receipt of an update, for each destination in its table, a router:

 Compares the metric in its local table with the metric in the
neighbor's table plus the cost of reaching that neighbor.

 if the path via the neighbor has a lower cost, the router updates its
local table to forward packets to the neighbor.
Adaptive
Algorithm
185
 Distance Vector Routing
 This is an adaptive algorithm. In distance vector routing, each
router periodically shares its knowledge about the entire
network with its neighbors. The three steps in this algorithm
are

 1. Knowledge about the whole network: Each router shares its


knowledge about the entire network. It sends all of its
collected knowledge about the network to its neighbors. How
much it knows doesn t matter, but whatever he known, shares
it with all its neighbors.

 2. Routing only to neighbors: Each router periodically shares


its knowledge about the network only to those routers to
which it has direct links.

 3. Information sharing at regular intervals: Each router does


the sharing after regular intervals of time.
186
Routing Algorithms Distance Vector Routing
Use Figure 5.10 as an example.

This algorithm was used in the original ARPANET. Unfortunately, it suffers from the problem:
good news travels quickly, bad news travels slowly (count-to-infinity problem).

The fundamental problem with the old Arpanet algorithm is that it continues to use `old'
information that is invalid, even after newer information becomes available.

Adaptive
Algorithm

187
Distance Vector Routing

(a) A subnet. (b) Input from A, I, H, K, and the new


routing table for J.
188
Distance Vector Routing (2)

The count-to-infinity problem.


189
Link State Routing
Each router must do the following:
1. Discover its neighbors, learn their network
address.
2. Measure the delay or cost to each of its
neighbors.
3. Construct a packet telling all it has just
learned.
4. Send this packet to all other routers.

5. Compute the shortest path to every other


router.
190
 Link State Routing
 This is another adaptive algorithm. In link state routing, each router
shares its knowledge of its neighborhood with every other router in
the network. The three steps in this algorithm are

 1. Knowledge about the neighborhood: Instead of sending its entire


routing table, a router sends information about its neighborhood only.

 2. To all routers: Each router sends information about its


neighborhood, to every router in the network. It does so by the
process called flooding.

 3. Information sharing only when there is a change: Each router sends


information about the neighbors where there is a change in its routing
table.

191
Learning about the
Neighbors

(a) Nine routers and a LAN. (b) A graph


model of (a).
192
Measuring Line Cost
A subnet in which the East and West
parts are connected by two lines.

193
Building Link State Packets

(a) A subnet. (b) The link state packets


for this subnet. 194
Distributing the Link State
Packets
The packet buffer for router B in the
previous slide (Fig. 5-13).

195
Hierarchical Routing

Hierarchical routing.

196
Broadcast Routing

Reverse path forwarding. (a) A subnet. (b) a Sink tree. (c) The
tree built by reverse path forwarding.
197
Multicast Routing

(a) A network. (b) A spanning tree for the leftmost router.


(c) A multicast tree for group 1. (d) A multicast tree for group 2.
198
Count to Infinity Problem

199
The Count-to-Infinity
Problem
AA
1
BB
1
CC

A's Routing Table B's Routing Table

to via cost to via cost


(next hop) (next hop)
C B 2 C C 1
now link B-C goes down
C B 2 C - oo

C 2 C oo

C - oo C A 3

C oo C 3

C B 4 C - oo

C 4 C oo
200
Count-to-Infinity
 The reason for the count-to-infinity problem is
that each node only has a “next-hop-view”
 For example, in the first step, A did not realize
that its route (with cost 2) to C went through node
B

 How can the Count-to-Infinity problem be solved?

201
Count-to-Infinity
 The reason for the count-to-infinity problem is that each node only
has a “next-hop-view”
 For example, in the first step, A did not realize that its route (with
cost 2) to C went through node B

 How can the Count-to-Infinity problem be solved?


 Solution 1: Always advertise the entire path in an
update message (Path vectors)
 If routing tables are large, the routing messages require
substantial bandwidth
 BGP uses this solution

202
Count-to-Infinity
 The reason for the count-to-infinity problem is that each node only
has a “next-hop-view”
 For example, in the first step, A did not realize that its route (with
cost 2) to C went through node B

 How can the Count-to-Infinity problem be solved?


 Solution 2: Never advertise the cost to a neighbor
if this neighbor is the next hop on the current
path (Split Horizon)
 Example: A would not send the first routing update to B, since
B is the next hop on A’s current route to C
 Split Horizon does not solve count-to-infinity in all cases!

203
Routing Algorithms Link State Routing

The `old' Arpanet routing algorithm was replaced in 1979. Problems with
old algorithm included:

1. High-priority routing update packets were large, adversely affecting


traffic.

2. Network was too slow in adapting to congestion, too fast to react to


minor changes.

3. Average queue length was used to estimate delay.

 This works only if all lines have the same capacity and
propagation delay.d
 Doesn't take into account that packets have varying sizes.

Adaptive
Algorithm
204
Routing Algorithms Link State Routing
In the new algorithm:

1. Each router maintains a database describing the topology and link delays between each
router. That is, each router keeps track of the full graph of links and nodes.

2. Each router periodically discovers it neighbors


 Sends `hello' message on booting.
 Measures the delays across its links (echo requests-should load be taken into
account?),
 Forwards that information to all other routers (link state packets).
3. Avoids the count to infinity problem since all routers get each other router’s information.

4. Updates are propagated at high priority using flooding.


 Updates contain sequence numbers, and a router forwards `new' copies of the packet.
 Why use flooding? Because that way routing updates propagate even when routing
tables aren't quite correct.
 ACKs are sent to neighbors.

5. Each router uses an SPF algorithm to calculate shortest paths based on the current values
in its database.

6. Because each router makes its calculation using the same information, better routing
decisions are made.
Adaptive
Algorithm
205
Routing Algorithms Link State Routing

Limitations of new algorithm:

1. Doesn't take link capacity into consideration.


 A 1200 baud link with 100 ms delay is favored over an Ethernet
having an 200 ms delay.

2. Doesn't scale well, as each router receives updates from all other
routers.
 Today, we need to think of scaling to a system with a million
nodes and many more links!
 After all, 5 billion people will (eventually) be on the network!

Adaptive
Algorithm
206
Routing Algorithms Hierarchical Routing

One of the fundamental issues regarding routing is scaling.


a) As a network becomes larger, the amount of information that must be
propagated increases, and the routing calculation becomes increasingly
expensive.
b) Obviously, there are limits to how big a network can be.

Hierarchical routing is an approach that hides information from far-away nodes,


reducing the amount of information a given router needs to perform routing:

Divide the network into regions, with a router only knowing the details of how to
route to other routers in its region.
a) In particular, a router does not know about the internal topology of other
regions.
b) Gateway is a router that knows about other regions.

A node in each region is designated as an entry point, and the entry point knows
how to reach the entry points in all the other regions. Adaptive
When traffic flows from A to B, it actually follows the path Algorithm
A - AENTRY - BENTRY - B,

where AENTRY and BENTRY are the entry points to the respective regions.

207
Routing Algorithms Hierarchical Routing
Advantage: Scaling. Each router needs less information (table space)
to perform routing.

Disadvantage: Sub optimal routes. The average path length increases


because there may be a shorter path that bypasses the entry
points, but we don't use it.

See the Figure.

Hierarchical routing can be extended to multi-


levels.

Example: telephone system:

• Area code identifies a region.

• Area code plus the first three digits


identify the central office within a
specific region.

Adaptive
Algorithm
208
Routing Algorithms Broadcast Routing

Sending a packet to all destinations simultaneously is Adaptive


known as broadcasting.
There are several ways to implement broadcasting: Algorithm
For Broadcast Networks:
1. The implementation is trivial: designate a special
address as the `all hosts address'.
For Non-Broadcast Networks:
1. Send a unicast packet to each destination. However, this approach makes poor use of resources.

2. Flood packets to all nodes. Flooding generates many packets and consumes too much bandwidth.

3. Use multi-destination routing:


a) Each packet contains a list (or bitmap) of all destinations, and when a router forwards a packet
across two or more lines, it splits the packet and divides the destination addresses
accordingly.
b) This approach is similar to sending uni-cast packets, except that we don't send individual
copies of each messages.
c) However, the copy operations slow down the ability of a router to process many packets.

209
Routing Algorithms Broadcast Routing

4. Use a spanning tree. If the network can be reduced to a tree


a) (There’s only one path between any two pairs of routers), copy a
packet to each line of spanning tree except the one on which it
arrived.
b) Works only if each router understands the same spanning tree.

5. Reverse Path Forwarding (RPF):


a) Use a sink tree (assume sink/source trees are the same).
b) If a packet, originating from X, arrives on a line of the sink tree
leading to X, the packet is traveling along the shortest path, so it
“must” be the first copy we've seen.
c) Copy the packet to all outgoing lines of the sink tree.

If the packet arrives on another line, assume that the packet is a copy -
it didn't arrive on the shortest path - and discard it.

RPF is easy to implement and makes efficient use of bandwidth.

Adaptive
Algorithm
210
Congestion Control Overview

CONGESTION MECHANISMS:

When one part of the subnet (e.g. one or more routers in an area) becomes
overloaded, congestion results. Congestion can be dealt with by:

1. Congestion control - when the problem occurs, limit senders or reroute. This
is a reactive mode. (No, this is not an antihistamine!!)

2. Congestion prevention - make resources available and enforce good behavior


so that the congestion won't occur.

Note thse definitions:

Congestion control means making sure the subnet can handle the offered traffic.

Flow control means preventing one sender from overflowing one receiver.
Congestion deals with wires and routers, while flow deals with hosts.

211
Congestion Control Overview

CONGESTION CONTROL POLICIES:

The approach followed will include:

1. Monitor the system to detect when and where


congestion occurs.

2. Pass this information to where something can be


done about it.

3. Adjust the system. This can be done by:


The subnet must prevent additional packets
from entering the congested region until those
already present can be processed.


The congested routers can discard queued
packets to make room for those that are
arriving.

See Figure 5.23 for mechanisms that affect congestion.

212
Congestion Control Congestion Prevention Policies

Pre-allocation schemes aim to prevent congestion from happening in the first place.

 For example, we can require that resources be pre-allocated before any packets can
be sent, guaranteeing that resources will be available to process each packet.

In virtual circuit networks, for example, the sender opens a connection before sending
data.

 The circuit setup operation selects a path through the subnet, and each router on
the path dedicates buffer space and bandwidth to the new circuit.

What happens when a user attempts to open a virtual circuit and the subnet is
congested?

 The subnet can refuse to open the connection, forcing the user to wait until
sufficient resources become available.

Note: The ability of the subnet to reject requests to open connections is an important
property of connection oriented networks.

213
Congestion Control Traffic Shaping
Control the rate at which packets are sent (not just how many). Widely used in ATM
networks.

At set up, the sender and carrier negotiate a traffic pattern (shape).

Leaky Bucket Algorithm used to control rate in a datagram network. Fig. 5.24.
 A single-server queue with constant service time.
 If bucket (buffer) overflows then packets are discarded.

Enforces a constant output rate regardless of burstiness of input. Does nothing when
input is idle.

The Token Bucket Algorithm causes a token to be generated periodically, which during
idle periods can be saved up.

Related to traffic shaping is flow specification, where a particular quality of service is


agreed upon between sender, receiver and carrier.

214
Congestion Control Flow Control

Flow control is one way of preventing a fast sender from overwhelming a slow receiver. Flow
control can be helpful at reducing congestion, but it can't really solve the congestion
problem. For example, suppose we connect a fast sender and fast receiver (e.g., two
Crays) using a 9.6 kbps line:

 If the two machines use a sliding window protocol, and the window is large, the link will
become congested in a hurry.

 If the window size is small (e.g., 2 packets), the link won't become congested. Note how
the window size limits the total number of packets that can be in transmission at one
time.

Flow control can take place at many levels:

 User process to user process (end-to-end). Later, we'll see how TCP uses flow control at
the end-to-end level.

 Host to host. For example, if multiple application connections share a single virtual circuit
between two hosts.

 router to router. For example, in virtual circuits.

215
Congestion Control Choke Packets

Routers can do the following:


1. Monitor the level of congestion around them
2. When congestion is present, they can send choke packets to the sender
that say `slow down'.
3. How can a router measure congestion?
 A router might estimate the level of congestion by measuring the
percentage of buffers in use, line utilization, or average queue
lengths.

Advantage:
1. Dynamic. Host sends as much data as it wants, the network informs it
when it is sending too much.

216
Congestion Control Choke Packets

Disadvantages:

1. Difficult to tune.
a) By how much should a host slow down?
b) The answer depends on how much traffic the host is sending, how much
of the congestion it is responsible for, and the total capacity of the
congested region.
c) Such information is not readily available in practice.

2. After receiving a choke packet….


a) The sending host should ignore additional choke packets for a short
b) Packets currently in transmission may generate additional choke packets.
c) How long? Depends on such dynamic network conditions as delay.

Desirable:
More attention paid to reserving resources so that chances of congestion are
reduced and the quality of service is more reliable.

217
Congestion Control Load Shedding

Opposite Approach:
 We could preallocate no resources in advance, and take our chances
that resources will be available when we need them.
 When insufficient resources are present to process existing packets,
discard queued packets to make room for newly arriving ones.

Who retransmits the discarded packets?

 In datagram (connectionless) networks, the sending host (transport


layer) retransmits discarded packets (if appropriate).

 In virtual circuit networks, the previous-hop router retransmits the


packet when it fails to receive an acknowledgment.

218
Congestion Control Load Shedding

Failure to preallocate resources leads to two problems: potential deadlock


and unfairness.

Deadlock. Suppose that all of a router's buffers hold packets.

 Because the router has no free buffers, it cannot accept additional


frames.

 Unfortunately, it also ignores frames containing ACKs that would free up


some of those buffers!

 If two adjacent routers, A and B, are sending packets to each other, since
both are waiting for the other to accept a packet, neither can proceed.

 This condition is known as a deadlock.

Solution: Reserve at least one buffer for each input line and use it to hold
incoming packets. Note that we can extract the ACK field and still discard
the packet, if we don't have buffers to hold it.

219
Congestion Control Load Shedding

There’s an advantage to discarding packets when congested: Easy to implement.


Disadvantages center around fairness:

1. Wastes resources. The network may have expended considerable resources


processing a packet that is eventually discarded.

2. Non-deterministic. There is less guarantee than with virtual circuits that packets
will ever reach their destination.

3. Requires that sending hosts pay attention to congestion. If the network can't
prevent a host from sending data, a host can overload the network. In particular,
a `broken' host may cause the network to become overly congested.

4. In the extreme case, congestion collapse occurs.


 The network becomes so overloaded, that few packets reach their destination.
 Meanwhile, the sending hosts continue to generate more data (both
retransmissions and new packets).
 This condition occurred several times in 1987, and the Internet/Arpanet
became unusable for a period of hours to days.

220
RIP - OSPF
CST 415

221
Topics
 Definitions
 RIP
 OSPF

222
Definitions
BGP – Boundary Gateway Protocol
IGP – Interior Gateway Protocol
RIP – Routing Information Protocol
OSPF – Open Shortest Path First

RIP and OSPF are both IGPs

223
Definitions

In the above diagram:


BGP is used for inter-autonomous system communication.
IGP is used for intra-autonomous system communication.
IGP can be any number of different protocols (RIP, OSPF, etc.)

224
Definitions
 There are many IGP protocols.
 The specific protocol a specific

router depends on
 The router manufacturer

e.g. Cisco may have a proprietary
protocol that relies on a specific
hardware implementation.
 The generation of the router

IGPs continued to be refined from
router generation to generation.
225
RIP

RIP (Routing Information Protocol)


originated in a variant of UNIX
 BSD standard UNIX
 Original incarnation was called

routed
 RIP became widely used through

the distribution of 4BSD


 RIP was widely adopted as an IGP

well before a standard existed


226
RIP
 RIP is an application layer
protocol.
 Therefore RIP uses well defined

ports for communication.


 Port 520
 This is a UDP port (e.g. send it

and forget it) as opposed to BGP


using a TCP port (guaranteed
delivery)
227
RIP

RIP Operation
 Uses simple distance-vector

routing
 Partitions participants into

 Active: advertises routes to other


participants
 Silent: only listen to routes. Do

not advertise route tables


228
RIP
Distance Vector Routing
 Each node knows the direct distance

cost to each of it’s neighbor nodes.


 Every node sends it’s distance vector

table to it’s neighbor nodes.


 When a node receives a distance vector

update, it will update it’s own distance


vector table with new information of cost
and next hops for all nodes in network.
 Send new information along.

 Repeat until no new information is

added.
229
RIP

Distance Vector Routing -


Formalized
 X : Source Node
 Y : Destination Node

 Z : Intermediate Node between X

and Y
 Dx(Y,Z) : Distance at X from Y to Z

 c(X,Z) : Cost in Distance of the

direct hop from Y to Z


230
RIP – General Routing Idea
c(X,Z) = 3

X 3 Z 2 Y

Dx(Y,Z) = 2

Dx(Y,Z) = c(X,Z) + minw{Dz(Y,w)} The minw is taken over all the


distances given to Y in Z's route update (e.g. Z could have
multiple routes to Y).

When a packet needs to be sent from X to Y, X simply sends it to the route

is has computed as the shortest.


231
RIP – Table Format

Destination – The network address of the destination network.


Next hop – IP address of the next packet destination.
Distance – The distance in hops to the ultimate destination.
Timers – Different times for route aging.
Flags – Possible conditional flags associated with the route.
232
RIP
c(X,Z) = 1

Intermediary
X Z Network Y

What is the
Dz(Y,w) = (2,4,8,3) necessary topology
w-set of network routes of the Intermediary
Network?
Dx(Y,Z) = c(X,Z) + minw{Dz(Y,w)}
= 1 + min(2,4,8,3)
= 3

Note: Z will really never have a list of routes to Y through the


intermediary network. It will maintain “it’s” shortest route information.
Backward propagation of shortest route information will select the “min”.
233
RIP
 RIP uses “hop count” as the metric
to measure distance.

Fewer hops may not result in the
shortest latency.
 Active routers broadcast route
update every 30 seconds.
 A Route will only stay active for
180 seconds.

Stale routes (e.g. haven’t been
updated in 180 seconds) will be
removed from the routing table.

234
RIP
 RIP defines a maximum hop
count for a valid route to be 16.
 This helps avoid the propagation
of circular routes.

235
RIP

Slow convergence occurs


because route updates take a time
to propagate across the network.

236
RIP – Message Format

237
RIP – Message Format

Command Meaning
1 Request routing information
2 Response containing network-distance pairs from
senders routing tables.

Version – 1 or 2 (2 handles subnet and supernetting)


Family of Net – See BSD4 Network Family Mumbers
(AF_INET for IP or 2).

238
OSPF
Open Shortest Path First

OSPF uses a different algorithm to


perform routing decisions.

OSPF working group was organized


in 1988 because RIP had several
shortcomings when dealing with
interior routing in a large
heterogeneous network.
239
OSPF
 Based on Bolt, Beranek, and
Newman's (BBN's) SPF algorithm
developed in 1978 for the ARPANET.
 Unlike RIP, OSPF can operate within
a hierarchy.
 The largest entity within the hierarchy
is the autonomous system (AS).
 OSPF is an intra-AS (interior gateway)
routing protocol, capable of receiving
routes from and sending routes to
other ASs.
240
OSPF
• Autonomous Systems
are broken down into
Areas.

• Areas communicate
through Area Border
Routers.

• The backbone
network connects areas
together.

• A Area Border
Router maintains
topological information
about networks it is in
241 charge of bridging.
OSPF – Shortest Path

Find the shortest path starting a vertex “x”


and ending at vertex “y”.
2
2
R0 R1
Example: 1
Shortest path from R5 to
1
R3.
2
R2 R3 R4
7

3
R5

242
OSPF – Shortest Path

Shortest path from R5 to R3.


To do this, we will use the
“greedy method” developed
2
by Dijkstra. 2
R0 R1
1
Basically:
1. Start at the destination. 1
2. Choose the shortest path 2
back R2 R3 R4
3. traverse to that vertex. 7

4. Repeat until the source is


reached. 5

3
R5

243
OSPF – Shortest Path

Shortest path from R5 to R3.


Basically:
1. Start at the destination.
2
2. Choose the shortest path 2
R0 R1
back
1
3. traverse to that vertex.
4. Repeat until the source is 1
reached. 2
R2 R3 R4
7

R3
5

3
R5

244
OSPF – Shortest Path

Shortest path from R5 to R3.


Basically:
1. Start at the destination.
2
2. Choose the shortest path 2
R0 R1
back
1
3. traverse to that vertex.
4. Repeat until the source is 1
reached. 2
R2 R3 R4
7

R3, R0
5

3
R5

245
OSPF – Shortest Path

Shortest path from R5 to R3.


Basically:
1. Start at the destination.
2
2. Choose the shortest path 2
R0 R1
back
1
3. traverse to that vertex.
4. Repeat until the source is 1
reached. 2
R2 R3 R4
7

R3, R0, R1
5

3
R5

246
OSPF – Shortest Path

Shortest path from R5 to R3.


Basically:
1. Start at the destination.
2
2. Choose the shortest path 2
R0 R1
back
1
3. traverse to that vertex.
4. Repeat until the source is 1
reached. 2
R2 R3 R4
7

R3, R0, R1, R4,


5

3
R5

247
OSPF – Shortest Path

Shortest path from R5 to R3.


Basically:
1. Start at the destination.
2
2. Choose the shortest path 2
R0 R1
back
1
3. traverse to that vertex.
4. Repeat until the source is 1
reached. 2
R2 R3 R4
7

R3, R0, R1, R4, R5


5
=7
3
R5

248
OSPF – Shortest Path
 The algorithm described above
is a simplified version of
Dijkstras algorithm.
 The BBN algorithm is a further

refinement dealing with path


priority.
 BBN is based on a graph

structure and a tree structure.


249
OSPF – Shortest Path
 To effect this shortest path
calculation
 Each Area Border Router must maintain
information related to it’s managed
area topology.
 As routers adjust routes, the new
information is exchanged with neighbor
routers.
 When new information arrives, the
routers must re-calculate their shortest
path tables.
250
OSPF – Message Format
 OSPF messages have two parts

The message header

The Payload

Hello Message

Database Description Message

Link Status Request Message

Link Status Update Message

Link Status Acknowledge Message

251
OSPF – Message Format :
Header

 Version number—Identifies the OSPF version used.


 Type—Identifies the OSPF packet type as one of the following:

Hello—Establishes and maintains neighbor relationships. Value - 1

Database description—Describes the contents of the topological database. These
messages are exchanged when an adjacency is initialized. Value - 2

Link-state request—Requests pieces of the topological database from neighbor
routers. These messages are exchanged after a router discovers (by examining
database-description packets) that parts of its topological database are outdated.
Value - 3

Link-state update—Responds to a link-state request packet. These messages also
are used for the regular dispersal of LSAs. Several LSAs can be included within a
single link-state update packet. Value - 4

Link-state acknowledgment—Acknowledges link-state update packets. Value -
5

252
OSPF – Message Format :
Header

 Message length—Specifies the packet length, including the OSPF header, in


bytes.
 Source Router IP Address—Identifies the source of the packet.
 Area ID—Identifies the area to which the packet belongs. All OSPF packets are
associated with a single area.
 Checksum—Checks the entire packet contents for any damage suffered in
transit.
 Authentication type—Contains the authentication type. All OSPF protocol
exchanges are authenticated. The authentication type is configurable on per-
area basis.
 Authentication—Contains authentication information.
 Data—Contains encapsulated upper-layer information.
253
13.4
BGP:
Border Gateway
Protocol

254
Basic BGP Review

255
Border Gateway Protocol

 Routing Protocol used to exchange routing


information between networks
 exterior gateway protocol
 RFC1771
 work in progress to update
 draft-ietf-idr-bgp4-17.txt
 Currently Version 4
 Runs over TCP

256
BGP
 Path Vector Protocol
 Incremental Updates
 Many options for policy enforcement
 Classless Inter Domain Routing (CIDR)
 Widely used for Internet backbone
 Autonomous systems

257
Path Vector Protocol
 BGP is classified as a path vector
routing protocol (see RFC 1322)
 A path vector protocol defines a route as
a pairing between a destination and the
attributes of the path to that
destination.

12.6.126.0/24
12.6.126.0/24 207.126.96.43
207.126.96.43 1021
1021 006461
64617018
70186337
633711268
11268i i

AS Path
258
AS-Path
 Sequence of ASes a
route has traversed AS 200 AS 100
 Loop detection 170.10.0.0/16 180.10.0.0/16

 Apply policy 180.10.0.0/16 300 200 100


170.10.0.0/16 300 200
AS 300
AS 400
150.10.0.0/16

180.10.0.0/16 300 200 100


AS 500 170.10.0.0/16 300 200
150.10.0.0/16 300 400

259
AS-Path loop detection

AS 200 AS 100
170.10.0.0/16 180.10.0.0/16

140.10.0.0/16 500 300


170.10.0.0/16 500 300 200
AS 300
140.10.0.0/16
180.10.0.0/16 is not announced to
AS 500 AS100 as AS500 sees that it is
originated from AS100, and that
AS100 is the neighbouring AS –
180.10.0.0/16 300 200 100 loop detection in action
170.10.0.0/16 300 200
140.10.0.0/16 300

260
Autonomous System (AS)

AS 100

 Collection of networks with same routing policy


 Single routing protocol
 Usually under single ownership, trust and
administrative control

261
BGP Basics

Peering

A C

AS 100 AS 101
B D

E
BGP speakers are
called peers
AS 102

262
BGP General Operation
 Learns multiple paths via internal
and external BGP speakers
 Picks the best path and installs in
the forwarding table
 Policies applied by influencing the
best path selection

263
External BGP Peering (eBGP)

AS 100 AS 101
C

 Between BGP speakers in different AS


 Should be directly connected
 Do not run an IGP between eBGP peers
264
Internal BGP Peering (iBGP)
AS 100
D
A
B

E
 Topology independent
 Each iBGP speaker must peer with
every other iBGP speaker in the AS

265
Internal BGP (iBGP)
 BGP peer within the same AS
 Not required to be directly connected
 iBGP speakers need to be fully
meshed
 they originate connected networks
 they do not pass on prefixes learned
from other iBGP speakers

266
Figure 13-50

Path vector packets

267
Figure 13-51

Types of BGP messages

268
BGP supports classless
addressing and CIDR.

269
Figure 13-52

BGP packet header

270
Figure 13-53

Open message

271
Figure 13-54

Update
message

272
Figure 13-55

Keepalive message

273
Figure 13-56

Notification message

274
BGP uses the
services of TCP on port 179.

275
Dynamic Host Configuration
Protocol (DHCP)

276
Dynamic Assignment of IP
addresses
 Dynamic assignment of IP addresses
is desirable for several reasons:
 IP addresses are assigned on-demand
 Avoid manual IP configuration
 Support mobility of laptops

277
Solutions for dynamic assignment of IP
addresses
 Reverse Address Resolution Protocol
(RARP)
 Works similar to ARP
 Broadcast a request for the IP address
associated with a given MAC address
 RARP server responds with an IP address
 Only assigns IP address (not the default
router and subnetmask)
IP address ARP Ethernet MAC
address
(32 bit)
(48 bit)
RARP

278
BOOTP
 BOOTstrap Protocol (BOOTP)

From 1985

Host can configure its IP parameters at boot time.

3 services.
 IP address assignment.
 Detection of the IP address for a serving machine.
 The name of a file to be loaded and executed by the client
machine (boot file name)

 Not only assign IP address, but also default router, network


mask, etc.
 Sent as UDP messages (UDP Port 67 (server) and 68 (host))
 Use limited broadcast address (255.255.255.255):

These addresses are never forwarded

279
Dynamic Host Configuration
Protocol (DHCP)

280
DHCP
 Dynamic Host Configuration Protocol (DHCP)
 From 1993
 An extension of BOOTP, very similar to DHCP
 Same port numbers as BOOTP
 Extensions:

Supports temporary allocation (“leases”) of IP addresses

DHCP client can acquire all IP configuration parameters
needed to operate
 DHCP is the preferred mechanism for dynamic
assignment of IP addresses
 DHCP can interoperate with BOOTP clients.

281
BOOTP Interaction
(b)
(a) Argon
Argon 128.143.137.144
00:a0:24:71:e4:44 BOOTP Server 00:a0:24:71:e4:44 DHCP Server
BOOTP Response:
IP address: 128.143.137.144
BOOTP Request
00:a0:24:71:e4:44 Server IP address: 128.143.137.100
Sent to 255.255.255.255 Boot file name: filename

 BOOTP can be used for


Argon
128.143.137.144
(c) downloading memory
00:a0:24:71:e4:44 DHCP Server
image for diskless
TFTP workstations
“filename”
 Assignment of IP
addresses to hosts is
128.143.137.100
static
282
DHCP Interaction
(simplified)
Argon
00:a0:24:71:e4:44 DHCP Server

DHCP Request
00:a0:24:71:e4:44
Sent to 255.255.255.255

Argon
128.143.137.144
00:a0:24:71:e4:44 DHCP Server
DHCP Response:
IP address: 128.143.137.144
Default gateway: 128.143.137.1
Netmask: 255.255.0.0

283
BOOTP/DHCP Message
Format
OpCode Hardware Type
Hardware Address
Length
Hop Count
Unused (in BOOTP)
Number of Seconds
Flags (in DHCP)
Transaction ID

Client IP address

Your IP address

Server IP address

Gateway IP address

Client hardware address (16 bytes)

Server host name (64 bytes)

Boot file name (128 bytes)

Options

284 (There are >100 different options)


BOOTP/DHCP
 OpCode: 1 (Request), 2(Reply)
Note: DHCP message type is sent in an option
 Hardware Type: 1 (for Ethernet)
 Hardware address length: 6 (for Ethernet)
 Hop count: set to 0 by client
 Transaction ID: Integer (used to match reply to response)
 Seconds: number of seconds since the client started to
boot
 Client IP address, Your IP address, server IP address,
Gateway IP address, client hardware address, server
host name, boot file name:
client fills in the information that it has, leaves rest blank

285
DHCP Message Type
Value Message Type
 Message type is sent as
an option. 1 DHCPDISCOVER

2 DHCPOFFER

3 DHCPREQUEST

4 DHCPDECLINE

5 DHCPACK

6 DHCPNAK

7 DHCPRELEASE

8 DHCPINFORM

286
Other options (selection)
 Other DHCP information that is sent as an
option:

Subnet Mask, Name Server, Hostname,


Domain Name, Forward On/Off, Default IP
TTL, Broadcast Address, Static Route,
Ethernet Encapsulation, X Window Manager,
X Window Font, DHCP Msg Type, DHCP
Renewal Time, DHCP Rebinding, Time SMTP-
Server, SMTP-Server, Client FQDN, Printer
Name, …
287
DHCP Operation
DHCP Client
00:a0:24:71:e4:44 DHCP Server

DHCPDISCOVER
 DCHP DISCOVER Sent to 255.255.255.255

DHCP Server

DHCP Client
00:a0:24:71:e4:44 DHCPOFFER DHCP Server

DHCPOFFER
DCHP OFFER

DHCP Server

288
DHCP Operation
DHCP Client
00:a0:24:71:e4:44 DHCP Server
DHCPREQUEST

DCHP DISCOVER DHCPACK

At this time, the DHCP client DHCP Server


can start to use the IP address

DHCP Client
00:a0:24:71:e4:44 DHCP Server
DHCPREQUEST

Renewing a Lease DHCPACK

(sent when 50% of lease has


expired)
If DHCP server sends DHCP Server
DHCPNACK, then address
is released.
289
DHCP Operation
DHCP Client
00:a0:24:71:e4:44 DHCP Server
DHCPRELEASE

DCHP RELEASE

At this time, the DHCP client DHCP Server


has released the IP address

290
19.3 Routing

Routing Techniques

Static Versus Dynamic Routing

Routing Table for Classful Addressing

Routing Table for Classless Addressing

291
Figure 19.28 Next-hop routing

292
Figure 19.29 Network-specific routing

293
Figure 19.30 Host-specific routing

294
Figure 19.31 Default routing

295
Figure 19.32 Classful addressing routing table

296
Example 10
Using the table in Figure 19.32, the router receives a packet for
destination 192.16.7.1. For each row, the mask is applied to the
destination address until a match with the destination address is
found. In this example, the router sends the packet through
interface m0 (host specific).

297
Example 11
Using the table in Figure 19.32, the router receives a packet for
destination 193.14.5.22. For each row, the mask is applied to the
destination address until a match with the next-hop address is
found. In this example, the router sends the packet through
interface m2 (network specific).

298
Example 12
Using the table in Figure 19.32, the router receives a packet for
destination 200.34.12.34. For each row, the mask is applied to the
destination address, but no match is found. In this example, the
router sends the packet through the default interface m0.

299
Chapter 7

ARP
and
RARP
300
CONTENTS
• ARP
• ARP PACKAGE
• RARP

301
Figure 7-1

ARP and RARP

302
Figure 7-2

Position of ARP and RARP


in TCP/IP protocol suite

303
7.1

ARP

304
Figure 7-3
ARP operation

305
Figure 7-4

ARP packet

306
Figure 7-5

Encapsulation of ARP packet

307
Figure 7-6:a

Four cases using ARP

308
Figure 7-6:b

Four cases using ARP

309
Figure 7-6:c

Four cases using ARP

310
Figure 7-6:d

Four cases using ARP

311
An ARP request is broadcast;
an ARP reply is unicast.

312
7.3

RARP

313
Figure 7-10
RARP
operation

314
The RARP request packets are
broadcast;
the RARP reply packets are
unicast.

315
Figure 7-11

RARP packet

316
Figure 7-12

Encapsulation of RARP packet

317
Internet Control Message
Protocol (ICMP)

318
Overview
 The IP (Internet Protocol) relies on
several other protocols to perform
necessary control and routing
functions:

Control functions (ICMP)
Routing
RIP

Multicast signaling (IGMP)
OSPF BGP PIM


Setting up routing tables (RIP, OSPF, BGP,
PIM(Protocol-Independent Multicast), …)
ICMP IGMP Control

319
Overview
 The Internet Control Message Protocol (ICMP) is a
helper protocol that supports IP with facility for
 Error reporting
 Simple queries

 ICMP messages are encapsulated as IP


datagrams:

IP header ICMP message

IP payload

320
ICMP message format
bit # 0 7 8 15 16 23 24 31

type code checksum

additional information
or
0x00000000

4 byte header:
• Type (1 byte): type of ICMP message
• Code (1 byte): subtype of ICMP message
• Checksum (2 bytes): similar to IP header checksum. Checksum is calculated over entire
ICMP message
If there is no additional data, there are 4 bytes set to zero.
 each ICMP messages is at least 8 bytes long

321
ICMP Query message

ICMP Request

ICMP Reply

Host Host or router

ICMP query:
• Request sent by host to a router or host
• Reply sent back to querying host

322
Example of ICMP Queries
Type/Code: Description

8/0 Echo Request


0/0 Echo Reply

13/0 Timestamp Request


14/0 Timestamp Reply

The ping command


10/0 Router Solicitation
9/0 Router Advertisement

uses Echo Request/


Echo Reply

323
Example of a Query:
Echo Request and Reply

 Ping’s are handled directly by the


kernel
 Each Ping is translated into an ICMP
Echo RequestICMP ECH
O REQUES
T
 TheHost
Ping’ed
Host
or
or
host respondsHost with an
Host
or
or
ICMP Echo ReplyO REPLY
Router
Router router
router
M P ECH
IC

324
Example of a Query:
 ICMP Timestamp
A system (host or router) asks Sender
Sender
Timestamp
Request
another system for the current
time. Receiver
Receiver

 Time is measured in
Timestamp
milliseconds after midnight Reply
UTC (Universal Coordinated
Time) of the current day
 Sender sends a request,
receiver responds with reply
Type Code
Checksum
(= 17 or 18) (=0)
identifier sequence number

32-bit sender timestamp

32-bit receive timestamp

32-bit transmit timestamp

325
ICMP Error message

IP datagram IP datagram
is discarded
ICMP Error
Message

Host Host or router

• ICMP error messages report error conditions


• Typically sent when a datagram is discarded
• Error message is often passed from ICMP to the application program

326
ICMP Error message
ICMP Message

from IP datagram that triggered the error

IP header ICMP header IP header 8 bytes of payload

type code checksum

Unused (0x00000000)

• ICMP error messages include the complete IP header and the first 8 bytes of the
payload (typically: UDP, TCP)

327
Frequent ICMP Error
message
Type Code Description

3 0–15 Destination Notification that an IP datagram could not be


unreachable forwarded and was dropped. The code field
contains an explanation.
5 0–3 Redirect Informs about an alternative route for the
datagram and should result in a routing table
update. The code field explains the reason for
the route change.
11 0, 1 Time Sent when the TTL field has reached zero
exceeded (Code 0) or when there is a timeout for the
reassembly of segments (Code 1)
12 0, 1 Parameter Sent when the IP header is invalid (Code 0) or
problem when an IP header option is missing (Code 1)

328
Some subtypes of the “Destination
Unreachable”

Code Description Reason for Sending


0 Network No routing table entry is available for the destination
Unreachable network.
1 Host Destination host should be directly reachable, but
Unreachable does not respond to ARP Requests.
2 Protocol The protocol in the protocol field of the IP header is
Unreachable not supported at the destination.
3 Port The transport protocol at the destination host cannot
Unreachable pass the datagram to an application.
4 Fragmentation IP datagram must be fragmented, but the DF bit in the
Needed IP header is set.
and DF Bit Set

329
Example: ICMP Port
 Unreachable
RFC 792: If, in the destination host, the IP module cannot deliver the datagram because the indicated
active, the destination host may send a destination unreachable message to the source host.
protocol module or process port is not

 Scenario:

Request
a
service
No process
at a por
t 80 is waiting
at port 80
Client
Client Server
Server

t e
Por achabl
e
Unr

330
IPv4

331
MTU

 Maximum Transmission Unit (MTU)


 Largest IP packet a network will accept
 Arriving IP packet may be larger
MTU

IP Packet

332
IP Fragmentation
 If IP packet is longer than the MTU, the
router breaks packet into smaller packets
 Called IP fragments

 Fragments are still IP packets

 Earlier in Mod A, fragmentation in TCP

MTU

IP Packet 3 2 1

IP Packets
Fragmentation

333
IP Fragmentation
 What is Fragmented?
 Only the original data field
 New headers are created

MTU

IP Packet 3 2 1

IP Packets
Fragmentation

334
IP Fragmentation
 What Does the Fragmentation?
 The router
 Not the subnet

MTU

IP Packet 3 2 1

IP Packets
Fragmentation

335
Multiple Fragmentations

 Original packet may be


fragmented multiple times along
its route
Source Destination
Host Host
Internet Internet
Process Process

Fragmentation

336
Defragmentation

 Internet layer process on destination host


defragments, restoring the original packet
 IP Defragmentation only occurs once

Source Destination
Host Host
Internet Internet
Process Process

Defragmentation

337
Fragmentation and IP
Fields
 More Fragments field (1 bit)

 1 if more fragments
 0 if not
 Source host internet process sets to 0
 If router fragments, sets More
Fragments field in last fragment to 0
 In all other fragments, sets to 1

0 0 1 1

Original IP Packet Fragments

338
Identification Field
 IP packet has a 16-bit Identification
field
Version Hdr Len
(4) (4)
TOS (8) Total Length in bytes (16)

Indication (16 bits) Flags (3) Fragment Offset (13)

Time to Live (8) Protocol (8) Header Checksum (16)

Source IP Address

Destination IP Address

Options (if any) PAD

Data Field

339
Identification Field
 IP packet has a 16-bit Identification
field
 Source host internet process places a
random number in the Identification
field
 Version Hdr Len
Different for
TOSeach
(8) IP packet
Total Length in bytes (16)
(4) (4)
Indication (16 bits) Flags (3) Fragment Offset (13)

Time to Live (8) Protocol (8) Header Checksum (16)

340
Identification Field
 IP packet has a 16-bit Identification
field
 If router fragments, places the original
Identification field value in the
Identification field of each fragment

47 47 47 47

Original IP Packet Fragments

341
Identification Field
 Purpose
 Allows receiving host’s internet layer
process know what fragments belong
to each original packet
 Works even if an IP packet is
fragmented several times

47 47 47 47

Original IP Packet Fragments

342
Fragment Offset Field

 Fragment offset field (13 bits) is used to


reorder fragments with the same
Identification field
 Contains the data field’s starting point (in
octets) from the start of the data field in the
original IP packet

Version Hdr Len


(4) (4)
TOS (8) Total Length in bytes (16)

Indication (16 bits) Flags (3) Fragment Offset (13)

343
Fragment Offset Field
 Receiving host’s internet layer
process assembles fragments in
order of increasing fragment offset
field value
 This works even if fragments arrive
out of order!
 Works even if fragmentation occurs
Fragment Offset Field
multiple times
730 212 0

344
Fragmentation: Recap

 IP Fragmentation
 Data field of a large IP packet is
fragmented
 The fragments are sent into a
series of smaller IP packets fitting a
network’s MTU
 Fragmentation is done by routers
 Fragmentation may be done
multiple times along the route
345
Defragmentation: Recap
 IP Defragmentation
 Defragmentation (reassembly) is done
once, by destination host’s internet
layer process

346
Defragmentation: Recap

 All IP packets resulting from the


fragmentation of the same original IP
packet have the same Identification
field value
 Destination host internet process
orders all IP packets from the same
original on the basis of their
Fragment Offset field values
 More Fragments field tells whether
there are no more fragments coming
347
IPv6: An Introduction

348
Outline

 Problems with IPv4


 Basic IPv6 Protocol
 IPv6 features
 Auto-configuration, QoS,
Security, Mobility
 Transition Plans

349
Internet Protocol
Transports a datagram from source host to
destination, possibly via several intermediate
nodes (“routers”)

Service is:
 Unreliable: Losses, duplicates, out-of-order

delivery
 Best effort: Packets not discarded capriciously,

delivery failure not necessarily reported


 Connectionless: Each packet is treated

independently
350
IP Datagram Header
0 4 8 16 19 31
VERS HLEN TOS TOTAL LENGTH

IDENTIFICATION FLAG FRAGMENT OFFSET

TTL PROTOCOL CHECKSUM

SOURCE ADDRESS

DESTINATION ADDRESS

OPTIONS (if any) + PADDING

351
Problems with IPv4: Limited
Address Space
 IPv4 has 32 bit addresses.
 Flat addressing (only netid + hostid with
“fixed” boundaries)
 Results in inefficient use of address space.
 Class B addresses are almost over.
 Addresses will exhaust in the next 5 years.
 IPv4 is victim of its own success.

352
Problems with IPv4: Routing
Table
 Explosion
IP does not permit route aggregation
(limited supernetting possible with new
routers)
 Mostly only class C addresses remain
 Number of networks is increasing very fast
(number of routes to be advertised goes up)
 Very high routing overhead
 lot more memory needed for routing table
 lot more bandwidth to pass routing information
 lot more processing needed to compute routes

353
Problems with IPv4:
 Header Limitations
Maximum header length is 60 octets.
(Restricts options)
 Maximum packet length is 64K octets.
(Do we need more than that ?)
 ID for fragments is 16 bits. Repeats every
65537th packet.
(Will two packets in the network have same ID?)
 Variable size header.
(Slower processing at routers.)
 No ordering of options.
(All routers need to look at all options.)

354
Problems with IPv4: Other
Limitations
 Lack of quality-of-service support.
 Only an 8-bit ToS field, which is hardly
used.
 Problem for multimedia services.
 No support for security at IP layer.
 Mobility support is limited.

355
IP Address Extension
 Strict monitoring of IP address assignment
 Private IP addresses for intranets
 Only class C or a part of class C to an organization
 Encourage use of proxy services

Application level proxies

Network Address Translation (NAT)
 Remaining class A addresses may use CIDR
 Reserved addresses may be assigned

But these will only postpone address exhaustion.


They do not address problems like QoS, mobility,
security.

356
IPng Criteria
 At least 109 networks, 1012 end-systems
 Datagram service (best effort delivery)
 Independent of physical layer technologies
 Robust (routing) in presence of failures
 Flexible topology (e.g., dual-homed nets)
 Better routing structures (e.g., aggregation)
 High performance (fast switching)
 Support for multicasting

357
IPng Criteria
 Support for mobile nodes
 Support for quality-of-service
 Provide security at IP layer
 Extensible
 Auto-configuration (plug-and--play)
 Straight-forward transition plan from
IPv4
 Minimal changes to upper layer
protocols
358
IPv6: Distinctive Features
 Header format simplification
 Expanded routing and addressing
capabilities
 Improved support for extensions and
options
 Flow labeling (for QoS) capability
 Auto-configuration and Neighbour discovery
 Authentication and privacy capabilities
 Simple transition from IPv4

359
IPv6 Header Format
0 4 12 16 24 31
Vers Traffic Class Flow Label

Payload Length Next Header Hop Limit

Source Address

Destination Address

360
IPv6 Header Fields
 Version number (4-bit field)
The value is always 6.
 Flow label (20-bit field)
Used to label packets requesting special handling by
routers.
 Traffic class (8-bit field)
Used to mark classes of traffic.
 Payload length (16-bit field)
Length of the packet following the IPv6 header, in octets.
 Next header (8-bit field)
The type of header immediately following the IPv6 header.

361
IPv6 Header Fields
 Hop limit (8-bit field)
Decremented by 1 by each node that forwards the
packet.
Packet discarded if hop limit is decremented to
zero.
 Source Address (128-bit field)
An address of the initial sender of the packet.
 Destination Address (128-bit field)
An address of the intended recipient of the packet.
May not be the ultimate recipient, if Routing
Header is present.

362
Header Changes from IPv4
 Longer address - 32 bits  128 bits
 Fragmentation field moved to separate header
 Header checksum removed
 Header length removed (fixed length header)
 Length field excludes IPv6 header
 Time to live  Hop limit
 Protocol  Next header
 64-bit field alignment
 TOS replaced by flow label, traffic class

363
Extension Headers
 Less used functions moved to extension headers.
 Only present when needed.
 Processed only by node identified in IPv6
destination field.
=> much lower overhead than IPv4 options
Exception: Hop-by-Hop option header
 Eliminated IPv4’s 40-byte limit on options
 Currently defined extension headers: Hop-by-hop,
Routing, Fragment, Authentication, Privacy, End-to-
end.
 Order of extension headers in a packet is defined.
 Headers are aligned on 8-byte boundaries.

364
Address Types
Unicast Address for a single interface.
Multicast Identifier for a set of interfaces.
Packet is sent to all these
interfaces.
Anycast Identifier for a set of interfaces.
Packet is sent to the nearest
one.

365
Text Representation of
Addresses
 HEX in blocks of 16 bits
BC84 : 25C2 : 0000 : 0000 : 0000 : 55AB : 5521 : 0018
 leading zero suppression
BC84 : 25C2 : 0 : 0 :55AB : 5521 : 18
 Compressed format removes strings of 0s
BC84 : 25C2 :: 55AB : 5521 : 18
:: can appear only once in an address.
can also be used to compress leading or trailing 0s
 Mixed Notation (X:X:X:X:X:X:d.d.d.d)
e.g., ::144.16.162.21

366
IPv6 Addresses
 128-bit addresses
 Multiple addresses can be assigned to an interface
 Provider-based hierarchy to be used in the
beginning
 Addresses should have 64-bit interface IDs in EUI-
64 format
 Following special addresses are defined :

IPv4-mapped

IPv4-compatible

link-local

site-local

367
Unicast Addresses
Examples
3
Global Aggregate Address
13 32 16 64 bits
FP TLA NLA SLA Interface ID
Public Topology Site Interface Identifier
Topology
 Link local address
10 bits 54 bits 64 bits
1111111010 0 Interface ID
 Site-local address

10 bits 38 bits 16 bits 64 bits


1111111011 0 subnet ID Interface ID

368
Multicast Address

8 bits 4 4 112 bits


11111111 flags scope Group ID

Flags 000T 3 bits reserved


T= 0 permanent
T= 1 transient

Scope 2 link-local
5 site-local
8 org-local
E global
Permanent groups are formed independent of scope.

369
IPv6 Routing
 Hierarchical addresses are to be used.
 Initially only provider-based hierarchy will be
used.
 Longest prefix match routing to be used.
(Same as IPv4 routing under CIDR.)
 OSPF, RIP, IDRP, ISIS, etc., will continue as is
(except 128-bit addresses).
 Easy renumbering should be possible.
 Provider selection possible with anycast groups.

370
QoS Capabilities
 Protocol aids QoS support, not provide it.
 Flow labels

To identify packets needing same quality-of-service

20-bit label decided by source

Flow classifier: Flow label + Source/Destination addresses

Zero if no special requirement

Uniformly distributed between 1 and FFFFFF
 Traffic class

8-bit value

Routers allowed to modify this field

371
IPv6: Security Issues

 Provision for

Authentication header

Guarantees authenticity and integrity of data

Encryption header

Ensures confidentiality and privacy
 Encryption modes:

Transport mode

Tunnel mode
 Independent of key management
algorithm.
 Security implementation is mandatory
requirement in IPv6.
372
Mobility Support in IPv6
 Mobile computers are becoming commonplace.
 Mobile IPv6 allows a node to move from one link to
another without changing the address.
 Movement can be heterogeneous, i.e., node can move
from an Ethernet link to a cellular packet network.
 Mobility support in IPv6 is more efficient than mobility
support in IPv4.
 There are also proposals for supporting micro-mobility.

373
Neighbour Discovery
 Router Discovery - determines set of routers on the
link.
 Prefix Discovery - set of on-link address prefixes.
 Parameter Discovery - to learn link parameters such
as link MTU, or internet parameters like hop limit, etc.
 Address Auto-configuration - address prefixes
that can be used for automatically configuring interface
address.
 Address resolution - IP to link-layer address mapping.
 Duplicate Address Detection.
 Route Redirect - inform of a better first hop node to
reach a particular destination.

374
Neighbour Discovery
Operation
Based on ICMPv6 messages
 Router Solicitation (RS)
 Router Advertisement (RA)
 Neighbour Solicitation (NS)
 Neighbour Advertisement (NA)
 Redirect

 Router Solicitation
 sent when an interface becomes enabled,
hosts request routers to send RA immediately.

375
Neighbour Discovery
Operation (contd..)
 Router advertisement
 Sent by routers periodically or in
response to RS.
 Hosts build a set of default routers based
on this information.
 Provides information for address auto-
configuration, set of on-link prefixes etc.
 Supplies internet/subnet parameters, like
MTU, and hop limit.
 Includes router’s link-layer address.

376
Neighbour Discovery
Operation (contd..)
 Neighbour Solicitation

To request link-layer address of neighbour

Also used for Duplicate Address Detection
 Neighbour Advertisement

Sent in response to NS

May be sent without solicitation to announce
change in link-layer address
 Redirect - used to inform hosts of a
better first hop for a destination.

377
Additional Features
Anycast Addresses
 Multiple nodes on link may have this address

 All those nodes will respond to an NS message.

 Host will get multiple NA messages, but should

accept only one.


 The messages should be tagged as non-

override.

Proxy advertisements
 Router may send NA on behalf of others.

 Useful for mobile nodes who have moved.

378
Address Auto-
configuration
The problem
 System bootstrap (“plug and play”)
 Address renumbering

Addressing Possibilities
Manual Address configured by hand
Autonomous Host creates address with no external
interaction (e.g., link local)
Semi-autonomous Host creates address by combining a priori
information and some external information.
Stateless Server Host queries a server, and gets an address.
Server does not maintain a state.
Stateful Server Host queries a server, and gets an address.
Server maintains a state.

379
Auto-configuration in IPv6
 Link-local prefix concatenated with 64-bit MAC
address. (Autonomous mode)
 Prefix advertised by router concatenated with
64-bit MAC address. (Semi-autonomous mode.)
 DHCPng (for server modes)
 Can provide a permanent address (stateless mode)
 Provide an address from a group of addresses, and
keep track of this allocation (stateful mode)
 Can provide additional network specific information.
 Can register nodes in DNS.

380
Address Renumbering
 To migrate to a new address

change of provider

change in network architecture
 Methods

router adds a new prefix in RA, and informs that the
old prefix is no longer valid.

When DHCP lease runs out, assign a new address to
node.

DHCPng can ask nodes to release their addresses.
 Requires DNS update. DHCPng can update DNS for clients.
 Existing conversations may continue if the old
address continues to be valid for some time.

381
Upper Layer Issues
 Minor changes in TCP
 Maximum segment size should be based on Path MTU.
 The packet size computation should take into account larger size
of IP header(s).
 Pseudo-header for checksum is different.
 UDP checksum computation is now
mandatory.
 Most application protocol specifications are
independent of TCP/IP - hence no change.
 FTP protocol exchanges IPv4 addresses -
hence needs to be changed.

382
 The pseudo-header is changed in
checksum computation:

Address are 128 bits.

Payload length is 32 bits.

Payload length is not copied from IPv6 header.
(Extension headers should not be counted.)

Next header field of last extension header is used in place
of protocol.
 UDP packets must also have
checksum.
(Since no IP checksum now.)

383
Changes in Other Protocols
 ICMPv6
 Rate limiting feature added

Timer based

Bandwidth based
 IGMP, ARP merged
 Larger part of offending packet is included
 DNS
 AAAA type for IPv6 addresses
 A6 type: recursive definition of IP address
 Queries that do additional section processing are
redefined to do processing for both ‘A’ and ‘AAAA’
type records

384
Socket API
 “Sockets” interface – the de facto standard API for
TCP/IP Applications.
 Need to change Socket API in order to reflect the
increased address length in IPv6.
 Also need to make new features like flow label,
visible to applications.
 A few new library routines
 Complete source and binary compatibility with
original API.
 One can have some sockets using IPv4 and others
using IPv6.

385
Transition to IPv6: Design
Goal
 No “flag”day.
 Incremental upgrade and deployment.
 Minimum upgrade dependencies.
 Interoperability of IPv4 and IPv6 nodes.
 Let sites transition at their own pace.
 Basic migration tools

Dual stack and tunneling

Translation

386
Transition Mechanisms: Dual
Stack

 New nodes support both IPv4 and IPv6.


 Upgrading from IPv4 to v4/v6 does not
break anything.
 Same transport layer and application
above both.
 Provides complete interoperability with
IPv4 nodes.

387
Transition Mechanism:
Tunnels
 Tunnel IPv6 packets across IPv4
topology.
 Configured tunnels:
 Explicitly configured tunnel endpoints.
 Router to router, host to router.
 Automatic tunnels:
 Automatic address resolution using
embedded IPv4 address (like IPv4-
compatible address).
 Host to host, router to host

388
Transition mechanism:
Translation
 This will allow communication between IPv6
only hosts and IPv4 only hosts.
 A typical translator consists of two components:

translation between IPv4 and IPv6 packets.

Address mapping between IPv4 and IPv6
 For translation, three technologies are
available:

header conversion

transport relay

application proxy

389
NAT-PT
 Combination of Network Address
Translation (NAT) and Protocol
Translation (PT)
 Meant for communication between
IPv6-only and IPv4-only nodes.
 No change is needed on the IPv6-
only nodes.
 But translation is not stateless.
 Hence, single point of failure.
390
NAPT-PT

 Network Address Port Translation +


Protocol Translation
 In addition to changing IP address,
changes the port number also in the
transport layer header.
 It will allow IPv6 nodes to communicate
with IPv4 nodes transparently using a
single IPv4 address.

391
Stateless IP-ICMP Translation
(SIIT)
 SIIT also translates between IPv4 and
IPv6 headers.
 Stateless: Translator does not keep
address mapping.
 There has to be a translator on every
path, not necessarily on all physical links.
 Uses IPv4-translatable addresses.
 Assumes that there is an IPv4 address
pool of addresses for the subnet.

392
Issues in Translation

 PMTU discovery is optional on IPv4 network.


 Fragmentation is difficult to handle.
 Security Associations may not be transparent.
 Options may not be translatable.
 UDP checksum is optional over IPv4.
 Some ICMP messages are different.
 Connections can only start from IPv6 node.

393
Transition Plan for Internet
 Maintain complete V4 routing till
addresses last.
 Upgrade V4 routers to dual stack.
 Incrementally build up V6 backbone
routing system.
 Use v6-over-v4 tunnels to construct 6bone.
 Grow like Mbone (multicast backbone).
 De-activate tunnels as soon as underlying
path upgraded to V6.

394
Transition Options for User
Sites
Incrementally upgrade V4 hosts to dual
V4/V6
 Use IPv4-compatible addresses with existing IPv4
address assignments
 Host-to-host automatic tunneling over IPv4
 Upgrade routers to IPv6.
 Hosts may require native IPv6 addresses
 DNS upgrade is needed before hosts get IPv6
addresses
 Connect IPv6 router to an IPv6-enabled ISP.
 Install translators like NAT-PT or SIIT.

395

You might also like