Sunday, May 17, 2009

Route Summarization – make your network scale

Probably one of the most critical parts of deploying and maintaining a network is route summarization. Many of you may find this easy, may be in an ideal network yes, however it is never perfect out there in the real world. Even I would admit that the summarization of our IPv4 addresses is not that good, at least to a point that we know we coud do better, but its already there and its virtually impossible to re-address an ISP network. That is why, planning out your address scheme is very critical into having a fine tuned and well summarized network.


Route Summarization is defined as – the technique of grouping IP networks together to minimize advertisements.


Why is summarization important anyway? Here are some of the benefits you will get in a well summarized network.


Faster routing – the smaller the routing table you have, the better. When it comes to network performance, speed is the key. We must make our routing table smaller whenever we can as this will make our routers forward traffic faster and thus resulting into a faster, more efficient network.


Hides route information details – this is to simplify your routing process. This is the key scalable routing, taking a huge set of advertisements and reduce it down to a single(if possible) or a fewer set of advertisements. You guys may refer to this as ‘supernetting’ – consolidating smaller networks into one route entry that represents a bigger network. This is good for hiding unimportant details like flapping routes. Information as detailed as this may not be significant to the neighboring routers as they may not be able to do anything about it anyway.


Reduces router resources – summarization reduces resource consumption because you save processor times for calculating routing information and reduced memory utilization due to the reduced number of routes. This would also save on network capacity there would be fewer and smaller advertisements to send around the network.


Speeds up convergence – because router with fewer routing entries has less routes to process and routers will receive updates faster. This advantage may even tuned more and may just depend on the routing protocol you are using.


Now let’s get to an example. Lets say we have 3 routers., and Router A has the networks 112.89.0.0/24 through 112.89.13.0/24 and we will be summarizing routes to advertise to routers B and C. As you can see this is a class A range chopped down into smaller class C (/24) blocks and that the first 2 octects will be the same for each and every network either we put them down in decimal or in binary.


112.89.0.0 – 01110000.01011001.00000000.00000000

112.89.1.0 – 01110000.01011001.00000001.00000000

112.89.2.0 – 01110000.01011001.00000010.00000000

112.89.3.0 – 01110000.01011001.00000011.00000000

112.89.4.0 – 01110000.01011001.00000100.00000000

112.89.5.0 – 01110000.01011001.00000101.00000000

112.89.6.0 – 01110000.01011001.00000110.00000000

112.89.7.0 – 01110000.01011001.00000111.00000000

112.89.8.0 – 01110000.01011001.00001000.00000000

112.89.9.0 – 01110000.01011001.00001001.00000000

112.89.10.0 – 01110000.01011001.00001010.00000000

112.89.11.0 – 01110000.01011001.00001011.00000000

112.89.12.0 – 01110000.01011001.00001100.00000000

112.89.13.0 – 01110000.01011001.00001101.00000000


We just wrote down each network in binary and the next thing to do is to the number of bits that match on these networks. This will result into a single summary that includes all the routes.


Looking at our example we can see that all networks are identical upto the 20th bit starting from the left. Therefore we could assume that we can summarize all these networks as 112.89.0.0/20 or 255.255.240.0. Now to check if we are correct we have to lay out the possible networks that this summary will include. The fastest way to achieve this is to simply put down in binary the first and last network within this summary route. The first network in the range will be put down as is in binary and the remaining bits will be turned on to determine the last network in the summarized range.

Using our example here is the binary to decimal conversion:


01110000.01011001.00000000.00000000 – 112.89.0.0/20


There we understand that the bits in bold are our network bits right? So we can only turn on bits upto the 24th bit or the last bit in the octet were we are in (3rd) and stop at that classful boundary. If all those remaining bits are turned on the result would be:


01110000.01011001.00001111.00000000 – 112.89.15.0/20


Based on the results, the range of 112.89.0.0/20 covers upto 112.89.15.0/20. What does this mean? Obviously this network summary summarized all our networks in Router A which is 112.89.0.0/24 through 112.89.13.0/24 however It also included 2 more networks, 112.89.14.0/24 and 112.89.15.0/24. This simply shows that we over summarized and that we actually included the networks that we are not even advertising. This is fine if we own these remaining networks and were to advertise them anyway in the future however if this isn’t the case we can’t just do that, specially in public IP routing because you can only advertise the range that was assigned to you and nothing more.


The next step would be to find the range in between wherein we can summarize properly without over summarizing. To find that out we just have to move our summarization 1 bit smaller. When I say this I mean we have to move 1 bit to the right and check upto which network we can summarize and stop there then move on to summarize the remaining networks that were left out.


Going back to our example we used a /20 mask and since we have to move 1 bit to the right we then have to use /21 as our mask. Let us check again to see the range of this mask.


01110000.01011001.00000000.00000000 – 112.89.0.0/21


Setting the remaining bits to 1 will result to:


01110000.01011001.00000111.00000000 – 112.89.7.0/21


Knowing this we determine that the networks that have the same matching bits is from 112.89.0.0 through 112.89.7.0 and thus can be summarized without over summarizing.


What happens now to the remaining networks? Ofcourse we start all over again and try to summarize what is left.


112.89.8.0 – 01110000.01011001.00001000.00000000

112.89.9.0 – 01110000.01011001.00001001.00000000

112.89.10.0 – 01110000.01011001.00001010.00000000

112.89.11.0 – 01110000.01011001.00001011.00000000

112.89.12.0 – 01110000.01011001.00001100.00000000

112.89.13.0 – 01110000.01011001.00001101.00000000


Looking at the remaining networks in binary we can see that we have the bits matched upto the 21st bit. Will we over summarize if we use this mask? Lets find out.


