All of lore.kernel.org
 help / color / mirror / Atom feed
* [MPTCP] Questions about DSS checksum
@ 2021-02-23 12:29 Geliang Tang
  0 siblings, 0 replies; only message in thread
From: Geliang Tang @ 2021-02-23 12:29 UTC (permalink / raw)
  To: mptcp

[-- Attachment #1: Type: text/plain, Size: 2412 bytes --]

In order to solve the issues 134, I'm reading the mptcp.org (branch:
mptcp_v0.95) source code about DSS checksum implementation recently but I
didn't understand it very well.

Here's my first question.

On the outgoing path (net/mptcp/mptcp_output.c), the function
mptcp_write_dss_mapping(), use the following code to generate the checksum
value and write it in the DSS option:

        if (tp->mpcb->dss_csum && data_len) {
                __sum16 *p16 = (__sum16 *)ptr;
                __be32 hdseq = mptcp_get_highorder_sndbits(skb, tp->mpcb);
                __wsum csum;

                *ptr = htonl(((data_len) << 16) |
                             (TCPOPT_EOL << 8) |
                             (TCPOPT_EOL));
                csum = csum_partial(ptr - 2, 12, skb->csum);
                p16++;
                *p16++ = csum_fold(csum_partial(&hdseq, sizeof(hdseq), csum));
        } else {

On the incoming path (net/mptcp/mptcp_input.c), the function
mptcp_parse_options, use the following code to parse MPTCP_SUB_DSS:

                if (mdss->M) {
                        if (mdss->m) {
                                u64 data_seq64 = get_unaligned_be64(ptr);

                                tcb->mptcp_flags |= MPTCPHDR_SEQ64_SET;
                                mopt->data_seq = (u32) data_seq64;

                                ptr += 12; /* 64-bit dseq + subseq */
                        } else {
                                mopt->data_seq = get_unaligned_be32(ptr);
                                ptr += 8; /* 32-bit dseq + subseq */
                        }
                        mopt->data_len = get_unaligned_be16(ptr);

                        tcb->mptcp_flags |= MPTCPHDR_SEQ;

                        /* Is a check-sum present? */
                        if (opsize == mptcp_sub_len_dss(mdss, 1))
                                tcb->mptcp_flags |= MPTCPHDR_DSS_CSUM;

                        /* DATA_FIN only possible with DSS-mapping */
                        if (mdss->F)
                                tcb->mptcp_flags |= MPTCPHDR_FIN;
                }

Here it just sets the MPTCPHDR_DSS_CSUM flag, it doesn't read the checksum
value from the DSS option. So my first question is: How dose it read the value
of the checksum in DSS option on the incoming path?

Please give me some help for it. Thanks.

-Geliang

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-02-23 12:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-23 12:29 [MPTCP] Questions about DSS checksum Geliang Tang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.