Skip to content

[Gateway] Connection establishment #23243

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: production
Choose a base branch
from
Open

Conversation

maxvp
Copy link
Contributor

@maxvp maxvp commented Jun 25, 2025

PCX-17962

Copy link
Contributor

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
* @cloudflare/pcx-technical-writing

@github-actions github-actions bot added size/s and removed size/xs labels Jun 25, 2025
Copy link
Contributor

github-actions bot commented Jun 25, 2025

@@ -135,6 +135,27 @@ flowchart TB
egress1-- "Egress with dedicated IP" -->internet
```

## Connection establishment

When a user connects to a server with Gateway, Gateway first establishes a TCP connection with the destination server on the port the user requested. If the connection is successful, Gateway will apply policies. If Gateway policies allow the connection, Gateway will connect the user to the destination server. If Gateway policies block the connection, Gateway will end the connection and will not send any data between the user and the destination server. If the TCP connection to the destination server is unsuccessful, Gateway will not run any policies nor accept further TCP connections from the user to the server.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jgpaiva what can we say about the first packet? We don't send any user info so it would be helpful to be as specific as possible to call that out.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe something around "since TCP traffic is proxied by Cloudflare, the connection that Gateway establishes with the upstream is independent from the connection the eyeball establishes with Gateway. This means it has new source IP and port, and no details from the original eyeball TCP handshake are included in this TCP handshake with the origin"?

@maxvp maxvp marked this pull request as ready for review June 27, 2025 20:56
@maxvp maxvp requested a review from a team as a code owner June 27, 2025 20:56
@@ -135,6 +135,29 @@ flowchart TB
egress1-- "Egress with dedicated IP" -->internet
```

## Connection establishment

When a user connects to a server with Gateway, Gateway first establishes a TCP connection with the destination server on the port the user requested. If the connection is successful, Gateway will apply policies. If Gateway policies allow the connection, Gateway will connect the user to the destination server. If Gateway policies block the connection, Gateway will end the connection and will not send any data between the user and the destination server. If the TCP connection to the destination server is unsuccessful, Gateway will not run any policies and retry TCP connections from the user to the server.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add this as the second sentence here? I want to make sure its the first thing admins see when reading this section.

Because TCP traffic is proxied by Cloudflare, the connection Gateway establishes with the origin is independent from the connection users establish with Gateway. This means Gateway assigns a new source IP and port to the user's connection and no details from the user's TCP handshake are included in the TCP handshake with the origin server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants