p4-discuss@lists.p4.org

discussion of p4 language ideas, tools, questions, etc. -- not related to direct code development

View all threads

Payload Bit Patter Matching

SK
Serdar Kut
Thu, Dec 20, 2018 12:34 PM

Hi all,

I'm very new to P4 and trying to figure out if I can match a specific bit pattern with the UDP Payload and take action according to a table which I'll predefine?

I'm aware any type of headers can be defined and used to match and forward the packet. But not sure if I can define a "header like" extension to match my bits of interest in the payload.

Thanks

Serdar
[Borsa Istanbul]http://www.borsaistanbul.com

Bu e-posta mesaji, mesajin alici kisminda belirtilmis olan kullanici icindir. Mesajin alicisi siz degilseniz -dogrudan veya dolayli olarak- mesaji kullanmayiniz, acmayiniz, dagitmayiniz, yazicidan dokumunu almayiniz veya herhangi bir kismini kopyalamayiniz. Yanlislikla bu mesaj size ulasmissa lutfen, siliniz ve t?m kopyalarini yok ederek mesaji gonderene acilen haber veriniz. Bu mesaj icerisinde belirtilenler sadece gondericinin kisisel gorusleridir. Bu gorusler Borsa Istanbul A.S.'nin goruslerini yansitmadigi gibi, Borsa Istanbul A.S.'yi baglayici da degildir.

This email is intended solely for the use of the individual or entity to whom it is addressed. If you are not the intended addressee of this message, you should not use, open, disseminate, distribute, print or copy this e-mail. If you have received this email in error, please delete it from your system and notify the sender immediately. Borsa Istanbul does not accept any legal responsibility whatsoever for the contents of this message. Any opinions contained in this message are those of the author and are not given or endorsed by Borsa Istanbul.

Borsa Istanbul A.S. http://www.borsaistanbul.com

Hi all, I'm very new to P4 and trying to figure out if I can match a specific bit pattern with the UDP Payload and take action according to a table which I'll predefine? I'm aware any type of headers can be defined and used to match and forward the packet. But not sure if I can define a "header like" extension to match my bits of interest in the payload. Thanks Serdar [Borsa Istanbul]<http://www.borsaistanbul.com> Bu e-posta mesaji, mesajin alici kisminda belirtilmis olan kullanici icindir. Mesajin alicisi siz degilseniz -dogrudan veya dolayli olarak- mesaji kullanmayiniz, acmayiniz, dagitmayiniz, yazicidan dokumunu almayiniz veya herhangi bir kismini kopyalamayiniz. Yanlislikla bu mesaj size ulasmissa lutfen, siliniz ve t?m kopyalarini yok ederek mesaji gonderene acilen haber veriniz. Bu mesaj icerisinde belirtilenler sadece gondericinin kisisel gorusleridir. Bu gorusler Borsa Istanbul A.S.'nin goruslerini yansitmadigi gibi, Borsa Istanbul A.S.'yi baglayici da degildir. This email is intended solely for the use of the individual or entity to whom it is addressed. If you are not the intended addressee of this message, you should not use, open, disseminate, distribute, print or copy this e-mail. If you have received this email in error, please delete it from your system and notify the sender immediately. Borsa Istanbul does not accept any legal responsibility whatsoever for the contents of this message. Any opinions contained in this message are those of the author and are not given or endorsed by Borsa Istanbul. Borsa Istanbul A.S. <http://www.borsaistanbul.com>
MB
Mihai Budiu
Thu, Dec 20, 2018 4:23 PM

The notion of header in P4 is not the same as a protocol header in internet standards.
"Headers" in P4 means "bytes at the beginning of the packet".
So if the thing you are looking for has fixed length and is at the beginning of the packet you can look for it.

In P4 you cannot write a loop to look for a pattern anywhere in a packet, or to look for a pattern whose size is not a constant.

Mihai

From: P4-discuss p4-discuss-bounces@lists.p4.org On Behalf Of Serdar Kut via P4-discuss
Sent: Thursday, December 20, 2018 4:35 AM
To: p4-discuss@lists.p4.org
Subject: [P4-discuss] Payload Bit Patter Matching

Hi all,

I'm very new to P4 and trying to figure out if I can match a specific bit pattern with the UDP Payload and take action according to a table which I'll predefine?

I'm aware any type of headers can be defined and used to match and forward the packet. But not sure if I can define a "header like" extension to match my bits of interest in the payload.

Thanks

Serdar
[Borsa Istanbul]https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.borsaistanbul.com&data=02%7C01%7Cmbudiu%40vmware.com%7C3860f492ba3d413023bd08d66677a14c%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C636809061332192691&sdata=iJZV4InERjRTKScaDBaBeya2MtRe4jpt6%2FeikHn3Z9o%3D&reserved=0

Bu e-posta mesaji, mesajin alici kisminda belirtilmis olan kullanici icindir. Mesajin alicisi siz degilseniz -dogrudan veya dolayli olarak- mesaji kullanmayiniz, acmayiniz, dagitmayiniz, yazicidan dokumunu almayiniz veya herhangi bir kismini kopyalamayiniz. Yanlislikla bu mesaj size ulasmissa lutfen, siliniz ve tüm kopyalarini yok ederek mesaji gonderene acilen haber veriniz. Bu mesaj icerisinde belirtilenler sadece gondericinin kisisel gorusleridir. Bu gorusler Borsa Istanbul A.S.'nin goruslerini yansitmadigi gibi, Borsa Istanbul A.S.'yi baglayici da degildir.

This email is intended solely for the use of the individual or entity to whom it is addressed. If you are not the intended addressee of this message, you should not use, open, disseminate, distribute, print or copy this e-mail. If you have received this email in error, please delete it from your system and notify the sender immediately. Borsa Istanbul does not accept any legal responsibility whatsoever for the contents of this message. Any opinions contained in this message are those of the author and are not given or endorsed by Borsa Istanbul.
Borsa Istanbul A.S. https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.borsaistanbul.com&data=02%7C01%7Cmbudiu%40vmware.com%7C3860f492ba3d413023bd08d66677a14c%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C636809061332202696&sdata=zUS8pesGhbJxFX7SgQ8BwqMO9dlyraHFyDb%2FwmEhVpY%3D&reserved=0

