122 Commits

Author SHA1 Message Date
Matus Fabian
f2a23cc860 NAT66 1:1 mapping (VPP-1108)
Support the 1:1 translation of source address for IPv6

Change-Id: I934d18e5ec508bf7422d796ee5f172b79c048011
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2018-01-31 17:29:13 +00:00
Matus Fabian
5f22499e88 NAT44: add opaque string tag to static mapping APIs (VPP-1147)
Change-Id: I620e2081285ca8ac5c2da8efc12fe6f540ea4fd1
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2018-01-25 22:00:31 -08:00
Neale Ranns
54c6dc4500 For DHCP client configuration control the setting of the broadcast flag in the
DISCOVER message sent.

According to RFC2131:

   In the case of a client using DHCP for initial configuration (before
   the client's TCP/IP software has been completely configured), DHCP
   requires creative use of the client's TCP/IP software and liberal
   interpretation of RFC 1122.  The TCP/IP software SHOULD accept and
   forward to the IP layer any IP packets delivered to the client's
   hardware address before the IP address is configured; DHCP servers
   and BOOTP relay agents may not be able to deliver DHCP messages to
   clients that cannot accept hardware unicast datagrams before the
   TCP/IP software is configured.

   To work around some clients that cannot accept IP unicast datagrams
   before the TCP/IP software is configured as discussed in the previous
   paragraph, DHCP uses the 'flags' field [21].  The leftmost bit is
   defined as the BROADCAST (B) flag.  The semantics of this flag are
   discussed in section 4.1 of this document.  The remaining bits of the
   flags field are reserved for future use.  They MUST be set to zero by
   clients and ignored by servers and relay agents.  Figure 2 gives the
   format of the 'flags' field.

this changes means VPP conforms to the:
   "SHOULD accept and forward to the IP layer any IP packets delivered
    to the client's hardware address before the IP address is configured"
with the caveat that VPP allows DHCP packets destined to the stanard client
DHCP port to be delivered. With this enhancement the control-plane is now
able to choose the setting of the broadcast flag.

Change-Id: Ia4eb2c9bb1e30c29f9192facc645e9533641955a
Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-01-23 13:36:48 +00:00
Matus Fabian
e82488f10f NAT44: asymmetrical static mapping rule (VPP-1135)
add option to NAT44 static mapping API/CLI to make rule asymmetrical (rule match only out2in direction)

Change-Id: If262a3ff375a24d3059f0de1f1ac387a4fe09475
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2018-01-22 09:44:45 +00:00
Matus Fabian
240b5ef57c NAT44: asymmetrical load balancing static mapping rule (VPP-1132)
Add option to NAT44 load balancing static mapping API/CLI to make rule asymmetrical (rule match only in out2in direction).

Change-Id: I325ecef5591e4bf44ce4469a24d44fe56c3bb2e9
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2018-01-11 04:10:26 -08:00
Juraj Sloboda
c5c6a3342f Add basic support for DS-Lite CE (VPP-1059)
Change-Id: Ifcca60da3f77c0a4959f98b3365c846badbdc2d0
Signed-off-by: Juraj Sloboda <jsloboda@cisco.com>
2018-01-11 09:34:17 +00:00
Neale Ranns
f068c3ed29 DVR: run L3 output features
- rename l2_bridged to is_dvr. Including on the ip.api
    this was new in the 18.01 release so no compatability issues.
- steal the free space in vnet_buffer_opaque_t for use with flags.
- run the ipX-output feature arc from the DVR DPO

Change-Id: I040e5976d1dbe076fcdda3a40a7804f56337ce3f
Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-01-09 16:38:19 +00:00
Juraj Sloboda
cba6936c45 Add support for 464XLAT NAT44 mode (VPP-1045)
Change-Id: I24e7a26972bbbfcea100292b212b29ae7a349335
Signed-off-by: Juraj Sloboda <jsloboda@cisco.com>
2018-01-05 10:18:22 +00:00
Florin Coras
b795bd0c5c tcp: add builtin server/client transfer test
Change-Id: Iab0baabf2f27bc7ad7fbf2d2789a493752b07d8a
Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-12-22 19:25:46 +00:00
Neale Ranns
55d0378829 L2 Emulation
L2 Emulation is a feautre that is applied to L2 ports to 'extract'
IP packets from the L2 path and inject them into the L3 path (i.e.
into the appropriate ip[4|6]_input node).
L3 routes in the table_id for that interface should then be configured
as DVR routes, therefore the forwarded packet has the L2 header
preserved and togehter the L3 routed system behaves like an L2 bridge.

Change-Id: I8effd7e2f4c67ee277b73c7bc79aa3e5a3e34d03
Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-12-20 16:26:04 +00:00
Juraj Sloboda
7b929793fe Translate matching packets using NAT (VPP-1069)
Add API function which enables forwarding of packets not matching
existing translation or static mapping instead of dropping them.

When forwarding is enabled matching packets will be translated
while non-matching packets will be forwarded without translation.

Change-Id: Ic13040cbad16d3a1ecdc3e02a497171bef6aa413
Signed-off-by: Juraj Sloboda <jsloboda@cisco.com>
2017-12-20 11:12:24 +00:00
Matus Fabian
b932d26ea4 NAT: Twice NAT44 (VPP-969)
Translation of both source and destination addresses and ports for 1:1 NAT
session initiated from outside network (ExternalIP K8 use case).

Change-Id: Ic0000497cf71619aac996d6d580844f0ea0edc14
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2017-12-19 10:34:07 +00:00
“mystarrocks”
23f0c4515f ESP_AH_test_automation_scripts rev1
Change-Id: I941abdc4a02e4c52c66b9d299e380b27caca7c1d
Signed-off-by: “mystarrocks” <mystarrocks@yahoo.com>
2017-12-15 09:50:21 +00:00
Florin Coras
3ea6ce235e tcp/session: add make tests
Change-Id: Icb93ab80c5a6432d7b2b698a47e8b612c6f06fbd
Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-12-12 21:35:51 +00:00
Neale Ranns
9128637ee8 BIER in non-MPLS netowrks
as decsribed in section 2.2
  ihttps://tools.ietf.org/html/draft-ietf-bier-mpls-encapsulation-10
with BIFT encoding from:
  https://tools.ietf.org/html/draft-wijnandsxu-bier-non-mpls-bift-encoding-00

changes:
1 - introduce the new BIFT lookup table. BIER tables that have an associated
    MPLS label are added to the MPLS-FIB. Those that don't are added to the
    BIER table
2 - BIER routes that have no associated output MPLS label will add a BIFT label.
3 - The BIER FMask has a path-list as a member to resolve via any possible path.

Change-Id: I1fd4d9dbd074f0e855c16e9329b81460ebe1efce
Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-12-09 20:55:08 +00:00
Matus Fabian
ab7a805fbb NAT44: identity NAT (VPP-1073)
Identity mapping translate an IP address to itself.

Change-Id: Icc0ca5102d32547a4b0c75720b5f5bf41ed69c71
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2017-11-30 12:09:11 +00:00
John Lo
70bfcaf477 Add Support of DHCP VSS Type 0 where VPN-ID is ASCII
Enhence support of DHCP VSS (Virtual Subnet Selection) to include
VSS type 0 where VSS info is a NVT (Network Virtual Terminal)
ASCII VPN ID where the ASCII string MUST NOT be terminated with a
zero byte. Existing code already support VSS type 1, where VSS
information is a RFC 2685 VPN-ID of 7 bytes with 3 bytes OUI
and 4 bytes VPN index, and VSS type 255 indicating global VPN.

Change-Id: I54edbc447c89a2aacd1cc9fc72bd5ba386037608
Signed-off-by: John Lo <loj@cisco.com>
2017-11-16 11:25:51 +00:00
Gabriel Ganne
8527f12b52 add classify session action set-sr-policy-index
This allows to use the classifier to steer source routing packets instead
of using the "sr steer" command.
This way we can steer on anything instead of only the dst ip address.

test:
 * add add_node_next function to the VppPapiProvider class.
 * add simple test scenario using the classifier to steer packets with
   dest ip addr == a7::/8 to the source routing insert node.
 * use new interface indexes (3,4) instead of (0,1) to prevent a cleanup
   conflict with the other tests which attach a specific fib to the
   interface.

The test creates interfaces sepsrated from the other tests to prevent a
conflict in the cleaning of the ip6 fib index 1 which causes vpp not to
be able to find a default route on this table.

Change-Id: Ibacb30fab3ce53f0dfe848ca6a8cdf0d111d8336
Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>
2017-11-10 20:25:10 +00:00
Neale Ranns
d792d9c01e BIER
- see draft-ietf-bier-mpls-encapsulation-10
- midpoint, head and tail functions
- supported payload protocols; IPv4 and IPv6 only.

Change-Id: I59d7363bb6fdfdce8e4016a68a9c8f5a5e5791cb
Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-11-09 15:16:52 +00:00
Pavel Kotucek
8daa80a4ad ACL plugin support tagged subinterfaces
Change-Id: I92b351895c7efb26533c05512b91ead8ddbfb9c8
Signed-off-by: Pavel Kotucek <pkotucek@cisco.com>
2017-11-08 19:51:15 +00:00
Matus Fabian
0938dcf192 NAT64 to use IPv4 address from interface (VPP-1051)
Change-Id: I326429c31dea6958a342ee152ef86cb975f4b12c
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2017-11-08 11:01:46 +00:00
Matus Fabian
efcd1e9e1d SNAT: IP fragmentation (VPP-890)
Translation of fragmented packets.

Change-Id: I9b1f2e9433ce273638080f32c2d3bff39c49899d
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2017-11-07 21:58:31 +00:00
Neale Ranns
810086d8fd UDP Encapsulation.
A UDP-encap object that particiapates in the FIB graph and contributes
DPO to teh output chain. It thereofre resembles a tunnel but without the
interface. FIB paths (and henace routes) can then be created to egress
through the UDP-encap. Said routes can have MPLS labels, hence this also
allows MPLSoUPD.
Encap is uni-directional. For decap, one still registers with the UDP port
dispatcher.

Change-Id: I23bd345523b20789a1de1b02022ea1148ca50797
Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-11-07 16:13:42 +00:00
Matus Fabian
8ebe625362 NAT: DS-Lite (VPP-1040)
Dual-Stack Lite enables a broadband service provider to share IPv4 addresses among customers by combining two well-known technologies: IPv4-in-IPv6 and NAT.

Change-Id: I039740f8548c623cd1ac89b8ecda1a6cc4aafb9c
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2017-11-07 11:52:39 +00:00
Mohsin Kazmi
57938f63cc l2fib: MAC: Fix uint64 to u8 byte array
As per proposal on the mailing list, this patch fixes
the represntation of MAC address in VPP API calls for
   ·  L2fib_add_del
   ·  L2_fib_table_details

Change-Id: I31e17efd1a6314cded69666e693cb8fc33158d02
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2017-10-31 15:21:28 +00:00
Matus Fabian
5ba86f7243 NAT: delete session API/CLI (VPP-1041)
Administratively delete NAT44 session for specific inside/outside addresses and port pair.

Change-Id: If5ab500ac3592c7153d6d8f2cc0297df7309fbc3
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2017-10-26 17:35:28 +00:00
Ole Troan
895b6e8b44 VPP-1033: Python API support arbitrary sized input parameters.
Dynamically calculate the required buffer size to pack into based on
message definition. Also add input parameter length checking.

Change-Id: I7633bec596e4833bb328fbf63a65b866c7985de5
Signed-off-by: Ole Troan <ot@cisco.com>
2017-10-25 17:16:56 +00:00
Marek Gradzki
0164a06d81 Remove unused 'not_last' parameter from ip_add_del_route
Vat supports setting value for the parameter, but
'not_last' is ignored by ip_add_del_route handler,
so can be removed.

This patch
- updates ip.api,
- removes vat handlers
- updates vpp_papi_provider.py
  (also mpls_route_add_del with unused not_last)

Change-Id: Ife15de123db4bc8247103a29b90bce1988e46534
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2017-10-19 07:31:16 +00:00
Neale Ranns
054c03ac9c Source Lookup progammable via API
Change-Id: I5d5d4f22b6369d504455a644f73076d772fbcfb4
Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-10-14 09:11:42 +00:00
Neale Ranns
d91c1dbdb3 punt and drop features:
- new IPv4 and IPv6 feature arcs on the punt and drop nodes
 - new features:
   - redirect punted traffic to an interface and nexthop
   - police punted traffic.

Change-Id: I53be8bf4e06545add8a3619e462de5ffedd0a95c
Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-10-10 16:42:39 +00:00
Marco Varlese
b598f1d3d7 Initial GENEVE TUNNEL implementation and tests.
Notes on this first implementation:
* First version of the implementation does NOT support GENEVE OPTIONS
HEADER: it isn't well understood what the purpose of the OPTIONS will be and/or
what content would be placed in the variable option data;

Once the IETF work will evolve and further information will be available
it could be possible to modify the frame rewrite to contemplate the
actual GENEVE OPTIONS.

Change-Id: Iddfe6f408cc45bb0800f00ce6a3e302e48a4ed52
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2017-10-06 08:51:09 +00:00
Neale Ranns
6f63115603 Distributed Virtual Router Support
A distributed virtual router works by attmpeting to switch a packet, but on failing to find a local consumer (i.e. the packet is destined to a locally attached host) then the packet is sent unmodified 'upstream' to where the rest of the 'distributed' router is present. When L3 switching a packet this means the L2 header must not be modifed. This patch adds a 'l2-bridge' object to the L3 FIB which re-injects packets from the L3 path back into the L2 path - use with extreme caution.

Change-Id: I069724eb45956647d7980cbe40a80a788ee6ee82
Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-10-05 09:50:26 +00:00
Eyal Bari
24db0ec78f L2-FIB:add mac learn events test
fixes an issue where events were not sent if BD doesn't enable  mac aging

Change-Id: Iddc53cb5c45e560633e6c5cff2731dccfc70ad5b
Signed-off-by: Eyal Bari <ebari@cisco.com>
2017-10-02 01:29:44 +00:00
Andrew Yourtchenko
987abe9eeb acl-plugin: take 2 at VPP-991 fix, this time with a test case which verifies it.
The replacement of [] with pool_elt_at_index and subsequent fixing it
was incorrect - it was equivalent to &[], since it returns a pointer to
the element. I've added VPP-993 previously to create a testcase,
so this commit partially fulfills that one as well.

Change-Id: I5b15e3ce48316f0429232aacf885e8f7c63d9522
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2017-09-27 16:07:20 +00:00
Andrew Yourtchenko
51d2651e4a acl-plugin: test: move the API calls to vpp_papi_provider.py
Change-Id: I1d3818027b8a1fcb1ec12016e3476b5c22a2d5a5
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2017-09-26 07:49:08 +00:00
Eyal Bari
c125eccc10 IP-MAC,ND:wildcard events,fix sending multiple events
wildcard ND events publisher was sending the last event mutiple times

Change-Id: I6c30f2de03fa825e79df9005a3cfaaf68ff7ea2f
Signed-off-by: Eyal Bari <ebari@cisco.com>
2017-09-22 01:55:33 +00:00
Eyal Bari
2019748a0e L2BD,ARP-TERM:fix arp query report mechanism+test
previous mechanism was emitting duplicates of last event, when handling multiple arp queries.
tests:
* arp events sent for graps
* duplicate suppression
* verify no events when disabled

Change-Id: I84adc23980d43b819261eccf02ec056b5cec61df
Signed-off-by: Eyal Bari <ebari@cisco.com>
2017-09-18 13:51:52 +00:00
Pavel Kotucek
c29940c58d ACL-plugin add "replace" semantics for adding a new MacIP acl
Change-Id: Ia5c869b2d8b8ad012b9e89fb6720c9c32d9ee065
Signed-off-by: Pavel Kotucek <pkotucek@cisco.com>
2017-09-12 08:38:25 +00:00
Neale Ranns
1500254bee FIB table add/delete API
part 2;
  - this adds the code to create an IP and MPLS table via the API.
  - but the enforcement that the table must be created before it is used is still missing, this is so that CSIT can pass.

Change-Id: Id124d884ade6cb7da947225200e3bb193454c555
Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-09-11 10:14:36 +00:00
Pavel Kotucek
932f74196d ACL-plugin MACIP ACLs tests
Change-Id: Ie40c837358454cfe9475cb2c14fdf20b24fa6602
Signed-off-by: Pavel Kotucek <pkotucek@cisco.com>
2017-09-08 05:51:24 +00:00
Matus Fabian
704018cf11 NAT: Destination NAT44 with load-balancing (VPP-954)
added load-balancing static mappings with unequal load support

Change-Id: Ie505e41f24d46f812b94dd28bdafe3dc170a6060
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2017-09-06 08:49:25 +00:00
Matus Fabian
2ba92e32e0 NAT: Rename snat plugin to nat (VPP-955)
Change-Id: I30a7e3da7a4efc6038a91e27b48045d4b07e2764
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2017-08-23 07:42:10 +00:00
Kris Michielsen
910744394f SRv6 tests
Change-Id: Ib1d2fc5a83d9d007a0468591a73881675f1bec9b
Signed-off-by: Kris Michielsen <kmichiel@cisco.com>
2017-08-22 11:12:34 +00:00
Matus Fabian
ab9a59c19a SNAT: Make proto optional in nat64_bib_dump (VPP-942)
make proto optional in nat64_bib_dump and nat64_st_dump

Change-Id: Idd102ce2b1555d38783fd22c84e46b4c48570edc
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2017-08-16 15:56:32 +00:00
Neale Ranns
a07bd70800 Dedicated SW Interface Event
Change-Id: I06a10a4291e61aec3f1396d2514ed6fe3901897a
Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2017-08-11 02:58:30 +00:00
Hongjun Ni
62f9cdd82c Add PPPoE Plugin
Supports 64K PPPoE sessions

This plugin adds three graph nodes:
1) pppoe-input for PPPoE decapsulation
2) pppoe-encap for PPPoE encapsulation
3) pppoe-tap-dispatch for control plane process

