You are on page 1of 10

1

KARNATAK LAW SOCIETY’S

GOGTE INSTITUTE OF TECHNOLOGY


UDYAMBAG, BELAGAVI-590008

(An Autonomous Institution under Visvesvaraya Technological University, Belagavi)


(APPROVED BY AICTE, NEW DELHI)

Department of Electronics and Communication Engineering

An Course Activity Report(WMC) on


Simulation of BGP/OSPF Routing Protocol

Submitted in the partial fulfillment for the award of the degree of

Bachelor of Engineering

In

Electronics and Communication Engineering

Submitted by

R SUJITH 2GI17EC090

PRATIKSHA PENDSE 2GI17EC084

PRAJWAL H 2GI17EC075

PRATIBHA PB 2GI17EC081
2

INTRODUCTION

Border Gateway Protocol is the protocol that makes the Internet work. Networks or
autonomous systems that need to interact with each other do so through peering, which
is made possible with BGP.

When one network router is connected to other networks it cannot determine which
network is the best network to send its data to by itself. Border Gateway Protocol
considers all peering partners that a router has and sends traffic to the router that is
closest to the data’s destination. This communication is possible because, at boot, BGP
allows peers to communicate their routing information and then stores that information
in a Routing Information Base (RIB).

Issues with Border Gateway Protocol

Border Gateway Protocol was originally created in 1989 as a quick fix for the Internet
but it has remained the primary protocol for long distance traffic. Since then, however,
cyber threats have evolved and BGP has not kept up.

Border Gateway Protocol abuse is called BGP hijacking which is possible because the
protocol relies on trusting advertised routes. There have been multiple attempts at
making a more secure version of BGP but implementation is extremely problematic.
Most of the new versions are unable to communicate with standard BGP which means
that every AS across the world would have to adopt the new protocol simultaneously.

A few BGP incidents that have taken place in the past include:

 In 2004, TTNet, a Turkish Internet service provider (ISP), advertised bad BGP
routes that claimed they were the best destination for all traffic on the Internet.
The issues only lasted one day but many people across the world were unable to
access the Internet.
 In 2008, a Pakistani ISP attempted to block Pakistani users from accessing
YouTube by routing traffic to a black hole. The route was accidentally advertised
to neighboring routers which propagated the route across the world. In this
instance, YouTube was only inaccessible for several hours.
 In 2018 attackers deliberately created bad BGP routes to redirect traffic meant
for Amazon’s DNS service. By redirecting the traffic to themselves, they were
able to steal $100,000 of cryptocurrency.
3

WORKING

The previous section covers how Border Gateway Protocol allows autonomous systems
to interact; this section will give a small insight into how to actually implement the
protocol and create peering relationships.

One of the most popular networking equipment companies in the world is Cisco.
The  below shows how to enable BGP and configure a peer on a Cisco Nexus 7000
series switch.

[enter configuration mode] switch# configure terminal [enable BGP and assign
the ASN 64496] switch(config)# router bgp 64496 [configure the IP and ASN for
a peer] switch(config-router)# neighbor 209.165.201.1 remote-as 64497 [add a
description for the peer] switch(config-router-neighbor)# description Peer
Router B [enter the neighbor address family configuration mode] switch(config-
router-neighbor)# address-family ipv4 unicast [save configuration changes]
switch(config-router-neighbor-af) copy running-config startup-config

Another popular vendor is Juniper Networks which has its own operating system called
Junos OS. The operating system’s command line varies slightly from Cisco’s. To
configure a peering relationship that is the same as the example above you would issue
the following commands:

[enable BGP and assign the ASN 64496] set routing-options autonomous-system
64496 [define the external-peers group and type] set protocols bgp group
external-peers type external [add a neighbor to external-peers] set protocols
bgp group external-peers neighbor 209.165.201.1 peer-as 64497
Examples of Border Gateway Protocol

Border Gateway Protocol use cases can be found anywhere that two networks need to
exchange traffic such as Internet exchange points (IXPs). They can also be found within
a single meshed network where routers need to communicate information to forward
traffic.

ADVATAGES

1. Internet service advantages