The notion of header in P4 is not the same as a protocol header in internet standards. "Headers" in P4 means "bytes at the beginning of the packet". So if the thing you are looking for has fixed length and is at the beginning of the packet you can look for it. In P4 you cannot write a loop to look for a pattern anywhere in a packet, or to look for a pattern whose size is not a constant. Mihai From: P4-discuss <p4-discuss-bounces@lists.p4.org> On Behalf Of Serdar Kut via P4-discuss Sent: Thursday, December 20, 2018 4:35 AM To: p4-discuss@lists.p4.org Subject: [P4-discuss] Payload Bit Patter Matching Hi all, I'm very new to P4 and trying to figure out if I can match a specific bit pattern with the UDP Payload and take action according to a table which I'll predefine? I'm aware any type of headers can be defined and used to match and forward the packet. But not sure if I can define a "header like" extension to match my bits of interest in the payload. Thanks Serdar [Borsa Istanbul]<https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.borsaistanbul.com&data=02%7C01%7Cmbudiu%40vmware.com%7C3860f492ba3d413023bd08d66677a14c%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C636809061332192691&sdata=iJZV4InERjRTKScaDBaBeya2MtRe4jpt6%2FeikHn3Z9o%3D&reserved=0> Bu e-posta mesaji, mesajin alici kisminda belirtilmis olan kullanici icindir. Mesajin alicisi siz degilseniz -dogrudan veya dolayli olarak- mesaji kullanmayiniz, acmayiniz, dagitmayiniz, yazicidan dokumunu almayiniz veya herhangi bir kismini kopyalamayiniz. Yanlislikla bu mesaj size ulasmissa lutfen, siliniz ve tüm kopyalarini yok ederek mesaji gonderene acilen haber veriniz. Bu mesaj icerisinde belirtilenler sadece gondericinin kisisel gorusleridir. Bu gorusler Borsa Istanbul A.S.'nin goruslerini yansitmadigi gibi, Borsa Istanbul A.S.'yi baglayici da degildir. This email is intended solely for the use of the individual or entity to whom it is addressed. If you are not the intended addressee of this message, you should not use, open, disseminate, distribute, print or copy this e-mail. If you have received this email in error, please delete it from your system and notify the sender immediately. Borsa Istanbul does not accept any legal responsibility whatsoever for the contents of this message. Any opinions contained in this message are those of the author and are not given or endorsed by Borsa Istanbul. Borsa Istanbul A.S. <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.borsaistanbul.com&data=02%7C01%7Cmbudiu%40vmware.com%7C3860f492ba3d413023bd08d66677a14c%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C636809061332202696&sdata=zUS8pesGhbJxFX7SgQ8BwqMO9dlyraHFyDb%2FwmEhVpY%3D&reserved=0>
SK
Serdar Kut
Thu, Dec 20, 2018 5:12 PM

Thanks Mihai. By means "at the beginning of the packet" it depends on how I match it right? My bits of interest is fix and begins with 64. Byte at the payload and has a fix length, so I think I can match it, am I correct? Packet type is also fixed, so I know  exactly where my bits are located.

Serdar Kut

Kimden: Mihai Budiu
G?nderildi: 20 Aral?k Per?embe 19:24
Konu: RE: Payload Bit Patter Matching
Kime: Serdar Kut, p4-discuss@lists.p4.org

The notion of header in P4 is not the same as a protocol header in internet standards.
"Headers" in P4 means "bytes at the beginning of the packet".
So if the thing you are looking for has fixed length and is at the beginning of the packet you can look for it.

In P4 you cannot write a loop to look for a pattern anywhere in a packet, or to look for a pattern whose size is not a constant.

Mihai

From: P4-discuss p4-discuss-bounces@lists.p4.org On Behalf Of Serdar Kut via P4-discuss
Sent: Thursday, December 20, 2018 4:35 AM
To: p4-discuss@lists.p4.org
Subject: [P4-discuss] Payload Bit Patter Matching

Hi all,

I'm very new to P4 and trying to figure out if I can match a specific bit pattern with the UDP Payload and take action according to a table which I'll predefine?

I'm aware any type of headers can be defined and used to match and forward the packet. But not sure if I can define a "header like" extension to match my bits of interest in the payload.

Thanks

Serdar
Bu e-posta mesaji, mesajin alici kisminda belirtilmis olan kullanici icindir. Mesajin alicisi siz degilseniz -dogrudan veya dolayli olarak- mesaji kullanmayiniz, acmayiniz, dagitmayiniz, yazicidan dokumunu almayiniz veya herhangi bir kismini kopyalamayiniz. Yanlislikla bu mesaj size ulasmissa lutfen, siliniz ve t?m kopyalarini yok ederek mesaji gonderene acilen haber veriniz. Bu mesaj icerisinde belirtilenler sadece gondericinin kisisel gorusleridir. Bu gorusler Borsa Istanbul A.S.'nin goruslerini yansitmadigi gibi, Borsa Istanbul A.S.'yi baglayici da degildir.
This email is intended solely for the use of the individual or entity to whom it is addressed. If you are not the intended addressee of this message, you should not use, open, disseminate, distribute, print or copy this e-mail. If you have received this email in error, please delete it from your system and notify the sender immediately. Borsa Istanbul does not accept any legal responsibility whatsoever for the contents of this message. Any opinions contained in this message are those of the author and are not given or endorsed by Borsa Istanbul.
Borsa Istanbul A.S. https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.borsaistanbul.com&data=02%7C01%7Cmbudiu%40vmware.com%7C3860f492ba3d413023bd08d66677a14c%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C636809061332202696&sdata=zUS8pesGhbJxFX7SgQ8BwqMO9dlyraHFyDb%2FwmEhVpY%3D&reserved=0

[Borsa Istanbul]http://www.borsaistanbul.com

Bu e-posta mesaji, mesajin alici kisminda belirtilmis olan kullanici icindir. Mesajin alicisi siz degilseniz -dogrudan veya dolayli olarak- mesaji kullanmayiniz, acmayiniz, dagitmayiniz, yazicidan dokumunu almayiniz veya herhangi bir kismini kopyalamayiniz. Yanlislikla bu mesaj size ulasmissa lutfen, siliniz ve t?m kopyalarini yok ederek mesaji gonderene acilen haber veriniz. Bu mesaj icerisinde belirtilenler sadece gondericinin kisisel gorusleridir. Bu gorusler Borsa Istanbul A.S.'nin goruslerini yansitmadigi gibi, Borsa Istanbul A.S.'yi baglayici da degildir.

This email is intended solely for the use of the individual or entity to whom it is addressed. If you are not the intended addressee of this message, you should not use, open, disseminate, distribute, print or copy this e-mail. If you have received this email in error, please delete it from your system and notify the sender immediately. Borsa Istanbul does not accept any legal responsibility whatsoever for the contents of this message. Any opinions contained in this message are those of the author and are not given or endorsed by Borsa Istanbul.

Borsa Istanbul A.S. http://www.borsaistanbul.com

