0% found this document useful (0 votes)
14 views27 pages

Internet Part2

The document discusses routing protocols at the network layer, including distance vector routing protocols like RIP and link state routing protocols like OSPF. It describes how distance vector routing can result in looping problems and how link state routing solves this by having each node maintain the full network topology.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views27 pages

Internet Part2

The document discusses routing protocols at the network layer, including distance vector routing protocols like RIP and link state routing protocols like OSPF. It describes how distance vector routing can result in looping problems and how link state routing solves this by having each node maintain the full network topology.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

Internet - Part 2

Dr. Sudhir Kumar

Assistant Professor
Department of Electrical Engineering,
Indian Institute of Technology Patna, India

April 18, 2020

Dr. Sudhir Kumar (Assistant Professor Department of Electrical


InternetEngineering,
- Part 2 Indian Institute of Technology
April
Patna,
18, 2020
India) 1 / 27
Routing at Network Layer

Routers use the routing table to send the IP packets from one hop to
another. At the beginning, the entire route from source to destination
is not known. Instead, the route is calculated after each hop.
For IoT networks, we use dynamic routing in contrast to static
routing. Static route in the network is manually updated, whereas,
the path is automatically changes based on the speed/failure of the
links in the case of dynamic routing.
Routing Information Protocol (RIP): It is based on distance vector
protocol. Distance vector is also known by other names such as
Bellman-Ford or Ford-Fulkerson routing algorithm. Limitations: It
assumes all the networks as equal and does not take bandwidth into
account, and a long convergence time (or count-to-infinity problem).
Open Shortest Path First (OSPF): It is based on link state
protocol. A route can have different metrics like delay, cost, speed etc.

Dr. Sudhir Kumar (Assistant Professor Department of Electrical


InternetEngineering,
- Part 2 Indian Institute of Technology
April
Patna,
18, 2020
India) 2 / 27
Interior and Exterior Routing Protocols

Autonomous System: A collection of networks under single


administration having a common routing scheme. Interior Routing
Protocol (IRP): Routing within the autonomous system to exchange
the information such OSPF routing protocol. Exterior Routing
Protocol (ERP): Routing between autonomous systems to exchange
the information between exterior routers. We use Border Gateway
Protocol (BGP).

Dr. Sudhir Kumar (Assistant Professor Department of Electrical


InternetEngineering,
- Part 2 Indian Institute of Technology
April
Patna,
18, 2020
India) 3 / 27
Distance Vector Routing

It consists of a array (table) of distance and direction (node) to


determine the route. Routers exchange routing tables with only
immediate neighbours. This in turn propagated to the entire network.
Initially, the cost is set to infinity if the node is not directly reachable.
After sharing of routing tables by, say immediate neighbours A and C
knows about others neighbours. C comes to know about B and A
comes to know about D and E . The cost is updated then and node
through which is reachable (via node) is also updated.

Dr. Sudhir Kumar (Assistant Professor Department of Electrical


InternetEngineering,
- Part 2 Indian Institute of Technology
April
Patna,
18, 2020
India) 4 / 27
Limitation of Distance Vector Routing

Let us consider nodes A, B and C only and placed in a linear fashion.


Assume that link between A and B gets fail. If A reports to C
immediately, then everything is fine. Otherwise, B tells A that I can
reach to C with cost 2 + 5 = 7. However, A does not know that the
path of B is through it itself. So, A updates its routing table that it
can reach to C via B with cost 5 + 7 = 12. Subsequently, B updates
that it can reach to B with cost 12 + 5 = 17.
This continues till infinity and called as count-to-infinity or loop
instability problem. The solution can be solved by setting infinity to a
smaller number or split horizon technique. However, these all solution
do not work in practice. If C tells A that I got a path, there is no way
to know that the path is through A itself.

