blob: 2bbb5f6b97ef810eec267c130ddca368f6f8135f [file] [log] [blame] [view]
Neale Ranns50f0ac02019-05-15 02:13:37 -07001.. _punt:
2
3Punting Packets
4===============
5
6.. toctree::
7
8Overview
9________
10
11To 'punt' can mean different things to different people. In VPP the
12data-plane punts when a packet cannot be handled by any further
13nodes. Punt differs from drop, in that VPP is giving other elements of
14the system the opportunity to handle this packet.
15
16A popular meaning of punt is to send packets to the user/control-plane.
17This is specific option of the more general case above, where VPP is
18handing the packet to the control-plane for further prosessing.
19
20The Punt Infrastructe
21---------------------
22
23Exception packets are those that a given node cannot handle via normal
24mecahnisms.
25Punting of exception packets is handled via the VLIB 'punt
26infra'. There are two types of nodes; sources and sinks. Sources
27allocate a punt 'reason' from the infrastructre and load time. When
28they encouter an exception during switch time it will tag the packet
29with the reason and ship the packet of the the punt-dispatch node. A
30sink will register with the punt infra at load time so it can receive
31packets that were punted for that reason. If no sinks are registerd
32for a given reason the packet is dropped, if multiple sinks register
33the packets are replicated.
34
35This mechanism allows us to extend the system to deal with packets
36that the source node would otherise drop.
37
38
39Punting to the Control Plane
40----------------------------
41
42Active Punt
43-----------
44
45The user/control-plane specifies that this is the type of packet I
46want to receive and this is where I want it sent.
47
48Currently there exists 3 ways to describe how to match/classify the
49packets to be punted:
50...
51 1) a matching UDP port
52 2) a matching IP protocol (i.e. OSPF)
53 3) a matching punt excpetion reason (see above)
54...
55
56Depending on the type/classification of the packet to be punted, that
57active punt will register itself into the VLIB graph to receive those
58packets. For example, if it's a packet matching a UDP port then it
59will hook into the UDP port dispatch functions; udp_register_port().
60
61There exists only one sink for passive punt, a unix domain socket. But
62more work is underway in this area.
63
64see the API in: vnet/ip/punt.api
65
66
67
68Passive Punt
69------------
70
71VPP input packet processing can be described as a series of
72classifiers. For example, a sequence of input classifications could
73be, is it IP? is it for-us? is it UDP? is it a known UDP-port? If at
74some point in this pipline VPP has no further classifications to make,
75then the packet can be punted, which means sent to ipX-punt node. This
76is described as passive since the control-plane is thus receiving
77every packet that VPP does not itself handle.
78For passive punt the user can specify where the packets should be
79sent and whether/how they should be policed/rate-limited.
80
81see the API in: vnet/ip/ip.api
82