## 5 Proof-of-Concept Results
### The P4 Algorithm
In the deparser stage, data are sent to the controller and final updates are done before sending bundles out of the switch. In Step 3.1, the struct of data that were initialized in Step 2.2 is finally sent out of the switch via the control plane link to the SDN controller. In Steps 3.2 and 3.3, the IPv4 and UDP checksums are updated because the bundle was modified and the checksums are the bundle's integrity by the endpoint. Finally, the bundle is sent out of the switch using the egress port that was determined in Step 2.7. Step 1: Parser  
```
1:Parse Ethernet header
2:Parse IPv4 header
3:Parse UDP header
4:Examine first byte after UDP header to determine if it is BPv6 or BPv7
5:Parse BPv6 or BPv7
6:Set a metadata flag indicating which BP version was ingested
7:Accept the bundle and transfer it to the match-action pipeline
8:Step 2: Match-Action Pipeline
9:Verify validity of bundle headers
10:Store digest data with information about/from the ingested bundle
11:Declare new headers for the translated version of the bundle and move data from original BP headers
12:Invalidate the original BP headers and validate the translated BP headers
13:Update the IPv4 Total Length field
14:Update the UDP Length field
15:Apply IPv4 forwarding logic and determine egress port
16:Step 3: Deparser
1:Pack and send digest data to the control plane
17:Recalculate and update IPv4 checksum
18:Recalculate and update UDP checksum
19:Emit bundle through egress port Figure 9: Expected format for incoming BPv6 bundles. A Previous Hop Insertion Block and Bundle Age Block are the only extension blocks expected, in this specific order. Additionally, currently only payloads up to 13 bytes are expected. There is undefined behavior for any bundles sent to the bundle translator that do not match this format. ### Design Constraints

One complexity faced was the parsing of SDNV fields due to the inability to determine the width of a SDNV field unless the entire field is examined. This is different from other protocols that use variable-width fields, in which there is usually a fixed-width field that provides information about the actual width of the variable-width fields. For example, in IPv4 there are optional fields and the total size of these optional fields can be deduced by examining the Internet Header Length (IHL) field. With SDNV-encoded fields, the P4 parser would need to use the lookahead function and recursively examine octets of bits until it encounters an octet with an MSB of 0, up to a maximum of eight octets for each field. Once the actual size of a field is determined, it would need to be assigned to the fixed-width header that handles the case of the exact size needed for that specific BP field (using the variable-width P4 workaround). In our attempts to implement the parsing of a basic SDNV field using lookahead we found that there was undefined behavior occurring

Figure 10: Expected format for incoming BPv7 bundles. Note that in the primary block, the creation timestamp can be between 88 to 96 bytes. A Previous Node Block, Experimental Class of Service Block, and Bundle Age Block are the only extension blocks expected, in this specific order. Additionally, currently only payloads up to 13 bytes are expected. There is undefined behavior for any bundles sent to the bundle translator that do not match this format. in the parser stage that broke the piece of our deparser stage where the checksums are calculated. This bug was discovered to be internal to the Intel software and will be fixed in SDE 9.11.0. Therefore, in the proof of concept several BPv6 fields were assumed to be a certain size to avoid this bug and having to handle all possible lengths for SDNV fields. Initially, the plan was to use incremental checksum calculations, where if certain fields are modified the checksum only needs to be updated to account for these modified fields rather than recomputing the checksum from scratch [38].