Dr. Sudhir Kumar (Assistant Professor Department of Electrical


InternetEngineering,
- Part 2 Indian Institute of Technology
April
Patna,
18, 2020
India) 5 / 27
Link State Routing
Each node has the entire topology of the network, however, the
routing table will be different for each nodes. Analogy: everyone has
a map of the area, however, there is different route for each person to
reach the destination.
The topology must be dynamic in the sense that topology must be
updated regularly if any node goes down or unreachable because of
some reasons.
Initially, the complete topology is not known by each node. Each
node shares the partial information (like distance with immediate
neighbour) of the its neighbours with the rest of the nodes. At the
end, it aggregated to get the entire topology which is shared among
all the nodes like distance vector routing.
Last Example: If A know that it is connected to B and C with cost
2 and 5 respectively. Therefore, B and C also come to know that
costs involved for connecting with A are 2 and 5 respectively. This
process is repeated.
Dr. Sudhir Kumar (Assistant Professor Department of Electrical
InternetEngineering,
- Part 2 Indian Institute of Technology
April
Patna,
18, 2020
India) 6 / 27
Link State Routing contd...
The router after boots learn about the neighbour by sending HELLO
packet and other router respond back with its details. Then the cost
is measured by sending ECHO packet. It calculates the round-trip
delay divided by 2. There are three steps in link state routing for
building routing tables.
First, each node makes a link state packet which consists of node ID,
list of links, sequence number and age. The first two helps in building
topology. The link state packet is made periodically or when some
events occur like node failure or nodes go down/come up.
Sequence number helps in identifying new packets and discarding old
packets at a particular node. There are some issues with sequence
number. First, we may run short of sequence number which can be
solved by using 32 bits sequence number. It will take 137 years to wrap
around for one link state packet per second. Second, sequence number
starts from zero again if router crashes. In this scenario, although
packet is new, however, it is rejected on the basis of duplicate sequence
number (or duplicate packet). Third, if sequence number is changed
from i to j (j >> i) because of some error, then all packets from i + 1
to j is rejected.
Dr. Sudhir Kumar (Assistant Professor Department of Electrical
InternetEngineering,
- Part 2 Indian Institute of Technology
April
Patna,
18, 2020
India) 7 / 27
Link State Routing contd...

The solution associated with sequence number is addressed using age.


Age is decremented once per second and if it becomes zero, the packet
is discarded.
Second, those LSPs are sent to all the nodes not only immediate
neighbours. This is called flooding. In the previous step, we make link
state packet periodically. The interval is chosen judiciously to avoid
network congestion because of flooding. Say, we choose 1 hour or 2
hour.
Third, the topology is at each nodes after receipts of link step packets.
Now, Dijkstra algorithm is used to find the shortest route between any
two nodes and the best route is determined. In each routing table, the
result of Dijkstra algorithm is stored. Finally, we have the routing
tables for each node like distance vector protocol.
For N number of routers and K number of neighbours for each router,
the memory requirement is NK .

Dr. Sudhir Kumar (Assistant Professor Department of Electrical


InternetEngineering,
- Part 2 Indian Institute of Technology
April
Patna,
18, 2020
India) 8 / 27
Shortest Path Routing - Dijkstra Algorithm

Dijkstra is read as DYKE-struh (Dutch name-Netherlands).


In shortest path routing: A router represents a node and edge
connecting nodes is a communication link. The weight over the edge
represents a metric such as distance, latency, cost, bandwidth
amongst others. The number of hops can a metric, however, the
length of each hop can be different.
We find the shortest path or minimum metric path from source to
destination. We describe the Dijkstra algorithm of year 1959 for
finding the shortest path in an undirected graph. The shortest path
from A to B and B to A would be same for an undirected graph.
Initially, nodes are assigned infinity weight as the path the unknown.
The path can change if we find the better path than previous one.
The weights on the path can be tentative or permanent. Once, it
becomes permanent based on minimum metric criteria, it will then
not change further.
Dr. Sudhir Kumar (Assistant Professor Department of Electrical
InternetEngineering,
- Part 2 Indian Institute of Technology
April
Patna,
18, 2020
India) 9 / 27
Dijkstra Algorithm contd: Example

We can use the same table to find the shortest path between any two nodes if the
source and destination are changed. The column represents the milestones (or
stops). Entry in bottom right corner shows the node through which the milestone
can be reached.
To go from A to the rest of the nodes, A to A requires cost 0. A to B and C need
cost 2 and 5 respectively. Since D and E are not reachable from A, these are set to
infinity initially. After first row, we choose cost 2 via A to reach B as this involves
a minimum cost.
In second row, to reach C, there is no path from B to C. We write the
corresponding entry from first row. To reach D from B: cost 2 to reach B from
first row Plus cost 4 to reach from B to D. Similarly, to reach E from B: cost 2 to
reach B from first row Plus cost 7 to reach from B to E.
We choose cost 5 via A to reach C. To reach D requires cost 8 via C (5 from
previous step to reach C plus cost 3 for C to D). Similarly, to reach E requires cost
10 via C (5 from previous step to reach C plus cost 5 for C to E). However, these
costs are more than the corresponding entry in the previous row and hence, these
are discarded.

Dr. Sudhir Kumar (Assistant Professor Department of Electrical


InternetEngineering,
- Part 2 Indian Institute of Technology
AprilPatna,
18, 2020
India) 10 / 27
Dijkstra Algorithm contd: Example contd...

In third row, we choose cost 6 via B to reach D. In fourth row, to


