# BGP 4-Byte AS Number

**URL:** https://forum.networklessons.com/t/bgp-4-byte-as-number/3184
**Category:** Lessons Discussion
**Created:** [March 15, 2018, 1:17pm UTC](https://forum.networklessons.com/t/bgp-4-byte-as-number/3184 "2018-03-15T13:17:15Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![ReneMolenaar](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/renemolenaar/32/488_2.png) [@ReneMolenaar](https://forum.networklessons.com/u/ReneMolenaar)
#### Post date: [March 15, 2018, 1:17pm UTC](https://forum.networklessons.com/t/bgp-4-byte-as-number/3184/1 "2018-03-15T13:17:15Z")

</div>

This topic is to discuss the following lesson:

> **[BGP 4-Byte AS Number](https://networklessons.com/bgp/bgp-4-byte-number)**
>
> BGP supports 4-byte AS numbers, displayed with the asplain (example: AS 5434555) or asdot format (example: AS 82.544). This lesson explains how it works.

---

<div class="post-metadata">

### Author: ![Zaman.rubd](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/z/45deac/32.png) [@Zaman.rubd](https://forum.networklessons.com/u/Zaman.rubd)
#### Post date: [April 21, 2018, 6:52pm UTC](https://forum.networklessons.com/t/bgp-4-byte-as-number/3184/2 "2018-04-21T18:52:24Z")

</div>

Hi Rene,  
Very Good Stuff.A quick questions for you …  
How R2 know R1 only 2 byte supported before sending any open message ??

br//zaman

---

<div class="post-metadata">

### Author: ![ReneMolenaar](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/renemolenaar/32/488_2.png) [@ReneMolenaar](https://forum.networklessons.com/u/ReneMolenaar)
#### Post date: [April 24, 2018, 9:55am UTC](https://forum.networklessons.com/t/bgp-4-byte-as-number/3184/3 "2018-04-24T09:55:08Z")

</div>

Hi Zaman,

It doesn’t. When R2 receives a reply from R1 without the “support for 4-octet AS number capability” in its OPEN message, it knows that R1 doesn’t support it.

You can see it in the wireshark capture:

> **[CS Personal on cloudshark.org](https://www.cloudshark.org/captures/d8e5e9240959)**

Take a look at the 1st packet from R2 and the 2nd packet from R1. R1 is missing the capability.

Hope this helps!

Rene

---

<div class="post-metadata">

### Author: ![dongquangminh](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/d/b19c9b/32.png) [@dongquangminh](https://forum.networklessons.com/u/dongquangminh)
#### Post date: [May 25, 2018, 1:44pm UTC](https://forum.networklessons.com/t/bgp-4-byte-as-number/3184/4 "2018-05-25T13:44:15Z")

</div>

Hi Rene,  
I have question in 2-Byte & 4-Byte AS compatibility situation.

In case of we adding R3 (AS3) and connect it to R2. R1 advertises one prefix (for example: 1.1.1.1/32) to R2 and R2 will forward to R3.  
What will be in the AS path on R3? (22222222 1 or 23456 1)?

Thanks,  
Minh

---

<div class="post-metadata">

### Author: ![lagapidis](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/lagapidis/32/4949_2.png) [@lagapidis](https://forum.networklessons.com/u/lagapidis)
#### Post date: [June 2, 2018, 8:21am UTC](https://forum.networklessons.com/t/bgp-4-byte-as-number/3184/5 "2018-06-02T08:21:36Z")

</div>

Hello Minh

This is an excellent question. Essentially what you are asking (allow me to put it more generally) is how is the AS path displayed when there is a 2-byte AS compatible router in the mix?

Well, if you display the AS path on the 2-byte AS compatible router, then you will see the 23456 AS in place of the incompatible 4-byte AS number. So essentially the AS\_TRANS attribute replaces the 4-byte AS number. However, the AS4 PATH number is an attribute that is received by the 2-byte AS compatible device, and is transitive. It may not understand it, but it will send it down the line. So if you have yet another router connected to your R3 that is 4-Byte AS compatible, it will receive the AS4 path attribute correctly and actually use the correct 4-Byte AS’s for the full path.

I hope this has been helpful!

Laz

---

<div class="post-metadata">

### Author: ![dongquangminh](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/d/b19c9b/32.png) [@dongquangminh](https://forum.networklessons.com/u/dongquangminh)
#### Post date: [June 2, 2018, 10:12am UTC](https://forum.networklessons.com/t/bgp-4-byte-as-number/3184/6 "2018-06-02T10:12:37Z")

</div>

Thanks Laz for the explanation.

Enjoy your weekend,  
Minh

---

<div class="post-metadata">

### Author: ![staut\_stefanita](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/staut_stefanita/32/1652_2.png) [@staut\_stefanita](https://forum.networklessons.com/u/staut_stefanita)
#### Post date: [April 14, 2019, 4:25pm UTC](https://forum.networklessons.com/t/bgp-4-byte-as-number/3184/7 "2019-04-14T16:25:08Z")

</div>

If we had another router R3 (4 byte support) connected to R1 (2 byte support), then on R1 we would configure R3 neighbor using the same 23456 AS (neighbor 192.168.13.3 remote-as 23456)? R1 would have believed that it is dual homed connected to the same AS?

Thanks,  
Stefanita

---

<div class="post-metadata">

### Author: ![lagapidis](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/lagapidis/32/4949_2.png) [@lagapidis](https://forum.networklessons.com/u/lagapidis)
#### Post date: [April 15, 2019, 7:31am UTC](https://forum.networklessons.com/t/bgp-4-byte-as-number/3184/8 "2019-04-15T07:31:53Z")

</div>

Hello Staut

Yes, that is correct. This is a limitation of the feature and thus must be used carefully,. This could result in routers using the 4-byte AS not being able to reconstruct the entire AS path information correctly.

I hope this has been helpful!

Laz

---

<div class="post-metadata">

### Author: ![madhu\_g1985](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/m/3da27b/32.png) [@madhu\_g1985](https://forum.networklessons.com/u/madhu_g1985)
#### Post date: [August 24, 2019, 4:46pm UTC](https://forum.networklessons.com/t/bgp-4-byte-as-number/3184/9 "2019-08-24T16:46:30Z")

</div>

Hi Laz,  
Will the My AS field always set o 23456 in open message when the router is configured for 4 byte AS. I am unable to test and capture it since my lab device don’t have support for 4 Byte AS, Could you please let me know.

Regards,  
Madhu.

---

<div class="post-metadata">

### Author: ![lagapidis](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/lagapidis/32/4949_2.png) [@lagapidis](https://forum.networklessons.com/u/lagapidis)
#### Post date: [August 26, 2019, 7:01am UTC](https://forum.networklessons.com/t/bgp-4-byte-as-number/3184/10 "2019-08-26T07:01:20Z")

</div>

Hello Madhu

If you have an AS of 23456 and you are using 4 byte AS, then BGP will always place the 23456 AS in the My AS field, and will place the actual 4byte AS in the Optional Parameters field as the “Support for 4-octet AS number capability”. You can see this in the cloudshark capture in the lesson, and as shown below:

 ![image](https://cdn-forum.networklessons.com/uploads/default/original/2X/d/dd5033a19db8868b2a2022fcb4e5a6731ec13581.png)

I hope this has bee helpful!

Laz

---

<div class="post-metadata">

### Author: ![remygafner](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/r/e0b2c6/32.png) [@remygafner](https://forum.networklessons.com/u/remygafner)
#### Post date: [March 9, 2020, 7:23pm UTC](https://forum.networklessons.com/t/bgp-4-byte-as-number/3184/11 "2020-03-09T19:23:31Z")

</div>

I think one the examples is wrong. The result of #AS 5434995 should be 82.61043, not 82.6104. Am i correct?

---

<div class="post-metadata">

### Author: ![lagapidis](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/lagapidis/32/4949_2.png) [@lagapidis](https://forum.networklessons.com/u/lagapidis)
#### Post date: [March 10, 2020, 6:13am UTC](https://forum.networklessons.com/t/bgp-4-byte-as-number/3184/12 "2020-03-10T06:13:43Z")

</div>

Hello Remy

Yes, you are correct, it seems that it’s a typo. I will let @ReneMolenaar know.

Thanks for pointing it out!

Laz

---

<div class="post-metadata">

### Author: ![gazwoz](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/gazwoz/32/596_2.png) [@gazwoz](https://forum.networklessons.com/u/gazwoz)
#### Post date: [March 12, 2020, 3:53pm UTC](https://forum.networklessons.com/t/bgp-4-byte-as-number/3184/13 "2020-03-12T15:53:28Z")

</div>

Hi Guys,

Shouldn’t AS 65538 become 1.2?

_"For AS numbers above 65535, we use the next high order bit value and start counting again at 0. For example:_

_AS 65536 becomes 1.0_  
_AS 65537 becomes 1.1_  
_AS 65538 becomes 1.1"_

Thanks,

Gareth.

---

<div class="post-metadata">

### Author: ![ReneMolenaar](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/renemolenaar/32/488_2.png) [@ReneMolenaar](https://forum.networklessons.com/u/ReneMolenaar)
#### Post date: [March 17, 2020, 3:40pm UTC](https://forum.networklessons.com/t/bgp-4-byte-as-number/3184/14 "2020-03-17T15:40:21Z")

</div>

Hi Gareth,

I just fixed this error, thanks.

Rene

---

<div class="post-metadata">

### Author: ![pradyumnayadavgla](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/p/f9ae1b/32.png) [@pradyumnayadavgla](https://forum.networklessons.com/u/pradyumnayadavgla)
#### Post date: [April 22, 2020, 9:35pm UTC](https://forum.networklessons.com/t/bgp-4-byte-as-number/3184/15 "2020-04-22T21:35:15Z")

</div>

Hi Rene,

what would be the range for higher bit Asdot+ starting from ::  
65536- 1.0  
65537-1.1  
65538-1.2  
!  
!  
!  
will be continued till last AS no but what will be the last AS value for this ( ? becomes ?.?) .  
Also please emphasize it in this way that it can show starting, Medium and last values ?

---

<div class="post-metadata">

### Author: ![lagapidis](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/lagapidis/32/4949_2.png) [@lagapidis](https://forum.networklessons.com/u/lagapidis)
#### Post date: [April 23, 2020, 1:58pm UTC](https://forum.networklessons.com/t/bgp-4-byte-as-number/3184/16 "2020-04-23T13:58:14Z")

</div>

Hello Pradyumna

If you continue this sequence, you will get:

- AS 65536 becomes 1.0
- AS 65537 becomes 1.1
- AS 65538 becomes 1.2
- …
- …
- AS 131071 becomes 1.65535
- AS 131072 becomes 2.0
- AS 131073 becomes 2.1
- AS 131074 becomes 2.2
- …
- …
- AS 4294967296 becomes 65535.65535
- AS 4294967297 becomes 65536.1
- AS 4294967298 becomes 65536.2
- …
- …
- AS 4295032831 becomes 65536.65535
- AS 4295032832 becomes 65536.65536

Now all of these values can be calculated, but many of them are reserved for various purposes including private AS’es and other uses. These can be seen [at the following IANA link](https://www.iana.org/assignments/as-numbers/as-numbers.xhtml). Another cool tool you might find useful is this [IANA converter](https://submit.apnic.net/cgi-bin/convert-asn.pl) of the various ASN formats.

I hope this has been helpful!

Laz

---

<div class="post-metadata">

### Author: ![pradyumnayadavgla](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/p/f9ae1b/32.png) [@pradyumnayadavgla](https://forum.networklessons.com/u/pradyumnayadavgla)
#### Post date: [April 23, 2020, 2:40pm UTC](https://forum.networklessons.com/t/bgp-4-byte-as-number/3184/17 "2020-04-23T14:40:34Z")

</div>

Hi Laz,

Thanks for this explanation but I think it must be stopped at AS 4295032831 becomes 65536.65535 as we know sequence started from 1.0 and 0-65535 makes total count 65536 and so 1-65536 makes total count 65536 so according to last AS value post dotted notation becomes 65537th which is exceeding the range.

Am i right or not ?

---

<div class="post-metadata">

### Author: ![lagapidis](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/lagapidis/32/4949_2.png) [@lagapidis](https://forum.networklessons.com/u/lagapidis)
#### Post date: [April 24, 2020, 6:30am UTC](https://forum.networklessons.com/t/bgp-4-byte-as-number/3184/18 "2020-04-24T06:30:02Z")

</div>

Hello Pradyumna

My numbers were incorrect. It seems it should actually end at **4294967295** which is **65535.65535** which in binary is just **32 ones**. But I was using the IANA converter to verify, and it seems to be able to convert ASNs up to **4295032832** or **65536.65536** which is incorrect, because in order to represent these numbers you need 33 bits, but ASNs are only 32 bits.

So it seems that IANA’s converter is incorrect 🤪 unless there is some other explanation for this.

I hope this has been helpful!

Laz

---

<div class="post-metadata">

### Author: ![pradyumnayadavgla](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/p/f9ae1b/32.png) [@pradyumnayadavgla](https://forum.networklessons.com/u/pradyumnayadavgla)
#### Post date: [April 24, 2020, 4:47pm UTC](https://forum.networklessons.com/t/bgp-4-byte-as-number/3184/19 "2020-04-24T16:47:26Z")

</div>

Thanks Laz for this correction and well explanation.

But Still confused for 65536 range b/c as per total counts b/w range, it should be up to 65536:65535 b/c before decimal value staring from 1 not 0?

---

<div class="post-metadata">

### Author: ![lagapidis](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/lagapidis/32/4949_2.png) [@lagapidis](https://forum.networklessons.com/u/lagapidis)
#### Post date: [April 26, 2020, 8:55am UTC](https://forum.networklessons.com/t/bgp-4-byte-as-number/3184/20 "2020-04-26T08:55:32Z")

</div>

Hello Pradyumna

Remember that asdot simply represents a 32 bit binary number. In binary, we have:

`11111111111111111111111111111111`

We can separate this into two 16 bit numbers like so:

`1111111111111111 1111111111111111`

Now if we translate these into decimal and put a dot between them we get:

65535.65535

This is the highest AS number you can get. Remember, that we start counting at 0, and if you include 0, we have a total number of 65536 values, but in decimal their representation goes from 0 to 65535.

I hope this has been helpful!

Laz

[Next page](https://forum.networklessons.com/t/bgp-4-byte-as-number/3184.md?page=2)
