In the previous article #003 "Are you P4 compliant ?" we exposed a setup where RARE/freeRouter was controlling BMv2 P4 dataplane called simple_switch_grpc. In this article we replace the open source BMv2 target by a commercial virtual target provided by INTEL/BAREFOOT. As a side note, we will show that this setup can be integrated with real networks. (with inherent software limitations)
Requirement
|
Overview
I'm repeating the core message from #003: For those who are not familiar with data plane programming and especially with P4, "P4 is a domain-specific programming language for specifying the behaviour of the dataplanes of network-forwarding elements." (from p4.org) in short it helps you to write a "program specifying how a switch processes packets".
...
Expand | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||
In that section, you'll need to get access to INTEL/BAREFOOT Software Development Environment. For Research & Academia institution, you can apply here in order to become a FASTER member and access to INTEL/BAREFOOT resources. You can find here, a document installing INTEL/BAREFOOT SDE on ONL for a WEDGE100BF32X system. In our case, we are setting up the following environment:
Just for the sake of example, SDE 9.2.0 is installed in root home directory:
TOFINO RARE bitbucket is a private repository. It is currently being reworked in order to make it public as per INTEL/BAREFOOT decision to grant make P4 code related to TOFINO architecture public. (It is thus inaccessible for now but will be opened soon opened.)
|
...
Expand | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Verification
|
Verification
Expand | |||||||||
---|---|---|---|---|---|---|---|---|---|
| |||||||||
|
Expand | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||
| |||||||||||||||||||
Expand | |||||||||||||||||||
|
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
╭─[7:07:41]floui@debian[1] ~/freeRouter/etc
╰─➤ telnet localhost 2323
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
welcome
line ready
freerouter# |
title | Check running-config |
---|
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
p4-freerouter#sh run
hostname p4-freerouter
buggy
!
vrf definition v1
exit
!
interface ethernet0
description freerouter@P4_CPU_PORT[veth251]
no shutdown
no log-link-change
exit
!
interface sdn1
description freerouter@sdn1[enp0s9]
mtu 9000
macaddr 0072.3e18.1b6f
vrf forwarding v1
ipv4 address 192.168.1.131 255.255.255.0
ipv6 address fd7d:a59c:650b::666 ffff:ffff:ffff:fff0::
ipv6 enable
no shutdown
no log-link-change
exit
!
!
!
!
!
!
!
!
!
!
!
!
!
!
server telnet tel
security protocol telnet
no exec authorization
no login authentication
vrf v1
exit
!
server p4lang p4
export-vrf v1 1
export-port sdn1 1 0
interconnect ethernet0
vrf v1
exit
!
client tcp-checksum transmit
!
end |
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
p4-freerouter#show interfaces summary interface state tx rx drop ethernet0 up 10616 9243 0 sdn1 up 10340 9069 0 |
title | Connectivity IPv4/IPv6 check for freeRouter |
---|
hostname p4-freerouter
buggy
!
!
vrf definition v1
exit
!
interface ethernet0
description freerouter@P4_CPU_PORT[veth251]
no shutdown
no log-link-change
exit
!
interface sdn1
description freerouter@sdn1[enp0s9]
mtu 9000
macaddr 0072.3e18.1b6f
vrf forwarding v1
ipv4 address 192.168.0.131 255.255.255.0
ipv6 address 2a01:e0a:159:2850::666 ffff:ffff:ffff:ffff::
ipv6 enable
no shutdown
no log-link-change
exit
!
!
!
!
!
!
!
!
!
!
!
!
!
!
server telnet tel
security protocol telnet
no exec authorization
no login authentication
vrf v1
exit
!
server p4lang p4
export-vrf v1 1
export-port sdn1 0 10
interconnect ethernet0
vrf v1
exit
!
client tcp-checksum transmit
!
end |
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
p4-freerouter#sh int sum | ||||||
Code Block | ||||||
| ||||||
p4-freerouter#ping 192.168.1.131 /vrf v1 pinging 192.168.1.131, src=null, cnt=5, len=64, tim=1000, ttl=255, tos=0, sweep=false !!!!! result=100%, recv/sent/lost=5/5/0, rtt min/avg/max/total=0/0/0/0 p4-freerouter#ping 192.168.1.1 /vrf v1 interface state tx rx pinging 192.168.1.1, src=null, cnt=5, len=64, tim=1000, ttl=255, tos=0, sweep=false !!!!! result=100%, recv/sent/lost=5/5/0, rtt min/avg/max/total=3/5/10/28drop ethernet0 up 89955 128007451 0 sdn1 up 87291 127572417 0 |
Expand | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Conclusion
In this article you:
...