A Simple IPv4 Prefix Summarization Procedure


In this short blog post we are going to present a simple procedure for IPv4 prefix summarization. The procedure is based on the one found in “Optimal Routing Design” book by Russ White, Don Slice and Alvaro Retana, but differs in some respects. The process is three step, and require the use of Windows calculator for ease of computation. No binary breakdowns are involved, just some basic arithmetic. For the sake of simplicity, we skip all proofs, as those are trivial. The same approach could be adopted for use with IPv6 prefixes, provided that decimal arithmetic is replaced with hexadecimal.


We are going to use an example to demonstrate the method. Here is the task: find the optimal (longest prefix length) summary prefix for the following set of subnets:
This example is taken from the wikipedia article: http://en.wikipedia.org/wiki/Supernet that illustrates the use of binary breakdown for the purpose of address summarization.


It does not matter if the subnets have different prefix lengths – you may simply ignore these, as the resulting summary will use its own prefix length. Sort the prefixes in ascending order, starting with lowest and to the highest 32-bit number. Find the octet where the prefixes differ (we would call it “changing octet” from here on). In our case this is the 3rd octet (98, 99 etc):
You only need to sort the prefixes to find the lowest and the highest changing octet values. The changing octet position also gives us the corresponding “positional prefix length”. If this octet is the first in the prefix, the positional prefix length is 8, if it’s the second then the positional prefix length is 16, next 24 for third and 32 for fourth position in the dotted-decimal form.

Step 1:

Take the highest and lowest changing octets and perform XOR operation on them. You may use Windows calculator or any other utility that allows for logical operations on decimal numbers: “98 XOR 105 = 11″. Next, take the lowest power of “2” that is strictly greater than the resulting number (even if the result is a power of two itself). In our case it is 16. Let’s call this number as “y”. After that, find the number z, so that “2^z=y” (here “^” means power, not XOR like in C), i.e. take Log2 of “y”: “z = Log2(y) = Log2(16) = 4″. You may use a short table of powers of 2 ranging from 2^0 to 2^8 – you don’t need more as you deal with just a single octet. It’s easy to memorize these numbers too. Notice that dealing with IPv6 would require the table of 16 elements (2^0 through 2^16).
Note The original method found in “Optimal Routing Design” uses subtraction operation instead of XOR at this step. It could be shown that subtraction does not work in all cases. For example, it does not reveal the correct highest mismatching bit position in the case of: and as “69-66=3″ (incorrectly approximated by 2^2) while “69 XOR 66 = 7″ (correctly approximated by 2^3). The reason being are “arithmetic underflows” that happen with subtraction.

Step 2:

Take the any changing octet value, e.g. the lowest one, and divide it by “y” then drop the remainder: “98/16 = 6.125″ rounded to 6 (“floor” function). Now multiply 6 by “y” again to yield 96 – this is the base octet of the summary address. The summary prefix now looks like: Effectively, these two operations represent logical binary shift right and left to mask the changing bits. Yes, you may take ANY octect from the set of prefixes – the result will be the same.

Step 3:

The final step is finding the summary prefix length. Take the positional prefix length corresponding to the changing octet, as described previously. In our case it’s the third octet, and thus the positional prefix length is 24. Now subtract “z” from this number to get “x” – the summary prefix length: “x=24-z=24-4=20″. The summary prefix is: 192.168.y.0/x =

Step 4 (Optional):

Convert prefix length into network mask, if needed. To accomplish this, take 256 and subtract “y”: 256-16=240. This is the netmask component that corresponds to the summary base octet:

Example 1

Take the following subnets:
Changing octet – 3rd, positional prefix length = 24. Next step: “61 XOR 57 = 4″ thus “y = 8, z=3; 57/y = 57/8 = 7.125″ and the base octet is “7*8=56″. The prefix length is “24-3=21″. Summary prefix is: or

Example 2

Take the following subnets:
Changing octet – 3rd, positional prefix length = 24. Next step: “100 XOR 97 = 5″, “y = 8, z = 3 97/8 = 12.125″, base = “12*8=96″. The prefix length = “24-3=21″. Summary Prefix: or

Example 3

Take the following subnets:
Changing Octet – 3rd, positional prefix length = 24. Next Step: “25 XOR 14 = 23, y = 32, z = 5; 14/32 = 0.43″, base octet = 0. Summary length: “24-5=19″. Summary prefix: or Notice that this summary address could be too exhaustive in terms of overlapped address space. You may want to summarize just two prefixes: and and leak summary of and = and is left un-summarized.


The procedure presented in this article could be useful when dealing with large-scale networks and configuring manual IPv4 prefix summarization. You may avoid complicated binary conversions and simply use the calculator to find the resulting prefix.


About US

