Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NETOBSERV-1190: update dns tracker to calc latency instead of TS #149

Merged
merged 1 commit into from
Jul 17, 2023
Merged

NETOBSERV-1190: update dns tracker to calc latency instead of TS #149

merged 1 commit into from
Jul 17, 2023

Conversation

msherif1234
Copy link
Contributor

@msherif1234 msherif1234 commented Jul 13, 2023

  • add new LRU map to correlate DNS Q/R and calculate TS
  • manual testing
]$ dig google.com

;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 30678
;; flags: qr rd ra; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;google.com.                    IN      A

;; ANSWER SECTION:
google.com.             224     IN      A       172.253.122.139
google.com.             224     IN      A       172.253.122.113
google.com.             224     IN      A       172.253.122.101
google.com.             224     IN      A       172.253.122.102
google.com.             224     IN      A       172.253.122.100
google.com.             224     IN      A       172.253.122.138

;; Query time: 21 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: Fri Jul 14 08:31:27 EDT 2023
;; MSG SIZE  rcvd: 135

Then use flows_logs collector

ipv4: 08:31:27.947192 unknown IP 127.0.0.53:53 > 127.0.0.1:49033: protocol:udp type: 0 code: 0 dir:0 bytes:177 packets:1 flags:0 ends: 08:31:27.947192 dnsId: 30678 dnsFlags: 0x8180 dnsLatency(ms): 21 rtt 0
  • test on cluster
{
  "AgentIP": "10.0.128.2",
  "Bytes": 137,
  "DnsFlags": 33152,
  "DnsFlagsResponseCode": "NoError",
  "DnsId": 29212,
  "DnsLatencyMs": 4,
  "DstAddr": "10.131.0.8",
  "DstK8S_HostIP": "10.0.128.2",
  "DstK8S_HostName": "ci-ln-mv3kgpt-72292-vcr5x-worker-a-2crf4",
  "DstK8S_Name": "dns-default-wcrv6",
  "DstK8S_Namespace": "openshift-dns",
  "DstK8S_OwnerName": "dns-default",
  "DstK8S_OwnerType": "DaemonSet",
  "DstK8S_Type": "Pod",
  "DstMac": "0A:58:0A:83:00:08",
  "DstPort": 54476,
  "Duplicate": false,
  "Etype": 2048,
  "FlowDirection": "0",
  "IfDirection": 0,
  "Interface": "unknown",
  "Packets": 1,
  "Proto": 17,
  "SrcAddr": "169.254.169.254",
  "SrcMac": "0A:58:0A:83:00:01",
  "SrcPort": 53,
  "TimeFlowEndMs": 1689336618135,
  "TimeFlowStartMs": 1689336618135,
  "TimeReceived": 1689336618,
  "app": "netobserv-flowcollector"
}

@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Jul 13, 2023

@msherif1234: This pull request references NETOBSERV-1190 which is a valid jira issue.

In response to this:

  • add new LRU map to correlate DNS Q/R and calculate TS

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Jul 13, 2023

@msherif1234: This pull request references NETOBSERV-1190 which is a valid jira issue.

In response to this:

  • add new LRU map to correlate DNS Q/R and calculate TS
  • manual testing
]$ dig google.com

; <<>> DiG 9.16.33-RH <<>> google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 15672
;; flags: qr rd ra; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;google.com.                    IN      A

;; ANSWER SECTION:
google.com.             194     IN      A       172.253.122.113
google.com.             194     IN      A       172.253.122.100
google.com.             194     IN      A       172.253.122.139
google.com.             194     IN      A       172.253.122.138
google.com.             194     IN      A       172.253.122.101
google.com.             194     IN      A       172.253.122.102

;; Query time: 132 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: Thu Jul 13 14:34:28 EDT 2023
;; MSG SIZE  rcvd: 135

Then use flows_logs collector

ipv4: 14:34:28.458790 unknown IP 127.0.0.53:53 > 127.0.0.1:43613: protocol:udp type: 0 code: 0 dir:0 bytes:177 packets:1 flags:0 ends: 14:34:28.458790 dnsId: 15672 dnsFlags: 0x8180 dnsLatency: nanos:131602039 rtt 0

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@codecov
Copy link

