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

[202012] fix dual-tor relay-reply handing issue #40

Merged
merged 20 commits into from
Jul 11, 2023

Conversation

jcaiMR
Copy link
Contributor

@jcaiMR jcaiMR commented Jun 21, 2023

Description of PR

Fix DHCPv6 relay dual-tor relay-reply handling issue.

Other related docker change PR:
https://github.com/sonic-net/sonic-buildimage/pull/15744/files

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Back port request

  • 201911
  • 202012
  • 202205

Approach

What is the motivation for this PR?

Fix DHCPv6 relay dual-tor relay-reply handling issue. In dual-tor scenario, we need responses from dhcpv6 server send to Active tor. Based on RFC8415 session [18.3.10], DHCPv6 server unicasts the Relay-reply message directly to the relay agent using the address in the source address field from the IP datagram in which the Relay-forward message was received. So in dual-tor we need use DUT unique loopback ipv6 address as relay-forward source (Vlan IPv6 is same on both active tor and standby tor).

Main changed in this PR:

  1. Use loopback0 as relay-forward source interface, create loopback0 socket for packet sending and listening
  2. Fix multiple level relay agent case: Relay-Reply send to next level relay agent will use GUA instead of LLA as source address, and dest port should use 547
  3. Multiple level relay-forward will insert option18 to carry vlan information, and relay agent will get vlan info from response to update counters in this case.
  4. Cherry pick a counting issue from 202205/master
  5. Code cleanup after apply latest code change

How did you do it?

How did you verify/test it?

single-tor sanity testing no issue
dual-tor function test

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

@jcaiMR jcaiMR requested review from yxieca and kellyyeh June 21, 2023 13:37
@jcaiMR jcaiMR marked this pull request as ready for review June 27, 2023 02:23
@jcaiMR jcaiMR requested a review from vivekrnv June 27, 2023 02:23
src/relay.cpp Show resolved Hide resolved
src/main.cpp Show resolved Hide resolved
src/relay.cpp Outdated Show resolved Hide resolved
src/relay.cpp Outdated Show resolved Hide resolved
src/relay.cpp Show resolved Hide resolved
jcaiMR added 2 commits July 7, 2023 13:33
@jcaiMR jcaiMR requested a review from kellyyeh July 9, 2023 02:25
@kellyyeh
Copy link
Collaborator

@jcaiMR There seems to be unrelated text in PR description. Please remove before merging

@jcaiMR
Copy link
Contributor Author

jcaiMR commented Jul 10, 2023

@jcaiMR There seems to be unrelated text in PR description. Please remove before merg

@jcaiMR There seems to be unrelated text in PR description. Please remove before merging

Thanks Kelly, just modified the PR description.

@jcaiMR jcaiMR merged commit 3578eb3 into sonic-net:202012 Jul 11, 2023
@jcaiMR jcaiMR deleted the dev/jcai_202012_dualtor_fix branch July 11, 2023 02:41
qiluo-msft pushed a commit to sonic-net/sonic-buildimage that referenced this pull request Jul 25, 2023
…rio (#15744)

#### Why I did it
1. sonic-build image side change to fix source interface selection in dual tor scenario.
dhcprelay related PR:
sonic-net/sonic-dhcp-relay#40

2. Announce dhcprelay submodule to 3578eb3 (to invoke [#40](sonic-net/sonic-dhcp-relay#40
) PR)

##### Work item tracking
- Microsoft ADO 24243215

#### How to verify it
run test case, dhcp_relay/test_dhcpv6_relay.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants