# TCP Entry Point

Convert and forward TCP traffic to cloud data ingest services.

This entry point accepts TCP traffic from an Air for Cellular device and forwards the individual packet (strictly one TCP segment) to the cloud service.

## Entry Point

Your device should be configured to send data to: `tcp://funnel.soracom.io:23080`.

## Behavior

### Request

The maximum transmission data size per request is based on the TCP fragment size. While the TCP specification allows a maximum of 65,536 bytes per packet, the actual maximum is determined by the MTU of the network path. In most cases, the maximum packet size is approximately 1500 bytes, with the maximum payload slightly less.

### Response

Since TCP has no request and response mechanism like HTTP, Funnel will return a TCP packet to the device containing the HTTP response code and message received from the cloud service. The TCP packet message will use the following format: `${http-status-code} ${http-response-body}`

When data has been successfully sent to the cloud service, Funnel will simply return a TCP packet containing the following body:

```
200
```

If the Funnel **Content type** has been set to `JSON` and the data contains invalid JSON, Funnel will return a TCP packet with the `FIN` flag, containing the following body:

```
400 Invalid JSON is send to funnel.
```

---

### Example

Establish a TCP session with Funnel:

```bash
nc -v funnel.soracom.io 23080

found 0 associations
found 1 connections:
     1: flags=82<CONNECTED,PREFERRED>
  outif en0
  src 192.168.43.232 port 51053
  dst 100.127.65.43 port 23080
  rank info not available
  TCP aux info available

Connection to funnel.soracom.io port 23080 [tcp/*] succeeded!
```

Send valid JSON:

```bash
{"key":"value"}

200
```

Send invalid JSON:

```bash
bad text

400 Invalid JSON is send to funnel.
```