01110000.01011001.00001000.00000000 – 112.89.8.0/21


Turning on the remaining bits will give:


01110000.01011001.00001111.00000000 – 112.89.15.0/21


It’s over summarized again and so then we try again and move 1 bit to the right.


01110000.01011001.00001000.00000000 – 112.89.8.0/22


Turning on the remaining bits will give:


01110000.01011001.00001011.00000000 – 112.89.11.0/22


The proper summarization then would be 112.89.88.0/22. The remaining networks will be just easy for you:)


112.89.12.0 – 01110000.01011001.00001100.00000000

112.89.13.0 – 01110000.01011001.00001101.00000000


The matching bits for these last 2 networks is upto the 23rd bit. We actually don’t even have to check because obviously were already looking at the first and last network in the range. Therefore the last summary we have is 112.89.12.0/23.


In summarizing our networks we ended up with 3 summary routes. We weren’t able to advertise a single route but this the best we do and is way much better than advertising 14 individual class C networks.


Here’s what we our neighbors will get in their routing tables.


112.89.0.0/21

112.89.8.0/22

112.89.12.0/23


But then wait what if we say 112.89.14.0/22? Is that possible? Just for the sake of example let’s say a colleague of yours was being cocky and asked you wether this can be summarized or not on the spot. There is no way you would get a paper and convert these networks in binary. So the real question im trying to imply here is; Is there an easy way? Ofcourse there isJ But you still got to have a pretty good math to answer it quickly. For that we have to at least have an idea how much addresses are there in a summary or in a CIDR notation.


Here's the table for this. It shows the summary mask and how many addresses are there in that specific summary.


class C

/24

/23

/22

/21

/20

/19

/18

/17

/16

/24

1









/23

2

1








/22

4

2

1







/21

8

4

2

1






/20

16

8

4

2

1





/19

32

16

8

4

2

1




/18

64

32

16

8

4

2

1



/17

128

64

32

16

8

4

2

1


/16

256

128

64

32

16

8

4

2

1

class B

/16

/15

/14

/13

/12

/11

/10

/9

/8

/16

1









/15

2

1








/14

4

2

1







/13

8

4

2

1






/12

16

8

4

2

1





/11

32

16

8

4

2

1




/10

64

32

16

8

4

2

1



/9

128

64

32

16

8

4

2

1


/8

256

128

64

32

16

8

4

2

1


I had it illustrated as using class C and class B summaries as these are the most common

summarization on the internet. If ever you get the chance to see the Inernet routing table these CIDR notations are the most that you will see.


So how are we going to use this anyway? Going back to our example we have 112.89.14.0/22 and we want to determine of this is a proper summarization without converting it to binary or any long method. The trick is to know how many addresses are there within the range of the mask used. We have a /22 mask and looking at the table we can see that it is composed of 4 class C or /24 blocks and it could also consist of 2 /23 blocks. We then take the the number on the class C octet (3rd octet) and divide it with how many class blocks we have for the given mask, in our case we’ll ofcourse try 4 class Cs first as this is the most number of class Cs. So 14 divided by 4 is equal to what? We have 3 but we still have a remainder of 2. What does this mean? It means we over summarized and cannot use the /22 mask therefore we move on then to the next possible divisor which is 2 which then equals to a 23 block or 2 /24 blocks. So 14 divided by 2 is equals to 7 and we don’t have any remainder. This just means that 112.89.14.0/23 is properly summarized network and this range consists of 2 class C blocks. To make it clearer lets check it on binary.


01110000.01011001.00001110.00000000 – 112.89.14.0/23


If we turn on the remaining bit, this range also includes:


01110000.01011001.00001111.00000000 – 112.89.15.0/23


So we were able answer the question by familiarization with how many addresses are there in a specified mask and simple division. We then were able to check and prove our answer using binary. Doing a lot more of these would actually make yourself much faster in route summarization. Not that you need to be fast but having to determine if a route is summarized correctly by a single glance will be an advantage. Having the ability to do so saves you time in preparing configurations for your routers or layer 3 switches.


Just some final tips before I end this topic. Having to know how to properly summarize routes is good but having to know how to use summarization on different routing protocols is a different story. Routing protocols behave differently when it comes to route summarization and this means that you may have to use different techniques in doing so. Not that there are other ways of summarization but on techniques to implement with your routing protocol. For example, summarization in OSPF can only be done on Area Border Routers (ABRs) and Autonomous System Boundary Routers (ASBRs). For EIGRP on the other hand, summarization can be done on the interface level and therefore gives you more flexibility on were to advertise your summary routes. You will be taking these things in consideration when planning and designing your network along with your addressing scheme.


One common practice you must always do along with summarizing your routes on a router is creating a route to Null 0 or better known as the bit bucket interface (blackhole). Because you are advertising a summary route, other routers on your network will send packets to any network within your summary route regardless wether that network is up or down. Your neighboring routers don’t know the status of that network as information such as that doesn’t even get to them. Remember that summary routes hides the detailed information for the specific networks within your summary route. This is because when you advertise a summary route you are basically saying “For all the addresses starting with ‘n’ bits, can be found behind me – do not worry about the details, just pass on the packets and leave the forwarding of your traffic to me”. If a packet gets to that router and the destination network or address happens to be down, it either gets dropped, or it will loop around until its time-to-live expires. So in order to be sure that traffic destined to unavailable networks get dropped we put in Null 0 routes to catch all those packets.


note: in EIGRP when you create a summary route it automatically creats a Null 0 route for that summary.


I hope this has been another informative topic and you guys learned something out of it.

No comments:

Post a Comment