Skip to content

Commit 13386bf

Browse files
committed
update the zping readme
1 parent aacd796 commit 13386bf

File tree

1 file changed

+66
-59
lines changed

1 file changed

+66
-59
lines changed

example/zping/README.md

Lines changed: 66 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -27,88 +27,95 @@ the Example" section above.
2727
![Diagram](network.png)
2828

2929
1. Create or use an existing ziti network with at least one edge router. This can be accomplished easily by running
30-
31-
ziti edge quickstart
30+
```
31+
ziti edge quickstart
32+
```
3233

3334
after the quickstart runs, you'll have an ephemeral network usable for testing.
3435

3536
1. Create at least two ziti identities and give them a common identity role i.e. #zping
36-
37-
ziti edge create identity client -o client.jwt -a "zping"
38-
ziti edge create identity server -o server.jwt -a "zping"
39-
ziti edge enroll client.jwt
40-
ziti edge enroll server.jwt
37+
```
38+
ziti edge create identity client -o client.jwt -a "zping"
39+
ziti edge create identity server -o server.jwt -a "zping"
40+
ziti edge enroll client.jwt
41+
ziti edge enroll server.jwt
42+
```
4143

4244
1. Create a simple sdk service named "ziti-ping". This is the default service name `zping` looks for. You can
4345
override the service by using the `-s` flag.
44-
45-
ziti edge create service ziti-ping
46+
```
47+
ziti edge create service ziti-ping
48+
```
4649

4750
1. Create a bind policy with identityRoles set to [#zping] and serviceroles set to [@ziti-ping].
48-
49-
ziti edge create service-policy zping.bind Bind --identity-roles "#zping" --service-roles "@ziti-ping"
51+
```
52+
ziti edge create service-policy zping.bind Bind --identity-roles "#zping" --service-roles "@ziti-ping"
53+
```
5054

5155
1. Create a dial service policy with identityRoles set to [#zping] and serviceroles set to [@ziti-ping].
52-
53-
ziti edge create service-policy zping.dial Dial --identity-roles "#zping" --service-roles "@ziti-ping"
56+
```
57+
ziti edge create service-policy zping.dial Dial --identity-roles "#zping" --service-roles "@ziti-ping"
58+
```
5459

5560
1. Ensure that you have created appropriate edge-router and service-edge-router policies allowing the identities access
5661
edge-router(s) and the edge-routers access to the service. Verify by running policy-advisor. Both identities
5762
should be able to dial **and** bind zping:
5863

59-
$ ziti edge policy-advisor identities -q
60-
ERROR: Default Admin
61-
- Identity does not have access to any services. Adjust service policies.
62-
63-
OKAY : client (1) -> ziti-ping (1) Common Routers: (1/1) Dial: Y Bind: N
64-
65-
OKAY : server (1) -> ziti-ping (1) Common Routers: (1/1) Dial: Y Bind: N
66-
67-
ERROR: quickstart-router
68-
- Identity does not have access to any services. Adjust service policies.
64+
```
65+
$ ziti edge policy-advisor identities -q
66+
ERROR: Default Admin
67+
- Identity does not have access to any services. Adjust service policies.
68+
69+
OKAY : client (1) -> ziti-ping (1) Common Routers: (1/1) Dial: Y Bind: N
70+
71+
OKAY : server (1) -> ziti-ping (1) Common Routers: (1/1) Dial: Y Bind: N
72+
73+
ERROR: quickstart-router
74+
- Identity does not have access to any services. Adjust service policies.
75+
```
6976

7077
1. In one window run the server
7178
```
72-
build/zping server -c server.json
79+
build/zping server -c server.json
80+
```
81+
82+
example:
83+
```
84+
$ build/zping server -c server.json
85+
INFO[0000] binding service ziti-ping
86+
87+
0xc00040d660 now serving
88+
89+
INFO[0000] new service session session token=52e059d2-f166-4561-b5a4-b42056bcd787
90+
INFO[0041] new connection
7391
```
74-
example:
75-
```
76-
$ build/zping server -c server.json
77-
INFO[0000] binding service ziti-ping
78-
79-
0xc00040d660 now serving
80-
81-
INFO[0000] new service session session token=52e059d2-f166-4561-b5a4-b42056bcd787
82-
INFO[0041] new connection
83-
```
8492

8593
1. In another window run the client
8694
```
87-
build/zping client -c client.json -i server
88-
```
89-
90-
```
91-
$ build/zping client -c client.json -i server
92-
93-
Sending 100 byte pings to server:
94-
95-
100 bytes from server: ziti_seq=1 time=0.609ms
96-
100 bytes from server: ziti_seq=2 time=0.670ms
97-
100 bytes from server: ziti_seq=3 time=0.381ms
98-
100 bytes from server: ziti_seq=4 time=0.387ms
99-
100 bytes from server: ziti_seq=5 time=0.564ms
100-
100 bytes from server: ziti_seq=6 time=0.455ms
101-
100 bytes from server: ziti_seq=7 time=0.446ms
102-
100 bytes from server: ziti_seq=8 time=0.377ms
103-
100 bytes from server: ziti_seq=9 time=0.455ms
104-
100 bytes from server: ziti_seq=10 time=0.502ms
105-
100 bytes from server: ziti_seq=11 time=0.977ms
106-
100 bytes from server: ziti_seq=12 time=0.487ms
107-
^C
108-
--- server ping statistics ---
109-
12 packets transmitted and 12 packets received, 0.00% packet loss
110-
round-trip min/max/avg/stddev 0.377/0.977/0.526/0.162 ms
111-
```
95+
build/zping client -c client.json -i server
96+
```
97+
```
98+
$ build/zping client -c client.json -i server
99+
100+
Sending 100 byte pings to server:
101+
102+
100 bytes from server: ziti_seq=1 time=0.609ms
103+
100 bytes from server: ziti_seq=2 time=0.670ms
104+
100 bytes from server: ziti_seq=3 time=0.381ms
105+
100 bytes from server: ziti_seq=4 time=0.387ms
106+
100 bytes from server: ziti_seq=5 time=0.564ms
107+
100 bytes from server: ziti_seq=6 time=0.455ms
108+
100 bytes from server: ziti_seq=7 time=0.446ms
109+
100 bytes from server: ziti_seq=8 time=0.377ms
110+
100 bytes from server: ziti_seq=9 time=0.455ms
111+
100 bytes from server: ziti_seq=10 time=0.502ms
112+
100 bytes from server: ziti_seq=11 time=0.977ms
113+
100 bytes from server: ziti_seq=12 time=0.487ms
114+
^C
115+
--- server ping statistics ---
116+
12 packets transmitted and 12 packets received, 0.00% packet loss
117+
round-trip min/max/avg/stddev 0.377/0.977/0.526/0.162 ms
118+
```
112119

113120
1. Send 5 zpings from the client to the server using `-n 5`
114121
```

0 commit comments

Comments
 (0)