# FANT: Flexible Attention-Shifting Network Telemetry
## 5 Attention-Switching Strategy
### Implementation
\(\delta v_{i,j,h,l}\) can be calculated as following: \(\delta v_{i,j,h,(t_{start}+n\!+\!s_{fl})}=|v_{i,j,h,(t_{start}+n\!+\!s_{fl})}-v_ {i,j,h,(t_{start}+(n+1)\!+\!s_{fl})}|\)

Additionally, FANT maintains two (key, value) pairs for each \(<\!m_{i},e_{j},p_{l}\!>\) tuple:

(\(key_{1}\), \(v_{sum}\)): The sum of all values in List 1, \(v_{sum}=\sum_{n=0}^{k}v_{i,j,l,(t_{start}+n\!+\!s_{fl})}\). (\(key_{2}\), \(\delta_{sum}\)): The sum of all values in List 2, \(\delta_{sum}=\sum_{n=0}^{k-1}\delta v_{i,j,h,(t_{start}+n\!+\!s_{fl})}\). As Algorithm A1 shows, since the calculation process for any \(v_{i,j,h,t}\) is executed only a constant number of times, the complexity of analyzing each cycle is \(O\) (the sum of the number of metrics received by all probes). ```
Input:\(v_{c}(v_{i,j,h,t})\) Output:\(flag\)
1\(flag\leftarrow\) false;
2\(v_{latest}\leftarrow\mathit{List}_{1}.\mathrm{LINDEX(0)}\); \(\delta v_{c}\leftarrow|v_{latest}-v_{c}|\);
3\(v_{sum}\leftarrow\mathrm{GET(}key_{1}\)); \(\delta_{sum}\leftarrow\mathrm{GET(}key_{2}\));
4\(AVG_{v}\leftarrow v_{sum}/n\); \(AVG_{\delta}=\delta_{sum}/(n-1)\);
5 if\(|v_{c}-AVG_{v}|>threshold_{1}\) or \(|\delta v_{c}-AVG_{\delta}|>threshold_{2}\)then
6\(v_{c}\leftarrow(v_{c}+AVG_{v})/2\); \(\delta v_{c}\leftarrow|v_{latest}-v_{c}|\);
7\(flag\leftarrow\) true;
8\(v_{delete}\leftarrow\mathit{List}_{1}.\mathrm{LPOP};List_{1}.\mathrm{RPUSH}(v_{c})\);
9\(\delta_{delete}\leftarrow\mathit{List}_{2}.\mathrm{LPOP};\mathit{List}_{2}. \mathrm{RPUSH}(\delta v_{c})\);
10\(\mathrm{SET(}key_{1}\))\(\leftarrow(v_{sum}-v_{delete}+v_{c})\); \(\mathrm{SET(}key_{1}\))\(\leftarrow(\delta sum-\delta_{delete}+\delta v_{c})\) return\(flag\)
```

**Algorithm A1**Analysis of Suspicious Links

## References

* [PERSON] et al. (2019) [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON]; et al. HPCC: High precision congestion control. In Proceedings of the ACM Special Interest Group on Data Communication, Beijing, China, 19-24 August 2019; pp. 44-58. * [PERSON] et al. (2014) [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON] Duet: Cloud scale load balancing with hardware and software. _ACM SIGCOMM Comput. Commun. Rev._**2014**, 44, 27-38. [CrossRef]* [PERSON] et al. (2017) [PERSON]; [PERSON]; [PERSON] Delta-net: Real-time network verification using atoms. In Proceedings of the 14 th USENIX Symposium on Networked Systems Design and Implementation (NSDI 17), Boston, MA, USA, 27-29 March 2017; pp. 735-749. * [PERSON] et al. (2024) [PERSON]; [PERSON]; [PERSON]; [PERSON]. Simple Network Management Protocol (SNMP). RFC 1157. 1990. Available online: [[https://www.rfc-editor.org/info/rfc1157](https://www.rfc-editor.org/info/rfc1157)]([https://www.rfc-editor.org/info/rfc1157](https://www.rfc-editor.org/info/rfc1157)) (accessed on 1 December 2024). * [PERSON] and [PERSON] (2001) [PERSON]; [PERSON]; [PERSON] InMon Corporation's sFlow: A Method for Monitoring Traffic in Switched and Routed Networks. RFC 3176. 2001. Available online: [[https://www.rfc-editor.org/info/rfc3176](https://www.rfc-editor.org/info/rfc3176)]([https://www.rfc-editor.org/info/rfc3176](https://www.rfc-editor.org/info/rfc3176)) (accessed on 1 December 2024). * [PERSON] et al. (2013) [PERSON]; [PERSON]; [PERSON] Traffic engineering in software defined networks. In Proceedings of the 2013 Proceedings IEEE INFOCOM, Turin, Italy, 14-19 April 2013; pp. 2211-2219. * [PERSON] et al. (2014) [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON] Millions of little minions: Using packets for low latency network programming and visibility. _ACM SIGCOMM Comput. Commun. Rev._**2014**, _44_, 3-14. [CrossRef]
* In-Band Network Telemetry (INT) Dataplane Specification Version v0.5. Available online: [[https://p4.org/p4-spec/docs/INT_v0_5.pdf](https://p4.org/p4-spec/docs/INT_v0_5.pdf)]([https://p4.org/p4-spec/docs/INT_v0_5.pdf](https://p4.org/p4-spec/docs/INT_v0_5.pdf)) (accessed on 1 December 2024). * In-Band Network Telemetry (INT) Dataplane Specification Version v1.0.