Commit graph

263 commits

Author SHA1 Message Date
Nico Schottelius
74e4e7034b Trigger ipv4 checksumming after nat64 translation 2019-04-03 11:46:52 +02:00
Nico Schottelius
0f2df2723b Set mac address based on destination network [HACK] 2019-04-03 11:31:29 +02:00
Nico Schottelius
bc2eb7dad1 Change ethernet addresses, too 2019-04-03 11:02:07 +02:00
Nico Schottelius
fb02ca1a7f Set checksum flag for icmp 2019-04-03 10:56:32 +02:00
Nico Schottelius
1d08a942d5 -() 2019-04-03 10:53:16 +02:00
Nico Schottelius
d87b897069 Add icmp handling / replying 2019-04-03 10:52:25 +02:00
Nico Schottelius
fdf828d687 Do not not not double swap 2019-04-03 10:21:40 +02:00
Nico Schottelius
fbe8e66431 Make arp swapping more readable, --BUG 2019-04-02 17:42:56 +02:00
Nico Schottelius
6e22465ae4 Update arp processing for ethernet 2019-04-02 17:22:21 +02:00
Nico Schottelius
16a1620002 Also emit the arp header 2019-04-02 17:16:17 +02:00
Nico Schottelius
018e9eef09 Begin to add egress / arp support 2019-04-02 17:13:05 +02:00
Nico Schottelius
30dcc0af81 Try to outsmart the compiler with the arp table
Adressing

