-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ext-ip-hack: fwd all ext traffic to phys gateway
This modifies the hacked up NAT layer to always rewrite external traffic to the local gateway on the "external" subnet. When the destination is another IP on the subnet the gateway will just forward it back onto the subnet. In the case of an off-subnet destination, the gateway will forward it to the next hop. This allows bouth inbound and outbound external traffic to work with the guest. I also tried to get intra-guest (aka internal VPC traffic) to work under the hack but it's fighting me and we want to land what's here for the next demo. I also modified the port process DTrace script to print more useful info. And I added a start to a flowchart for processing flow.
- Loading branch information
Showing
8 changed files
with
132 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
The size of the TCP flow table is currently 8096. | ||
|
||
```mermaid | ||
flowchart TD | ||
process_in([process_in]) --> is_def_id{flow_id == FLOW_ID_DEFAULT?}; | ||
is_def_id -- Yes --> lp[layers_process]; | ||
is_def_id -- No --> check_uft{UFT entry?}; | ||
check_uft -- Yes --> same_epoch{entry.epoch == port.epoch?}; | ||
check_uft -- No --> lp; | ||
same_epoch -- Yes --> run_ht[run HT]; | ||
same_epoch -- No --> inv[invalidate UFT entry]; | ||
inv --> lp; | ||
run_ht --> is_tcp_uft{TCP?}; | ||
is_tcp_uft -- Yes --> pite[process_in_tcp_existing]; | ||
is_tcp_uft -- No --> rm([return Modified]); | ||
lp --> lr{Layer Result?}; | ||
lr -- Allow --> uft_add[add UFT entry]; | ||
lr -- Deny --> rd([return Drop]); | ||
lr -- "Hairpin(hp)" --> rhp(["return Hairpin(hp)"]); | ||
lr -- "Err(e)" --> re(["return Err(e)"]); | ||
pitn -- "Ok(TcpState::Closed)" --> rd; | ||
pitn -- "Ok(tcp_state)" --> rm; | ||
pitn -- "Err(e)" --> re; | ||
pite -- "Ok(TcpState::Closed)" --> rd; | ||
pite -- "Ok(tcp_state)" --> rm; | ||
pite -- "Err(e)" --> re; | ||
uft_add --> is_tcp_no_uft{TCP?}; | ||
is_tcp_no_uft -- Yes --> pitn[process_in_tcp_new]; | ||
is_tcp_no_uft -- No --> rm; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters