3 ; Copyright(c) 2016 Intel Corporation. All rights reserved.
6 ; Redistribution and use in source and binary forms, with or without
7 ; modification, are permitted provided that the following conditions
10 ; * Redistributions of source code must retain the above copyright
11 ; notice, this list of conditions and the following disclaimer.
12 ; * Redistributions in binary form must reproduce the above copyright
13 ; notice, this list of conditions and the following disclaimer in
14 ; the documentation and/or other materials provided with the
16 ; * Neither the name of Intel Corporation nor the names of its
17 ; contributors may be used to endorse or promote products derived
18 ; from this software without specific prior written permission.
20 ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 ; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 ; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 ; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 ; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 ; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 ; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 ; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 ; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 ; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 ; The diagram below shows how additional protocol components can be plugged into
33 ; the IP layer implemented by the ip_pipeline application. Pick your favorite
34 ; open source components for dynamic ARP, ICMP, UDP or TCP termination, etc and
35 ; connect them through SWQs to the IP infrastructure.
37 ; The input packets with local destination are sent to the UDP/TCP applications
38 ; while the input packets with remote destination are routed back to the
39 ; network. Additional features can easily be added to this setup:
40 ; * IP Reassembly: add SWQs with IP reassembly enabled (typically required for
41 ; the input traffic with local destination);
42 ; * IP Fragmentation: add SWQs with IP fragmentation enabled (typically
43 ; required to enforce the MTU for the routed output traffic);
44 ; * Traffic Metering: add Flow Action pipeline instances (e.g. for metering the
45 ; TCP connections or ICMP input traffic);
46 ; * Traffic Management: add TMs for the required output LINKs;
47 ; * Protocol encapsulations (QinQ, MPLS) for the output packets: part of the
48 ; routing pipeline configuration.
54 ; |_________| |_________|
57 ; | | SWQ0 (UDP TX) | | SWQ1 (TCP TX)
58 ; | UDP |-------+ | TCP |------------+
60 ; |_________| | |_________| |
63 ; | (UDP RX) | | (TCP RX) |
64 ; ____|____ | ____|____ |
66 ; RXQ<0..3>.1 ------>|Firewall +--->| | +------>| Flow +--->| |
67 ; (UDP local dest) | (P2) | SINK0 | | | (P3) | SINK1 |
68 ; |_________| (Deny)| | |_________| (RST) |
69 ; RXQ<0..3>.2 -------------------------|-----+ |
70 ; (TCP local dest) | |
71 ; | +------------------------------+
75 ; | Routing | TXQ<0..3>.0
76 ; RXQ<0..3>.0 ---------------------->| & ARP +----------------------------->
77 ; (IP remote dest) | (P1) |
80 ; SWQ4 +-------------+ | | SWQ5 (ARP miss)
81 ; (Route miss) | | +------------+
83 ; ___V__|__ SWQ6 ____V____
84 ; | | (ICMP TX) | | TXQ<0..3>.1
85 ; RXQ<0..3>.3 ------>| ICMP | +------>| Dyn ARP +------------->
86 ; (IP local dest) | | | | |
87 ; |_________| | |_________|
88 ; RXQ<0..3>.4 -------------------------------+
91 ; This configuration file implements the diagram presented below, where the
92 ; dynamic ARP, ICMP, UDP and TCP components have been stubbed out and replaced
93 ; with loop-back and packet drop devices.
96 ; | | SWQ0 (UDP TX) | | SWQ1 (TCP TX)
97 ; |Loobpack |-------+ |Loopback |------------+
98 ; | (P4) | | | (P5) | |
99 ; |_________| | |_________| |
102 ; | (UDP RX) | | (TCP RX) |
103 ; ____|____ | ____|____ |
105 ; RXQ<0..3>.1 ------>|Firewall +--->| | +------>| Flow +--->| |
106 ; (UDP local dest) | (P2) | SINK0 | | | (P3) | SINK1 |
107 ; |_________| (Deny)| | |_________| (RST) |
108 ; RXQ<0..3>.2 -------------------------|-----+ |
109 ; (TCP local dest) | |
110 ; | +------------------------------+
114 ; | Routing | TXQ<0..3>.0
115 ; RXQ<0..3>.0 ---------------------->| & ARP +----------------------------->
116 ; (IP remote dest) | (P1) |
119 ; SINK2 |<---+ +--->| SINK3
120 ; (Route miss) (ARP miss)
122 ; _________ _________
124 ; RXQ<0..3>.3 ------>| Drop +--->| SINK<4..7> +------>| Drop +--->| SINK<8..11>
125 ; (IP local dest) | (P6) | (IP local dest) | | (P7) | (ARP)
126 ; |_________| | |_________|
127 ; RXQ<0..3>.4 ------------------------------------+
131 ; Input packet: Ethernet/IPv4 or Ethernet/ARP
132 ; Output packet: Ethernet/IPv4 or Ethernet/ARP
134 ; Packet buffer layout (for input IPv4 packets):
135 ; # Field Name Offset (Bytes) Size (Bytes)
138 ; 2 Ethernet header 256 14
139 ; 3 IPv4 header 270 20
140 ; 4 ICMP/UDP/TCP header 290 8/8/20
176 pktq_in = RXQ0.0 RXQ1.0 RXQ2.0 RXQ3.0 SWQ0 SWQ1
177 pktq_out = TXQ0.0 TXQ1.0 TXQ2.0 TXQ3.0 SINK2 SINK3
178 port_local_dest = 4 ; SINK2 (Drop)
186 pktq_in = RXQ0.1 RXQ1.1 RXQ2.1 RXQ3.1
187 pktq_out = SWQ2 SINK0
191 type = FLOW_CLASSIFICATION
193 pktq_in = RXQ0.2 RXQ1.2 RXQ2.2 RXQ3.2
194 pktq_out = SWQ3 SINK1
196 key_size = 16 ; IPv4 5-tuple key size
197 key_offset = 278 ; IPv4 5-tuple key offset
198 key_mask = 00FF0000FFFFFFFFFFFFFFFFFFFFFFFF ; IPv4 5-tuple key mask
199 flowid_offset = 128 ; Flow ID effectively acts as TCP socket ID
202 type = PASS-THROUGH ; Loop-back (UDP place-holder)
206 swap = 282 286 ; IPSRC <-> IPDST
207 swap = 290 292 ; PORTSRC <-> PORTDST
210 type = PASS-THROUGH ; Loop-back (TCP place-holder)
214 swap = 282 286 ; IPSRC <-> IPDST
215 swap = 290 292 ; PORTSRC <-> PORTDST
218 type = PASS-THROUGH ; Drop (ICMP place-holder)
220 pktq_in = RXQ0.3 RXQ1.3 RXQ2.3 RXQ3.3
221 pktq_out = SINK4 SINK5 SINK6 SINK7
224 type = PASS-THROUGH ; Drop (Dynamic ARP place-holder)
226 pktq_in = RXQ0.4 RXQ1.4 RXQ2.4 RXQ3.4
227 pktq_out = SINK8 SINK9 SINK10 SINK11