0% found this document useful (0 votes)
8 views70 pages

Network Layer - Unicast Routing

The document discusses unicast routing protocols, focusing on Internet Protocol (IP) and its datagram format, including fragmentation and routing mechanisms. It covers various routing protocols such as Distance Vector Routing, RIP, Link State Routing, OSPF, Path Vector Routing, and BGP, explaining their functionalities and differences. Additionally, it highlights the importance of autonomous systems in routing and the challenges faced in large networks.

Uploaded by

devanbansal777
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)
8 views70 pages

Network Layer - Unicast Routing

The document discusses unicast routing protocols, focusing on Internet Protocol (IP) and its datagram format, including fragmentation and routing mechanisms. It covers various routing protocols such as Distance Vector Routing, RIP, Link State Routing, OSPF, Path Vector Routing, and BGP, explaining their functionalities and differences. Additionally, it highlights the importance of autonomous systems in routing and the challenges faced in large networks.

Uploaded by

devanbansal777
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/ 70

Unicast Routing

Protocols

Dr Mohit Kumar
Assistant Professor
Dept. of Information Technology
National Institute of Technology
Jalandhar-144008, Punjab India
Internet Protocol (IP)

Figure 1: Position of IP and other network-layer


protocols in
TCP/IP protocol suite
2
Datagram Format
 Packets used by the IP are called datagrams.
Figure 2 shows the IPv4 datagram format.

 A datagram is a variable-length packet consisting


of two parts: header and payload (data).

 The header is 20 to 60 bytes in length and contains


information essential to routing and delivery.

 It is customary in TCP/IP to show the header in 4-


byte sections.

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 ?

 In an IPV4 packet, the value of HLEN is 5, and value of total


length field is 0x0028. How many bytes of data 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

An IP router with a Maximum Transmission Unit (MTU) of 200 bytes has


received an IP packet of size 520 bytes with an IP header of length 20
bytes. The values of the relevant fields in the IP header.

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

An internet is a combination of networks


connected by routers. When a datagram
goes from a source to a destination, it
will probably pass through many routers
until it reaches the router attached to
the destination network.
 Cost or Metric
 Static versus Dynamic Routing Table
 Routing Protocol

10
Least cost Routing

11
Least-Cost Trees

12
2 INTER- AND INTRA-DOMAIN
ROUTING

 Today, an internet can be so large that one


routing protocol cannot handle the task of
updating the routing tables of all routers.
 For this reason, an internet is divided into
autonomous systems.
 An autonomous system (AS) is a group of
networks and routers under the authority of
a single administration.
 Routing inside an autonomous system is
called intra-domain routing.
 Routing between autonomous systems is
called inter-domain routing
13
Figure 1 Autonomous systems

14
Figure 2 Popular routing protocols

15
3 DISTANCE VECTOR ROUTING

The distance-vector (DV) routing uses to find the best


route.
DV is simple routing protocol which takes routing decision on
the number of hops between source and destination.
A route with less number of hops is considered as best route.
Every router advertises its set best routes to other routers.
Ultimately, all routers build up their network topology based
on the advertisements of their peer routers

 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

TCP/IP Protocol Suite 20


TCP/IP Protocol Suite 21
22
Example 1

 Next figure shows the initial routing table


for an AS.

 Note that the figure does not mean that all


routing tables have been created at the
same time; each router creates its own
routing table when it is booted.

23
Figure 5 Example 1

24
Example 2

 Now assume router A sends four records to its


neighbors, routers B, D, and C.

 Next figure 6 shows the changes in B’s routing


table when it receives these records. We leave
the changes in the routing tables of other
neighbors as exercise.

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

RIP uses the services of UDP on well-


known port 520.

36
5 LINK STATE ROUTING

Link state routing has a different


philosophy from that of distance vector
routing.
In link state routing, if each node in the
domain has the entire topology of the
domain—the list of nodes and links, how
they are connected including the type,
cost (metric), and the condition of the
links (up or down)—the node can use the
Dijkstra algorithm to build a routing
table.
37
Figure 17 Concept of Link state routing

38
Figure 18 Link state knowledge

Building Routing Table:

1)Creation of link state packets (LSP)


2)Flooding of LSPs
3)Formation of shortest path tree
4)Calculation of routing table from shortest path tree

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

The Open Shortest Path First (OSPF)


protocol is an intra-domain routing
protocol based on link state routing. Its
domain is also an autonomous system.
 Area
 Metric
 Types of Links
 Graphical Representation
 OSPF Packets
 Link State Update Packet
 Other Packets
 Encapsulation
49
 In OSPF, like RIP, the cost of reaching a destination from the
host is calculated from the source router to the destination
network.
 However, each link (network) can be assigned a weight based
on the throughput, round-trip time, reliability, and so on.

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

OSPF packets are encapsulated in


IP datagrams.

59
7 PATH VECTOR ROUTING

Distance vector and link state routing are both interior


routing protocols.
They can be used inside an autonomous system. Both of
these routing protocols become intractable when the
domain of operation becomes large.
Distance vector routing is subject to instability if there is
more than a few hops in the domain of operation.
Link state routing needs a huge amount of resources to
calculate routing tables. It also creates heavy traffic
because of flooding.
There is a need for a third routing protocol which
we call path vector routing.

60
PATH VECTOR ROUTING

Routing takes place between the two autonomous


networks.

DV and Link State Routing ignore the internet outside


the autonomous system whereas Path Vector routing
assumes that internet consists of a collection of
interconnected autonomous systems.

Protocol for inter-domain routing are also called


as exterior gateway protocols.
 Reachability
 Routing Table

61
Example 10

The difference between the distance vector


routing and path vector routing can be
compared to the difference between a national
map and an international map.

A national map can tell us the road to each


city and the distance to be traveled if we
choose a particular route;

An international map can tell us which cities


exist in each country and which countries
should be passed before reaching that city.

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

Border Gateway Protocol (BGP) is an


interdomain routing protocol using path vector
routing. It first appeared in 1989 and has gone
through four versions.
 Types of Autonomous Systems: stub, multihomed, transit
 Path Attributes: Well known and optional attribute
 BGP Sessions
 External and Internal BGP
 Types of Packets
 Packet Format
 Encapsulation
66
Figure 53 Internal and external BGP sessions

67
Figure 54 Types of BGP messages

68
Note

BGP supports classless addressing .

69
Note

BGP uses the services of TCP


on port 179.

70

You might also like