Network Bulls is Best Institute for Cisco CCNA, CCNA Security, CCNA Voice, CCNP, CCNP Security, CCNP Voice, CCIP, CCIE RS, CCIE Security Version 4 and CCIE Voice Certification courses in India. Network Bulls is a complete Cisco Certification Training and Course Coaching Institute in Gurgaon/Delhi NCR region in India. Network Bulls has Biggest Cisco Training labs in India. Network Bulls offers all Cisco courses on Real Cisco Devices. Network Bulls has Biggest Team of CCIE Trainers in North India, with more than 90% of passing rate in First Attempt for CCIE Security Version 4 candidates.
  • Biggest Cisco Training Labs in India
  • More than 90% Passing Rate in First Attempt
  • CCIE Certified Trainers for All courses
  • 24x7 Lab Facility
  • 100% Job Guaranteed Courses
  • Awarded as Best Network Security Institute in 2011 by Times
  • Only Institute in India, to provide CCIE Security Version 4.0 Training
  • CCIE Security Version 4 Training available
  • Latest equipments available for CCIE Security Version 4

Network Bulls Institute Gurgaon

Network Bulls Institute in Gurgaon is one of the best Cisco Certifications Training Centers in India. Network Bulls has Biggest Networking Training and Networking courses labs in North India. Network Bulls is offering Cisco Training courses on real Cisco Routers and Switches. Labs of Network Bulls Institute are 24x7 Available. There are many coaching Centers in Delhi, Gurgaon, Chandigarh, Jaipur, Surat, Mumbai, Bangalore, Hyderabad and Chennai, who are offering Cisco courses, but very few institutes out of that big list are offering Cisco Networking Training on real Cisco devices, with Live Projects. Network Bulls is not just an institute. Network Bulls is a Networking and Network Security Training and consultancy company, which is offering Cisco certifications Training as well support too. NB is awarded in January 2012, by Times, as Best Network Security and Cisco Training Institute for the year 2011. Network Bulls is also offering Summer Training in Gurgaon and Delhi. Network Bulls has collaboration with IT companies, from which Network Bulls is offering Networking courses in Summer Training and Industrial Training of Btech BE BCA MCA students on real Live projects. Job Oriented Training and Industrial Training on Live projects is also offered by network bulls in Gurgaon and Delhi NCR region. Network Bulls is also providing Cisco Networking Trainings to Corporates of Delhi, Gurgaon, bangalore, Jaipur, Nigeria, Chandigarh, Mohali, Haryana, Punjab, Bhiwani, Ambala, Chennai, Hyderabad.
Cisco Certification Exams are also conducted by Network Bulls in its Gurgaon Branch.
Network Bulls don't provide any Cisco CCNA, CCNP simulations for practice. They Provide High End Trainings on Real topologies for high tech troubleshooting on real Networks. There is a list of Top and best Training Institutes in India, which are providing CCNA and CCNP courses, but NB has a different image from market. Many students has given me their feedbacks and reviews about Network bulls Institute, but there were no complaints about any fraud from this institute. Network Bulls is such a wonderful place to get trained from Industry expert Trainers, under guidance of CCIE Certified Engineers.

About Blog

This Blog Contains Links shared by sites: Cisco Guides, Dumps collection, Exam collection, Career Cert, Ketam Mehta, GodsComp.co.cc.


Cisco Networking Certifications Training

Cisco Training in Delhi

ccna training in gurgaon. ccnp course institute in gurgaon, ccie coaching and bootcamp training near gurgaon and delhi. best institute of ccna course in delhi gurgaon india. network bulls provides ccna,ccnp,ccsp,ccie course training in gurgaon, new delhi and india. ccsp training new delhi, ccie security bootcamp in delhi.

Testimonials : Network Bulls

My Name is Rohit Sharma and i Have done CCNA and CCNP Training in Gurgaon Center of Network Bulls and it was a great experience for me to study in Network Bulls.

Cisco Networking Certifications

Myself Komal Verma and i took CCSP Training from Network Bulls in Gurgaon. The day i joined Network Bulls, the day i get addicted with Networking Technologies and I thank Mr. Vikas Sheokand for this wonderful session of Networking. :)
I must say that Network Bulls is Best Institute of CCNA CCNP CCSP CCIE Course Training in Gurgaon, New Delhi and in India too.
Komal Verma

About a wonderfull CCIE Training Institute in Gurgaon

I am Kiran shah from New Delhi. I have recently completed my CCNA CCNP & CCIE Training in Gurgaon from Network Bulls and i recommend Network Bulls for Cisco Training in India.

Kiran Shah

Cisco Coaching and Learning Center

Disclaimer: This site does not store any files on its server. I only index and link to content provided by other sites. If you see any file on server that is against copy right you can inform me at (sidd12341 [at] gmail.com). I will delete that materials within two days. This Website is not official Website of any Institute like INE, Network Bulls, IP Expert. Thanks

CCIE Security Version 4

Cisco Finally updated CCIE Security Lab exam blueprint. WSA Ironport and ISE devices are added in CCIE Security Version 4 Lab Exam Syllabus Blueprint. In Updated CCIE Security Version 4 Syllabus blueprint, new technologies like Mobile Security, VoIP Security and IPV6 Security along with Network Security, are added. As in CCIE Security Version 3 blueprint, Cisco had focused on Network Security only, but now as per market demand, Cisco is looking forward to produce Internet gear Security Engineer, not only Network Security engineers.
In CCIE Security Version 4 Bluerpint, Lab Exam is going to be more interested than before. What is Difference in CCIE Security Version 3 and Version 4? Just go through the CCIE Security Version 4 Lab Equipment and Lab Exam Syllabus Blueprints and find out!