3) Jeremy Ethridge for taking the role of someone who did not
understand Netlink and reviewing the document to make sure that it
made sense.
Appendix 1: Sample Service Hierarchy
In the diagram below we show a simple IP service, foo, and the
interaction it has between CP and FE components for the service
(labels 1-3).
The diagram is also used to demonstrate CP<->FE addressing. In this
section, we illustrate only the addressing semantics. In Appendix 2,
the diagram is referenced again to define the protocol interaction
between service foo's CPC and FEC (labels 4-10).
CP
[--------------------------------------------------------.
| .-----. |
| | . -------. |
| | CLI | / \ |
| | | | CP protocol | |
| /->> -. | component | <-. |
| __ _/ | | For | | |
| | | IP service | ^ |
| Y | foo | | |
| | ___________/ ^ |
| Y 1,4,6,8,9 / ^ 2,5,10 | 3,7 |
--------------- Y------------/---|----------|-----------
| ^ | ^
**|***********|****|**********|**********
************* Netlink layer ************
**|***********|****|**********|**********
FE | | ^ ^
.-------- Y-----------Y----|--------- |----.
| | / |
| Y / |
| . --------^-------. / |
| |FE component/module|/ |
| | for IP Service | |
--->---|------>---| foo |----->-----|------>--
| ------------------- |
| |
| |
------------------------------------------
The control plane protocol for IP service foo does the following to
connect to its FE counterpart. The steps below are also numbered
above in the diagram.
1) Connect to the IP service foo through a socket connect. A typical
connection would be via a call to: socket(AF_NETLINK, SOCK_RAW,
NETLINK_FOO).
2) Bind to listen to specific asynchronous events for service foo.
3) Bind to listen to specific asynchronous FE events.
Appendix 2: Sample Protocol for the Foo IP Service
Our example IP service foo is used again to demonstrate how one can
deploy a simple IP service control using Netlink.
These steps are continued from Appendix 1 (hence the numbering).
4) Query for current config of FE component.
5) Receive response to (4) via channel on (3).
6) Query for current state of IP service foo.
7) Receive response to (6) via channel on (2).
8) Register the protocol-specific packets you would like the FE to
forward to you.
9) Send service-specific foo commands and receive responses for them,
if needed.
Appendix 2a: Interacting with Other IP services
The diagram in Appendix 1 shows another control component configuring
the same service. In this case, it is a proprietary Command Line
Interface. The CLI may or may not be using the Netlink protocol to
communicate to the foo component. If the CLI issues commands that
will affect the policy of the FEC for service foo then, then the foo
CPC is notified. It could then make algorithmic decisions based on
this input. For example, if an FE allowed another service to delete
policies installed by a different service and a policy that foo
installed was deleted by service bar, there might be a need to
propagate this to all the peers of service foo.
Appendix 3: Examples
In this example, we show a simple configuration Netlink message sent
from a TC CPC to an egress TC FIFO queue. This queue algorithm is
based on packet counting and drops packets when the limit exceeds 100
packets. We assume that the queue is in a hierarchical setup with a
parent 100:0 and a classid of 100:1 and that it is to be installed on
a device with an ifindex of 4.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Length (52) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type (RTM_NEWQDISC) | Flags (NLM_F_EXCL | |
| |NLM_F_CREATE | NLM_F_REQUEST)|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Sequence Number(arbitrary number) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Process ID (0) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Family(AF_INET)| Reserved1 | Reserved1 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Interface Index (4) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Qdisc handle (0x1000001) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Parent Qdisc (0x1000000) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| TCM Info (0) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type (TCA_KIND) | Length(4) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Value ("pfifo") |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type (TCA_OPTIONS) | Length(4) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Value (limit=100) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Authors' Addresses
Jamal Hadi Salim
Znyx Networks
Ottawa, Ontario
Canada
EMail: hadi@znyx.com
Hormuzd M Khosravi
Intel
2111 N.E. 25th Avenue JF3-206
Hillsboro OR 97124-5961
USA
Phone: +1 503 264 0334
EMail: hormuzd.m.khosravi@intel.com
Andi Kleen
SuSE
Stahlgruberring 28
81829 Muenchen
Germany
EMail: ak@suse.de
Alexey Kuznetsov
INR/Swsoft
Moscow
Russia
EMail: kuznet@ms2.inr.ac.ru
Full Copyright Statement
Copyright (C) The Internet Society (2003). All Rights Reserved.
This document and translations of it may be copied and furnished to
others, and derivative works that comment on or otherwise explain it
or assist in its implementation may be prepared, copied, published
and distributed, in whole or in part, without restriction of any
kind, provided that the above copyright notice and this paragraph are
included on all such copies and derivative works. However, this
document itself may not be modified in any way, such as by removing
the copyright notice or references to the Internet Society or other
Internet organizations, except as needed for the purpose of
developing Internet standards in which case the procedures for
copyrights defined in the Internet Standards process must be
followed, or as required to translate it into languages other than
English.
The limited permissions granted above are perpetual and will not be
revoked by the Internet Society or its successors or assignees.
This document and the information contained herein is provided on an
"AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
Acknowledgement
Funding for the RFCEditor function is currently provided by the
Internet Society.