If you're an Internet service provider (ISP), running BGP in your network is almost a must. I've
seen consumer-focused ISPs that tried to get around this recommendation and used BGP solely
to peer with their upstream ISPs, but they eventually had to bite the bullet and deploy BGP to
increase the stability of their network, provide end-to-end quality-of-service or penetrate
enterprise markets. Enterprise-focused ISPs have to run BGP from the start to support their
multi-homed customers).
4

2. Layer 3 VPN services

We've seen a variety of technologies used to implement Layer 3 VPN services in recent years,


and MPLS-based VPNs have undoubtedly proven to be the most scalable solution, partly due to
using BGP as the underlying routing protocol. Fortunately, you don't have to deploy BGP
everywhere in your network if you want to deploy MPLS/VPN solutions. It's enough to deploy
BGP on the Provider Edge (PE) routers that connect your VPN customers and on a few core
devices that act as route servers (these devices should not be expected to forward heavy traffic
loads).
3. Increasing network stability
Although I've met networking engineers trying to use BGP as the sole routing protocol in their
networks, that's not how you should use it. Any decent BGP design should rely on another faster
routing protocol (for example, OSPF, EIGRP or IS-IS) to provide core routing in the network,
with BGP responsible for the edge/customer routing.

With the separation of core and edge routing into two routing protocols, your network core
becomes more stable, as the edge problems cannot disrupt the core. This design has been used
very successfully in large enterprise networks with haphazard addressing schemes that defied
attempts at route summarization. It should also be used in almost all service provider
environments. You should never carry your customers' routes in your core routing protocol, as
customer's internal problems could quickly affect the stability of your own network.

I must note that it's amazing what you can see in the field. I saw an ISP running OSPF with its
customers a few years ago. In that setup, a rogue or ignorant customer could have easily
disrupted the whole service provider network.

4. Automatic Response to Denial-of-Service Attacks


Among other peculiarities, BGP allows you to specify any IP address as the next-hop for an IP
prefix. This property is most-often used to ensure optimum routing across a BGP autonomous
system. You can also use it to implement network-wide sinkholes and remote blackholes to
quickly stop worms and denial-of-service attacks on your network.
5

Please note that you don't have to migrate your routing to BGP if you want to use these
mechanisms. To implement remote blackholes, it's enough that you deploy BGP on strategic
points in your network and link them via BGP sessions with a central router through which you'll
insert the IP addresses to block.

5. Large-scale QOS or web caching deployment


Not only does BGP carry a number of attributes describing the IP routes, it allows you to add
extra baggage to every IP route it advertises in the form of BGP communities that are totally
transparent to BGP (unless you're manually configuring route selection rules to use them) but
propagated throughout the network.

A few technologies completely unrelated to BGP allow you to use these attributes to implement
large-scale designs. For example, Quality-of-Service Policy Propagation with BGP
(QPPB) allows you to set QoS bits for specific BGP destinations based on BGP communities and
other BGP attributes. Similarly, you can control the Web Cache Communication Protocol
(WCCP)-based web caching policy with BGP.

ALGORTIHM

1 .Start.

2. Read the no. of nodes.

3. Read the distance between one node to the other for every node.

4. Assign the distance from a node to itself as zero.

5. Find the shortest path from the given node to other node and assign the same as
distance.

6. Print the distance from one node to every other node in form of a matrix.

7. Stop.
6

C Program To Simulate

#include<stdio.h>
int main()
{
int b[10][10],n,i,j,k,a[10][10];
printf("\nEnter the number of nodes: ");
scanf("%d",&n);
for(i=0; i<n; i++)
{
for(j=0; j<n; j++)
{
printf("\nEnter the distance between the host %d%d:", i+1,j+1);
scanf("%d",&a[i][j]);
}
}
for(i=0; i<n; i++)
{
for(j=0; j<n; j++)
printf("%d\t",a[i][j]);
printf("\n");
}
for(k=0; k<n; k++)
{
for(i=0; i<n; i++)
{
for(j=0; j<n; j++)
{
if(a[i][j]>a[i][k]+a[k][j])
a[i][j]=a[i][k]+a[k][j];
}
}
}
for(i=0; i<n; i++)
{
for(j=0; j<n; j++)
{
b[i][j]=a[i][j];
if(i==j)
b[i][j]=0;
}
}
printf("\nThe output matrix is:\n");
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
7

printf("%d\t",b[i][j]);
printf("\n");
}
return 0;
}