codecov bot commented Jul 13, 2023

Codecov Report

Merging #149 (e5a3902) into main (1045794) will increase coverage by 0.24%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main     #149      +/-   ##
==========================================
+ Coverage   39.00%   39.25%   +0.24%     
==========================================
  Files          31       31              
  Lines        2238     2214      -24     
==========================================
- Hits          873      869       -4     
+ Misses       1314     1296      -18     
+ Partials       51       49       -2     
Flag Coverage Δ
unittests 39.25% <0.00%> (+0.24%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/exporter/proto.go 95.12% <0.00%> (+12.14%) ⬆️
pkg/flow/record.go 63.63% <0.00%> (-0.47%) ⬇️

@msherif1234 msherif1234 changed the title NETOBSERV-1190: update dns tracker to provide DNS latency instead of query/rsp TS NETOBSERV-1190: update dns tracker to provide latency instead of TS Jul 13, 2023
@msherif1234
Copy link
Contributor Author

/ok-to-test

@openshift-ci openshift-ci bot added the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Jul 14, 2023
@github-actions
Copy link

New image: quay.io/netobserv/netobserv-ebpf-agent:0dc1c9d. It will expire after two weeks.

@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Jul 14, 2023

@msherif1234: This pull request references NETOBSERV-1190 which is a valid jira issue.

In response to this:

  • add new LRU map to correlate DNS Q/R and calculate TS
  • manual testing
]$ dig google.com

; <<>> DiG 9.16.33-RH <<>> google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 15672
;; flags: qr rd ra; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;google.com.                    IN      A

;; ANSWER SECTION:
google.com.             194     IN      A       172.253.122.113
google.com.             194     IN      A       172.253.122.100
google.com.             194     IN      A       172.253.122.139
google.com.             194     IN      A       172.253.122.138
google.com.             194     IN      A       172.253.122.101
google.com.             194     IN      A       172.253.122.102

;; Query time: 132 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: Thu Jul 13 14:34:28 EDT 2023
;; MSG SIZE  rcvd: 135

Then use flows_logs collector

ipv4: 14:34:28.458790 unknown IP 127.0.0.53:53 > 127.0.0.1:43613: protocol:udp type: 0 code: 0 dir:0 bytes:177 packets:1 flags:0 ends: 14:34:28.458790 dnsId: 15672 dnsFlags: 0x8180 dnsLatency: nanos:131602039 rtt 0
  • test on cluster
{
 "AgentIP": "10.0.128.2",
 "Bytes": 137,
 "DnsFlags": 33152,
 "DnsFlagsResponseCode": "NoError",
 "DnsId": 29212,
 "DnsLatencyMs": 4,
 "DstAddr": "10.131.0.8",
 "DstK8S_HostIP": "10.0.128.2",
 "DstK8S_HostName": "ci-ln-mv3kgpt-72292-vcr5x-worker-a-2crf4",
 "DstK8S_Name": "dns-default-wcrv6",
 "DstK8S_Namespace": "openshift-dns",
 "DstK8S_OwnerName": "dns-default",
 "DstK8S_OwnerType": "DaemonSet",
 "DstK8S_Type": "Pod",
 "DstMac": "0A:58:0A:83:00:08",
 "DstPort": 54476,
 "Duplicate": false,
 "Etype": 2048,
 "FlowDirection": "0",
 "IfDirection": 0,
 "Interface": "unknown",
 "Packets": 1,
 "Proto": 17,
 "SrcAddr": "169.254.169.254",
 "SrcMac": "0A:58:0A:83:00:01",
 "SrcPort": 53,
 "TimeFlowEndMs": 1689336618135,
 "TimeFlowStartMs": 1689336618135,
 "TimeReceived": 1689336618,
 "app": "netobserv-flowcollector"
}

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@msherif1234 msherif1234 changed the title NETOBSERV-1190: update dns tracker to provide latency instead of TS NETOBSERV-1190: update dns tracker to calc latency instead of TS Jul 14, 2023
@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Jul 14, 2023