Thanks Mihai. By means "at the beginning of the packet" it depends on how I match it right? My bits of interest is fix and begins with 64. Byte at the payload and has a fix length, so I think I can match it, am I correct? Packet type is also fixed, so I know exactly where my bits are located. Serdar Kut Kimden: Mihai Budiu G?nderildi: 20 Aral?k Per?embe 19:24 Konu: RE: Payload Bit Patter Matching Kime: Serdar Kut, p4-discuss@lists.p4.org The notion of header in P4 is not the same as a protocol header in internet standards. "Headers" in P4 means "bytes at the beginning of the packet". So if the thing you are looking for has fixed length and is at the beginning of the packet you can look for it. In P4 you cannot write a loop to look for a pattern anywhere in a packet, or to look for a pattern whose size is not a constant. Mihai From: P4-discuss <p4-discuss-bounces@lists.p4.org> On Behalf Of Serdar Kut via P4-discuss Sent: Thursday, December 20, 2018 4:35 AM To: p4-discuss@lists.p4.org Subject: [P4-discuss] Payload Bit Patter Matching Hi all, I'm very new to P4 and trying to figure out if I can match a specific bit pattern with the UDP Payload and take action according to a table which I'll predefine? I'm aware any type of headers can be defined and used to match and forward the packet. But not sure if I can define a "header like" extension to match my bits of interest in the payload. Thanks Serdar Bu e-posta mesaji, mesajin alici kisminda belirtilmis olan kullanici icindir. Mesajin alicisi siz degilseniz -dogrudan veya dolayli olarak- mesaji kullanmayiniz, acmayiniz, dagitmayiniz, yazicidan dokumunu almayiniz veya herhangi bir kismini kopyalamayiniz. Yanlislikla bu mesaj size ulasmissa lutfen, siliniz ve t?m kopyalarini yok ederek mesaji gonderene acilen haber veriniz. Bu mesaj icerisinde belirtilenler sadece gondericinin kisisel gorusleridir. Bu gorusler Borsa Istanbul A.S.'nin goruslerini yansitmadigi gibi, Borsa Istanbul A.S.'yi baglayici da degildir. This email is intended solely for the use of the individual or entity to whom it is addressed. If you are not the intended addressee of this message, you should not use, open, disseminate, distribute, print or copy this e-mail. If you have received this email in error, please delete it from your system and notify the sender immediately. Borsa Istanbul does not accept any legal responsibility whatsoever for the contents of this message. Any opinions contained in this message are those of the author and are not given or endorsed by Borsa Istanbul. Borsa Istanbul A.S. <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.borsaistanbul.com&data=02%7C01%7Cmbudiu%40vmware.com%7C3860f492ba3d413023bd08d66677a14c%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C636809061332202696&sdata=zUS8pesGhbJxFX7SgQ8BwqMO9dlyraHFyDb%2FwmEhVpY%3D&reserved=0> [Borsa Istanbul]<http://www.borsaistanbul.com> Bu e-posta mesaji, mesajin alici kisminda belirtilmis olan kullanici icindir. Mesajin alicisi siz degilseniz -dogrudan veya dolayli olarak- mesaji kullanmayiniz, acmayiniz, dagitmayiniz, yazicidan dokumunu almayiniz veya herhangi bir kismini kopyalamayiniz. Yanlislikla bu mesaj size ulasmissa lutfen, siliniz ve t?m kopyalarini yok ederek mesaji gonderene acilen haber veriniz. Bu mesaj icerisinde belirtilenler sadece gondericinin kisisel gorusleridir. Bu gorusler Borsa Istanbul A.S.'nin goruslerini yansitmadigi gibi, Borsa Istanbul A.S.'yi baglayici da degildir. This email is intended solely for the use of the individual or entity to whom it is addressed. If you are not the intended addressee of this message, you should not use, open, disseminate, distribute, print or copy this e-mail. If you have received this email in error, please delete it from your system and notify the sender immediately. Borsa Istanbul does not accept any legal responsibility whatsoever for the contents of this message. Any opinions contained in this message are those of the author and are not given or endorsed by Borsa Istanbul. Borsa Istanbul A.S. <http://www.borsaistanbul.com>
AF
Andy Fingerhut
Thu, Dec 20, 2018 5:17 PM

If you can define one or more sequences of fixed-length headers that you
can write a P4 parser for (or some of them can even have variable-length
portions, like IPv4 options), and the part you want to match on appears at
a fixed offset from the beginning of one of those headers, that is what P4
is very good at.

If the part you want to match on is at a variable-length offset from the
beginning of one of those headers, and it is in one of only 2 or 3 or a
small fixed number of places, you can write multiple conditions and OR them
together.

If it can be at one of N possible places, where N can be as large as the
payload, then while technically N is still finite and you can write a big
OR of many fixed-offset conditions, you are getting further and further
away from the strengths of P4.

Andy

On Thu, Dec 20, 2018 at 9:13 AM Serdar Kut via P4-discuss <
p4-discuss@lists.p4.org> wrote:

Thanks Mihai. By means "at the beginning of the packet" it depends on how
I match it right? My bits of interest is fix and begins with 64. Byte at
the payload and has a fix length, so I think I can match it, am I correct?
Packet type is also fixed, so I know  exactly where my bits are located.

Serdar Kut

Kimden: Mihai Budiu
Gönderildi: 20 Aralık Perşembe 19:24
Konu: RE: Payload Bit Patter Matching
Kime: Serdar Kut, p4-discuss@lists.p4.org

The notion of header in P4 is not the same as a protocol header in
internet standards.
“Headers” in P4 means “bytes at the beginning of the packet”.
So if the thing you are looking for has fixed length and is at the
beginning of the packet you can look for it.

In P4 you cannot write a loop to look for a pattern anywhere in a packet,
or to look for a pattern whose size is not a constant.

Mihai

From: P4-discuss p4-discuss-bounces@lists.p4.org *On Behalf Of *Serdar
Kut via P4-discuss
Sent: Thursday, December 20, 2018 4:35 AM
To: p4-discuss@lists.p4.org
Subject: [P4-discuss] Payload Bit Patter Matching

Hi all,

I’m very new to P4 and trying to figure out if I can match a specific bit
pattern with the UDP Payload and take action according to a table which
I’ll predefine?

I’m aware any type of headers can be defined and used to match and forward
the packet. But not sure if I can define a “header like” extension to match
my bits of interest in the payload.

Thanks

