aboutsummaryrefslogtreecommitdiffstats
path: root/hicn-plugin/src/interest_hitpit_node.c
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2023-01-16 20:18:23 +0000
committerMauro Sardara <msardara@cisco.com>2023-01-18 09:08:39 +0000
commitf904218765e58ab1cdf05b6dfd14912369cd9fe7 (patch)
treeadb40251384a395a5ee791c246e4ed3b4acda4ee /hicn-plugin/src/interest_hitpit_node.c
parent4d2e8310cbeacf1c20ec0adb3dc6cf06abcdcbb8 (diff)
feat: local-remote strategy
Ticket: HICN-824 Change-Id: Iea285cb499b13c943a142fa39328ee36c91ae913 Signed-off-by: Mauro Sardara <msardara@cisco.com> (cherry picked from commit 7560918629eb11aa7bdaee5f4856243b38c77f93)
Diffstat (limited to 'hicn-plugin/src/interest_hitpit_node.c')
-rw-r--r--hicn-plugin/src/interest_hitpit_node.c35
1 files changed, 28 insertions, 7 deletions
diff --git a/hicn-plugin/src/interest_hitpit_node.c b/hicn-plugin/src/interest_hitpit_node.c
index a84aace9c..0b09711f7 100644
--- a/hicn-plugin/src/interest_hitpit_node.c
+++ b/hicn-plugin/src/interest_hitpit_node.c
@@ -61,7 +61,7 @@ hicn_interest_hitpit_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node,
const hicn_strategy_vft_t *strategy_vft0;
const hicn_dpo_vft_t *dpo_vft0;
u8 dpo_ctx_id0;
- u8 found = 0;
+ u8 forward = 0;
hicn_face_id_t outfaces[MAX_OUT_FACES];
u32 clones[MAX_OUT_FACES];
u16 outfaces_len;
@@ -147,15 +147,37 @@ hicn_interest_hitpit_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node,
}
else
{
- // Distinguish between aggregation or retransmission
- found =
+ // Distinguish between aggregation, retransmission and
+ // additionally check if the strategy mandates to always send
+ // the interest
+
+ // Retransmission
+ forward =
hicn_pcs_entry_pit_search (pcs_entry, hicnb0->face_id);
- if (found && hicnb0->payload_type != HPT_MANIFEST)
+ // Strategy mandates to force send after aggregation
+ if (!forward && strategy_vft0->hicn_send_after_aggregation (
+ dpo_ctx_id0, hicnb0->face_id))
+ {
+ forward = true;
+ hicn_pcs_entry_pit_add_face (pcs_entry, hicnb0->face_id);
+ }
+
+ if (forward && hicnb0->payload_type != HPT_MANIFEST)
{
- // Retransmission
+ // Send interest
strategy_vft0->hicn_select_next_hop (
- dpo_ctx_id0, outfaces, &outfaces_len);
+ dpo_ctx_id0, hicnb0->face_id, outfaces, &outfaces_len);
+
+ // If no next hops, drop the packet
+ if (outfaces_len == 0)
+ {
+ drop_packet (&next0);
+ vlib_validate_buffer_enqueue_x1 (
+ vm, node, next_index, to_next, n_left_to_next, bi0,
+ next0);
+ continue;
+ }
// Prepare the packet for the forwarding
next0 = isv6 ? HICN_INTEREST_HITPIT_NEXT_FACE6_OUTPUT :
@@ -224,7 +246,6 @@ hicn_interest_hitpit_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node,
// Aggregation
hicn_pcs_entry_pit_add_face (pcs_entry, hicnb0->face_id);
- /* Aggregation */
drop_packet (&next0);
stats.interests_aggregated++;