@msherif1234: This pull request references NETOBSERV-1190 which is a valid jira issue.

In response to this:

  • add new LRU map to correlate DNS Q/R and calculate TS
  • manual testing
]$ dig google.com

;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 30678
;; flags: qr rd ra; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;google.com.                    IN      A

;; ANSWER SECTION:
google.com.             224     IN      A       172.253.122.139
google.com.             224     IN      A       172.253.122.113
google.com.             224     IN      A       172.253.122.101
google.com.             224     IN      A       172.253.122.102
google.com.             224     IN      A       172.253.122.100
google.com.             224     IN      A       172.253.122.138

;; Query time: 21 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: Fri Jul 14 08:31:27 EDT 2023
;; MSG SIZE  rcvd: 135

Then use flows_logs collector

ipv4: 08:31:27.947192 unknown IP 127.0.0.53:53 > 127.0.0.1:49033: protocol:udp type: 0 code: 0 dir:0 bytes:177 packets:1 flags:0 ends: 08:31:27.947192 dnsId: 30678 dnsFlags: 0x8180 dnsLatency(ms): 21 rtt 0
  • test on cluster
{
 "AgentIP": "10.0.128.2",
 "Bytes": 137,
 "DnsFlags": 33152,
 "DnsFlagsResponseCode": "NoError",
 "DnsId": 29212,
 "DnsLatencyMs": 4,
 "DstAddr": "10.131.0.8",
 "DstK8S_HostIP": "10.0.128.2",
 "DstK8S_HostName": "ci-ln-mv3kgpt-72292-vcr5x-worker-a-2crf4",
 "DstK8S_Name": "dns-default-wcrv6",
 "DstK8S_Namespace": "openshift-dns",
 "DstK8S_OwnerName": "dns-default",
 "DstK8S_OwnerType": "DaemonSet",
 "DstK8S_Type": "Pod",
 "DstMac": "0A:58:0A:83:00:08",
 "DstPort": 54476,
 "Duplicate": false,
 "Etype": 2048,
 "FlowDirection": "0",
 "IfDirection": 0,
 "Interface": "unknown",
 "Packets": 1,
 "Proto": 17,
 "SrcAddr": "169.254.169.254",
 "SrcMac": "0A:58:0A:83:00:01",
 "SrcPort": 53,
 "TimeFlowEndMs": 1689336618135,
 "TimeFlowStartMs": 1689336618135,
 "TimeReceived": 1689336618,
 "app": "netobserv-flowcollector"
}

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

…query/rsp TS

Signed-off-by: msherif1234 <mmahmoud@redhat.com>
@github-actions github-actions bot removed the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Jul 14, 2023
@msherif1234
Copy link
Contributor Author

/ok-to-test

@openshift-ci openshift-ci bot added the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Jul 14, 2023
@github-actions
Copy link

New image: quay.io/netobserv/netobserv-ebpf-agent:1404a60. It will expire after two weeks.

@jotak
Copy link
Member

jotak commented Jul 17, 2023

I am still wondering if we could find ways to not generate any new flow, but just edit the existing ones - I did some tries for that but without success, cf my slack message
Anyway this PR is already a nice improvement, thanks @msherif1234 !
/lgtm

@msherif1234
Copy link
Contributor Author

I am still wondering if we could find ways to not generate any new flow, but just edit the existing ones - I did some tries for that but without success, cf my slack message Anyway this PR is already a nice improvement, thanks @msherif1234 ! /lgtm

Thanks @jotak lets proceed with that to unlock QE and continue looking for improvemnst

@msherif1234
Copy link
Contributor Author

/approve

@openshift-ci
Copy link

openshift-ci bot commented Jul 17, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: msherif1234

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit 4a182aa into netobserv:main Jul 17, 2023
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved jira/valid-reference lgtm ok-to-test To set manually when a PR is safe to test. Triggers image build on PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants