LLDPd - Know your network neighbors

An introduction into LLDP

What is LLDP?

LLDP is a network layer 2 protocol, called "Link Layer Discovery Protocol". It transmits many information about the device and ports to all
network neighbors. It is vendor independent and specified in IEEE 802.1AB. There are many similar vendor specific protocols, f.e. CDP (Cisco) and FDP (Foundry/Brocade).

The information is sent as a LLDPDU in a TLV (Type, Length, Value) format at a fixed interval. Included in the transmitted data is the hostname, description, port name and many more.

How is LLDP used on a Brocade FastIron device?

Enabling LLDP is easy: device(config)# lldp run

At this time, LLDP is enabled globally and transmits and receives LLDPDUs.

To see neighbour information, use show lldp neighbors or show lldp neighbors detail

Example

r1#show lldp neighbors  
Lcl Port Chassis ID      Port ID         Port Description         System Name   
1/1/3    0023.7dfb.xxxx  0023.7dfb.xxxx  eth2                     pilatus.domai~
1/1/5    0000.5a73.xxxx  0030.487a.xxxx  eth0                     uetli1.domain~
1/1/6    0010.187f.xxxx  0030.487b.xxxx  eth0                     uetli2.domain~
1/1/23   748e.f82d.xxxx  748e.f82d.xxxx  GigabitEthernet1/1/23    r2            
1/1/24   748e.f82d.xxxx  748e.f82d.xxxx  GigabitEthernet1/1/24    r2            

See something? Exactly, there are not only information about the other router, but also about linux servers. More on that later.

Here is an example of the detail output:

r1#show lldp neighbors detail ports e 1/1/3
Local port: 1/1/3
  Neighbor: 0023.7dfb.xxxx, TTL 111 seconds
    + Chassis ID (MAC address): 0023.7dfb.xxxx
    + Port ID (MAC address): 0023.7dfb.xxxx
    + Time to live: 120 seconds
    + System name         : "pilatus.domain.tld"
    + System description  : "Ubuntu 13.10 Linux 3.11.0-13-generic #20-Ubuntu S\
                             MP Wed Oct 23 07:38:26 UTC 2013 x86_64"
    + System capabilities : bridge, WLAN access point, router
      Enabled capabilities: router
    + Management address (IPv4): 192.168.1.10
    + Port description    : "eth2"
    + Link aggregation: capable, but not aggregated
    + 802.3 MAC/PHY          : auto-negotiation enabled
      Advertised capabilities: 10BaseT-HD, 10BaseT-FD, 100BaseTX-HD,
                               100BaseTX-FD, 1000BaseT-FD
      Operational MAU type   : 1000BaseT-FD

Using LLDP on Linux

As seen on the above examples, not only network devices are able to use LLDP, but also Linux. The software is called lldpd and can simply be installed with apt-get install lldpd After starting lldpd, LLDPDUS are received and transmitted on all local network interfaces. To query the received information, the included tool lldpcli tool can be used:

root@server ~ # lldpcli show neighbors
-------------------------------------------------------------------------------
LLDP neighbors:
-------------------------------------------------------------------------------
Interface:    eth0, via: LLDP, RID: 2, Time: 1 day, 03:17:13
  Chassis:     
    ChassisID:    mac 74:8e:f8:xx:xx:xx
    SysName:      r2
    SysDescr:     Not received
    MgmtIP:       192.168.1.10
    MgmtIP:       2a02:418:xxxx::x
    Capability:   Bridge, on
    Capability:   Router, on
  Port:        
    PortID:       mac 74:8e:f8:xx:xx:xx
    PortDescr:    GigabitEthernet1/1/3
-------------------------------------------------------------------------------
Interface:    eth2, via: LLDP, RID: 4, Time: 1 day, 03:23:37
  Chassis:     
    ChassisID:    mac 74:8e:f8:xx:xx:xx
    SysName:      r1
    SysDescr:     Not received
    MgmtIP:       192.168.1.9
    MgmtIP:       2a02:418:xxxx::x
    Capability:   Bridge, on
    Capability:   Router, on
  Port:        
    PortID:       mac 74:8e:f8:xx:xx:xx
    PortDescr:    GigabitEthernet1/1/3
-------------------------------------------------------------------------------

The lldpd software not only speaks LLDP, but also a bunch of other similar protocols:

  • CDP (Cisco)
  • EDP (Extreme)
  • SONMP (Nortel)
  • FDP (Foundry)

Many network management tools are able to draw a network map using this information.

You've successfully subscribed to Tobias Brunner aka tobru
Great! Next, complete checkout to get full access to all premium content.
Error! Could not sign up. invalid link.
Welcome back! You've successfully signed in.
Error! Could not sign in. Please try again.
Success! Your account is fully activated, you now have access to all content.
Error! Stripe checkout failed.
Success! Your billing info is updated.
Error! Billing info update failed.