Serdar
Bu e-posta mesaji, mesajin alici kisminda belirtilmis olan kullanici
icindir. Mesajin alicisi siz degilseniz -dogrudan veya dolayli olarak-
mesaji kullanmayiniz, acmayiniz, dagitmayiniz, yazicidan dokumunu almayiniz
veya herhangi bir kismini kopyalamayiniz. Yanlislikla bu mesaj size
ulasmissa lutfen, siliniz ve tüm kopyalarini yok ederek mesaji gonderene
acilen haber veriniz. Bu mesaj icerisinde belirtilenler sadece gondericinin
kisisel gorusleridir. Bu gorusler Borsa Istanbul A.S.’nin goruslerini
yansitmadigi gibi, Borsa Istanbul A.S.’yi baglayici da degildir.
This email is intended solely for the use of the individual or entity to
whom it is addressed. If you are not the intended addressee of this
message, you should not use, open, disseminate, distribute, print or copy
this e-mail. If you have received this email in error, please delete it
from your system and notify the sender immediately. Borsa Istanbul does not
accept any legal responsibility whatsoever for the contents of this
message. Any opinions contained in this message are those of the author and
are not given or endorsed by Borsa Istanbul.
*Borsa Istanbul A.S. *
https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.borsaistanbul.com&data=02%7C01%7Cmbudiu%40vmware.com%7C3860f492ba3d413023bd08d66677a14c%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C636809061332202696&sdata=zUS8pesGhbJxFX7SgQ8BwqMO9dlyraHFyDb%2FwmEhVpY%3D&reserved=0

[image: Borsa Istanbul] http://www.borsaistanbul.com

Bu e-posta mesaji, mesajin alici kisminda belirtilmis olan kullanici
icindir. Mesajin alicisi siz degilseniz -dogrudan veya dolayli olarak-
mesaji kullanmayiniz, acmayiniz, dagitmayiniz, yazicidan dokumunu almayiniz
veya herhangi bir kismini kopyalamayiniz. Yanlislikla bu mesaj size
ulasmissa lutfen, siliniz ve tüm kopyalarini yok ederek mesaji gonderene
acilen haber veriniz. Bu mesaj icerisinde belirtilenler sadece gondericinin
kisisel gorusleridir. Bu gorusler Borsa Istanbul A.S.’nin goruslerini
yansitmadigi gibi, Borsa Istanbul A.S.’yi baglayici da degildir.

This email is intended solely for the use of the individual or entity to
whom it is addressed. If you are not the intended addressee of this
message, you should not use, open, disseminate, distribute, print or copy
this e-mail. If you have received this email in error, please delete it
from your system and notify the sender immediately. Borsa Istanbul does not
accept any legal responsibility whatsoever for the contents of this
message. Any opinions contained in this message are those of the author and
are not given or endorsed by Borsa Istanbul.
Borsa Istanbul A.S. http://www.borsaistanbul.com


P4-discuss mailing list
P4-discuss@lists.p4.org
http://lists.p4.org/mailman/listinfo/p4-discuss_lists.p4.org

If you can define one or more sequences of fixed-length headers that you can write a P4 parser for (or some of them can even have variable-length portions, like IPv4 options), and the part you want to match on appears at a fixed offset from the beginning of one of those headers, that is what P4 is very good at. If the part you want to match on is at a variable-length offset from the beginning of one of those headers, and it is in one of only 2 or 3 or a small fixed number of places, you can write multiple conditions and OR them together. If it can be at one of N possible places, where N can be as large as the payload, then while technically N is still finite and you can write a big OR of many fixed-offset conditions, you are getting further and further away from the strengths of P4. Andy On Thu, Dec 20, 2018 at 9:13 AM Serdar Kut via P4-discuss < p4-discuss@lists.p4.org> wrote: > Thanks Mihai. By means "at the beginning of the packet" it depends on how > I match it right? My bits of interest is fix and begins with 64. Byte at > the payload and has a fix length, so I think I can match it, am I correct? > Packet type is also fixed, so I know exactly where my bits are located. > > Serdar Kut > > > > Kimden: Mihai Budiu > Gönderildi: 20 Aralık Perşembe 19:24 > Konu: RE: Payload Bit Patter Matching > Kime: Serdar Kut, p4-discuss@lists.p4.org > > > The notion of header in P4 is not the same as a protocol header in > internet standards. > “Headers” in P4 means “bytes at the beginning of the packet”. > So if the thing you are looking for has fixed length and is at the > beginning of the packet you can look for it. > > In P4 you cannot write a loop to look for a pattern anywhere in a packet, > or to look for a pattern whose size is not a constant. > > Mihai > > *From:* P4-discuss <p4-discuss-bounces@lists.p4.org> *On Behalf Of *Serdar > Kut via P4-discuss > *Sent:* Thursday, December 20, 2018 4:35 AM > *To:* p4-discuss@lists.p4.org > *Subject:* [P4-discuss] Payload Bit Patter Matching > > > Hi all, > > I’m very new to P4 and trying to figure out if I can match a specific bit > pattern with the UDP Payload and take action according to a table which > I’ll predefine? > > I’m aware any type of headers can be defined and used to match and forward > the packet. But not sure if I can define a “header like” extension to match > my bits of interest in the payload. > > Thanks > > Serdar > Bu e-posta mesaji, mesajin alici kisminda belirtilmis olan kullanici > icindir. Mesajin alicisi siz degilseniz -dogrudan veya dolayli olarak- > mesaji kullanmayiniz, acmayiniz, dagitmayiniz, yazicidan dokumunu almayiniz > veya herhangi bir kismini kopyalamayiniz. Yanlislikla bu mesaj size > ulasmissa lutfen, siliniz ve tüm kopyalarini yok ederek mesaji gonderene > acilen haber veriniz. Bu mesaj icerisinde belirtilenler sadece gondericinin > kisisel gorusleridir. Bu gorusler Borsa Istanbul A.S.’nin goruslerini > yansitmadigi gibi, Borsa Istanbul A.S.’yi baglayici da degildir. > This email is intended solely for the use of the individual or entity to > whom it is addressed. If you are not the intended addressee of this > message, you should not use, open, disseminate, distribute, print or copy > this e-mail. If you have received this email in error, please delete it > from your system and notify the sender immediately. Borsa Istanbul does not > accept any legal responsibility whatsoever for the contents of this > message. Any opinions contained in this message are those of the author and > are not given or endorsed by Borsa Istanbul. > *Borsa Istanbul A.S. * > <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.borsaistanbul.com&data=02%7C01%7Cmbudiu%40vmware.com%7C3860f492ba3d413023bd08d66677a14c%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C636809061332202696&sdata=zUS8pesGhbJxFX7SgQ8BwqMO9dlyraHFyDb%2FwmEhVpY%3D&reserved=0> > > > [image: Borsa Istanbul] <http://www.borsaistanbul.com> > > Bu e-posta mesaji, mesajin alici kisminda belirtilmis olan kullanici > icindir. Mesajin alicisi siz degilseniz -dogrudan veya dolayli olarak- > mesaji kullanmayiniz, acmayiniz, dagitmayiniz, yazicidan dokumunu almayiniz > veya herhangi bir kismini kopyalamayiniz. Yanlislikla bu mesaj size > ulasmissa lutfen, siliniz ve tüm kopyalarini yok ederek mesaji gonderene > acilen haber veriniz. Bu mesaj icerisinde belirtilenler sadece gondericinin > kisisel gorusleridir. Bu gorusler Borsa Istanbul A.S.’nin goruslerini > yansitmadigi gibi, Borsa Istanbul A.S.’yi baglayici da degildir. > > This email is intended solely for the use of the individual or entity to > whom it is addressed. If you are not the intended addressee of this > message, you should not use, open, disseminate, distribute, print or copy > this e-mail. If you have received this email in error, please delete it > from your system and notify the sender immediately. Borsa Istanbul does not > accept any legal responsibility whatsoever for the contents of this > message. Any opinions contained in this message are those of the author and > are not given or endorsed by Borsa Istanbul. > Borsa Istanbul A.S. <http://www.borsaistanbul.com> > > _______________________________________________ > P4-discuss mailing list > P4-discuss@lists.p4.org > http://lists.p4.org/mailman/listinfo/p4-discuss_lists.p4.org >
MB
Mihai Budiu
Thu, Dec 20, 2018 5:20 PM

