OSPF-Build an OSPF network, version 1.0

OSPF Definition: Open Shortest Path First (OSPF), is a routing protocol used to determine the correct route for packets within IP networks. It was designed by the Internet Engineering Task Force to serve as an Interior Gateway Protocol replacing RIP.

Advantages of OSPF:


Changes in an OSPF network are propagated quickly.

OSPF is heirarchical, using area 0 as the top as the heirarchy.

OSPF is a Link State Algorith

OSPF supports Variable Length Subnet Mask(VLSM)
OSPF uses multicasting within areas.

After initialization, OSPF only sends updates on routing table sections which have changed, it does not send the entire routing table.

Using areas, OSPF networks can be logically segmented to decrease the size of routing tables. Table size can be further reduced by using route summarization.

OSPF is an open standard, not related to any particular vendor.

Disadvantages of OSPF:

OSPF is very processor intensive.

OSPF maintains multiple copies of routing information, increasing the amount of memory needed.
Using areas, OSPF can be logically segmented (this can be a good thing and a bad thing).

OSPF is not as easy to learn as some other protocols.

In the case where an entire network is running OSPF, and one link within it is "bouncing" every few seconds, OSPF updates would dominate the network by informing every other router every time the link changed state (I've done this).


OSPF routers check the status of other routers on the network by sending a small hello packet at regular intervals. If a router does not respond to the hello packet, it is assumed dead, and routing updates are sent to every other router by using a multicaste address.



In the case where there are no network changes, OSPF will use very little bandwidth (only sending hello packets). As soon as there is an outage, however, OSPF will flood the network as the change is sent to every router (and then every router notifies every other router about the change). This system of near silence when possible and flooding when necessary ensures that routing information gets propagated throughout the network as quickly as possible.


It's now time to...



Build an OSPF network, version 1.0


Scenario: Camp Swampy is running out of IP addresses. They have a fully meshed base backbone consisting of five seperate routers, here known as A through E:
Camp Swampy's Base Network Topology




Camp Swampy has been given the Class B network 181.160.0.0. The network uses IGRP as their routing protocol, and they are using an 8 bit subnet mask (255.255.255.0).



Since IGRP does not support VLSM`s , Camp Swampy is forced to use an 8 bit mask throughout their entire network. For networks that contain users, this should be acceptable, but for network connections, such as the network that connects A and B, this is a huge waste of IP ADDRESS. We will rebuild their base network using OSPF for one reason only: To free up IP addresses by using Variable Length Subnet Masks.



This means we are going to have to get into binary, just a little...



Pick a class C equivalent network (in other words, pick a number out of the range available in their third octet), and use it for network connections within their base backbone. In this case, lets use 181.160.254.0. We could use a 14 bit subnet mask, 255.255.255.252 (which would only leave two bits for the host part) to get the maximum number of networks out of the 254 subnet, but that only allows two hosts per network. Since the Camp Swampy admin regularly put sniffers and other devices on their network connections, we need to scale the subnet mask back a bit to 13, 255.255.255.248 (leaves three bits for hosts, a total of 6 possible devices on each net).



You can't use the first or last network to connect to hosts, since the first net is always the network address for the ENTIRE network (for instance, you don't see many IP addresses like 181.160.0.1), and the broadcast address for the last subnetted network is also the broadcast address for the ENTIRE network .
Here's what is entered on the "A" Router to implement the change to OSPF: A-router# config t
Enter configuration commands, one per line. End with CNTL/Z.
A-router(config)# interface e 0 A - B connection
A-router(config-if)# ip address 181.160.254.9 255.255.255.248
A-router(config-if)# exit
A-router(config)# interface e 1 A - C connection
A-router(config-if)# ip address 181.160.254.41 255.255.255.248
A-router(config-if)# exit
A-router(config)# interface e 2 A - D connection
A-router(config-if)# ip address 181.160.254.49 255.255.255.248
A-router(config-if)# exit
A-router(config)# interface e 3 A - E connection
A-router(config-if)# ip address 181.160.254.81 255.255.255.248
A-router(config-if)# exit
A-router(config)# no router igrp 200 turn off igrp routing
A-router(config)# router ospf 1 start ospf routing, Autonomous System # 1
A-router(config)# network 181.160.0.0 0.0.255.255 area 0 entire net is area 0
A-router(config)# ^Z
A-router(config)# write save the configuration

BGP-show ip bgp injected-paths

show ip bgp injected-paths
To display all the injected paths in the BGP routing table, use the show ip bgp injected-paths command in EXEC mode.show ip bgp injected-paths
Syntax Description: This command has no arguments or keywords.
Command Modes EXEC
Examples


BGP As_path Attribute

Whenever a route update passes through an AS, the AS number is prepended to that update. The AS_path attribute is actually the list of AS numbers that a route has traversed in order to reach a destination.
An AS−SET is an ordered mathematical set {} of all the ASs that have been traversed. An example of AS−SET is given later.
In the above example, network 190.10.0.0 is advertised by RTB in AS200, when that route traverses AS300 and RTC will append its own AS number to it. So when 190.10.0.0 reaches RTA it will have two AS numbers attached to it: first 200 then 300. So as far as RTA is concerned the path to reach 190.10.0.0 is (300,200).
The same applies for 170.10.0.0 and 180.10.0.0. RTB will have to take path (300,100) i.e. traverse AS300 and then AS100 in order to reach 170.10.0.0. RTC will have to traverse path (200) in order to reach 190.10.0.0 and path (100) in order to reach 170.10.0.0.




eBGP and iBGP

eBGP and iBGP
If an AS has multiple BGP speakers, it could be used as a transit service for other ASs. As you see below, AS200 is a transit AS for AS100 and AS300.
It is necessary to ensure reachability for networks within an AS before sending the information to external ASs. This is done by a combination of internal BGP (iBGP) peering between routers inside an AS and by redistributing BGP information to Internal Gateway Protocols (IGPs) running in the AS.
As far as this paper is concerned, when BGP is running between routers belonging to two different ASs, we call this exterior BGP (eBGP). When BGP is running between routers in the same AS, we call this iBGP.










BGP-How Does BGP Work

How Does BGP Work ?

BGP uses TCP as its transport protocol (port 179). Two BGP routers form a TCP connection between one another (peer routers) and exchange messages to open and confirm the connection parameters.BGP routers exchange network reachability information. This information is mainly an indication of the full paths (BGP AS numbers) that a route should take in order to reach the destination network. This information helps in constructing a graph of ASs that are loop−free and where routing policies can be applied in order to enforce some restrictions on the routing behavior.Any two routers that have formed a TCP connection in order to exchange BGP routing information are called peers, or neighbors. BGP peers initially exchange their full BGP routing tables. After this exchange, incremental updates are sent as the routing table changes. BGP keeps a version number of the BGP table, which should be the same for all of its BGP peers. The version number changes whenever BGP updates the table due to routing information changes. Keepalive packets are sent to ensure that the connection is alive between the BGP peers and notification packets are sent in response to errors or special conditions.