reach E from node D requires cost 8 via D (6 for reaching D and 2
from D to E).
The shortest path from A to E is written using back-propagating A -
B - D - E. We use here 8 via D to reach E, 6 via B to reach D and 2
via A to reach B. Similarly, the shortest path from A to D is written
using back-propagating A - B - D. We use here 6 via B to reach D
and 2 via A to reach B.

Dr. Sudhir Kumar (Assistant Professor Department of Electrical


InternetEngineering,
- Part 2 Indian Institute of Technology
AprilPatna,
18, 2020
India) 11 / 27
Interior Gateway Routing Protocol: RIP

Oldest interior gateway routing protocol for within a (intra)


autonomous system based on Distance Vector Routing. Routing
Information Protocol (RIP) is developed by Xerox network system
RIP uses Hop Count as a metric and it is measured from source
router to destination subnet. Maximum hop count allowed is 15.
Distance vector routing: Each router exchanges distance vector with
neighbouring routers. The distance vector is the current shortest path
distance from that router to the subnet. Routing information is
exchanged between routers every 30 seconds.
Router does not listen anything from neighbouring router once every
180 seconds in case of neighbour is down/fail. Subsequently, routing
table is updated by sending advertisements to neighbouring routers.
A router can also send RIP request message to know its neighbour’s
cost to destination.

Dr. Sudhir Kumar (Assistant Professor Department of Electrical


InternetEngineering,
- Part 2 Indian Institute of Technology
AprilPatna,
18, 2020
India) 12 / 27
RIP Routing Table
RIP Routing Table consists of three columns. First, second and
third columns has destination subnet, number of hops to destination
subnet and the next router on the shortest path towards destination
subnet respectively.
First the routing table for router A is created and then for router B.
Next, when router A receives the advertisement from router B, router
A comes to know the shorter path to destination subnet Z via router
D. Hence, routing table for router A is updated by adding 1 hop
count via router B to subnet Z .

Limitation of RIP: Works well for a small system and also suffers
from count-to-infinity problem and convergence. This motivates us to
go for OSPF which is based on link state routing.
Dr. Sudhir Kumar (Assistant Professor Department of Electrical
InternetEngineering,
- Part 2 Indian Institute of Technology
AprilPatna,
18, 2020
India) 13 / 27
Interior Gateway Routing Protocol: OSPF

Standardized by IETF in RFC 2328 for Routing in Internet.


Different autonomous systems uses different interior routing
algorithms.
Open Shortest Path First (OSPF) is an interior gateway routing
protocol for within a (intra) autonomous system
It uses link state routing for flooding the link state packets and
Dijkstra shortest path algorithm.
Open in OSPF means that the routing protocol specification is
publicly open in literature.
Administrator calculates several metrics for the connection (edge)
between two routers such as distance, delay, data rate, inversely
proportional to link capacity discourage traffic from a particular route.
However, OSPF provides the mechanism to determine the
minimum-cost path routing.

Dr. Sudhir Kumar (Assistant Professor Department of Electrical


InternetEngineering,
- Part 2 Indian Institute of Technology
AprilPatna,
18, 2020
India) 14 / 27
OSPF contd...

Router in OSPF broadcasts link state information to all the routers in


the Autonomous System (AS) periodically every 30 minutes or when
the link goes down/up unlike distance vector where broadcasting is
done for only immediate neighbours
OSPF also does load balancing between multiple paths. Exchange of
information between OSPF routers is also secured. Novice researcher
cannot inject the false routing information.
OSPF supports hierarchical structure of an autonomous system for
better management.

Dr. Sudhir Kumar (Assistant Professor Department of Electrical


InternetEngineering,
- Part 2 Indian Institute of Technology
AprilPatna,
18, 2020
India) 15 / 27
OSPF Terminologies

Area - Generalized subnet which consists of networks, routers and


hosts. The router in an area broadcasts link-state packets to other
routers of that area. Each area runs its own link-state routing using
shortest-path algorithm. Areas do not overlap, but some routers may
not belong to any area. The network should be connected inside an
area.
Area border router: Sends the packets to other areas. Backbone
router: The router inside the backbone (or primary or area 0) area.
The backbone area connects all the areas of an autonomous system.
The traffic goes from one area to another area via backbone area.
The backbone and areas act like spokes and hub respectively in a star
kind of topology. The packets are first sent to area border router
(intra-area routing) and then to backbone router (inter-area routing)
of the AS and finally to AS boundary router (inter-AS) for other AS.