The way you read bits out of a packet is by using parsers. Think of a packet as being a byte stream. When you call extract(header) you actually take a number of bits from the packet enough to populate the header and advance the cursor of the byte stream. Headers can have a variable number of bits, (in P4-16 this is done with varbit fields) - an example is IP options.

If you can write a set of headers and express your computation as a sequence of extracts from the beginning of the packet using these headers then you will be able to get the information you want. In the end your program will have to execute some sequence like:

extract(ethernet);
extract(ip);
extract(udp);
extract(myCustomHeader);

From: Serdar Kut Serdar.Kut@borsaistanbul.com
Sent: Thursday, December 20, 2018 9:13 AM
To: p4-discuss@lists.p4.org; Mihai Budiu mbudiu@vmware.com
Subject: Re: Payload Bit Patter Matching

Thanks Mihai. By means "at the beginning of the packet" it depends on how I match it right? My bits of interest is fix and begins with 64. Byte at the payload and has a fix length, so I think I can match it, am I correct? Packet type is also fixed, so I know  exactly where my bits are located.
Serdar Kut

Kimden: Mihai Budiu
Gönderildi: 20 Aralık Perşembe 19:24
Konu: RE: Payload Bit Patter Matching
Kime: Serdar Kut, p4-discuss@lists.p4.orgmailto:p4-discuss@lists.p4.org

The notion of header in P4 is not the same as a protocol header in internet standards.
"Headers" in P4 means "bytes at the beginning of the packet".
So if the thing you are looking for has fixed length and is at the beginning of the packet you can look for it.

In P4 you cannot write a loop to look for a pattern anywhere in a packet, or to look for a pattern whose size is not a constant.

Mihai

From: P4-discuss <p4-discuss-bounces@lists.p4.orgmailto:p4-discuss-bounces@lists.p4.org> On Behalf Of Serdar Kut via P4-discuss
Sent: Thursday, December 20, 2018 4:35 AM
To: p4-discuss@lists.p4.orgmailto:p4-discuss@lists.p4.org
Subject: [P4-discuss] Payload Bit Patter Matching

Hi all,

I'm very new to P4 and trying to figure out if I can match a specific bit pattern with the UDP Payload and take action according to a table which I'll predefine?

I'm aware any type of headers can be defined and used to match and forward the packet. But not sure if I can define a "header like" extension to match my bits of interest in the payload.

Thanks

Serdar
Bu e-posta mesaji, mesajin alici kisminda belirtilmis olan kullanici icindir. Mesajin alicisi siz degilseniz -dogrudan veya dolayli olarak- mesaji kullanmayiniz, acmayiniz, dagitmayiniz, yazicidan dokumunu almayiniz veya herhangi bir kismini kopyalamayiniz. Yanlislikla bu mesaj size ulasmissa lutfen, siliniz ve tüm kopyalarini yok ederek mesaji gonderene acilen haber veriniz. Bu mesaj icerisinde belirtilenler sadece gondericinin kisisel gorusleridir. Bu gorusler Borsa Istanbul A.S.'nin goruslerini yansitmadigi gibi, Borsa Istanbul A.S.'yi baglayici da degildir.
This email is intended solely for the use of the individual or entity to whom it is addressed. If you are not the intended addressee of this message, you should not use, open, disseminate, distribute, print or copy this e-mail. If you have received this email in error, please delete it from your system and notify the sender immediately. Borsa Istanbul does not accept any legal responsibility whatsoever for the contents of this message. Any opinions contained in this message are those of the author and are not given or endorsed by Borsa Istanbul.
Borsa Istanbul A.S. https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.borsaistanbul.com&data=02%7C01%7Cmbudiu%40vmware.com%7C4f11ebb9a9f34256dd0708d6669e7c50%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C636809228231932300&sdata=cpuaeAuO73FZChk2REN4PmV4WScglOWr6RLNFfTWWaI%3D&reserved=0

[Borsa Istanbul]https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.borsaistanbul.com&data=02%7C01%7Cmbudiu%40vmware.com%7C4f11ebb9a9f34256dd0708d6669e7c50%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C636809228231932300&sdata=cpuaeAuO73FZChk2REN4PmV4WScglOWr6RLNFfTWWaI%3D&reserved=0

Bu e-posta mesaji, mesajin alici kisminda belirtilmis olan kullanici icindir. Mesajin alicisi siz degilseniz -dogrudan veya dolayli olarak- mesaji kullanmayiniz, acmayiniz, dagitmayiniz, yazicidan dokumunu almayiniz veya herhangi bir kismini kopyalamayiniz. Yanlislikla bu mesaj size ulasmissa lutfen, siliniz ve tüm kopyalarini yok ederek mesaji gonderene acilen haber veriniz. Bu mesaj icerisinde belirtilenler sadece gondericinin kisisel gorusleridir. Bu gorusler Borsa Istanbul A.S.'nin goruslerini yansitmadigi gibi, Borsa Istanbul A.S.'yi baglayici da degildir.

