Cisco Support Community
Community Member

BGP prefix concept

I was looking for the exact meaning of BGP prefix, I found this on net,,,

A route announcement is sometimes referred to as a 'prefix'.

A prefix is composed of a path of AS numbers, indicating which networks the packet must pass through, and the IP block that is being routed, so a BGP prefix would look something like:

701 1239 42 206.24. 14.0/24.

Any additional comment ?

CCNP Advanced Routing V3 Curriculum 3.1.1 Routing fundamentals Cisco says:

"A routing table maps network prefixes to an outbound interface. When RTA receives a packet destined for, it looks for the prefix in the routing table. RTA then forwards the packet out an interface, such as Ethernet0, based on the routing table entry. If RTA receives a packet destined for, it sends that packet out Serial0 (S0)".

But this is different form what I am looking for.

Community Member

Re: BGP prefix concept

Any idea

Community Member

Re: BGP prefix concept

Any idea

Re: BGP prefix concept


No idea ... what your question is!?!

Community Member

Re: BGP prefix concept

((No idea ... what your question is!?!))

I want to know which is BGP prefix ? Is this what I have mentioned above or something elase ?

Re: BGP prefix concept

Prefix is a measurement to quantify large number. In networking, prefix is used to quantify large number of hosts/networks - and is a prefix.

My definition of BGP Prefix is a large number of networks learned via BGP Routing Protocol.

203 25 1002 is a BGP AS Path to the Prefix (in this example Since this path is presented by BGP Routing Protocol, you can call it a BGP Prefix


Re: BGP prefix concept

I think there are several possible reasons we use the term "prefix" in BGP (and it's use is now spreading to other routing protocols). We would normally call the number identifying a network the "network," and the numebr identifying the number of significant bits in the network the "subnet mask," or "network mask."

In BGP terms, the bits representing the network identifier are the "prefix" of the entire address, hence the "network" is the "prefix." The number of bits set in the "subnet mask" is called the "prefix length," and indicates how much of the IP address is the "prefix."

A route is a completely different animal from a prefix. A route consists of a prefix, a prefix length, and a set of information indicating policies and preference to reach the destinations indicated by the prefix. Thus, is a prefix, via neighbor x is a route. In the BGP packet format, these two concepts are split apart. A set of "attributes" are sent separately from a set of "prefixes." When the two are combined in the receiving router's database, they become "routes."

EIGRP always sends compete routes, which means each prefix is always paired with it's corresponding attributes (metric, route type, originator, etc). OSPF always sends prefixes with their attributes, but since the next hop is really only calculated by the receiving router (when it runs SPF), true routes don't exist in the OSPF database or LSAs (or IS-IS, for that matter), but only in the local tables of the calculating router.

I know it's a little confusing, but, I hope that helps.



Community Member

Re: BGP prefix concept

I did not get what you meant by :

(( and indicates how much of the IP address is the "prefix." ))

Second ,,,what does the bitmask mean in the attachment below ?

Re: BGP prefix concept


the bitmask in the example given refers to the bitmask representing the network mask. Basically a router does all calculations in binary. I think sometimes the problem arises from the fact that we do recalculate the Bits into decimal numbers (which are easier to handle for our brain though ;-)

So let us look at a host with 25 Bits mask. What is the network portion, what is the host specific part and what is the network mask?

If I had written the above in binary the answer would be close to trivial:

Network in binary representation


mask in binary representation


This is the bitmask the example talkes about. It indicates how many bits of the IP address belongs to the network part and how many bits belong to the host specific part of the IP address. In other words: indicates how much of the IP address is the "prefix."

So network is 11000000.10110000.00000001.00000000 or (all host bits 0). Host specific portion is 23 (0010111) and mask is

So some general remarks about IP routing. It is not feasable to have host routes to every host in the network. This would just put too much stress into routers to keep routing tables up to date. Imagine in the internet every new dial-in PC would have to be announced worldwide.

So what is done to simplify the life of a router is to summarize. The first summarization is the network with the help of a mask (there are also other reasons than route summarization for using networks with masks!).

It groups a range of IP addresses. To announce the address range we need TWO informations: where the address range starts and how large it is. Now in a binary world life for the routers is more simple if we follow bit boundaries for both informations needed.

So the common part (network) and the size (defined by the mask) is adjusted according the bits in the IPv4 addresses - see the example above.

The big advantage we get by introducing network/mask is that routers do not need to announce single hosts in the address range being reachable (or not).

Did this help? Please rate it


Community Member

Re: BGP prefix concept

I have serious problems to understand the instruction network in BGP. The same desire to know if it has some material that is didactic and also it can transmit my students this concepts.


Community Member

Re: BGP prefix concept

FYI Curriculum CCNP1 V3.0----"9.2 Basic BGP,, article 9.2.5 Network-layer reachability information (NLRI) " says :

((--Rather than advertise reachable destinations as a network and a subnet mask, BGP advertises them using network-layer reachability information (NLRI), which consists of prefixes and prefix lengths.

The prefix represents the reachable destination, and the prefix length represents the number of bits set in the subnet mask.

For example, has a prefix of and a prefix length of 24.

Note: There are 24 bits set in the subnet mask. Therefore it would be advertised by BGP as

The NLRI consists of multiple instances of the 2-tuple .

A tuple is a mathematical term for a set of elements.

In this case, the two (2) refers to the fact that there are only two elements in the set.

Therefore, the NLRI <19,> represents the prefix of, and the length is a 19-bit mask.

In decimal terms, this NLRI refers to the supernet ))

CreatePlease to create content