Krishna,

I’ll try to give some high level guidance, however much of this is also 
explained in various places in the wiki. 
https://wiki.fd.io/view/File:Fd.io_vpp_overview_29.03.17.pptx is a good start.

There are two different uses of the word vector: As a dimensioned allocation of 
memory (so it can be used like an array) or as a bundle of packets that need to 
be processed. The latter is a specific case of the former.

The IP stack is built as a graph of nodes. Each node represents a small piece 
of the overall stack functionality. Further, each node in the graph processes 
all the packets it is presented with; this is the where vectors of packets are 
processed. If you look at the implementation of each node you will observe a 
while loop for this. In some cases VPP processes 2 or 4 packets in parallel in 
this loop by interleaving the instructions for more than one packet. This loop 
also determines the disposition of each packet which typically involves 
queueing it for another node; not all the packets in a single vector end up 
with the same outward disposition. Thus, there’s no single loop that alone 
processes packets, rather there’s a collection of loops that process parts of 
the network stack.

FIB lookup could happen in several places; but obvious places to look are nodes 
named something like ‘ip4-lookup’.

I hope that gets you started.

Chris.

From: vpp-dev@lists.fd.io [mailto:vpp-dev@lists.fd.io] On Behalf Of Krishna 
Tippur Gururaj
Sent: Friday, February 9, 2018 16:08
To: vpp-dev@lists.fd.io
Subject: [vpp-dev] VPP code clarification

Hello All,

I am a graduate student at Rochester Institute of Technology, NY, and I am 
working with Prof. Minseok Kwon on implementing various probabilistic filters 
around the VPP fib lookup logic.

I am having a hard time trying to figure out the code flow so I am sending this 
out requesting for some help on the same.

1. There is a point in the VPP code where the vector elements (packets) are 
looped over one by one; somewhere down the chain, the fib lookup is done for 
each packet. Could you please tell me where that "for" loop (or something 
similar) exists, from where each packet in a vector is processed individually?

2. I was trying to figure out how VPP determines the size of a vector while 
processing the packets. I found the vec_create() and other such calls in 
vppinfra/ but was unable to determine how they are used in actual packet 
processing. Could you please tell me where the vector size is determined?

Thanks in advance for the guidance and help!

--
Regards,
Krishna Tippur Gururaj
Computer Science graduate student, RIT
(585) 532-3636

Reply via email to