Dr. Sudhir Kumar (Assistant Professor Department of Electrical


InternetEngineering,
- Part 2 Indian Institute of Technology
AprilPatna,
18, 2020
India) 16 / 27
OSPF Links
Transit networks: Carry data that neither originate nor terminate on
the system attached to it. Stub network: It is connected to a single
router, that is, data either originate or terminate at the router.
In order to exchange information between routers, a designated
router is elected with which other routers connect. This way is
efficient instead of sending between each pairs of routers. In case of
exigency, backup designated router and virtual link are used.
Each router floods link state information (neighbours and costs) with
Hello message to all other routers in its area. Sequence number is
used to keep the latest information. Each router creates a topology
for its area and then Dijkstra algorithm is used to find the
shortest-path between the backbone router and other routers.

Dr. Sudhir Kumar (Assistant Professor Department of Electrical


InternetEngineering,
- Part 2 Indian Institute of Technology
AprilPatna,
18, 2020
India) 17 / 27
Exterior Gateway Routing Protocol: BGP

Routing protocol among multiple autonomous systems, Border


Gateway Protocol (BGP) is used. BGPs reliably communicate by
establishing TCP connections. BGP is a distance vector protocol,
however, it is different from RIP (consider only cost to destination).
BGP routing table consists of the exact path being used in addition to
cost to reach destination. This is then sent to its neighbour.
Standardized in RFC 4271. In BGP, we choose route based on metric
(cost) and local preference. In local preference, we have politics
where some ASes may not send data through some ASes even though
they lie on shortest path. ASes can charge for transit traffic from
other ASes or can refuse also. BGP select the shortest path if the
degree of local preferences for two routes are the similar. If both
degree of local preferences and costs are the same, then the route
with the closest next-hop router is selected.

Dr. Sudhir Kumar (Assistant Professor Department of Electrical


InternetEngineering,
- Part 2 Indian Institute of Technology
AprilPatna,
18, 2020
India) 18 / 27
BGP contd...

Mesh of TCP connections inside an AS is called internal BGP or


iBGP session. The TCP connection between two BGPs is called
external BGP or eBGP session.
In BGP, destination is not host but a collection of subnets. The
traffic goes from source AS to destination AS via neighbouring AS.
AS1 sends the reachability information to AS2 through eBGP and
vice versa and similarly, AS2 and AS3 do. Now, gateway of AS2 sends
the reachability information of AS1 to AS3. Routing/forwarding table
of AS3 is updated with reachability information of AS1.
Thus, there are three steps in BGP: neighbour agreement,
neighbour reachability and network reachability.

Dr. Sudhir Kumar (Assistant Professor Department of Electrical


InternetEngineering,
- Part 2 Indian Institute of Technology
AprilPatna,
18, 2020
India) 19 / 27
BGP Features
Autonomous system is known by globally unique Autonomous
System Number (ASN) like IP address. This is provided by ICANN.
AS-Path includes the list of ASes that are traversed for the route.
When the advertisement goes from AS1 to AS3 via AS2, AS-Path
would be {AS1, AS2}.
BGP does not suffer from count-to-infinity problem and hence prevent
routing loops and instability. The router does not choose any route if
it include itself the route. Thanks to AS path which tell the exact
ASes (BGP routers of those ASes) to be traversed.
In figure, suppose A is the destination BGP router. B chooses B-A
path. Other paths are discarded as those include B. Ties is resolved
as mentioned in first slide of BGP. Now, A-B link fails. Then, B does
not choose CBA as it includes B itself rather choose BDA.

Dr. Sudhir Kumar (Assistant Professor Department of Electrical


InternetEngineering,
- Part 2 Indian Institute of Technology
AprilPatna,
18, 2020
India) 20 / 27
Performance Metrics: Delay
Total Delay (Latency): Amount of time for traversal of all packets
from source to destination.
Total delay = Processing time + Queuing time
+Transmission time + Propagation time
Processing Time: Time for examining packet header, determining
the next stop and checking bit-level errors.
Queuing Time: Waiting time before transmission. It depend on
amount of packets already in queue. If queue is empty then queueing
time will be zero.
Transmission Time: Time for transmitting all the packet’s bits into
Message size (bits)
the communication link. It is given by bandwidth (bits per second) s
Propagation Time: Amount of time required for bits for travelling
distance
between source and destination. It is given by propagation speed . The
propagation speed of electromagnetic signal in vacuum is 3 × 108
m/s > speed in the cable (two-third of speed of light)
Dr. Sudhir Kumar (Assistant Professor Department of Electrical
InternetEngineering,
- Part 2 Indian Institute of Technology
AprilPatna,
18, 2020
India) 21 / 27
Performance Metric [Forouzan page 89+]