p4c --target bmv2 --arch v1model --std p4-16 "../p4src/static-mapping.p4" -o "/home/p4/master-thesis/p4src"
../p4src/static-mapping.p4(366): error: Program is not supported by this target, because table MyIngress.v6_networks has multiple successors
    table v6_networks {
          ^^^^^^^^^^^
Compilation Error
2019-03-31 16:40:44 +02:00
Nico Schottelius
26605a43e7 Arp is not IPv4 2019-03-31 16:37:21 +02:00
Nico Schottelius
5097f9dbd1 +action for arp table 2019-03-31 15:55:57 +02:00
Nico Schottelius
d8d7591647 +header arp 2019-03-31 15:50:07 +02:00
Nico Schottelius
07f0867175 Begin to introduce arp support 2019-03-31 15:48:00 +02:00
Nico Schottelius
801b4d818e Fix total_length by adding 15 bytes 2019-03-30 18:11:04 +01:00
Nico Schottelius
cd3084d8f9 rewrite checksum triggers in ndp/echo reply 2019-03-30 17:19:17 +01:00
Nico Schottelius
33117f0ca8 Remove unused tables 2019-03-30 17:12:34 +01:00
Nico Schottelius
cb3b1501ef also setter code s/true/1/ 2019-03-30 17:03:06 +01:00
Nico Schottelius
ec40bc2c54 s/bool/bit<1>/
Fixing

Invalid entry type 'expression' in field list
bad json:
{
   "type" : "expression",
   "value" : {
      "type" : "expression",
      "value" : {
         "left" : null,
         "op" : "d2b",
         "right" : {
            "type" : "field",
            "value" : [ "scalars", "metadata.chk_icmp6" ]
         }
      }
   }
}
2019-03-30 17:02:18 +01:00
Nico Schottelius
d1cc9d2643 Rewrite one check to bit<1> 2019-03-30 17:01:04 +01:00
Nico Schottelius
9f5b9fb0c9 Compare the right field 2019-03-30 16:59:32 +01:00
Nico Schottelius
bfd4a35942 Try to find another workaround against json error in the switch
[15:54:38.463] [bmv2] [D] [thread 21721] Set default default entry for table 'MyIngress.nat46': MyIngress.controller_debug_table_id - 4,
[15:54:38.463] [bmv2] [D] [thread 21721] Set default default entry for table 'tbl_act_3': act_3 -
[15:54:38.463] [bmv2] [D] [thread 21721] Set default default entry for table 'tbl_act_4': act_4 -
[15:54:38.463] [bmv2] [D] [thread 21721] Set default default entry for table 'tbl_nat46_icmp_generic': MyIngress.nat46_icmp_generic -
[15:54:38.463] [bmv2] [D] [thread 21721] Set default default entry for table 'tbl_act_5': act_5 -
[15:54:38.463] [bmv2] [D] [thread 21721] Set default default entry for table 'tbl_act_6': act_6 -
[15:54:38.463] [bmv2] [D] [thread 21721] Set default default entry for table 'tbl_act_7': act_7 -
Invalid entry type 'expression' in field list
bad json:
{
   "type" : "expression",
   "value" : {
      "type" : "expression",
      "value" : {
         "left" : null,
         "op" : "d2b",
         "right" : {
            "type" : "field",
            "value" : [ "scalars", "metadata.chk_icmp6_na_ns" ]
         }
      }
   }
}

p4@ubuntu:~/master-thesis/p4app$
2019-03-30 16:57:57 +01:00
Nico Schottelius
78308a00ee v6: next_header 2019-03-30 16:54:19 +01:00
Nico Schottelius
dae3d5ce30 + { 2019-03-30 16:53:20 +01:00
Nico Schottelius
f57f15a9cb Cleanup tables++ 2019-03-30 16:51:34 +01:00
Nico Schottelius
d5312dd04c Change table name 2019-03-30 16:50:17 +01:00
Nico Schottelius
92163d46ef Begin NAT46 translation of ICMP->ICMP6 2019-03-30 16:35:52 +01:00
Nico Schottelius
881643e2c3 +chk_ prefix 2019-03-30 15:01:24 +01:00
Nico Schottelius
f32ad44e0b Refactor #n: go back to generic entry point, use if in apply{} 2019-03-30 14:59:46 +01:00
Nico Schottelius
432965eb4f Reordering actions... 2019-03-27 20:15:31 +01:00
Nico Schottelius
b87b7b72f6 Action definition order matters... 2019-03-27 20:12:56 +01:00
Nico Schottelius
f52522fe0c Correct typo / rename bug 2019-03-27 20:11:41 +01:00
Nico Schottelius
b12d5d41ee Resolve name conflict 2019-03-27 20:08:49 +01:00
Nico Schottelius
d6264a32a4 Add code to mimic if in action
New table logic, new actions
2019-03-27 19:43:49 +01:00
Nico Schottelius
ac96fe467d Commit sketch tables for reference 2019-03-27 18:59:35 +01:00
Nico Schottelius
c551b944f8 Remove outter if action call 2019-03-27 18:25:56 +01:00
Nico Schottelius
9a5571fc39 Remove inner if 2019-03-27 18:25:05 +01:00
Nico Schottelius
12658b23ac Use an action to do the same thing as before 2019-03-27 18:22:37 +01:00
Nico Schottelius
7d9e9e1cfd Replace switch in action with multiple if's
p4c --target bmv2 --arch v1model --std p4-16 "../p4src/static-mapping.p4" -o "/home/p4/master-thesis/p4src"
../p4src/static-mapping.p4(60): error: SwitchStatement: switch statements not allowed in actions
        switch(hdr.icmp6.type) {
        ^^^^^^
2019-03-27 18:05:59 +01:00
Nico Schottelius
aa1b316767 + block in swtich 2019-03-27 18:02:42 +01:00
Nico Schottelius
404d4ff0df Begin checksumming icmp4 2019-03-27 18:01:11 +01:00
Your Name
31c86b2e7c Actually call() the function! 2019-03-27 13:13:04 +00:00
Your Name
907f677e2d Use if instead of switch 2019-03-27 13:09:27 +00:00
Nico Schottelius
01d9305350 Move def of nat64_icmp6 prior to use 2019-03-27 13:55:07 +01:00
Nico Schottelius
e349de5859 Change protocol in case of icmp6->icmp 2019-03-27 13:49:39 +01:00
Nico Schottelius
c1953aab5c Re-enable standard IPv4 processing 2019-03-27 13:32:14 +01:00
Nico Schottelius
f59c35c41b setValid() before filling in the values 2019-03-27 13:26:50 +01:00
Nico Schottelius
29296a30e4 verify again 2019-03-26 22:16:53 +01:00
Nico Schottelius
74420d8bbd Uncomment region to check flow 2019-03-26 22:13:17 +01:00
Nico Schottelius
658227cd5b Clarify execution order in nat64/nat46 case 2019-03-26 22:06:35 +01:00
Nico Schottelius
e48abdb254 Use symbolic names in debugging 2019-03-25 14:28:36 +01:00
Nico Schottelius
764245a914 Add table_id info to the NAT* tables 2019-03-25 14:16:14 +01:00
Nico Schottelius
1c1eeaf46e + table id bit width 2019-03-25 14:04:11 +01:00
Nico Schottelius
f25d98503f Correct field width 2019-03-25 14:03:04 +01:00
Nico Schottelius
1e9ba58148 +; 2019-03-25 14:00:22 +01:00
Nico Schottelius
1e95278eb7 Try to use default action with parameter 2019-03-25 13:57:09 +01:00
Nico Schottelius
f965942dd5 Add action to action list 2019-03-25 13:51:08 +01:00
Nico Schottelius
976397379d Try to use function parameter in default_action 2019-03-25 13:50:29 +01:00
Nico Schottelius
f0fc4bcf0e +; 2019-03-25 13:44:31 +01:00
Nico Schottelius
9ca4d4c8de Transport table debug information to controller 2019-03-25 13:43:47 +01:00
Nico Schottelius
b5524b636f Order matters in function definition 2019-03-25 13:13:02 +01:00
Nico Schottelius
236bd8e7d6 Debug send ipv4 packets to controller 2019-03-25 13:09:29 +01:00
Nico Schottelius
c6b1463e17 Debug missing checksum, introduce new field 2019-03-25 13:02:09 +01:00
Nico Schottelius
905f51fba3 Add checksum marker 2019-03-25 12:56:54 +01:00
Nico Schottelius
6e40043c71 +, 2019-03-25 12:13:10 +01:00
Nico Schottelius
4a280716a6 Rewrite code to use unique destination networks 2019-03-25 12:11:20 +01:00
Nico Schottelius
d0f4f11aaa Enable NAT64/NAT46 in apply block 2019-03-23 16:25:12 +01:00
Nico Schottelius
25fd78c900 Add table constant 2019-03-23 16:22:48 +01:00
Nico Schottelius
a408d7a803 + reorg +add simple nat64 w/o protocol specific translations 2019-03-23 16:20:13 +01:00
Nico Schottelius
4d3641fc50 Also add required icmp6_type 2019-03-23 15:07:07 +01:00
Nico Schottelius
5f14967a32 Introduce the icmp6 table 2019-03-23 15:03:42 +01:00
Nico Schottelius
5dec26d957 Update meta.task field for checksumming 2019-03-23 14:41:32 +01:00
Nico Schottelius
162ef20072 Checksum the newly parsed fields 2019-03-23 14:39:56 +01:00
Nico Schottelius
39c280cd33 Correct state parser to match on icmp6.type 2019-03-23 14:30:20 +01:00
Nico Schottelius
22538a93c9 Update deparser type, add emitting of option field 2019-03-23 14:20:11 +01:00
Nico Schottelius
9f5a37f7f6 Prepare switch for fully answering NDP/NS query
Including parser which might be broken in case there are no options present
2019-03-23 14:15:31 +01:00
Nico Schottelius
f79033c0c9 Parse down to icmp6_na_ns 2019-03-23 13:33:25 +01:00
Nico Schottelius
7db850a731 [p4] remove "rest" type 2019-03-21 20:48:56 +01:00
Nico Schottelius
5781d26541 add icmp6_ns to v6_networks table 2019-03-19 23:53:42 +01:00
Nico Schottelius
c89441001b try 42: ndp in the switch. this episode is with checksums... 2019-03-19 23:49:49 +01:00
Nico Schottelius
492888fd2f s/layer/field/ 2019-03-19 23:23:54 +01:00
Nico Schottelius
880db528e7 Mute multicast registrations (MLDv2) 2019-03-19 23:01:55 +01:00
Nico Schottelius
809110edc7 Debug print to controller by default, not dropping 2019-03-19 21:03:10 +01:00
Nico Schottelius
1e04446398 Cast the result 2019-03-14 14:52:26 +01:00
Nico Schottelius
255973a4c9 Correct address types 2019-03-14 14:41:28 +01:00
Nico Schottelius
ab8e328dd3 Order of actions matters 2019-03-14 14:39:17 +01:00
Nico Schottelius
7c8f019b2a ++ nat64 update, discussion update 2019-03-14 14:37:45 +01:00
Nico Schottelius
b5cd3aeb0e doc + gitignore for p4src 2019-03-14 14:12:50 +01:00
Nico Schottelius
472a104e2b ++ doc update ++ nat64_static / P4 begin 2019-03-14 14:05:17 +01:00
Nico Schottelius
81bf368279 [p4] try to include type+code in the checksum part 2019-03-07 00:33:41 +01:00
Nico Schottelius
aca088094e Re-add tcp_length 2019-03-06 19:39:20 +01:00
Nico Schottelius
260857b457 Remove unused meta field 2019-03-06 19:38:13 +01:00
Nico Schottelius
bd86fb4bc5 Fix the ingrees part 2019-03-06 19:37:29 +01:00
Nico Schottelius
a25da0f0df Try to shrink down bool bug code 2019-03-06 19:33:24 +01:00
Nico Schottelius
7495061f9d Try to include ingress casted value in checksumming 2019-03-06 17:38:43 +01:00
Nico Schottelius
ee62eb32c3 ++notes; try to cast & save payload_length in ingress 2019-03-06 17:37:30 +01:00
Nico Schottelius
3651ec4bc5 Remove unfinished code 2019-03-06 15:16:44 +01:00
Nico Schottelius
591175db7a Re-re-re-try to do checkumming based on a meta field 2019-03-06 15:15:46 +01:00
Nico Schottelius
6497db857c & remove checksumming again 2019-03-06 13:59:41 +01:00
Nico Schottelius
6f3bd8773b ... try reenabling checksumming in P4 2019-03-06 13:54:22 +01:00
Nico Schottelius
e9b08d638c s/bool/bit/ 2019-03-06 13:51:45 +01:00
Nico Schottelius
6dc5f34d43 s/ .. -> do_cksum 2019-03-06 13:51:06 +01:00
Nico Schottelius
8913cb8c3a Still getting json error, trying to short variable name 2019-03-06 13:50:03 +01:00
Nico Schottelius
6765b878c2 [p4] Disable checksum code again
To make the switch compile. Current error:

*** Starting 2 switches
s1 Starting P4 switch s1.
simple_switch -i 1@s1-eth1 -i 2@s1-eth2 -i 3@s1-eth3 -i 4@s1-eth4 -i 5@s1-cpu-eth0 --pcap=/home/p4/master-thesis/p4app/pcap --thrift-port 9090 --nanolog ipc:///tmp/bm-1-log.ipc --device-id 1 ../p4src/static-mapping.json --log-console >/home/p4/master-thesis/p4app/log/s1.log
P4 switch s1 did not start correctly. Check the switch log file.
p4@ubuntu:~/master-thesis/p4app$ cat /home/p4/master-thesis/p4app/log/s1.log
Warning: you requested the nanomsg event logger, but bmv2 was compiled without -DBMELOG, and the event logger cannot be activated
Calling target program-options parser
[12:24:10.407] [bmv2] [D] [thread 13263] Set default default entry for table 'MyIngress.v6_addresses': NoAction -
[12:24:10.407] [bmv2] [D] [thread 13263] Set default default entry for table 'MyIngress.v6_networks': NoAction -
[12:24:10.407] [bmv2] [D] [thread 13263] Set default default entry for table 'MyIngress.v4_networks': NoAction -
[12:24:10.408] [bmv2] [D] [thread 13263] Set default default entry for table 'tbl_act': act -
Invalid entry type 'expression' in field list
bad json:
{
   "type" : "expression",
   "value" : {
      "type" : "expression",
      "value" : {
         "left" : null,
         "op" : "d2b",
         "right" : {
            "type" : "field",
            "value" : [ "scalars", "metadata.calc_icmp6_checksum" ]
         }
      }
   }
}

p4@ubuntu:~/master-thesis/p4app$
2019-03-06 13:48:24 +01:00
Nico Schottelius
b0f3f5ea85 Try implicit cast by prepending 16 0 bits 2019-03-06 13:23:41 +01:00
Nico Schottelius
25f80b1b76 Try moving the cast to ingrees 2019-03-06 13:19:10 +01:00
Nico Schottelius
1b95179fc5 -typo 2019-03-06 13:13:01 +01:00
Nico Schottelius
0ca0b94b1c +notes; Try shifting the cast into the parser 2019-03-06 13:12:06 +01:00
Nico Schottelius
0bd12260c6 Re-introduce checksumming in p4 2019-03-05 22:42:51 +01:00
Nico Schottelius
2c3db11c80 +6 2019-03-05 22:33:03 +01:00
Nico Schottelius
8832069536 +-comment 2019-03-05 22:32:31 +01:00
Nico Schottelius
5620add27f Phasing in icmp6 in the switch 2019-03-05 22:31:05 +01:00
Nico Schottelius
45e2bd4237 Disable checksumming in the switch 2019-03-05 21:53:27 +01:00
Nico Schottelius
59655e0d32 Include correct offset AND debug info 2019-03-04 18:54:00 +01:00
Nico Schottelius
77b21207b9 Fix task width 2019-03-04 18:19:01 +01:00
Nico Schottelius
bc63f5edcf Bitwidth change / adjust 2019-03-04 18:13:34 +01:00
Nico Schottelius
8448e5121b Fix bitwidth 2019-03-04 18:11:08 +01:00
Nico Schottelius
1dd9542168 Also expose ingrees port to controller 2019-03-04 18:10:24 +01:00
Nico Schottelius
60a3c8d8c5 include ether type in cpu package 2019-03-04 18:05:56 +01:00
Nico Schottelius
5bcf328509 refactor 2019-03-04 16:38:45 +01:00
Nico Schottelius
542b4ddd50 rename to v4networks 2019-03-04 16:38:06 +01:00
Nico Schottelius
91f2788778 re-import tcp_length 2019-03-04 16:25:21 +01:00
Nico Schottelius
cfa3e3ecbc refactor 2019-03-04 16:24:37 +01:00
Nico Schottelius
ea1873c14c Use types for signalling expected action 2019-03-04 16:23:28 +01:00
Nico Schottelius
6f83eeddb2 Keep packet type correct for multicast / ndp 2019-03-04 14:27:12 +01:00
Nico Schottelius
28b2bc46f2 Test debug function 2019-03-04 14:22:36 +01:00
Nico Schottelius
4e8da01250 Setup ethertype in egress control 2019-03-04 14:15:44 +01:00
Nico Schottelius
03ffe73957 [icmp6] v6_networks table add actions 2019-03-04 14:10:11 +01:00
Nico Schottelius
f2cd835ced [p4] refactor 2019-03-04 14:08:09 +01:00
Nico Schottelius
0fa70432d1 [icmp6] forward NDP multicast to controller in correct fashion 2019-03-04 14:07:05 +01:00
Nico Schottelius
165f0e6b98 [p4] typo 2019-03-04 13:53:14 +01:00
Nico Schottelius
4c331dc296 adjust table/action 2019-03-03 22:37:58 +01:00
Nico Schottelius
7f1e9f6252 Begin icmp6 in controller -> pass special info 2019-03-03 22:36:25 +01:00
Nico Schottelius
b3e51d550a [p4] icmp6 hard code length 2019-02-28 11:09:45 +01:00
Nico Schottelius
1f497982b3 [p4] try casting before 2019-02-28 11:06:11 +01:00
Nico Schottelius
21d1b82416 [p4+plan] Try casting payload length to 32 2019-02-28 11:03:01 +01:00
Nico Schottelius
b01341f48c [p4] correct action name 2019-02-28 10:57:00 +01:00
Nico Schottelius
b29cf1a296 [p4, controller] hack NDP reply 2019-02-28 10:56:22 +01:00
Nico Schottelius
11d376bcb8 [p4] add controller action 2019-02-26 15:54:41 +01:00
Nico Schottelius
0ea9e708de [p4] If non matching ndp -> escalate to controller 2019-02-26 15:53:48 +01:00
Nico Schottelius
67afa855d0 [NDP] apply table... 2019-02-26 15:33:37 +01:00
Nico Schottelius
72c600d8da [NDP] Begin to add multicast / NDP support 2019-02-26 15:30:47 +01:00
Nico Schottelius
949560c995 [controller,p4] add debug print into controller 2019-02-24 15:53:10 +01:00
Nico Schottelius
e8e33c78ea [p4] --typo 2019-02-23 21:15:47 +01:00
Nico Schottelius
67bf3878d0 [p4] update parser to emit all (potentially] modified headers 2019-02-23 21:15:10 +01:00
Nico Schottelius
3fecfad989 [p4] +, 2019-02-23 21:07:05 +01:00
Nico Schottelius
a5c8be40be [p4] begin icmp6 checksum 2019-02-23 21:05:46 +01:00
Nico Schottelius
c38eb0dfc4 [p4,controller] Begin to add icmp6 echo reply support + more NDP "fixes" 2019-02-23 19:52:01 +01:00