RESULTS/OUTPUT

Enter the number of nodes: 3

Enter the distance between the host 1 1:2

Enter the distance between the host 1 2:4

Enter the distance between the host 1 3:6

Enter the distance between the host 2 1:8

Enter the distance between the host 2 2:10

Enter the distance between the host 2 3:3

Enter the distance between the host 3 1:5

Enter the distance between the host 3 2:7

Enter the distance between the host 3 3:9


2     4     6
8     10     3
5     7     9

The output matrix is:


0     4     6
8     0     3
5     7     0
8

Examples of Border Gateway Protocol

Border Gateway Protocol use cases can be found anywhere that two networks need to
exchange traffic such as Internet exchange points (IXPs). They can also be found within
a single meshed network where routers need to communicate information to forward
traffic.

ADVATAGES

1. Internet service advantages


If you're an Internet service provider (ISP), running BGP in your network is almost a must. I've
seen consumer-focused ISPs that tried to get around this recommendation and used BGP solely
to peer with their upstream ISPs, but they eventually had to bite the bullet and deploy BGP to
increase the stability of their network, provide end-to-end quality-of-service or penetrate
9

enterprise markets. Enterprise-focused ISPs have to run BGP from the start to support their
multi-homed customers).
2. Layer 3 VPN services

We've seen a variety of technologies used to implement Layer 3 VPN services in recent years,


and MPLS-based VPNs have undoubtedly proven to be the most scalable solution, partly due to
using BGP as the underlying routing protocol. Fortunately, you don't have to deploy BGP
everywhere in your network if you want to deploy MPLS/VPN solutions. It's enough to deploy
BGP on the Provider Edge (PE) routers that connect your VPN customers and on a few core
devices that act as route servers (these devices should not be expected to forward heavy traffic
loads).
3. Increasing network stability
Although I've met networking engineers trying to use BGP as the sole routing protocol in their
networks, that's not how you should use it. Any decent BGP design should rely on another faster
routing protocol (for example, OSPF, EIGRP or IS-IS) to provide core routing in the network,
with BGP responsible for the edge/customer routing.

With the separation of core and edge routing into two routing protocols, your network core
becomes more stable, as the edge problems cannot disrupt the core. This design has been used
very successfully in large enterprise networks with haphazard addressing schemes that defied
attempts at route summarization. It should also be used in almost all service provider
environments. You should never carry your customers' routes in your core routing protocol, as
customer's internal problems could quickly affect the stability of your own network.

I must note that it's amazing what you can see in the field. I saw an ISP running OSPF with its
customers a few years ago. In that setup, a rogue or ignorant customer could have easily
disrupted the whole service provider network.

4. Automatic Response to Denial-of-Service Attacks


Among other peculiarities, BGP allows you to specify any IP address as the next-hop for an IP
prefix. This property is most-often used to ensure optimum routing across a BGP autonomous
system. You can also use it to implement network-wide sinkholes and remote blackholes to
quickly stop worms and denial-of-service attacks on your network.
10

Please note that you don't have to migrate your routing to BGP if you want to use these
mechanisms. To implement remote blackholes, it's enough that you deploy BGP on strategic
points in your network and link them via BGP sessions with a central router through which you'll
insert the IP addresses to block.

5. Large-scale QOS or web caching deployment


Not only does BGP carry a number of attributes describing the IP routes, it allows you to add
extra baggage to every IP route it advertises in the form of BGP communities that are totally
transparent to BGP (unless you're manually configuring route selection rules to use them) but
propagated throughout the network.

A few technologies completely unrelated to BGP allow you to use these attributes to implement
large-scale designs. For example, Quality-of-Service Policy Propagation with BGP
(QPPB) allows you to set QoS bits for specific BGP destinations based on BGP communities and
other BGP attributes. Similarly, you can control the Web Cache Communication Protocol
(WCCP)-based web caching policy with BGP.

You might also like