Below is the configuration to make PPPoE CP and DP work:
vim /etc/vpp/startup.conf
tuntap {
  enable
  ethernet
  name newtap
}

create pppoe tap tap-if-index 1

//Configure it after a subscriber's PPPoE discovery and PPP link establishment succeeds:
create pppoe session client-ip 100.1.2.1 session-id 1 client-mac 00:11:01:00:00:01

show pppoe fib
show pppoe session

Change-Id: I73e724b6bf7c3e4181a9914c5752da1fa72d7e60
Signed-off-by: Hongjun Ni <hongjun.ni@intel.com>
2017-08-09 07:41:11 +00:00
Neale Ranns
da78f957e4 L2 over MPLS
[support for VPWS/VPLS]
- switch to using dpo_proto_t rather than fib_protocol_t in fib_paths so that we can describe L2 paths
- VLIB nodes to handle pop/push of MPLS labels to L2

Change-Id: Id050d06a11fd2c9c1c81ce5a0654e6c5ae6afa6e
Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-08-08 17:25:00 +00:00
Pavel Kotucek
15ac81c16f P2P Ethernet
Change-Id: Idb97e573961b3bc2acdeef77582314590795f8c3
Signed-off-by: Pavel Kotucek <pkotucek@cisco.com>
2017-08-01 14:44:13 +00:00
Eyal Bari
001fd406df SPAN:add l2 mirror
added span feature nodes for l2-input / l2-output

Change-Id: Ib6e0ce60d0811901b6edd70209e6a4c4a35cd8ff
Signed-off-by: Eyal Bari <ebari@cisco.com>
2017-07-24 08:21:52 +03:00
Matus Fabian
93d84c9fc2 SNAT: in2out translation as an output feature (VPP-903)
in2out translation as an output feature on the outside interface (postrouting)

Change-Id: I32c0311be09bdf102b9a0885b8b89c7588cb558f
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2017-07-20 06:56:07 +00:00