# Raw (TCP/UDP/TLS/DTLS)

Sending a binary content or even strings over UDP/TCP is possible with IoTIFY. The motivation to use a raw protocol could be either to conserve the bandwidth or to support binary formatting of data. There isn't much to specify when using the raw protocols.&#x20;

![Settings for Raw Protocol](https://1549501356-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhKFvCh4dnxgthNTIuu%2F-M8PY-PEJTi5dwPBrIx2%2F-M8PerSKoNccl2-RXmqA%2Fimage.png?alt=media\&token=ef9feb59-c8ec-4f0a-bba9-a183c950c29c)

We only need to specify the transport as well as the server endpoint along with the port number. The timeout field is only applicable in case of TCP/TLS/DTLS and specify how long should we wait for connection (as there is no concept of connection in UDP)

### Generating Binary Payload for Raw Protocol

For Raw protocol, you could choose to send a binary payload by returning a buffer Object in the Device Model message function. E.g.&#x20;

```
{
    payload = [10,20,44,46]
    
    return new Buffer.from(payload);
}
```

E.g. you could convert a string to base64 representation

```
    let payload = new Buffer('Hello World', 'binary').toString('base64')
    return payload;
```
