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

TCP connection RESET with ODP 1.23 #262

Open
manishmatey opened this issue Sep 8, 2020 · 1 comment
Open

TCP connection RESET with ODP 1.23 #262

manishmatey opened this issue Sep 8, 2020 · 1 comment

Comments

@manishmatey
Copy link

OFP function tcp_ts_getticks() calls below ODP API's:

ofp_timer_ticks_u64(0) -> odp_timer_current_tick(shm->socket_timer_pool) -> rte_get_timer_cycles()

rte_get_timer_cycles() returns big value (in my case : 604475915736788 ) but tcp_ts_getticks() expect value between 1 to 1000 as per below comment on function:
/*

tcp_ts_getticks() in ms, should be 1ms < x < 1000ms according to RFC 1323.
We always use 1ms granularity independent of hz.
*/
static __inline uint32_t
tcp_ts_getticks(void)
{
return (ofp_timer_ticks(0) * (OFP_TIMER_RESOLUTION_US / 1000));
}

Issue : TCP connection RESET while handshake.

Current ODP/OFP version :
OFP : 3.0
ODP : 1.23

Please help me on this above issue.

I have some queries as well :

  1. What value is expected by tcp_ts_getticks() ?
  2. Do we need any conversion here as we are getting value (in my case : 604475915736788) ?
  3. Is there any conversion API is available which is needed here?
@bogdanPricope
Copy link
Contributor

My guess is, this was part of the original BSD code and it actually refers to timer granularity and not to the returned value.

See this:
https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8&ved=2ahUKEwjm6J_vpebrAhVGrxoKHRvXD1YQFjAGegQICBAB&url=http%3A%2F%2Fweb.mit.edu%2F~mkgray%2Fafs%2Fbar%2Fafs%2Fsipb.mit.edu%2Fproject%2Ffreebsd%2Fhead%2Fsys%2Fnetinet%2Ftcp_seq.h&usg=AOvVaw37XVV5bJuDvlVs5iA_UTbC

/*

  • tcp_ts_getticks() in ms, should be 1ms < x < 1000ms according to RFC 1323.

  • We always use 1ms granularity independent of hz.
    */
    static __inline u_int
    tcp_ts_getticks(void)
    {
    struct timeval tv;
    u_long ms;

    /*

    • getmicrouptime() should be good enough for any 1-1000ms granularity.
    • Do not use getmicrotime() here as it might break nfsroot/tcp.
      */
      getmicrouptime(&tv);
      ms = tv.tv_sec * 1000 + tv.tv_usec / 1000;

    return (ms);
    }

I guess is referring to this:
https://tools.ietf.org/html/rfc1323
"Based upon these considerations, we choose a timestamp clock
frequency in the range 1 ms to 1 sec per tick. This range also
matches the requirements of the RTTM mechanism, which does not
need much more resolution than the granularity of the
retransmit timer, e.g., tens or hundreds of milliseconds."

Ofp uses a OFP_TIMER_RESOLUTION_US of 10000UL (10ms) (most of the times).

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

No branches or pull requests

2 participants