lldp: Move to plugin
[vpp.git] / src / plugins / lldp / lldp_doc.md
1 # VPP Link Layer Discovery Protocol (LLDP) implementation    {#lldp_doc}
2
3 This is a memo intended to contain documentation of the VPP LLDP implementation
4 Everything that is not directly obvious should come here.
5
6
7 ## LLDP
8 LLDP is a link layer protocol to advertise the capabilities and current status of the system.
9
10 There are 2 nodes handling LLDP
11
12 1.) input-node which processes incoming packets and updates the local database
13 2.) process-node which is responsible for sending out LLDP packets from VPP side
14
15
16 ### Configuration
17
18 LLDP has a global configuration and a per-interface enable setting.
19
20 Global configuration is modified using the "set lldp" command
21
22 set lldp [system-name <string>] [tx-hold <value>] [tx-interval <value>]
23
24 system-name: the name of the VPP system sent to peers in the system-name TLV
25 tx-hold: multiplier for tx-interval when setting time-to-live (TTL) value in the LLDP packets (TTL = tx-hold * tx-interval + 1, if TTL > 65535, then TTL = 65535)
26 tx-interval: time interval between sending out LLDP packets
27
28 Per interface setting is done using the "set interface lldp" command
29
30 set interface lldp <interface> | if_index <idx> [port-desc <string>] [disable]
31
32 interface: the name of the interface for which to enable/disable LLDP
33 if_index: sw interface index can be used if interface name is not used.
34 port-desc: port description
35 disable: LLDP feature can be enabled or disabled per interface.
36
37 ### Configuration example
38
39 Configure system-name as "VPP" and transmit interval to 10 seconds:
40
41 set lldp system-name VPP tx-interval 10
42
43 Enable LLDP on interface TenGigabitEthernet5/0/1 with port description
44
45 set interface lldp TenGigabitEthernet5/0/1 port-desc vtf:eth0
46
47
48 ### Operational data
49
50 The list of LLDP-enabled interfaces which are up can be shown using "show lldp" command
51
52 Example:
53 DBGvpp# show lldp
54 Local interface           Peer chassis ID           Remote port ID               Last heard      Last sent      Status
55 GigabitEthernet2/0/1                                                               never         27.0s ago     inactive
56 TenGigabitEthernet5/0/1   8c:60:4f:dd:ca:52         Eth1/3/3                     20.1s ago       18.3s ago      active
57
58 All LLDP configuration data with all LLDP-enabled interfaces can be shown using "show lldp detail" command
59
60 Example:
61 DBGvpp# show lldp detail
62 LLDP configuration:
63 Configured system name: vpp
64 Configured tx-hold: 4
65 Configured tx-interval: 30
66
67 LLDP-enabled interface table:
68
69 Interface name: GigabitEthernet2/0/1
70 Interface/peer state: inactive(timeout)
71 Last known peer chassis ID:
72 Last known peer port ID:
73 Last packet sent: 12.4s ago
74 Last packet received: never
75
76 Interface name: GigabitEthernet2/0/2
77 Interface/peer state: interface down
78 Last packet sent: never
79
80 Interface name: TenGigabitEthernet5/0/1
81 Interface/peer state: active
82 Peer chassis ID: 8c:60:4f:dd:ca:52(MAC address)
83 Remote port ID: Eth1/3/3(Locally assigned)
84 Last packet sent: 3.6s ago
85 Last packet received: 5.5s ago
86