Network Layer - Unicast Routing
Network Layer - Unicast Routing
Protocols
Dr Mohit Kumar
Assistant Professor
Dept. of Information Technology
National Institute of Technology
Jalandhar-144008, Punjab India
Internet Protocol (IP)
3
Figure 2: IP datagram
4
An IPV4 packet, the value of HLEN is 1000 in binary. How
many of options are being carried by this packet ?
5
The host or datagram that fragments a datagram must change
the values of three fields: flags, fragmentation offset, total
length.
Identification: This 16 bit field identifies a datagram
originating from source host.
The combination of identification and source IPV4 address
must uniquely define a datagram as it leave the source host.
6
Fragment Offset field (13 bits) is used to indicate the starting position of
the data in the fragment in relation to the start of the data in the original
packet.
This information is used to reassemble the data from all the fragments
(whether they arrive in order or not).
In the first fragment the offset is 0 as the data in this packet starts in the
same place as the data in the original packet (at the beginning).
In subsequent fragments, the value is the offset of the data the fragment
contains from the beginning of the data in the first fragment (offset 0), in 8
byte ‘blocks’.
If a packet containing 800 bytes of data is split into two equal fragments
carrying 400 bytes of data, the fragment offset of the first fragment is 0, of
the second fragment 50 (400/8).
The offset value must be the number of 8 byte blocks of data, which means
the data in the prior fragment must be a multiple of 8 bytes.
The last fragment can carry data that isn’t a multiple of 8 bytes as there
won’t be a further fragment with an offset that must meet the 8 byte ‘rule’.
7
In an IPv4 datagram, the M bit is 0, the value of HLEN is 10, the value of
total length is 400 and the fragment offset value is 300. The position of the
datagram, the sequence numbers of the first and the last bytes of the
payload, respectively are
(A) Last fragment, 2400 and 2789
(B) First fragment, 2400 and 2759
(C) Last fragment, 2400 and 2759
(D) Middle fragment, 300 and 689
8
1 Introduction
2 Intra- and Inter-Domain
Routing
3 Distance Vector Routing
4 RIP
5 Link State Routing
6 OSPF
7 Path Vector Routing
8 BGP
9
1 INTRODUCTION
10
Least cost Routing
11
Least-Cost Trees
12
2 INTER- AND INTRA-DOMAIN
ROUTING
14
Figure 2 Popular routing protocols
15
3 DISTANCE VECTOR ROUTING
Bellman-Ford Algorithm
Distance Vector Routing Algorithm
Count to Infinity
16
Figure 3 A graph for Bellman-Ford algorithm
17
Figure 4 The fact behind Bellman-Ford algorithm
18
TCP/IP Protocol Suite 19
Distance vectors
23
Figure 5 Example 1
24
Example 2
25
Figure 6 Example 2
4 3 2
Net5 , 1Net4 , 1Net2 , 1
26
Example 3
Figure 7 shows the final routing tables for routers
in Figure 5.
27
Figure 7 Example 3
28
Figure 8 Two-node instability
29
Figure 9 Three-node instability
30
4 RIP
The Routing Information Protocol (RIP) is an
intra-domain (interior) routing protocol used
inside an autonomous system.
It is a very simple protocol based on distance
vector routing. RIP implements distance
vector routing directly with some
considerations.
RIP Message Format
Request and Response
Timers in RIP
RIP Version 2
Encapsulation
31
Figure 10 Example of a domain using RIP
32
Figure 11 RIP message format
33
Figure 12 Request messages
34
Figure 14 RIP timers
35
Note
36
5 LINK STATE ROUTING
38
Figure 18 Link state knowledge
39
Creation of link state
packets
A link state packet can carry a large amount of information.
For the moment, however we assume that it carries a
minimum amount of data: node identity, cost of links, a
sequence no and age.
The first two are need to form the topology.
LSP are generated on two occasions:
When there is a change in the topology of the domain
On a periodic basis
40
41
42
Figure 19 Forming shortest path three for router A in a graph
43
Figure 19 Continued
44
Figure 19 Continued
45
Example 6
To show that the shortest path tree for each node
is different, we found the shortest path tree as
seen by node C (Figure 20). We leave the detail
as an exercise.
46
Figure 20 Example 6
47
TCP/IP Protocol Suite 48
6 OSPF
50
OSPF was designed to handle routing in a small or large
autonomous system.
The formation of shortest-path trees in OSPF requires that all
routers flood the whole AS with their LSPs to create the global
LSDB.
This may not create a problem in a small AS, but create traffic
in large AS.
To prevent this, the AS needs to be divided into small sections
called areas.
Each area acts as a small independent domain for flooding .
51
Figure 21 Areas in an autonomous system
52
Figure 22 Types of links
53
Figure 23 Point-to-point link
54
Figure 24 Transient link
55
Figure 25 Stub link
56
Figure 26 Example of an AS and its graphical representation in OSPF
57
Figure 27 Types of OSPF packet
58
Note
59
7 PATH VECTOR ROUTING
60
PATH VECTOR ROUTING
61
Example 10
62
Figure 50 Reachability
WAN
WAN
63
Figure 51 Stabilized table for three autonomous system
64
Figure 52 Routing tables after aggregation
65
8 BGP
67
Figure 54 Types of BGP messages
68
Note
69
Note
70