1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
# nack
nack demonstrates how to send RTP packets over a connection that both generates and handles NACKs
## Instructions
### run main.go
```
go run main.go
```
You will then see output like
```
$ go run main.go
2020/12/16 00:27:54 Received RTP
2020/12/16 00:27:54 Received RTP
2020/12/16 00:27:54 Received RTP
2020/12/16 00:27:54 Received RTP
2020/12/16 00:27:54 Received RTP
2020/12/16 00:27:55 Received RTP
2020/12/16 00:27:55 Received NACK
2020/12/16 00:27:55 Received RTP
2020/12/16 00:27:55 Received RTP
2020/12/16 00:27:55 Received RTP
2020/12/16 00:27:55 Received RTP
2020/12/16 00:27:56 Received RTP
2020/12/16 00:27:56 Received NACK
2020/12/16 00:27:56 Received RTP
2020/12/16 00:27:56 Received NACK
2020/12/16 00:27:56 Received RTP
2020/12/16 00:27:56 Received RTP
2020/12/16 00:27:56 Received RTP
2020/12/16 00:27:57 Received RTP
2020/12/16 00:27:57 Received RTP
2020/12/16 00:27:57 Received RTP
2020/12/16 00:27:58 Received RTP
2020/12/16 00:27:58 Received NACK
2020/12/16 00:27:58 Received RTP
2020/12/16 00:27:58 Received RTP
2020/12/16 00:27:58 Received RTP
2020/12/16 00:27:58 Received NACK
2020/12/16 00:27:58 Received RTP
2020/12/16 00:27:58 Received RTP
```
### Introduce loss
You will not see much loss on loopback by default. To introduce 15% loss you can do
```
$ iptables -A INPUT -m statistic --mode random --probability 0.15 -p udp -j DROP
```
|