This email is intended solely for the use of the individual or entity to whom it is addressed. If you are not the intended addressee of this message, you should not use, open, disseminate, distribute, print or copy this e-mail. If you have received this email in error, please delete it from your system and notify the sender immediately. Borsa Istanbul does not accept any legal responsibility whatsoever for the contents of this message. Any opinions contained in this message are those of the author and are not given or endorsed by Borsa Istanbul.
Borsa Istanbul A.S. https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.borsaistanbul.com&data=02%7C01%7Cmbudiu%40vmware.com%7C4f11ebb9a9f34256dd0708d6669e7c50%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C636809228232088554&sdata=qLhs7EACTV9s4UXVUg4V4Juxa1mbqZjhjSdbhGCniec%3D&reserved=0

The way you read bits out of a packet is by using parsers. Think of a packet as being a byte stream. When you call extract(header) you actually take a number of bits from the packet enough to populate the header and advance the cursor of the byte stream. Headers can have a variable number of bits, (in P4-16 this is done with varbit fields) - an example is IP options. If you can write a set of headers and express your computation as a sequence of extracts from the beginning of the packet using these headers then you will be able to get the information you want. In the end your program will have to execute some sequence like: extract(ethernet); extract(ip); extract(udp); extract(myCustomHeader); From: Serdar Kut <Serdar.Kut@borsaistanbul.com> Sent: Thursday, December 20, 2018 9:13 AM To: p4-discuss@lists.p4.org; Mihai Budiu <mbudiu@vmware.com> Subject: Re: Payload Bit Patter Matching Thanks Mihai. By means "at the beginning of the packet" it depends on how I match it right? My bits of interest is fix and begins with 64. Byte at the payload and has a fix length, so I think I can match it, am I correct? Packet type is also fixed, so I know exactly where my bits are located. Serdar Kut Kimden: Mihai Budiu Gönderildi: 20 Aralık Perşembe 19:24 Konu: RE: Payload Bit Patter Matching Kime: Serdar Kut, p4-discuss@lists.p4.org<mailto:p4-discuss@lists.p4.org> The notion of header in P4 is not the same as a protocol header in internet standards. "Headers" in P4 means "bytes at the beginning of the packet". So if the thing you are looking for has fixed length and is at the beginning of the packet you can look for it. In P4 you cannot write a loop to look for a pattern anywhere in a packet, or to look for a pattern whose size is not a constant. Mihai From: P4-discuss <p4-discuss-bounces@lists.p4.org<mailto:p4-discuss-bounces@lists.p4.org>> On Behalf Of Serdar Kut via P4-discuss Sent: Thursday, December 20, 2018 4:35 AM To: p4-discuss@lists.p4.org<mailto:p4-discuss@lists.p4.org> Subject: [P4-discuss] Payload Bit Patter Matching Hi all, I'm very new to P4 and trying to figure out if I can match a specific bit pattern with the UDP Payload and take action according to a table which I'll predefine? I'm aware any type of headers can be defined and used to match and forward the packet. But not sure if I can define a "header like" extension to match my bits of interest in the payload. Thanks Serdar Bu e-posta mesaji, mesajin alici kisminda belirtilmis olan kullanici icindir. Mesajin alicisi siz degilseniz -dogrudan veya dolayli olarak- mesaji kullanmayiniz, acmayiniz, dagitmayiniz, yazicidan dokumunu almayiniz veya herhangi bir kismini kopyalamayiniz. Yanlislikla bu mesaj size ulasmissa lutfen, siliniz ve tüm kopyalarini yok ederek mesaji gonderene acilen haber veriniz. Bu mesaj icerisinde belirtilenler sadece gondericinin kisisel gorusleridir. Bu gorusler Borsa Istanbul A.S.'nin goruslerini yansitmadigi gibi, Borsa Istanbul A.S.'yi baglayici da degildir. This email is intended solely for the use of the individual or entity to whom it is addressed. If you are not the intended addressee of this message, you should not use, open, disseminate, distribute, print or copy this e-mail. If you have received this email in error, please delete it from your system and notify the sender immediately. Borsa Istanbul does not accept any legal responsibility whatsoever for the contents of this message. Any opinions contained in this message are those of the author and are not given or endorsed by Borsa Istanbul. Borsa Istanbul A.S. <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.borsaistanbul.com&data=02%7C01%7Cmbudiu%40vmware.com%7C4f11ebb9a9f34256dd0708d6669e7c50%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C636809228231932300&sdata=cpuaeAuO73FZChk2REN4PmV4WScglOWr6RLNFfTWWaI%3D&reserved=0> [Borsa Istanbul]<https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.borsaistanbul.com&data=02%7C01%7Cmbudiu%40vmware.com%7C4f11ebb9a9f34256dd0708d6669e7c50%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C636809228231932300&sdata=cpuaeAuO73FZChk2REN4PmV4WScglOWr6RLNFfTWWaI%3D&reserved=0> Bu e-posta mesaji, mesajin alici kisminda belirtilmis olan kullanici icindir. Mesajin alicisi siz degilseniz -dogrudan veya dolayli olarak- mesaji kullanmayiniz, acmayiniz, dagitmayiniz, yazicidan dokumunu almayiniz veya herhangi bir kismini kopyalamayiniz. Yanlislikla bu mesaj size ulasmissa lutfen, siliniz ve tüm kopyalarini yok ederek mesaji gonderene acilen haber veriniz. Bu mesaj icerisinde belirtilenler sadece gondericinin kisisel gorusleridir. Bu gorusler Borsa Istanbul A.S.'nin goruslerini yansitmadigi gibi, Borsa Istanbul A.S.'yi baglayici da degildir. This email is intended solely for the use of the individual or entity to whom it is addressed. If you are not the intended addressee of this message, you should not use, open, disseminate, distribute, print or copy this e-mail. If you have received this email in error, please delete it from your system and notify the sender immediately. Borsa Istanbul does not accept any legal responsibility whatsoever for the contents of this message. Any opinions contained in this message are those of the author and are not given or endorsed by Borsa Istanbul. Borsa Istanbul A.S. <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.borsaistanbul.com&data=02%7C01%7Cmbudiu%40vmware.com%7C4f11ebb9a9f34256dd0708d6669e7c50%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C636809228232088554&sdata=qLhs7EACTV9s4UXVUg4V4Juxa1mbqZjhjSdbhGCniec%3D&reserved=0>
SK
Serdar Kut
Thu, Dec 20, 2018 5:20 PM

Thanks Andy. Cristal clear now.

Serdar Kut

On Thu, Dec 20, 2018 at 8:18 PM +0300, "Andy Fingerhut" <andy.fingerhut@gmail.commailto:andy.fingerhut@gmail.com> wrote:

If you can define one or more sequences of fixed-length headers that you can write a P4 parser for (or some of them can even have variable-length portions, like IPv4 options), and the part you want to match on appears at a fixed offset from the beginning of one of those headers, that is what P4 is very good at.