Analogy for delay: cars and toll tax on a highway [Kurose P38]
Jitter: It is the variation in delay of received packets. Different
packets experience different delays.
Throughput: It is the ratio of number of bits at the receiver and
time elapsed. It is less (may be because of congestion or other
practical constraints) than the theoretical limit called bandwidth.
Bandwidth-Delay Product: Number of bits that can fit in the link.
Analogy: bandwidth is cross-section of a pipe, delay is length of the
pipe and volume of the pipe is bandwidth-delay product.

Dr. Sudhir Kumar (Assistant Professor Department of Electrical


InternetEngineering,
- Part 2 Indian Institute of Technology
AprilPatna,
18, 2020
India) 22 / 27
Performance Metric and Example [Forouzan page 89+]

Packet Loss: The capacity of buffer (queue) is finite. If the packet


arrives and queue is full, the router drops the packet and it is lost.
The loss is proportional to traffic intensity.

1 Determine the transmission time and propagation time for a 10 kb


message over a bandwidth of 100 Mbps. The distance between source
and destination is 2000 km and propagation speed in cable is 2 × 108
m/s.
Transmission time = 10×1024
100×106 = 0.0001024 s = 0.1024 ms
2000×1000
Propagation time = 2×108 0.01 s = 10 ms
2 We can send on an average 10,000 frame per minute with each frame
is made of 6000 bits. Determine the throughput of this 5 Mbps
bandwidth network
Throughput = 10,000×6000
60 = 1 × 106 bps = 1 Mbps which is less than
theoretical 5 Mbps bandwidth network

Dr. Sudhir Kumar (Assistant Professor Department of Electrical


InternetEngineering,
- Part 2 Indian Institute of Technology
AprilPatna,
18, 2020
India) 23 / 27
Throughput of the Network [Ammar+Kurose]
Analogy: Connection of pipes and water is flowing through it.
The throughput of the network in Figure a and b are, respectively,
given by
Throughput = min{R1 , R2 }

R
, R2 }
Throughput = min{R1 ,
3
where R = transmission rate, R1 and R2 are the server and client
access rates respectively.

It can be generalized for multiple routers between source and


destination.
Dr. Sudhir Kumar (Assistant Professor Department of Electrical
InternetEngineering,
- Part 2 Indian Institute of Technology
AprilPatna,
18, 2020
India) 24 / 27
Exercise/Further Readings
1 Complete distance vector routing tables of example considered in the
text. Show how sharing of routing tables with immediate neighbours
helps in knowing the entire network. page 661 of Forouzan but
different example
2 Consider a four nodes topology where all three nodes want to connect
to the fourth node. Illustrate the instability using count-to-infinity of
these three nodes when the link to fourth node goes down/fail. page
665 of Forouzan
3 What split horizon technique for addressing issue in distance vector
routing? page 664-665 of Forouzan
4 Find the shortest path from node A to node E in the following figure.
Notes and Ans: A-B-C-E

Dr. Sudhir Kumar (Assistant Professor Department of Electrical


InternetEngineering,
- Part 2 Indian Institute of Technology
AprilPatna,
18, 2020
India) 25 / 27
Exercise/Further Readings contd...

1 Why do we use different interior and exterior gateway routing


protocols? Kurose page 398
2 Covert the following autonomous system to a directed graph of
autonomous system. N and R = node, L2 to L4 bidirectional, L1 and
L5 = stub n/w and so unidirectional towards it, Stalling page 624-625

3 Determine the time the network takes for transfer of 10 kb in figure


of Throughput of the Network slide.
4 In the previous question, if the there are two parallel routes having
the same rate, what is throughput of the network. 2 times unlike
figure (b) of that slide, Ammar book, p52
Dr. Sudhir Kumar (Assistant Professor Department of Electrical
InternetEngineering,
- Part 2 Indian Institute of Technology
AprilPatna,
18, 2020
India) 26 / 27
References

1 Tannenbaum, Andrew S. Computer networks. Pearson Education India, 2002.


2 Forouzan, A. Behrouz. Data communications and networking. Tata McGraw-Hill Education, 2007.
3 Rayes, Ammar, and Samer Salam. ”Internet of things from hype to reality.” The Road to Digitization; River Publisher
Series in Communications; Springer: Basel, Switzerland 49 (2017).
4 Kurose, James F. Computer networking: A top-down approach featuring the internet. Pearson Education India, 2005.
5 Stallings, William. Data and computer communications. Pearson Education India, 2007.

Dr. Sudhir Kumar (Assistant Professor Department of Electrical


InternetEngineering,
- Part 2 Indian Institute of Technology
AprilPatna,
18, 2020
India) 27 / 27

You might also like