|
1 | 1 | .. zephyr:code-sample:: rtpw |
2 | | - :name: Rtpw |
| 2 | + :name: SRTP client and server |
3 | 3 |
|
4 | 4 | Send and receive data using (S)RTP protocol. |
5 | 5 |
|
6 | 6 | Overveiw |
7 | 7 | ******** |
8 | 8 |
|
9 | 9 | A simple demo of using (S)RTP protocol to send and receive data over network. The sample could be sender or receiver. |
| 10 | + |
10 | 11 | To test (S)RTP via a Linux machine, you should build the libsrtp. |
| 12 | + |
11 | 13 | To test the sender while PC is receiver, the peer IP address should be set in Kconfig file. Next open a terminal and enter command: |
12 | 14 |
|
13 | | -.. code-block:: console |
14 | | -``~/libsrtp/test$ ./rtpw -r -k c1eec3717da76195bb878578790af71c4ee9f859e197a414a78d5abc7451 -e 128 -a 0.0.0.0 9999`` |
| 15 | +.. code-block:: shell |
| 16 | +
|
| 17 | + ~/libsrtp/test$ ./rtpw -r -k c1eec3717da76195bb878578790af71c4ee9f859e197a414a78d5abc7451 -e 128 -a 0.0.0.0 9999 |
| 18 | +
|
15 | 19 | You should see in PC side: |
16 | | -.. code-block:: |
17 | | -``Using libsrtp3 3.0.0-pre [0x3000000] |
18 | | -security services: confidentiality message authentication |
19 | | -set master key/salt to c1eec3717da76195bb878578790af71c/4ee9f859e197a414a78d5abc7451 |
20 | | - word: SRTP test0. |
21 | | - word: SRTP test1. |
22 | | - word: SRTP test2. |
23 | | - word: SRTP test3.`` |
| 20 | + |
| 21 | +.. code-block:: console |
| 22 | +
|
| 23 | + Using libsrtp3 3.0.0-pre [0x3000000] |
| 24 | + security services: confidentiality message authentication |
| 25 | + set master key/salt to c1eec3717da76195bb878578790af71c/4ee9f859e197a414a78d5abc7451 |
| 26 | + word: SRTP test0. |
| 27 | + word: SRTP test1. |
| 28 | + word: SRTP test2. |
| 29 | + word: SRTP test3. |
24 | 30 |
|
25 | 31 | You should see in device side: |
26 | | -.. code-block:: |
27 | | -``*** Booting Zephyr OS build v4.2.0-5032-g84d1da7ea2a6 *** |
28 | | -[00:00:00.060,000] <inf> net_config: Initializing network |
29 | | -[00:00:00.068,000] <inf> net_config: Waiting interface 1 (0x341b0380) to be up... |
30 | | -[00:00:01.651,000] <inf> phy_mii: PHY (0) Link speed 100 Mb, full duplex |
31 | | -[00:00:01.660,000] <inf> net_config: Interface 1 (0x341b0380) coming up |
32 | | -[00:00:01.670,000] <inf> net_config: IPv4 address: 10.42.0.2 |
33 | | -[00:00:01.678,000] <inf> rtpw_sample: Using Zephyr 1.0.0 [0x1000000] |
34 | | -
|
35 | | -``[00:00:01.770,000] <inf> rtpw_sample: peer IPv4 address: 10.42.0.1. |
36 | | -[00:00:01.779,000] <inf> rtpw_sample: my IPv4 address: 10.42.0.2. |
37 | | -[00:00:01.788,000] <inf> rtpw_sample: sending word: SRTP test0. |
38 | | -[00:00:02.297,000] <inf> rtpw_sample: sending word: SRTP test1. |
39 | | -[00:00:02.806,000] <inf> rtpw_sample: sending word: SRTP test2. |
40 | | -[00:00:03.315,000] <inf> rtpw_sample: sending word: SRTP test3.`` |
| 32 | + |
| 33 | +.. code-block:: console |
| 34 | +
|
| 35 | + *** Booting Zephyr OS build v4.2.0-5032-g84d1da7ea2a6 *** |
| 36 | + [00:00:00.060,000] <inf> net_config: Initializing network |
| 37 | + [00:00:00.068,000] <inf> net_config: Waiting interface 1 (0x341b0380) to be up... |
| 38 | + [00:00:01.651,000] <inf> phy_mii: PHY (0) Link speed 100 Mb, full duplex |
| 39 | + [00:00:01.660,000] <inf> net_config: Interface 1 (0x341b0380) coming up |
| 40 | + [00:00:01.670,000] <inf> net_config: IPv4 address: 10.42.0.2 |
| 41 | + [00:00:01.678,000] <inf> rtpw_sample: Using Zephyr 1.0.0 [0x1000000] |
| 42 | + [00:00:01.770,000] <inf> rtpw_sample: peer IPv4 address: 10.42.0.1. |
| 43 | + [00:00:01.779,000] <inf> rtpw_sample: my IPv4 address: 10.42.0.2. |
| 44 | + [00:00:01.788,000] <inf> rtpw_sample: sending word: SRTP test0. |
| 45 | + [00:00:02.297,000] <inf> rtpw_sample: sending word: SRTP test1. |
| 46 | + [00:00:02.806,000] <inf> rtpw_sample: sending word: SRTP test2. |
| 47 | + [00:00:03.315,000] <inf> rtpw_sample: sending word: SRTP test3. |
41 | 48 |
|
42 | 49 | To test (S)RTP via a Linux machine, you should build the libsrtp. |
43 | 50 | To test the receiver while PC is sender, the peer IP address should be set in Kconfig file. Next open a terminal and enter command: |
44 | 51 |
|
45 | | -.. code-block:: console |
46 | | -``~/libsrtp/test$ ./rtpw -s -k c1eec3717da76195bb878578790af71c4ee9f859e197a414a78d5abc7451 -e 128 -a <CONFIG_NET_CONFIG_MY_IPV4_ADDR> 9999`` |
| 52 | +.. code-block:: shell |
| 53 | +
|
| 54 | + ~/libsrtp/test$ ./rtpw -s -k c1eec3717da76195bb878578790af71c4ee9f859e197a414a78d5abc7451 -e 128 -a <CONFIG_NET_CONFIG_MY_IPV4_ADDR> 9999 |
| 55 | +
|
47 | 56 | for example: |
48 | | -``~/libsrtp/test$ ./rtpw -s -k c1eec3717da76195bb878578790af71c4ee9f859e197a414a78d5abc7451 -e 128 -a 10.42.0.2 9999`` |
| 57 | + |
| 58 | +.. code-block:: shell |
| 59 | +
|
| 60 | + ~/libsrtp/test$ ./rtpw -s -k c1eec3717da76195bb878578790af71c4ee9f859e197a414a78d5abc7451 -e 128 -a 10.42.0.2 9999 |
49 | 61 |
|
50 | 62 | You should see in PC side: |
51 | | -.. code-block:: console |
52 | | -``Using libsrtp3 3.0.0-pre [0x3000000] |
53 | | -security services: confidentiality message authentication |
54 | | -set master key/salt to c1eec3717da76195bb878578790af71c/4ee9f859e197a414a78d5abc7451 |
55 | | -sending word: abducing |
56 | | -sending word: acidheads |
57 | | -sending word: acidness |
58 | | -sending word: actons`` |
59 | 63 |
|
60 | | -You should see in device side: |
61 | 64 | .. code-block:: console |
62 | | -``*** Booting Zephyr OS build v4.2.0-5032-g84d1da7ea2a6 *** |
63 | | -[00:00:00.060,000] <inf> net_config: Initializing network |
64 | | -[00:00:00.068,000] <inf> net_config: Waiting interface 1 (0x341b04c0) to be up... |
65 | | -[00:00:01.651,000] <inf> phy_mii: PHY (0) Link speed 100 Mb, full duplex |
66 | | -[00:00:01.660,000] <inf> net_config: Interface 1 (0x341b04c0) coming up |
67 | | -[00:00:01.670,000] <inf> net_config: IPv4 address: 10.42.0.2 |
68 | | -[00:00:01.678,000] <inf> rtpw_sample: Using Zephyr 1.0.0 [0x1000000]`` |
69 | 65 |
|
70 | | -``[00:00:01.770,000] <inf> rtpw_sample: peer IPv4 address: 0.0.0.0. |
71 | | -[00:00:01.779,000] <inf> rtpw_sample: my IPv4 address: 10.42.0.2. |
72 | | -[00:00:18.010,000] <inf> rtpw_sample: receiving word: abducing`` |
| 66 | + Using libsrtp3 3.0.0-pre [0x3000000] |
| 67 | + security services: confidentiality message authentication |
| 68 | + set master key/salt to c1eec3717da76195bb878578790af71c/4ee9f859e197a414a78d5abc7451 |
| 69 | + sending word: abducing |
| 70 | + sending word: acidheads |
| 71 | + sending word: acidness |
| 72 | + sending word: actons |
73 | 73 |
|
74 | | -``[00:00:18.510,000] <inf> rtpw_sample: receiving word: acidheads`` |
| 74 | +You should see in device side: |
75 | 75 |
|
76 | | -``[00:00:19.010,000] <inf> rtpw_sample: receiving word: acidness`` |
| 76 | +.. code-block:: console |
77 | 77 |
|
78 | | -``[00:00:19.510,000] <inf> rtpw_sample: receiving word: actons`` |
| 78 | + *** Booting Zephyr OS build v4.2.0-5032-g84d1da7ea2a6 *** |
| 79 | + [00:00:00.060,000] <inf> net_config: Initializing network |
| 80 | + [00:00:00.068,000] <inf> net_config: Waiting interface 1 (0x341b04c0) to be up... |
| 81 | + [00:00:01.651,000] <inf> phy_mii: PHY (0) Link speed 100 Mb, full duplex |
| 82 | + [00:00:01.660,000] <inf> net_config: Interface 1 (0x341b04c0) coming up |
| 83 | + [00:00:01.670,000] <inf> net_config: IPv4 address: 10.42.0.2 |
| 84 | + [00:00:01.678,000] <inf> rtpw_sample: Using Zephyr 1.0.0 [0x1000000] |
| 85 | + [00:00:01.770,000] <inf> rtpw_sample: peer IPv4 address: 0.0.0.0. |
| 86 | + [00:00:01.779,000] <inf> rtpw_sample: my IPv4 address: 10.42.0.2. |
| 87 | + [00:00:18.010,000] <inf> rtpw_sample: receiving word: abducing |
| 88 | + [00:00:18.510,000] <inf> rtpw_sample: receiving word: acidheads |
| 89 | + [00:00:19.010,000] <inf> rtpw_sample: receiving word: acidness |
| 90 | + [00:00:19.510,000] <inf> rtpw_sample: receiving word: actons |
79 | 91 |
|
80 | 92 | Configuration |
81 | 93 | ************* |
|
0 commit comments