If the part you want to match on is at a variable-length offset from the beginning of one of those headers, and it is in one of only 2 or 3 or a small fixed number of places, you can write multiple conditions and OR them together.

If it can be at one of N possible places, where N can be as large as the payload, then while technically N is still finite and you can write a big OR of many fixed-offset conditions, you are getting further and further away from the strengths of P4.

Andy

On Thu, Dec 20, 2018 at 9:13 AM Serdar Kut via P4-discuss <p4-discuss@lists.p4.orgmailto:p4-discuss@lists.p4.org> wrote:
Thanks Mihai. By means "at the beginning of the packet" it depends on how I match it right? My bits of interest is fix and begins with 64. Byte at the payload and has a fix length, so I think I can match it, am I correct? Packet type is also fixed, so I know  exactly where my bits are located.

Serdar Kut

Kimden: Mihai Budiu
G?nderildi: 20 Aral?k Per?embe 19:24
Konu: RE: Payload Bit Patter Matching
Kime: Serdar Kut, p4-discuss@lists.p4.orgmailto:p4-discuss@lists.p4.org

The notion of header in P4 is not the same as a protocol header in internet standards.
"Headers" in P4 means "bytes at the beginning of the packet".
So if the thing you are looking for has fixed length and is at the beginning of the packet you can look for it.

In P4 you cannot write a loop to look for a pattern anywhere in a packet, or to look for a pattern whose size is not a constant.

Mihai

From: P4-discuss <p4-discuss-bounces@lists.p4.orgmailto:p4-discuss-bounces@lists.p4.org> On Behalf Of Serdar Kut via P4-discuss
Sent: Thursday, December 20, 2018 4:35 AM
To: p4-discuss@lists.p4.orgmailto:p4-discuss@lists.p4.org
Subject: [P4-discuss] Payload Bit Patter Matching

Hi all,

I'm very new to P4 and trying to figure out if I can match a specific bit pattern with the UDP Payload and take action according to a table which I'll predefine?

I'm aware any type of headers can be defined and used to match and forward the packet. But not sure if I can define a "header like" extension to match my bits of interest in the payload.

Thanks

Serdar
Bu e-posta mesaji, mesajin alici kisminda belirtilmis olan kullanici icindir. Mesajin alicisi siz degilseniz -dogrudan veya dolayli olarak- mesaji kullanmayiniz, acmayiniz, dagitmayiniz, yazicidan dokumunu almayiniz veya herhangi bir kismini kopyalamayiniz. Yanlislikla bu mesaj size ulasmissa lutfen, siliniz ve t?m kopyalarini yok ederek mesaji gonderene acilen haber veriniz. Bu mesaj icerisinde belirtilenler sadece gondericinin kisisel gorusleridir. Bu gorusler Borsa Istanbul A.S.'nin goruslerini yansitmadigi gibi, Borsa Istanbul A.S.'yi baglayici da degildir.
This email is intended solely for the use of the individual or entity to whom it is addressed. If you are not the intended addressee of this message, you should not use, open, disseminate, distribute, print or copy this e-mail. If you have received this email in error, please delete it from your system and notify the sender immediately. Borsa Istanbul does not accept any legal responsibility whatsoever for the contents of this message. Any opinions contained in this message are those of the author and are not given or endorsed by Borsa Istanbul.
Borsa Istanbul A.S. https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.borsaistanbul.com&data=02%7C01%7Cmbudiu%40vmware.com%7C3860f492ba3d413023bd08d66677a14c%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C636809061332202696&sdata=zUS8pesGhbJxFX7SgQ8BwqMO9dlyraHFyDb%2FwmEhVpY%3D&reserved=0

[Borsa Istanbul]http://www.borsaistanbul.com

Bu e-posta mesaji, mesajin alici kisminda belirtilmis olan kullanici icindir. Mesajin alicisi siz degilseniz -dogrudan veya dolayli olarak- mesaji kullanmayiniz, acmayiniz, dagitmayiniz, yazicidan dokumunu almayiniz veya herhangi bir kismini kopyalamayiniz. Yanlislikla bu mesaj size ulasmissa lutfen, siliniz ve t?m kopyalarini yok ederek mesaji gonderene acilen haber veriniz. Bu mesaj icerisinde belirtilenler sadece gondericinin kisisel gorusleridir. Bu gorusler Borsa Istanbul A.S.'nin goruslerini yansitmadigi gibi, Borsa Istanbul A.S.'yi baglayici da degildir.

This email is intended solely for the use of the individual or entity to whom it is addressed. If you are not the intended addressee of this message, you should not use, open, disseminate, distribute, print or copy this e-mail. If you have received this email in error, please delete it from your system and notify the sender immediately. Borsa Istanbul does not accept any legal responsibility whatsoever for the contents of this message. Any opinions contained in this message are those of the author and are not given or endorsed by Borsa Istanbul.

Borsa Istanbul A.S. http://www.borsaistanbul.com


P4-discuss mailing list
P4-discuss@lists.p4.orgmailto:P4-discuss@lists.p4.org
http://lists.p4.org/mailman/listinfo/p4-discuss_lists.p4.org
[Borsa Istanbul]http://www.borsaistanbul.com

Bu e-posta mesaji, mesajin alici kisminda belirtilmis olan kullanici icindir. Mesajin alicisi siz degilseniz -dogrudan veya dolayli olarak- mesaji kullanmayiniz, acmayiniz, dagitmayiniz, yazicidan dokumunu almayiniz veya herhangi bir kismini kopyalamayiniz. Yanlislikla bu mesaj size ulasmissa lutfen, siliniz ve t?m kopyalarini yok ederek mesaji gonderene acilen haber veriniz. Bu mesaj icerisinde belirtilenler sadece gondericinin kisisel gorusleridir. Bu gorusler Borsa Istanbul A.S.'nin goruslerini yansitmadigi gibi, Borsa Istanbul A.S.'yi baglayici da degildir.

This email is intended solely for the use of the individual or entity to whom it is addressed. If you are not the intended addressee of this message, you should not use, open, disseminate, distribute, print or copy this e-mail. If you have received this email in error, please delete it from your system and notify the sender immediately. Borsa Istanbul does not accept any legal responsibility whatsoever for the contents of this message. Any opinions contained in this message are those of the author and are not given or endorsed by Borsa Istanbul.

Borsa Istanbul A.S. http://www.borsaistanbul.com

