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-1379: enhance DNS debugging to dbg DNS over TCP with NA fields #218

Merged
merged 1 commit into from
Nov 6, 2023

Conversation

msherif1234
Copy link
Contributor

@msherif1234 msherif1234 commented Oct 26, 2023

Description

it was noticed with DNS over TCP that the handshake packets are too small and it doesn't contain any DNS data from UI DNS fields showed as n/a which is true

this PR propagate the DNS lookup return code so we can differentiate between cases like TCP handshake case and real errors enriching with DNS info.

when we get N/A bpf_skb_load_bytes() return an error

working
======
 "dns_record": {
                        "id": 40514,
                        "flags": 34176,
                        "latency": 185794,
                        "errno": 0,
                        "offset": 68,
                        "tcp_len": 34,
                        "skb_len": 291
                    },

none working
==========
 "dns_record": {
                        "id": 0,
                        "flags": 0,
                        "latency": 0,
                        "errno": 7,
                        "offset": 68,
                        "tcp_len": 34,
                        "skb_len": 66
                    },

in the none working case the received packet is very small that is why we can't fetch DNS header info.

Those small packets are TCP handshake and those packets don't have data by definition this clear when u look at the pcap

image (1)

Dependencies

netobserv/network-observability-console-plugin#425
netobserv/flowlogs-pipeline#533

Checklist

If you are not familiar with our processes or don't know what to answer in the list below, let us know in a comment: the maintainers will take care of that.

  • Will this change affect NetObserv / Network Observability operator? If not, you can ignore the rest of this checklist.
  • Is this PR backed with a JIRA ticket? If so, make sure it is written as a title prefix (in general, PRs affecting the NetObserv/Network Observability product should be backed with a JIRA ticket - especially if they bring user facing changes).
  • Does this PR require product documentation?
    • If so, make sure the JIRA epic is labelled with "documentation" and provides a description relevant for doc writers, such as use cases or scenarios. Any required step to activate or configure the feature should be documented there, such as new CRD knobs.
  • Does this PR require a product release notes entry?
    • If so, fill in "Release Note Text" in the JIRA.
  • Is there anything else the QE team should know before testing? E.g: configuration changes, environment setup, etc.
    • If so, make sure it is described in the JIRA ticket.
  • QE requirements (check 1 from the list):
    • Standard QE validation, with pre-merge tests unless stated otherwise.
    • Regression tests only (e.g. refactoring with no user-facing change).
    • No QE (e.g. trivial change with high reviewer's confidence, or per agreement with the QE team).

@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 Oct 26, 2023
@github-actions
Copy link

New image:
quay.io/netobserv/netobserv-ebpf-agent:0fd928e

It will expire after two weeks.

To deploy this build, run from the operator repo, assuming the operator is running:

USER=netobserv VERSION=0fd928e make set-agent-image

@codecov
Copy link

codecov bot commented Oct 26, 2023

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (0891b34) 31.79% compared to head (d66c036) 31.84%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #218      +/-   ##
==========================================
+ Coverage   31.79%   31.84%   +0.05%     
==========================================
  Files          37       37              
  Lines        3362     3369       +7     
==========================================
+ Hits         1069     1073       +4     
- Misses       2230     2232       +2     
- Partials       63       64       +1     
Flag Coverage Δ
unittests 31.84% <57.14%> (+0.05%) ⬆️

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

Files Coverage Δ
pkg/decode/decode_protobuf.go 29.59% <100.00%> (+0.44%) ⬆️
pkg/exporter/proto.go 95.27% <100.00%> (+0.07%) ⬆️
pkg/flow/record.go 55.22% <0.00%> (-2.59%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@msherif1234
Copy link
Contributor Author

/ok-to-test

@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 Oct 26, 2023
@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 Oct 26, 2023
@github-actions
Copy link

New image:
quay.io/netobserv/netobserv-ebpf-agent:a7e6749

It will expire after two weeks.

To deploy this build, run from the operator repo, assuming the operator is running:

USER=netobserv VERSION=a7e6749 make set-agent-image

@msherif1234
Copy link
Contributor Author

/ok-to-test

@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 Oct 26, 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 Oct 26, 2023
@github-actions
Copy link

New image:
quay.io/netobserv/netobserv-ebpf-agent:ed3a6a6

It will expire after two weeks.

To deploy this build, run from the operator repo, assuming the operator is running:

USER=netobserv VERSION=ed3a6a6 make set-agent-image

@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 Oct 27, 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 Oct 27, 2023
@github-actions
Copy link

New image:
quay.io/netobserv/netobserv-ebpf-agent:35e2cc7

It will expire after two weeks.

To deploy this build, run from the operator repo, assuming the operator is running:

USER=netobserv VERSION=35e2cc7 make set-agent-image

@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 Oct 27, 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 Oct 27, 2023
@github-actions
Copy link

New image:
quay.io/netobserv/netobserv-ebpf-agent:075fb69

It will expire after two weeks.

To deploy this build, run from the operator repo, assuming the operator is running:

USER=netobserv VERSION=075fb69 make set-agent-image

@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 Oct 27, 2023
@msherif1234 msherif1234 force-pushed the dns_na_issue branch 2 times, most recently from 9abb630 to 688063a Compare October 29, 2023 10:35
@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Oct 31, 2023

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

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.15.0" version, but no target version was set.

In response to this:

Description

it was noticed with DNS over TCP that the handshake packets are too small and it doesn't contain any DNS data from UI DNS fields showed as n/a which is true

this PR propagate the DNS lookup return code so we can differentiate between cases like TCP handshake case and real errors enriching with DNS info.

when we get N/A bpf_skb_load_bytes() return an error

working
======
"dns_record": {
                       "id": 40514,
                       "flags": 34176,
                       "latency": 185794,
                       "errno": 0,
                       "offset": 68,
                       "tcp_len": 34,
                       "skb_len": 291
                   },

none working
==========
"dns_record": {
                       "id": 0,
                       "flags": 0,
                       "latency": 0,
                       "errno": 7,
                       "offset": 68,
                       "tcp_len": 34,
                       "skb_len": 66
                   },

in the none working case the received packet is very small that is why we can't fetch DNS header info.

Those small packets are TCP handshake and those packets don't have data by definition this clear when u look at the pcap

image (1)

Dependencies

netobserv/network-observability-console-plugin#425

Checklist

If you are not familiar with our processes or don't know what to answer in the list below, let us know in a comment: the maintainers will take care of that.

  • Will this change affect NetObserv / Network Observability operator? If not, you can ignore the rest of this checklist.
  • Is this PR backed with a JIRA ticket? If so, make sure it is written as a title prefix (in general, PRs affecting the NetObserv/Network Observability product should be backed with a JIRA ticket - especially if they bring user facing changes).
  • Does this PR require product documentation?
  • If so, make sure the JIRA epic is labelled with "documentation" and provides a description relevant for doc writers, such as use cases or scenarios. Any required step to activate or configure the feature should be documented there, such as new CRD knobs.
  • Does this PR require a product release notes entry?
  • If so, fill in "Release Note Text" in the JIRA.
  • Is there anything else the QE team should know before testing? E.g: configuration changes, environment setup, etc.
  • If so, make sure it is described in the JIRA ticket.
  • QE requirements (check 1 from the list):
  • Standard QE validation, with pre-merge tests unless stated otherwise.
  • Regression tests only (e.g. refactoring with no user-facing change).
  • No QE (e.g. trivial change with high reviewer's confidence, or per agreement with the QE team).

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.

@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 Oct 31, 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 Oct 31, 2023
Copy link

New image:
quay.io/netobserv/netobserv-ebpf-agent:054faa4

It will expire after two weeks.

To deploy this build, run from the operator repo, assuming the operator is running:

USER=netobserv VERSION=054faa4 make set-agent-image

@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 Oct 31, 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 Oct 31, 2023
Copy link

New image:
quay.io/netobserv/netobserv-ebpf-agent:138178c

It will expire after two weeks.

To deploy this build, run from the operator repo, assuming the operator is running:

USER=netobserv VERSION=138178c make set-agent-image

Signed-off-by: Mohamed Mahmoud <[email protected]>
@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 Oct 31, 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 Oct 31, 2023
Copy link

New image:
quay.io/netobserv/netobserv-ebpf-agent:9bed2e9

It will expire after two weeks.

To deploy this build, run from the operator repo, assuming the operator is running:

USER=netobserv VERSION=9bed2e9 make set-agent-image

@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Oct 31, 2023

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

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.15.0" version, but no target version was set.

In response to this:

Description

it was noticed with DNS over TCP that the handshake packets are too small and it doesn't contain any DNS data from UI DNS fields showed as n/a which is true

this PR propagate the DNS lookup return code so we can differentiate between cases like TCP handshake case and real errors enriching with DNS info.

when we get N/A bpf_skb_load_bytes() return an error

working
======
"dns_record": {
                       "id": 40514,
                       "flags": 34176,
                       "latency": 185794,
                       "errno": 0,
                       "offset": 68,
                       "tcp_len": 34,
                       "skb_len": 291
                   },

none working
==========
"dns_record": {
                       "id": 0,
                       "flags": 0,
                       "latency": 0,
                       "errno": 7,
                       "offset": 68,
                       "tcp_len": 34,
                       "skb_len": 66
                   },

in the none working case the received packet is very small that is why we can't fetch DNS header info.

Those small packets are TCP handshake and those packets don't have data by definition this clear when u look at the pcap

image (1)

Dependencies

netobserv/network-observability-console-plugin#425
netobserv/flowlogs-pipeline#533

Checklist

If you are not familiar with our processes or don't know what to answer in the list below, let us know in a comment: the maintainers will take care of that.

  • Will this change affect NetObserv / Network Observability operator? If not, you can ignore the rest of this checklist.
  • Is this PR backed with a JIRA ticket? If so, make sure it is written as a title prefix (in general, PRs affecting the NetObserv/Network Observability product should be backed with a JIRA ticket - especially if they bring user facing changes).
  • Does this PR require product documentation?
  • If so, make sure the JIRA epic is labelled with "documentation" and provides a description relevant for doc writers, such as use cases or scenarios. Any required step to activate or configure the feature should be documented there, such as new CRD knobs.
  • Does this PR require a product release notes entry?
  • If so, fill in "Release Note Text" in the JIRA.
  • Is there anything else the QE team should know before testing? E.g: configuration changes, environment setup, etc.
  • If so, make sure it is described in the JIRA ticket.
  • QE requirements (check 1 from the list):
  • Standard QE validation, with pre-merge tests unless stated otherwise.
  • Regression tests only (e.g. refactoring with no user-facing change).
  • No QE (e.g. trivial change with high reviewer's confidence, or per agreement with the QE team).

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.

Copy link
Contributor

@jpinsonneau jpinsonneau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a note for future improvment.
Thanks @msherif1234 !

@@ -90,11 +90,13 @@ func PBFlowToMap(flow *pbflow.Record) config.GenericMap {
}
}

out["DnsErrno"] = flow.GetDnsErrno()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed, my concern here is adding unecessary field on non dns related flows.
We agreed to keep it as is for now.

@Amoghrd
Copy link

Amoghrd commented Nov 6, 2023

/label qe-approved

@openshift-ci openshift-ci bot added the qe-approved QE has approved this pull request label Nov 6, 2023
@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Nov 6, 2023

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

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.15.0" version, but no target version was set.

In response to this:

Description

it was noticed with DNS over TCP that the handshake packets are too small and it doesn't contain any DNS data from UI DNS fields showed as n/a which is true

this PR propagate the DNS lookup return code so we can differentiate between cases like TCP handshake case and real errors enriching with DNS info.

when we get N/A bpf_skb_load_bytes() return an error

working
======
"dns_record": {
                       "id": 40514,
                       "flags": 34176,
                       "latency": 185794,
                       "errno": 0,
                       "offset": 68,
                       "tcp_len": 34,
                       "skb_len": 291
                   },

none working
==========
"dns_record": {
                       "id": 0,
                       "flags": 0,
                       "latency": 0,
                       "errno": 7,
                       "offset": 68,
                       "tcp_len": 34,
                       "skb_len": 66
                   },

in the none working case the received packet is very small that is why we can't fetch DNS header info.

Those small packets are TCP handshake and those packets don't have data by definition this clear when u look at the pcap

image (1)

Dependencies

netobserv/network-observability-console-plugin#425
netobserv/flowlogs-pipeline#533

Checklist

If you are not familiar with our processes or don't know what to answer in the list below, let us know in a comment: the maintainers will take care of that.

  • Will this change affect NetObserv / Network Observability operator? If not, you can ignore the rest of this checklist.
  • Is this PR backed with a JIRA ticket? If so, make sure it is written as a title prefix (in general, PRs affecting the NetObserv/Network Observability product should be backed with a JIRA ticket - especially if they bring user facing changes).
  • Does this PR require product documentation?
  • If so, make sure the JIRA epic is labelled with "documentation" and provides a description relevant for doc writers, such as use cases or scenarios. Any required step to activate or configure the feature should be documented there, such as new CRD knobs.
  • Does this PR require a product release notes entry?
  • If so, fill in "Release Note Text" in the JIRA.
  • Is there anything else the QE team should know before testing? E.g: configuration changes, environment setup, etc.
  • If so, make sure it is described in the JIRA ticket.
  • QE requirements (check 1 from the list):
  • Standard QE validation, with pre-merge tests unless stated otherwise.
  • Regression tests only (e.g. refactoring with no user-facing change).
  • No QE (e.g. trivial change with high reviewer's confidence, or per agreement with the QE team).

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
Copy link
Contributor Author

/approve

Copy link

openshift-ci bot commented Nov 6, 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-ci openshift-ci bot added the approved label Nov 6, 2023
@openshift-merge-bot openshift-merge-bot bot merged commit d69703f into netobserv:main Nov 6, 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. qe-approved QE has approved this pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants