API: Remove legacy vlibsocket code.
[vpp.git] / docs / guides / progressivevpp / twovppinstances.rst
1 .. _twovppinstances:
2
3 .. toctree::
4
5 Connecting two FD.io VPP Instances
6 ----------------------------------
7
8 .. _background-1:
9
10 memif is a very high performance, direct memory interface type which can
11 be used between FD.io VPP instances to form a topology. It uses a file socket
12 for a control channel to set up that shared memory.
13
14 .. _skills-to-be-learned-1:
15
16 Skills to be Learned
17 ^^^^^^^^^^^^^^^^^^^^
18
19 You will learn the following new skill in this exercise:
20
21 #. Create a memif interface between two FD.io VPP instances
22
23 You should be able to perform this exercise with the following skills
24 learned in previous exercises:
25
26 #. Run a second FD.io VPP instance
27 #. Add an ip address to a FD.io VPP interface
28 #. Ping from FD.io VPP
29
30 .. _topology-1:
31
32 Topology
33 ^^^^^^^^
34
35 .. figure:: /_images/Connecting_two_vpp_instances_with_memif.png
36    :alt: Connect two FD.io VPP topology
37
38    Connect two FD.io VPP topology
39
40 .. _initial-state-1:
41
42 Initial state
43 ^^^^^^^^^^^^^
44
45 The initial state here is presumed to be the final state from the
46 exercise `Create an
47 Interface <VPP/Progressive_VPP_Tutorial#Exercise:_Create_an_Interface>`__
48
49 .. _action-running-a-second-vpp-instances-1:
50
51 Running a second FD.io VPP instances
52 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
53
54 You should already have a FD.io VPP instance running named: vpp1.
55
56 Run a second FD.io VPP instance named: vpp2.
57
58 .. _action-create-memif-interface-on-vpp1-1:
59
60 Create memif interface on vpp1
61 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
62
63 Create a memif interface on vpp1:
64
65 .. code-block:: console
66
67    vpp# create interface memif id 0 master
68
69 This will create an interface on vpp1 memif0/0 using /run/vpp/memif as
70 its socket file. The role of vpp1 for this memif inteface is 'master'.
71
72 Use your previously used skills to:
73
74 #. Set the memif0/0 state to up.
75 #. Assign IP address 10.10.2.1/24 to memif0/0
76 #. Examine memif0/0 via show commands
77
78 .. _action-create-memif-interface-on-vpp2-1:
79
80 Create memif interface on vpp2
81 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
82
83 We want vpp2 to pick up the 'slave' role using the same
84 run/vpp/memif-vpp1vpp2 socket file
85
86 .. code-block:: console
87
88    vpp# create interface memif id 0 slave
89
90 This will create an interface on vpp2 memif0/0 using /run/vpp/memif as
91 its socket file. The role of vpp1 for this memif inteface is 'slave'.
92
93 Use your previously used skills to:
94
95 #. Set the memif0/0 state to up.
96 #. Assign IP address 10.10.2.2/24 to memif0/0
97 #. Examine memif0/0 via show commands
98
99 .. _action-ping-from-vpp1-to-vpp2-1:
100
101 Ping from vpp1 to vpp2
102 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
103
104 Ping 10.10.2.2 from vpp1
105
106 .. code-block:: console
107
108     $ ping 10.10.2.2 
109
110 Ping 10.10.2.1 from vpp2
111
112 .. code-block:: console
113
114     $ ping 10.10.2.1