Tuesday, April 3, 2012

The OSPF Stub Area

The Open Shortest Path First routing protocol is a critical piece of knowledge for any networking professional working in an enterprise environment. Most major networking certifications covering routing and switching including the Cisco Certified Network Associate (CCNA), Cisco Certified Network Professional (CCNP), and Cisco Certified Internetwork Expert (CCIE) extensively test OSPF knowledge and skills. OSPF is the most popular dynamic routing protocol used in complex enterprise networks. This post will describe some of the important aspects of the OSPF Stub Area as it exists in the Cisco IOS implementation of the OSPF routing protocol. This OSPF lab is built in Dynamips/GNS3 utilizing Cisco c3725 routers.

The OSPF implementation in Cisco IOS recognizes 5 main classifications of areas:
The descriptions of networks in the RFCs for OSPF are classified between what are called "transit" and "stub" networks. Transit networks differ from stub networks in that they can carry traffic which is neither locally originated nor locally destined. Areas follow the same idea, but more on a scale of breaking a network into smaller pieces containing multiple networks (defined from a layer 3 perspective).

From an OSPF design perspective, areas represent sections of the enterprise network where it is advantageous for all of the routers in an area to have detailed topology information and have the ability to make detailed routing decisions involving the shortest path to a destination (as calculated by Djikstra's algorithm). For stub areas, this isn't typically necessary because the networks outside of the stub area are reachable by 1-2 equal cost paths and are easily represented by a default route within the stub area. Stub areas automatically filter type 5 (external) LSAs and optionally filter type 3 (summary) LSAs depending on whether the totally stubby option is chosen. The only traffic flowing into a stub area is the traffic that is either locally originated or destined for that particular area.

The following topology creates a backbone area and a stub area for further consideration:



The autonomous system border router (ASBR) in the topology redistributes connected subnets (to get E2 routes and 5 LSAs into the OSPF database) for area 0. The internal routers and interfaces ( ASBR s0/0, Area0, and Area1) are configured in a similar way to the single area OSPF example. To avoid being repetitive, I will start the configuration discussion with the area border router (ABR) router. First, assign IP addresses to the interfaces,


interface Serial0/0
 ip address 10.0.1.2 255.255.255.0
!
interface Serial0/1
 ip address 192.168.0.1 255.255.255.0
!



Then configure OSPF as you normally would. In this case, the area stub command is necessary to have routers in area 1 agree that the area is a stub area.


router ospf 1
 log-adjacency-changes
 area 1 stub
 network 10.0.1.0 0.0.0.255 area 0
 network 192.168.0.0 0.0.0.255 area 1
!



Now, there are 3 points of interest int he network. Looking at the internal router for area 0, Area0, We see both routing table entries and database entries for all networks in the diagrams.


Area0#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     1.0.0.0/24 is subnetted, 1 subnets
O E2    1.1.1.0 [110/100] via 10.0.0.1, 01:22:24, Serial0/0
     10.0.0.0/24 is subnetted, 2 subnets
C       10.0.0.0 is directly connected, Serial0/0
C       10.0.1.0 is directly connected, Serial0/1
O IA 192.168.0.0/24 [110/128] via 10.0.1.2, 01:19:22, Serial0/1
O IA 192.168.1.0/24 [110/129] via 10.0.1.2, 01:19:13, Serial0/1



We see that the OSPF database for area 0 has type 1 and type 2 LSAs that provide routers in area 0 with a full topology in area 0. There are type 3 (summary) LSAs  originating from the ABR for area 1 that contain the 192.168.x.x networks. We also see a type 5 LSA for the E2 route advertised by the ASBR. We do not see any type 4 (ASBR Summary) LSAs because we have no ASBRs in other areas.


Area0#show ip ospf database

            OSPF Router with ID (10.0.1.1) (Process ID 1)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
1.1.1.1         1.1.1.1         1393        0x80000006 0x008AE9 2
10.0.1.1        10.0.1.1        1264        0x80000006 0x00222B 4
192.168.0.1     192.168.0.1     1122        0x80000004 0x003A6D 2

                Summary Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
192.168.0.0     192.168.0.1     1122        0x80000003 0x0044E2
192.168.1.0     192.168.0.1     1122        0x80000003 0x0043E1

                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag
1.1.1.0         1.1.1.1         1393        0x80000003 0x00C482 0



One potential point of confusion is that there are Type 1 LSAs that are being advertised by the router ID 192.168.0.1. This is only the router ID that was chosen, all of the 192.168.x.x interfaces exist in Area 1. This is evident from examining the LSA on the router that is internal to area 0:


Area0#show ip ospf database router 192.168.0.1

            OSPF Router with ID (10.0.1.1) (Process ID 1)

                Router Link States (Area 0)

  Routing Bit Set on this LSA
  LS age: 1325
  Options: (No TOS-capability, DC)
  LS Type: Router Links
  Link State ID: 192.168.0.1
  Advertising Router: 192.168.0.1
  LS Seq Number: 80000004
  Checksum: 0x3A6D
  Length: 48
  Area Border Router
  Number of Links: 2

    Link connected to: another Router (point-to-point)
     (Link ID) Neighboring Router ID: 10.0.1.1
     (Link Data) Router Interface address: 10.0.1.2
      Number of TOS metrics: 0
       TOS 0 Metrics: 64

    Link connected to: a Stub Network
     (Link ID) Network/subnet number: 10.0.1.0
     (Link Data) Network Mask: 255.255.255.0
      Number of TOS metrics: 0
       TOS 0 Metrics: 64


Now we look at the ABR. Databases and routing tables tend to be more interesting on area border routers because they have complete topology databases for more than one area. Additionally, ABRs create and advertise default routes for other routers that are internal to stub areas, but they do not install the default route themselves. When we examine the OSPF database for the ABR, it is apparent that there are 2 complete databases (one for area 0, and one for area 1).

ABR#show ip ospf database

            OSPF Router with ID (192.168.0.1) (Process ID 1)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
1.1.1.1         1.1.1.1         2008        0x80000006 0x008AE9 2
10.0.1.1        10.0.1.1        1880        0x80000006 0x00222B 4
192.168.0.1     192.168.0.1     1736        0x80000004 0x003A6D 2

                Summary Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
192.168.0.0     192.168.0.1     1736        0x80000003 0x0044E2
192.168.1.0     192.168.0.1     1736        0x80000003 0x0043E1

                Router Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum Link count
192.168.0.1     192.168.0.1     1736        0x80000005 0x00E8A4 2
192.168.1.1     192.168.1.1     1887        0x80000004 0x00F819 3

                Summary Net Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum
0.0.0.0         192.168.0.1     1736        0x80000003 0x009B36
10.0.0.0        192.168.0.1     1748        0x80000003 0x001434
10.0.1.0        192.168.0.1     1748        0x80000003 0x008601

                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag
1.1.1.0         1.1.1.1         3           0x80000004 0x00C283 0



The routing table also reflects all of the routes installed from both areas (but not the default route created by the ABR and flooded to the Area1 router).


ABR#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route


Gateway of last resort is not set

     1.0.0.0/24 is subnetted, 1 subnets
O E2    1.1.1.0 [110/100] via 10.0.1.1, 01:37:34, Serial0/0
     10.0.0.0/24 is subnetted, 2 subnets
O       10.0.0.0 [110/128] via 10.0.1.1, 01:37:34, Serial0/0
C       10.0.1.0 is directly connected, Serial0/0
C    192.168.0.0/24 is directly connected, Serial0/1
O    192.168.1.0/24 [110/65] via 192.168.0.2, 01:37:19, Serial0/1



Now, we look at the router that is internal to area 1, the stub area. We can see from the routing table that the default route is installed, but the E2 route advertised by ASBR has disappeared. This is because stub areas do not propagate type 5 (external) LSAs. In this configuration, type 3 LSAs are still propagated, but this can be modified using a totally stubby area.


Area1#show ip route
Gateway of last resort is 192.168.0.1 to network 0.0.0.0

     10.0.0.0/24 is subnetted, 2 subnets
O IA    10.0.0.0 [110/192] via 192.168.0.1, 01:42:47, Serial0/0
O IA    10.0.1.0 [110/128] via 192.168.0.1, 01:42:47, Serial0/0
C    192.168.0.0/24 is directly connected, Serial0/0
C    192.168.1.0/24 is directly connected, Loopback0
O*IA 0.0.0.0/0 [110/65] via 192.168.0.1, 01:42:47, Serial0/0


The database also shows no type 5 (external) LSAs, but we see that the default route is propagated as a type 3 (network summary) LSA:

Area1#show ip ospf database

            OSPF Router with ID (192.168.1.1) (Process ID 1)

                Router Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum Link count
192.168.0.1     192.168.0.1     279         0x80000006 0x00E6A5 2
192.168.1.1     192.168.1.1     418         0x80000005 0x00F61A 3

                Summary Net Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum
0.0.0.0         192.168.0.1     279         0x80000004 0x009937
10.0.0.0        192.168.0.1     279         0x80000004 0x001235
10.0.1.0        192.168.0.1     279         0x80000004 0x008402



In later posts, we will go into the details of totally stubby areas and the effects of the NSSA option.

See Also:
The Road to the CCIE

Thursday, March 29, 2012

Singe Area OSPF Routing Example

The Open Shortest Path First routing protocol is a critical piece of knowledge for any networking professional working in an enterprise environment. Most major networking certifications covering routing and switching including the Cisco Certified Network Associate (CCNA), Cisco Certified Network Professional (CCNP), and Cisco Certified Internetwork Expert (CCIE) extensively test OSPF knowledge and skills. OSPF is the most popular dynamic routing protocol used in complex enterprise networks. This example will demonstrate the concepts and configuration involved with setting up a single area OSPF network. This lab is built using Dynamips/GNS3 and shows configuration using Ethernet as the layer 2 switching protocol between the routers. Frame Relay will be covered in a different post because there are special issues involving network types and non-broadcast multiaccess (NBMA) networks.

For our topology we will be demonstrating basic OSPF routing using 2 virtual Cisco c7200 routers and 2 Cisco c3725 routers configured in the following topology. There is also another c3725 router that is being used as an Ethernet Switch in the virtual topology:



There are two ways to configure OSPF for IPv4 networks. OSPF can be configured directly on the interface or using the global router ospf command. Most organizations develop standards for using one or the other, since troubleshooting complexity can increase if both are used throughout a network. If both are specified, the interface configuration takes precedence over the global configuration.

Let's start out by configuring the necessary interfaces in the backbone area (area 0):
Router Configuration
R1 interface GigabitEthernet0/0
 ip address 192.168.0.1 255.255.255.252
!
interface FastEthernet1/0
 ip address 10.0.0.1 255.255.255.248
!
R2 interface GigabitEthernet0/0
 ip address 192.168.0.2 255.255.255.252
!
interface FastEthernet1/0
 ip address 10.0.0.2 255.255.255.248
!
R3 interface FastEthernet0/0
 ip address 10.0.0.3 255.255.255.248
!
R4 interface FastEthernet0/1
 ip address 10.0.0.4 255.255.255.248
!

Next, configure the routing protocols on the 4 routers:

Router OSPF Configuration
R1 router ospf 1
 router-id 1.1.1.1
 log-adjacency-changes
 auto-cost reference-bandwidth 1000
 network 10.0.0.0 0.0.0.7 area 0
 network 192.168.0.0 0.0.0.3 area 0
!
R2 router ospf 1
 router-id 2.2.2.2
 log-adjacency-changes
 auto-cost reference-bandwidth 1000
 network 10.0.0.0 0.0.0.7 area 0
 network 192.168.0.0 0.0.0.3 area 0
!
R3 router ospf 1
 router-id 3.3.3.3
 log-adjacency-changes
 auto-cost reference-bandwidth 1000
 network 10.0.0.0 0.0.0.7 area 0
!
R4 router ospf 1
 router-id 4.4.4.4
 log-adjacency-changes
 auto-cost reference-bandwidth 1000
 network 10.0.0.0 0.0.0.7 area 0
!

Why did we change the default bandwidth used in the OSPF metric calculation? In this case, we have Gigabit Ethernet interfaces and using the default reference bandwidth of 100 Mb/s, the Fast Ethernet and Gigabit Ethernet interfaces would have the exact same cost of 1. See OSPF Cost/Metric Calculation for more details.  Additionally, we statically set the router IDs. If we did not do this, then the router id would be determined by the following, listed from highest precedence to lowest precedence:
  • Statically assigned OSPF router ID (highest)
  • Highest IPv4 address of up/up loopback interface
  • Highest IPv4 address of up/up interface on router (lowest)
If the OSPF process can't determine a valid router ID (this happens when none of the above are configured or in native IPv6 implementations of OSPF with no RID specified), the OSPF process does not start. Note also that the ospf process IDs in the configuration above do not have to match, but sometimes this can be convenient on larger networks if multiple OSPF routing domains are used.

With the configuration above, the OSPF database consists of 6 LSAs: 4 router LSAs (type 1) and 2 transit networks (type 2 LSAs):

R3#show ip ospf database

            OSPF Router with ID (3.3.3.3) (Process ID 1)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
1.1.1.1         1.1.1.1         493         0x80000007 0x000A13 2
2.2.2.2         2.2.2.2         486         0x80000007 0x00E52D 2
3.3.3.3         3.3.3.3         76          0x80000007 0x00A44C 1
4.4.4.4         4.4.4.4         533         0x80000005 0x006A7F 1

                Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
10.0.0.4        4.4.4.4         77          0x80000005 0x00905E
192.168.0.2     2.2.2.2         737         0x80000003 0x00FDBD



In this instance, the OSPF database is not fully optimized because the Gi0/0 interfaces for R1 and R2 are point to point IP links. We can reduce the size of the OSPF database in this example by setting the OSPF network type to point-to-point. Even with the /30 (255.255.255.252) mask, OSPF still considers this a broadcast network. To resolve this on R1 and R2:


R1(config)#Interface GigabitEthernet 0/0
R1(config-if)#ip ospf network point-to-point


After making this change on R1 and R2, we now have the OSPF database reduced to 5 total LSAs:


R3#show ip ospf database

            OSPF Router with ID (3.3.3.3) (Process ID 1)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
1.1.1.1         1.1.1.1         97          0x80000008 0x0017F1 3
2.2.2.2         2.2.2.2         15          0x80000008 0x00DC26 3
3.3.3.3         3.3.3.3         447         0x80000007 0x00A44C 1
4.4.4.4         4.4.4.4         904         0x80000005 0x006A7F 1

                Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
10.0.0.4        4.4.4.4         448         0x80000005 0x00905E


Something else worth noting is that in a single area, OSPF only propagates type 1 and type 2 LSAs. An Area Border Router (ABR) autonomous system border router (ASBR) is required to see any of the other LSA types that are related to unicast routing.


See Also
The Road to the CCIE
The OSPF Stub Area

Wednesday, March 28, 2012

Personal Cash Flow Basics

Personal financial literacy is the first step towards developing true financial security and realizing a dream of quitting a job or having a comfortable retirement. I received an MBA in accounting and now I use my knowledge to help others. People and businesses have a lot of difficulty managing cash flow. Even though most people have an idea of what they make and spend, timing issues can occasionally cause bounced checks, rejected payments, and other issues. In the worst cases, individuals resort to using credit cards or payday loans to smooth income, but this tends to cause more problems than it solves.

You might ask what makes me an authority on cash flow? Besides having an MBA and a strong background in economics, finance, and accounting, I am one of the few people in the world who has never had a missed or late payment. Among other things, my credit reports routinely show no negative items and no late payments. Looking back over my late high school years and college years this is astonishing because I made many of the mistakes that young people make with credit (e.g. eating out on credit cards, financing a car through the dealership, "12 months with no interest," etc.). Ultimately I made it through because I had a good sense of cash flow management and effectively managed inflows and outflows. I even had the foresight through the cash flow modeling process to change jobs to higher paying positions months in advance of upcoming financial issues (due to rent increases and other major changes in expense composition).

This post will be less about the statement of cash flows than cash flow planning because individuals are forced to operate on the cash basis of accounting either indirectly or directly. Planning and timing are more important than retrospective analysis for individuals. Businesses use a statement of cash flow to show how cash actually moves in and out of a business since the numbers on an income statement differ significantly from actual cash flow. The income statement includes a lot of non-cash items like depreciation, certain unrealized gains and losses, and really unintuitive things around consolidation and pensions that do not affect cash (or distort the actual change in cash). For the most part, individuals prepare their balance sheets and income statements on the cash basis or on a fair value basis (vs. the historic basis that companies use). This basis typically reflects:
  • Income/expenses measured on the receipt/disbursement of cash
  • Fair value of investments, vehicles, and real estate property if they were to be converted to cash (sold). Changes in fair value recorded directly in equity.
  • Settlement amount required for liabilities (e.g. pay off a mortgage or car loan today)
Going back to the bookkeeping example, John Doe would immediately expense all of the prepaid insurance under the cash basis when he wrote the check instead of making adjusting entries. Interest would also be treated differently on the income statement example because the loan payment and the interest would both be expended instead of offsetting the principal payment against the liability on the balance sheet.

So why does cash flow timing cause so many problems?

Let's take a simple example where John Doe starts a new job that pays around $4,000/month after taxes and he is paid on the last working day of the month. I use this example because I faced the exact same situation with my last job change where I changed from bi-weekly to monthly pay. Let's also say that John Doe has $3500 of bills that are mostly due on the 1st, 7th, 15th, and 28th days of the month. Before John can even take the job, he needs to have $3,500 in cash sitting in checking or savings, or else he will be stuck incurring $3,500 in payday loans or credit card debt during the first month of working in order to cover bills. This is a bad situation to encounter. Typically cash inflows spike throughout the month (for biweekly employees) and the average individual can handle a pay lag of 2 weeks much more easily than 1 month. Planning a missed paycheck (especially a monthly one) can be very difficult if things are tight.

Ultimately the key to controlling cash and preventing late payments is to identify all inflows and outflows and the day(s) of the month that they need to occur. Then a spreadsheet or database can be kept that shows the projected amount of money that needs to be kept in an account at any point in time based on budgeted inflows and outflows to support on-time payments for everything. It is not necessary to track things down to the day. For many years, I used a spreadsheet that showed by-weekly inflows/outflows and I showed all outflows going out the pay period before they were due. Additionally I used the conditional formatting feature of Excel to tel me if my projected account balance was ever below a minimum threshold (in my case I chose $100). Using this strategy I could also easily plan out debt payoff scenarios and understand what was left to go to savings and other purchases.

If cash outflows are systematically greater than inflows, then changes need to be made. Bills need to be reduced or a higher income needs to be sought from a job change or a business expansion.

Good cash flow management is only part of a solid financial picture, effort also needs to be made to ensure that expenses (not necessarily cash flows) are kept below monthly revenues so that bigger replacement purchases (ex. cars, appliances, computers, etc.) don't create a balance sheet problem when they need to be made.

See Also
Retirement in the 21st Century
The Personal Balance Sheet
The Personal Income Statement
Basic Bookkeeping for Everyone

Basic Bookkeeping for Everyone

Personal financial literacy is the first step towards developing true financial security and realizing a dream of quitting a job or having a comfortable retirement. I received an MBA in accounting and now I use my knowledge to help others. In this post, I'll cover some of the basic transactions that an individual is likely to see and how they impact the personal income statement and balance sheet. It is necessary to understand the basics of the personal income statement and balance sheet before reading this post, as some of the meaning may be lost without understanding the financial statements that these transactions affect.

Accountants spend a lot of time thinking about the recognition and economic measurement surrounding a set of business events. Bookkeepers focus on the proper entry of data into the main operational financial records: the general ledger and the general journal.  The journal tracks specific events as they affect different accounts and the ledger keeps track of the balances in each account. Operationally, information first appears in the journal and is then transferred to the ledger. The entries in the journal, creatively called "journal entries," illustrate different events like these:
  • Pay day
  • Taking out a new loan
  • Paying off a loan
  • Prepaying car insurance or health insurance
  • Paying other normal bills
  • Buying/Selling a house or a car
Journal entries are a list of accounts along with a debit or credit amount. Each transaction affects a minimum of two accounts (this is where the term "double entry bookkeeping" originates). The individual parts of a journal entry may affect an account that exists on the income statement or on the balance sheet. A fundamental identity for journal entries is the following:

debits = credits

This confuses a lot of people when they first explore the concept, but it becomes clearer with examples. Let's return to our friend, John Doe...

John gets paid $1500 for working for a week:
                     Dr.    Cr. 
Cash                1050
Tax Withheld         450
     Wage Income           1500 
   (to reflect pay day) 
In this case, we know that our cash in the bank increased by 1050. Cash is an asset that exists on the balance sheet. Tax withheld is either an expense or an asset, depending on your philosophy. In my case, I argue that it is an expense because you ultimately never see it and it doesn't do anything besides hurt your purchasing power. If you consider it an expense, it goes on the income statement; if you consider it a pre-paid expense, then it is on the balance sheet. Wage income is clearly a personal revenue account and exists on the income statement.

Next, John buys a house for $200,000 and pays $10,000 down with a $190,000 mortgage:

                     Dr.    Cr. 
Home              200,000
     Cash                  10,000
     Mortgage              190,000 
   (to reflect home purchase)
 
In this case, only the balance sheet is affected. The home is recorded for the purchase price, cash is reduced by $10,000, and a new liability, "Mortgage," is created for the principal value of the note. Interest is calculated periodically and is handled in a separate journal entry. We will consider loans for real estate, vehicles, and credit cards in a future post. As a final example, let's look at the purchase of a 6 month health insurance policy:

                             Dr.    Cr. 
Pre-paid health insurance    6,000 
      Cash                          6,000 
   (recorded for purchase of insurance policy) 

The examples above demonstrate the mechanics of transactions that happen at a discrete point in time, but at the end of a period there are entries that need to be made to adjust accounts that have changed due to the passage of time. These include things like interest on loans, changes in pre-paid expenses, accruals of new expenses (e.g. utilities, cable TV, rent in some cases). Below is an example of John's usage of pre-paid health insurance:

For the next 6 months, John would expense a portion of the health insurance policy at the end of the month:
                                 Dr.    Cr. 
Health insurance expense       1,000
     Pre-paid health insurance        1,000 
   (to reflect use of a month of coverage) 
 
Journal entries aren't typically complicated to figure out, the exercise typically involves identification of accounts and then an evaluation of the amounts that get applied. Assets, losses, and expenses increase with debits and decrease with credits. Liabilities, equity, revenues, and gains increase with credits and decrease with debits. In future posts I will typically directly state that we are increasing or decreasing an account, rather than referring to debit amounts and credit amounts.

Finally at the end of the month, income statement accounts are zeroed out and applied to accounts on the balance sheet (typically personal equity accounts). This allows the balance sheet to reflect the financial position for a person at a point in time (typically at the end of a week, month, quarter, or year). The main closing entry is a credit (or debit) of the difference between income and expense (or expense and income if expenses > income) to the personal equity account on the balance sheet.

Managing personal finances using double entry methods may seem cumbersome, but it allows an individual to stay close to their finances and understand the effects of each transaction on their overall financial and economic position. It also provides a framework for an individual or family to use to evaluate the effects of different possible purchases. Finally, the usefulness of double entry methods is that they allow an individual or family to manage their finances more along the lines that a business would (though businesses and governments are subject to rules that individuals are not).

See Also
Retirement in the 21st Century
The Personal Balance Sheet
The Personal Income Statement

Tuesday, March 27, 2012

The Personal Income Statement

Personal financial literacy is the first step towards developing true financial security and realizing a dream of quitting a job or having a comfortable retirement. In my last post I covered the basics of the personal balance sheet and how an individual's assets and liabilities look at a point in time. I also showed a couple of examples including a graduating student and a homeowner with an underwater mortgage. In this post, we will work more with the flows that affect the personal balance sheet: revenue, expenses, gains, and losses.

From a business perspective, revenues are different from gains in that revenues arise from a business' primary operating activities while gains arise from events that are not considered primary activities. For example, Best Buy would recognize revenue on merchandise that is sold in its stores while they might recognize a gain when a building is sold (in this case, it is assumed that the purchase and sale of real estate isn't one of Best Buy's primary operating activities). The same analogy holds for expenses and losses. Companies recognize expenses when they engage in activities that reduce the organization's economic resources and the activities that are closely related to the organization's primary purpose. Losses are often tied to events that are not routine and infrequent in nature.

One of the causes of difficulty for the lower and middle classes is that it is a lot easier to generate expenses and losses than it is to generate revenues and gains. A good example of this is that an individual could choose to eat out every night in a given week and triple their food expense, while they will receive the exact same paycheck that week. Businesses have a lot more flexibility to drive revenues and gains and are not limited in the same ways as individuals (upwards or downwards). For most people, the goal should be to operate more like a business than an individual for all things related to finance. This is also why there is an extraordinary and growing wealth gap in the world. The richest individuals are able to operate their finances in the exact same way that businesses operate, where there is no limit on upward potential. Most individuals are limited by the raises that their employers are willing to pay them, and increasing that amount is virtually impossible in an employer driven labor market.

Let's look at the mechanics of an income statement. An income statement differs from a balance sheet in that it shows how revenues, expenses, gains, and losses occur over a period where a balance sheet shows assets and liabilities at a point in time. Revenues and gains typically add to assets (e.g. more cash in the bank) while expenses and losses decrease assets (e.g. depreciation) or increase liabilities (e.g. credit cards).

Let's look at an example personal income statement for a guy named John Doe assuming the following:
  • John makes $1,500 per week (before taxes)
  • John's taxes take about 30% of his income
  • John spends the following
    • $2,000/month on rent and utilities
    • $450/month on doggie day care (because his landlord does not allow pets)
    • $200/week on food
    • $200/month on gas
    • $120/month for cell phone
    • $120/month for Internet and Cable TV
    • $300/month on student loans (20% of this is interest)

Let's determine if John is making any money after expenses. We will prepare an income statement that shows a typical month.

        Monthly Statement of Income
                John Doe
      For the Period Ended 3/31/2012

Wage Revenue                        6,000
Taxes Deducted                1,800
Wages, Net                          4,200

Rent and Utility Expense      2,000
Food Expense                    800
Doggie day care                 450
Fuel Expense                    200
Cell Phone Expense              120
Cable/Internet Expense          120
Student Loan Interest Expense    60

Total Expenses                      3,750

Net Income (Loss)                     450  
 
But wait... I've read a financial statement... aren't taxes subtracted at the end?  For businesses... yes... but no for individuals. Why? Think about it, although you may have negotiated $78,000 at the end of your last job search, you really only see a maximum of about $58,500 actually go through your bank account (the rest is a somewhat fictitious amount that appears at the end of the year on your W-2). The government knows that nobody would pay taxes at the end of the year if they weren't taken out of the paycheck, so legislation has been passed to make withholding mandatory for most individuals and they impose immediate and severe penalties on businesses that fail to send payroll taxes in to the state and federal government. Taxes are typically calculated values, but in this case it makes more sense to either create an asset (called taxes withheld in the personal balance sheet) or make an adjustment at the end of the year that reduces the total year expense by the amount of the refund expected. I prefer the latter approach.

Imagine what you could do over the course of a year with an additional $19,500, even if it had to be paid at the end of the year. Gains could be generated from the purchase and sale of stocks or interest income could be generated from bonds... but these doors are closed for the majority of people. The money could even be used as a down payment on a car or home and then taken out as a secured loan at the end of the year.

Another interesting thing to note is that the student loan interest expense is only $60. This is due to the fact that only 20% of the $300 cash outlay is interest. The other $240 is a reduction in the principal of the loan (and this is applied against the corresponding student loan liability on John's personal balance sheet). We'll look at working with loan calculations in more depth in a future post.

Ultimately the personal income statement tells you how much money you have made or lost for a given period of time. Figure out your expenses and debt service and see how they compare to your income. The answer may surprise you... I didn't touch on gains and losses yet because these are less straightforward than simply determining revenue and expenses. As we continue our discussion on assets and liabilities, I will cover more detailed scenarios involving gains and losses on homes, cars, stocks, bonds, and a number of other assets. I will also explore the darker area of gains and losses on liabilities.

See Also
The Personal Balance Sheet
Retirement in the 21st Century

Monday, March 26, 2012

The Personal Balance Sheet

The average individual is in a lot of trouble with his/her personal balance sheet. Since the financial crisis started in 2007 and 2008, the average value of an individual's assets has dropped dramatically and the value of an individual's liability has increased substantially. Personal financial literacy is the first step towards developing true financial security and realizing a dream of quitting a job or having a comfortable retirement. In my previous post, I describe how most retirement advisers give fundamentally flawed advice about managing cash flows in the retirement years.

The balance sheet is the main starting point for understanding finances. It was my starting point when I was working on my MBA and the educational requirements for the CPA exam and it is a logical starting point to show people how finances work from the bottom up. In my previous post, I described some regular activities in terms of stocks and flows and the balance sheet represents the stocks at a single point in time. Ultimately the balance sheet follows the fundamental accounting equation:

Assets = Liabilities + Equity

Conceptually, this means that everything that has an economic value or can produce some sort of future economic benefit (assets) are composed of the owner's economic interest (equity) and items that will trigger future economic sacrifices (liabilities). Common assets on a set of personal financial statements are cash, receivables (typically salary or interest from bonds and insured savings), real estate, retirement savings, and vehicles. Common examples of liabilities are student loans, mortgages, credit cards, and most regular expenses like auto insurance, utilities, etc. Equity gets interesting in the business context, but for a personal financial statement is mainly a placeholder for showing the difference between assets and liabilities and can reasonably be thought of as wealth at a point in time.

Let's look at a couple of examples. The first example is a college student that financed his/her education with loans and is about to graduate. This student also purchased a new car to get to a job. Assume that the student is at the end of an apartment lease and used $5,000 on a credit card on eating out over 5 years.

Assets Liabilities Equity
Cash (checking account): $1000 Car Loan: $15,000
Car: $15,000 Credit Card: $5,000

Student Loan: $100,000



Total Assets: $16,000 Total Liabilities: $120,000 Total Equity: ($104,000)

This is a bad way to start out, I know a lot of people who have ended up here and the graduating classes for the foreseeable future will have the same sort of financial position. The main difference between the people I graduated with and the people in the newer graduating classes are that the newer graduates will be dealing with an unemployment rate of more than 8% and few job prospects that will pay the amount required to service the liabilities generated from being a student. Ultimately this cost will either be taken by private investors or taxpayers when students default on education loans after a failed job search.

Let's look at an example of a homeowner who isn't currently under water with their loan. Assume they bought their house 10 years ago for $200,000 at a rate of 6% and  have just paid off a car with a carrying value of $10,000. This homeowner has no other liabilities. His/her financial position, not including rainy day/retirement savings, might look like this:

Assets Liabilities Equity
Cash: $3,000 Home Mortgage: $167,371.45
Car: $10,000

Home: 200,000




Total Assets: $213,000 Total Liabilities: $167,371.45 Total Equity: $45,628.55

What's interesting here is that the homeowner has paid almost $144,000 to generate about $32,000 in equity (meaning that $112,000 of interest has been paid on a $200,000 home over 10 years, see this post for how this is calculated). Yikes!

What if this homeowner bought in 2007 and had their home depreciate to a value of $100,000:

Assets Liabilities Equity
Cash: $3,000 Home Mortgage: $167,371.45
Car: $10,000

Home: 100,000




Total Assets: $113,000 Total Liabilities: $167,371.45 Total Equity: ($54,371.45)

In this case the owner has paid more interest than the home is worth (same amount as above) and they are underwater on the home loan. Is it any wonder that they simply walk away at this point. Anyway, what we see here is that the financial situations of typical people are more difficult than most people understand, especially politicians who were hand picked from Wall Street. Understanding the personal balance sheet is the first step to controlling and improving personal finances.

See Also,
Retirement in the 21st Century
How Much Interest Are You Paying?

Retirement in the 21st Century

I'm always amazed by the number of articles that I read that discuss the impending Social Security crisis and the retirement savings crisis in the country. As the baby boomer generation starts getting into the older ages and is unable to retire, the country will have an unemployment spike involving older individuals and will have a huge public policy problem to determine how to take care of all of the would-be retirees who have either no savings or vastly insufficient savings to sustain them for the later years.

Ultimately one of the major challenges (or opportunities) is that the world has shifted to the defined contribution model for retirement (IRA, 401k, etc), but the mentality of the average individual remains the defined benefit (also known as pension). People still believe that someone, whether it is the government or a company, will cover their retirement years for them. This isn't the case... social security has all but failed fiscally, companies are restructuring and eliminating pensions, and even the state and federal government is asking people to voluntarily reduce their pension benefit. Ultimately, people are being asked to take responsibility for their own financial care and feeding.

This creates a problem for the average individual because it requires an investment of time and effort into developing strong financial literacy. Additionally, effort needs to be taken by people to understand how different financial instruments (stocks, bonds, derivatives, etc.) and how the economy as a whole works. It also doesn't help that the average financial adviser/planner subscribes to a fundamentally flawed view that retirees need to use savings in place of income in the retirement/post retirement years.

This last statement probably surprises a lot of people... "Why would he say that?"

Let's take a step back and think about the basic concepts of assets, liabilities, revenues, and expenses... or really more fundamentally stocks and flows. I'll cover assets, liabilities, revenues, and expenses in a lot more detail in future posts.

From a financial standpoint a stock is a store of value, such as cash under the mattress, in a savings account or IRA, or in a hard asset like a home. The fair market value of a portfolio can also be considered a stock. Liabilities such as credit cards, mortgages, car loans, etc. can also be considered stocks, but these stocks work against you. For the majority of people, there is a combination of both and the average American has a negative net worth from a personal financial standpoint.

Financial flows are represented by income and expenditures, these can be income from working, dividends, bond coupons, etc. Some common expenditures are debt service payments (mortgage, car loans, and credit cards, etc.) and regular bills (car insurance, health insurance, utilities, food, taxes, etc). Naturally, any surplus of income is added to an existing stock, such as the cash pile under the mattress. Any surplus in expenses reduces an existing stock or increases a negative stock (such as a credit card or other loan). Flows ultimately determine what is financially possible.

I will focus on income because it is the main determinant in purchasing power and the quality of retirement living. Income is either active (working) or passive (from direct or indirect investment). Direct investment means owning a business and investing in the tangible (machinery, etc) and intangible (customer databases, patents, trademarks) assets of the business. Indirect investment comes from owning a financial instrument or investing in a business that is not directly managed or overseen (via a board of directors seat).

So back to the retirement question, why is the strategy sold by financial/retirement advisers fundamentally flawed?

The average retirement adviser recommends substituting income through the sale of assets during retirement. This could be the partial liquidation of a stock/bond portfolio or could be something like a reverse mortgage on a home. This poses a problem because once the stock is gone, there is nothing left to use. Ultimately that same asset could be used to generate an income (use a home for rental income, reinvest in more bonds, reinvest dividends, etc.), but the main problem exists that the income generated from these assets is insufficient to support the average individual during retirement.

Ultimately, when the asset is sold, no further income can be generated from it.

The secret to comfortably retiring in the 21st century is going to be the successful creation of passive income sources and the active management of personal finances. This also requires a fundamental mind shift to think about things the way an accountant or an investment fund manager would.

I'll use this as an anchor for other posts in the series, so bookmark this page or follow my blog for the latest and greatest.

Retirement in the 21st Century

Sunday, March 25, 2012

Comprehensive OSPF Cost Example

The Open Shortest Path First routing protocol is a critical piece of knowledge for any networking professional working in an enterprise environment. Most major networking certifications covering routing and switching including the Cisco Certified Network Associate (CCNA), Cisco Certified Network Professional (CCNP), and Cisco Certified Internetwork Expert (CCIE) extensively test OSPF knowledge and skills. OSPF is the most popular dynamic routing protocol used in complex enterprise networks as an interior gateway protocol (IGP). This post will provide a comprehensive example of the OSPF metric calculation and how different configurations impact the metric for type-1 and type-2 routes. The OSPF lab is configured in Dynamips/GNS3 using 5 Cisco c3725 routers laid out in the topology below. For more information on how the OSPF metric is determined, see OSPF Cost/Metric Calculation.

As I described in a previous post, there are really three main types of metrics considered in OSPF:
  • Intra-area and summary cost
  • External/NSSA type 1 cost
  • External/NSSA type 2 cost
In the topology below, we have a backbone area and two non-backbone areas (one a regular area and one a totally not so stubby [totally NSSA] area).

We have two routing domains running the routing information protocol (RIP) and the routing domain running Open Shortest Path First (OSPF). To get our external routes into OSPF, we redistribute RIP into OSPF on R1 and R2. The RIP routes from R1 are propagated through the OSPF domain (until R02) and the RIP routes from R2 are only propagated through the no-summary NSSA area as N1/N2 routes, then they become E1/E2 routes in area 0 and beyond.

For the initial part of the lab, get the basic OSPF configuration and RIP redistribution set up. In this instance, I use a route map on R1 and R2 to set the following:

172.16.1.0/24 Metric type 1, initial cost 100
172.16.2.0/24 Metric type 2, cost 100
192.168.1.0/24 Metric type 1, initial cost 100
192.168.2.0/24 Metric type 2, cost 100

There are multiple ways to achieve this configuration, but I use a route map and prefix lists. Here are the relevant configuration commands for R1

!
router ospf 1
 redistribute rip subnets route-map set-ospf-metric-type
 network 10.0.0.0 0.255.255.255 area 1
!
ip prefix-list match-172-16-1 seq 5 permit 172.16.1.0/24
!
ip prefix-list match-172-16-2 seq 5 permit 172.16.2.0/24
!
route-map set-ospf-metric-type permit 10
 match ip address prefix-list match-172-16-1
 set metric 100
 set metric-type type-1
!
route-map set-ospf-metric-type permit 20
 match ip address prefix-list match-172-16-2
 set metric 100
 set metric-type type-2
!


And for R2:
!
router ospf 1
 log-adjacency-changes
 area 2 nssa no-summary
 redistribute rip subnets route-map set-ospf-metric
 network 10.0.3.0 0.0.0.255 area 2
!
ip prefix-list match-192-168-1 seq 5 permit 192.168.1.0/24
!
ip prefix-list match-192-168-2 seq 5 permit 192.168.2.0/24
!
route-map set-ospf-metric permit 10
 match ip address prefix-list match-192-168-1
 set metric 100
 set metric-type type-1
!
route-map set-ospf-metric permit 20
 match ip address prefix-list match-192-168-2
 set metric 100
 set metric-type type-2
!


Looking at the Area Border Router (ABR) routing tables, it is clear that the E1/N1 cost increases as it is propagated through the network, but the E2/N2 cost remains what it was initially set to.

From R01:

R01#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     172.16.0.0/24 is subnetted, 2 subnets
O E1    172.16.1.0 [110/110] via 10.0.2.1, 00:12:14, FastEthernet0/1
O E2    172.16.2.0 [110/100] via 10.0.2.1, 00:12:14, FastEthernet0/1
     10.0.0.0/24 is subnetted, 4 subnets
C       10.0.2.0 is directly connected, FastEthernet0/1
O IA    10.0.3.0 [110/30] via 10.0.0.2, 01:57:47, FastEthernet0/0
C       10.0.0.0 is directly connected, FastEthernet0/0
O       10.0.1.0 [110/20] via 10.0.0.2, 01:57:47, FastEthernet0/0
O E1 192.168.1.0/24 [110/130] via 10.0.0.2, 01:57:47, FastEthernet0/0
O E2 192.168.2.0/24 [110/100] via 10.0.0.2, 01:57:49, FastEthernet0/0


From R02:

Gateway of last resort is not set

     172.16.0.0/24 is subnetted, 2 subnets
O E1    172.16.1.0 [110/130] via 10.0.1.1, 00:00:02, FastEthernet0/0
O E2    172.16.2.0 [110/100] via 10.0.1.1, 00:00:02, FastEthernet0/0
     10.0.0.0/24 is subnetted, 4 subnets
O IA    10.0.2.0 [110/30] via 10.0.1.1, 00:00:02, FastEthernet0/0
C       10.0.3.0 is directly connected, FastEthernet0/1
O       10.0.0.0 [110/20] via 10.0.1.1, 00:00:02, FastEthernet0/0
C       10.0.1.0 is directly connected, FastEthernet0/0
O N1 192.168.1.0/24 [110/110] via 10.0.3.2, 03:44:00, FastEthernet0/1
O N2 192.168.2.0/24 [110/100] via 10.0.3.2, 03:44:00, FastEthernet0/1


For internal routes, it is easy to see that the cost increases as the advertisement propagates from the source.

OSPF Cost for Summary Routes

Summary external routes can be created on autonomous system border routers (ASBRs) using the OSPF summary-address router configuration command. External summary route cost is determined according to the following rules:
  • If all summary components are E2/N2 routes, the summary is considered E2/N2 and is advertised with the lowest metric (cost) of the summarized routes
  • If any of the summarized routes are E1/N1 routes, the summary is considered E1/N1 and is initially advertised with the lowest cost/metric of any of the summarized routes. As the LSA is propagated, the new metric follows regular E1/N1 rules.  
For routes within the OSPF routing domain that are summarized at the area border routers (ABRs) using the area range command, the metric advertised with the summary is the lowest metric of any of the summarized routes.

See Also,
The Road to the CCIE
OSPF Cost/Metric Calculation

Friday, March 23, 2012

OSPF Cost/Metric Calculation

The Open Shortest Path First routing protocol is a critical piece of knowledge for any networking professional working in an enterprise environment. Most major networking certifications covering routing and switching including the Cisco Certified Network Associate (CCNA), Cisco Certified Network Professional (CCNP), and Cisco Certified Internetwork Expert (CCIE) extensively test OSPF knowledge and skills. OSPF is the most popular dynamic routing protocol used in complex enterprise networks as an interior gateway protocol (IGP). This example will demonstrate the concepts and configuration involved with metrics in an OSPF network. I utilize a Cisco c7200 in Dynamips/GNS3 to provide syntax examples in the post below.

Understanding OSPF Cost

Internal Route OSPF Cost

OSPF uses a value called cost for its metric when determining the metric for a particular routing prefix. OSPF defines the cost for a particular prefix according to the following formula:

OSPF cost = cost from LSA + (incoming interface bandwidth/reference bandwidth)

OSPF uses 100 Mb/s for its default reference bandwidth on Cisco routers, but on routers that use Gigabit Ethernet or 10 Gigabit Ethernet, this value should be changed both on the router and everywhere else in the OSPF network. This can be changed using the auto-cost reference-bandwidth  command:

R1(config-router)#auto-cost reference-bandwidth ?
  <1-4294967>  The reference bandwidth in terms of Mbits per second


Note that this is the configured bandwidth on the interface, not the actual bandwidth. The following table shows the OSPF cost for different link types and reference bandwidths:
Link Type 100M (default) Reference Bandwidth 1G Reference Bandwidth 10G Reference Bandwidth
56k serial 1785 17857 178571
64k serial 1562 15625 156250
T1 (1.544 Mbps serial) 64 647 6476
E1 (2.048 Mbps serial) 48 488 4882
Ethernet 10 100 1000
Fast Ethernet 1 10 100
Gigabit Ethernet 1 1 10

The OSPF cost can also be manually set for an interface with the ip ospf cost interface subcommand.

R1(config-if)#ip ospf cost ?
  <1-65535>  Cost

The OSPF cost of an outgoing interface is not added to an outgoing LSA, rather the receiving router adds its own interface cost to the cost that was advertised in the LSA (and propagates that cost to other routers). In this way, the total cost is the cost of each outgoing interface on each router between a particular router and the router connected to a specific prefix.

The OSPF cost can be set for connected networks being advertised into OSPF using the ip ospf cost interface command. It is also possible to set the OSPF cost for a connected route using a route map and redistributing connected networks, though this causes the route to be considered an external route and the metric is determined initially by the set clause of the route map and propagated according to whether it is considered a type 1 external route or a type 2 external route (type 2 is default on the Cisco IOS platform).

It should also be noted that the bandwidth interface configuration command (which has no actual effect on available bandwidth) can modify the OSPF cost for an interface by overriding the bandwidth inferred from the interface type.

Inter-Area and External Route OSPF Cost and Path Selection

Inter-area routes add the cost of the ABR to reach a particular network with the cost to reach an ABR.

External routes redistributed into OSPF are either considered type 2 or type 1 external routes. Type 2 is default and the cost used to determine the shortest path to the advertised network is solely the cost advertised by the ASBR for the prefix (not by the cost to reach any intermediate ABRs or other routers). For type 1 routes, routers add the cost to get to the ASBR to the cost advertised by the ASBR to determine the metric for the route as well as the cost to reach any intermediate ABRs or other routers.

Most of the examples that show routing differences between type 1 and type 2 external routes are theoretical. There aren't very many drivers from a network design standpoint to implement multiple interior gateway routing protocols in a new network or in a network that is being re-engineered or transitioning between routing protocols (ex. RIP -> OSPF or EIGRP -> OSPF). The drivers that do exist mainly involve migrations due to mergers and acquisitions or in high complexity service provider scenarios (mainly interior to a service provider's network or involved with layer 3 carrier MPLS solutions). For VoIP design, EIGRP and OSPF can both be tuned to have subsecond convergence assuming the correct level of redundancy exists in the network and redistribution is not typically required.  

When thinking about OSPF costs, it is important to think about how OSPF chooses routes because the rules may supercede cost in a few different scenarios:
  • OSPF prefers intra-area routes to inter-area routes, regardless of cost
  • OSPF routes across area zero without routing across a non-backbone area if at all possible
  • Finally, OSPF routes to the destination without traversing area 0
This creates challenges with design and troubleshooting because flows may take a non-intuitive path if two non-backbone areas are directly connected with a lower cost than the cost across a backbone area, or if there is a high cost route through the backbone area and a low cost route that traverses the backbone area and a non-backbone area. Special care should be taken with regard to link failures and different external routing scenarios.

See Also
The Road to the CCIE

Thursday, March 22, 2012

OSPF Concepts: Areas and LSA Types

OSPF (Open Shortest Path First) is the most popular interior gateway protocol (IGP) used in private networks today. Because of its widespread use, it is one of the most important topics for individuals pursuing any of the mainstream networking certifications available. Both Cisco and Juniper extensively test on OSPF concepts and configuration for their exams at the entry level, intermediate level, and advanced level. Since I have more Cisco background than Juniper, I will describe OSPF concepts and configuration from the standpoint of the Cisco Internetwork Operating System (IOS). Since I am pursuing the second highest Cisco certification, the Cisco Certified Internetwork Expert (CCIE), I will develop both simple and advanced labs and examples with Dynamips/GNS3 involving basic and advanced configuration scenarios. For now, I will describe OSPF version 2 which is currently used for IPv4 networks. At a future time, I will develop a similar set of posts that describes OSPFv3 and IPv6.

Open Shortest Path First is a link state protocol, meaning that it propagates information about individual links (and their connected subnets) and each router builds a complete view of the attached network (really the OSPF area, but more on this later...). Each router analyzes the information in the OSPF link state database and makes its own decision on the best way to route traffic to a particular destination. Compare this with a distance vector protocol such as RIPv2 where each router has no view of the topology beyond the first hop, but only knows the distance (for RIP this is hop count) to reach a subnet that was advertised by the neighboring router. No computation is necessary beyond knowing which next hop has the lowest hop count to a specific destination.

OSPF Areas

Areas are the name given to a set of routers that has a complete view of the link states in any given area. OSPF uses a two layer hierarchy of consisting of a backbone area (area 0) and one or more non-backbone areas. For small networks, it is possible that only a single area is used. Each interface/subinterface can be part of a single OSPF area. All areas other than the backbone area must connect directly to the backbone area (or connect via an OSPF virtual link). Since the routers in a single area have a complete view of the topology, adding more routers to an area increases the size of the OSPF database in memory and increases the time that the shortest path first (SPF) algorithm takes to run. Specifics with each type of area: normal area, stub area, totally stubby area, not so stubby area (NSSA), and totally not so stubby area will be discussed in their own posts.

OSPF LSA Types

Routers in an OSPF area propagate reachable subnets via link state advertisements (LSAs). Within an individual area Type 1 (link) and type 2 (transit network) LSAs help routers develop a complete topology view. Between areas type 3 (summary) and type 4 (autonomous system border router summary [ASBR summary]) LSAs are propagated. Type 5 LSAs are generated and propagated for external routes (those completely outside of OSPF). Type 7 LSAs are used to represent external routes in not so stubby areas (NSSAs). Each of these LSA types and their appearance in the OSPF database will be described in more detail and demonstrated in future configuration examples.

See Also,
The Road to the CCIE