Zebra-vtysh source code analysis and Transformation (I): Zebra Software Architecture

Source: Internet
Author: User

1. Knowledge about the zebra Function

Zebra provides a hierarchical multi-user Command Parsing engine-vty (virtual terminal) for Cisco command lines ). It is a virtual terminal interface similar to Linux Shell and is responsible for security authentication, data buffering, Command Parsing, mode switching, and command calling for access.

Each time you access a vtysh interface, a corresponding vty is initiated. Vty initializes and mounts the command node of the command set based on the user's priority. The command node contains the commands that the user can access and use in the form of a linked list.

You can access vty through various interfaces. vty parses each of your commands and finds and executes the corresponding command function through the command set linked list. In this way, you can access vty to implement command set-based management.

2. Zebra Architecture

Zebra adopts a modular architecture. The entire program consists of a series of daemon processes. Each routing protocol has its own route processing process. At the same time, it provides a zebra daemon for managing kernel route tables. The routing handler manages the kernel route table through the zebra daemon.

The figure shows that in zebra, there are a total of five routing daemon and a management process. These routing processes and management processes can be distributed on different machines. Each process can listen to vty connections from different ports.

3. Compile zebra for my use

Common routing products can be used with zebra with slight changes. If you only need the vty connection function and use interfaces to add, modify, and delete commands, Zebra supports module deletion and blocking.

For example, if you only need vty, you can add the following parameters during congfigure compilation.

...

CD .. /ZEBRA-vtysh & (test-e config. status | (touch config. status &&. /configure -- disable-ipv6 -- disable-bgpd -- disable-ripngd -- disable-ospf6d -- disable-BGP-announce -- enable-vtysh -- disable-ospfd -- disable-ripd -- disable-Zebra
-- Prefix =/-- With-cflags = "-O2-wall" -- Build = i386 -- Host = MIPS-Linux -- target = MIPS ))&&

...

(Config. Status indicates the configure status record for future use)

In this way, after compiling zebra, you can run vtysh and view its various modes (as described in the next article) to start your happy journey.

Reference: http://www.zebra.org

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.