Code in this topic is taken from the jnx-flow sample application. Once you create your development sandbox, the source code for this example is available in the following locations:
- C source code for the management component:
- C source code for the data component:
- DDL source:
For information about creating your development sandbox, see "Creating Reference and Development Sandboxes" in the Installation Guide.
- ODL source:
Transit applications receive packets in transit to their destination and then reinject, modify, or drop the packets as needed. The JUNOS software enables this functionality using the service set: a collection of rules or policies that can be applied to traffic coming to the Multiservices PIC. For basics about service sets and configuring them, see Service Set Configuration.
The following figure shows the operations of a typical transit application:
- Before writing a transit application, you should be familiar with the concepts described in the JUNOS Services Interfaces Configuration Guide, which is available in the Juniper Networks documentation set.
The following steps are the major operations an application performs to configure and use service sets.
Lifecycle of a Transit Application
This topic continues with the following sections:
You write the configuration in a DDL file with the suffix
.cnf.dd that you save in the
sandbox/src/lib/ddl/input directory for your application. The configuration defines the policy rules, match conditions, and actions for each service set. (For details about configuring SDK applications, see the SDK CLI Configuration section of this documentation; for details about writing DDL, see Creating a User Interface with DDL and ODL.)
The JUNOS spd daemon reads the configuration, stores it in the Routing Engine kernel, and creates a public blob that stores the mapping of service set name to a unique service set ID, and input and output next hops (if configured).
Your application's management daemon on the Routing Engine parses the complete service set configuration to retrieve the information configured for the service set and the policy rules.
Your application's management daemon on the Routing Engine calls SDK KCOM functions to retrieve the public blob with the mappings created by the spd daemon.
The management daemon sends the policy rules and service set ID to your application's data daemon running on the PIC, using the SDK libconn library.
The data daemon receives and sends packets according to the policy rules:
Packets arrive bearing the service set or subunit ID, packet direction, and incoming interface index. Each incoming packet indicates whether the packet is interface style, nexthop style, or sampling style; the default is nexthop style. The system stores this information in jbuf fields.
There is also a direction bit in the packet that indicates if the input filter or output filter matched, which your daemon can use as needed.
The data daemon calls a jbuf function to get the service set information from the packet. (For more information about the jbuf library, see Using the Services SDK jbuf Library for Packet Processing.)
The data daemon maintains a policy database that stores the service set or subunit ID and the policy rules received from the management daemon; it applies the rules and decides what to do with the packet.
© 2007-2009 Juniper Networks, Inc. All rights reserved. The information contained herein is confidential information of Juniper Networks, Inc., and may not be used, disclosed, distributed, modified, or copied without the prior written consent of Juniper Networks, Inc. in an express license. This information is subject to change by Juniper Networks, Inc. Juniper Networks, the Juniper Networks logo, and JUNOS are registered trademarks of Juniper Networks, Inc. in the United States and other countries. All other trademarks, service marks, registered trademarks, or registered service marks are the property of their respective owners.
Generated on Sun May 30 20:26:47 2010 for Juniper Networks Partner Solution Development Platform JUNOS SDK 10.2R1 by Doxygen 1.4.5