Thanks Andy. Cristal clear now. Serdar Kut On Thu, Dec 20, 2018 at 8:18 PM +0300, "Andy Fingerhut" <andy.fingerhut@gmail.com<mailto:andy.fingerhut@gmail.com>> wrote: If you can define one or more sequences of fixed-length headers that you can write a P4 parser for (or some of them can even have variable-length portions, like IPv4 options), and the part you want to match on appears at a fixed offset from the beginning of one of those headers, that is what P4 is very good at. If the part you want to match on is at a variable-length offset from the beginning of one of those headers, and it is in one of only 2 or 3 or a small fixed number of places, you can write multiple conditions and OR them together. If it can be at one of N possible places, where N can be as large as the payload, then while technically N is still finite and you can write a big OR of many fixed-offset conditions, you are getting further and further away from the strengths of P4. Andy On Thu, Dec 20, 2018 at 9:13 AM Serdar Kut via P4-discuss <p4-discuss@lists.p4.org<mailto:p4-discuss@lists.p4.org>> wrote: Thanks Mihai. By means "at the beginning of the packet" it depends on how I match it right? My bits of interest is fix and begins with 64. Byte at the payload and has a fix length, so I think I can match it, am I correct? Packet type is also fixed, so I know exactly where my bits are located. Serdar Kut Kimden: Mihai Budiu G?nderildi: 20 Aral?k Per?embe 19:24 Konu: RE: Payload Bit Patter Matching Kime: Serdar Kut, p4-discuss@lists.p4.org<mailto:p4-discuss@lists.p4.org> The notion of header in P4 is not the same as a protocol header in internet standards. "Headers" in P4 means "bytes at the beginning of the packet". So if the thing you are looking for has fixed length and is at the beginning of the packet you can look for it. In P4 you cannot write a loop to look for a pattern anywhere in a packet, or to look for a pattern whose size is not a constant. Mihai From: P4-discuss <p4-discuss-bounces@lists.p4.org<mailto:p4-discuss-bounces@lists.p4.org>> On Behalf Of Serdar Kut via P4-discuss Sent: Thursday, December 20, 2018 4:35 AM To: p4-discuss@lists.p4.org<mailto:p4-discuss@lists.p4.org> Subject: [P4-discuss] Payload Bit Patter Matching Hi all, I'm very new to P4 and trying to figure out if I can match a specific bit pattern with the UDP Payload and take action according to a table which I'll predefine? I'm aware any type of headers can be defined and used to match and forward the packet. But not sure if I can define a "header like" extension to match my bits of interest in the payload. Thanks Serdar Bu e-posta mesaji, mesajin alici kisminda belirtilmis olan kullanici icindir. Mesajin alicisi siz degilseniz -dogrudan veya dolayli olarak- mesaji kullanmayiniz, acmayiniz, dagitmayiniz, yazicidan dokumunu almayiniz veya herhangi bir kismini kopyalamayiniz. Yanlislikla bu mesaj size ulasmissa lutfen, siliniz ve t?m kopyalarini yok ederek mesaji gonderene acilen haber veriniz. Bu mesaj icerisinde belirtilenler sadece gondericinin kisisel gorusleridir. Bu gorusler Borsa Istanbul A.S.'nin goruslerini yansitmadigi gibi, Borsa Istanbul A.S.'yi baglayici da degildir. This email is intended solely for the use of the individual or entity to whom it is addressed. If you are not the intended addressee of this message, you should not use, open, disseminate, distribute, print or copy this e-mail. If you have received this email in error, please delete it from your system and notify the sender immediately. Borsa Istanbul does not accept any legal responsibility whatsoever for the contents of this message. Any opinions contained in this message are those of the author and are not given or endorsed by Borsa Istanbul. Borsa Istanbul A.S. <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.borsaistanbul.com&data=02%7C01%7Cmbudiu%40vmware.com%7C3860f492ba3d413023bd08d66677a14c%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C636809061332202696&sdata=zUS8pesGhbJxFX7SgQ8BwqMO9dlyraHFyDb%2FwmEhVpY%3D&reserved=0> [Borsa Istanbul]<http://www.borsaistanbul.com> Bu e-posta mesaji, mesajin alici kisminda belirtilmis olan kullanici icindir. Mesajin alicisi siz degilseniz -dogrudan veya dolayli olarak- mesaji kullanmayiniz, acmayiniz, dagitmayiniz, yazicidan dokumunu almayiniz veya herhangi bir kismini kopyalamayiniz. Yanlislikla bu mesaj size ulasmissa lutfen, siliniz ve t?m kopyalarini yok ederek mesaji gonderene acilen haber veriniz. Bu mesaj icerisinde belirtilenler sadece gondericinin kisisel gorusleridir. Bu gorusler Borsa Istanbul A.S.'nin goruslerini yansitmadigi gibi, Borsa Istanbul A.S.'yi baglayici da degildir. This email is intended solely for the use of the individual or entity to whom it is addressed. If you are not the intended addressee of this message, you should not use, open, disseminate, distribute, print or copy this e-mail. If you have received this email in error, please delete it from your system and notify the sender immediately. Borsa Istanbul does not accept any legal responsibility whatsoever for the contents of this message. Any opinions contained in this message are those of the author and are not given or endorsed by Borsa Istanbul. Borsa Istanbul A.S. <http://www.borsaistanbul.com> _______________________________________________ P4-discuss mailing list P4-discuss@lists.p4.org<mailto:P4-discuss@lists.p4.org> http://lists.p4.org/mailman/listinfo/p4-discuss_lists.p4.org [Borsa Istanbul]<http://www.borsaistanbul.com> Bu e-posta mesaji, mesajin alici kisminda belirtilmis olan kullanici icindir. Mesajin alicisi siz degilseniz -dogrudan veya dolayli olarak- mesaji kullanmayiniz, acmayiniz, dagitmayiniz, yazicidan dokumunu almayiniz veya herhangi bir kismini kopyalamayiniz. Yanlislikla bu mesaj size ulasmissa lutfen, siliniz ve t?m kopyalarini yok ederek mesaji gonderene acilen haber veriniz. Bu mesaj icerisinde belirtilenler sadece gondericinin kisisel gorusleridir. Bu gorusler Borsa Istanbul A.S.'nin goruslerini yansitmadigi gibi, Borsa Istanbul A.S.'yi baglayici da degildir. This email is intended solely for the use of the individual or entity to whom it is addressed. If you are not the intended addressee of this message, you should not use, open, disseminate, distribute, print or copy this e-mail. If you have received this email in error, please delete it from your system and notify the sender immediately. Borsa Istanbul does not accept any legal responsibility whatsoever for the contents of this message. Any opinions contained in this message are those of the author and are not given or endorsed by Borsa Istanbul. Borsa Istanbul A.S. <http://www.borsaistanbul.com>