Skip to contentSkip to conversation

: Fix default sequence window size

PATCH Applied Ian McDonald 3 participants 6 messages Jun 22, 2006 – Jul 23, 2006 Networking

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 : Fix default sequence window size

When using the default sequence window size (100) I got the following in my logs:

Jun 22 14:24:09 localhost kernel: [ 1492.114775] DCCP: Step 6 failed for 
DATA packet, (LSWL(6279674225) <= P.seqno(6279674749) <= 
S.SWH(6279674324)) and (P.ackno doesn't exist or LAWL(18798206530) <= 
P.ackno(1125899906842620) <= S.AWH(18798206548), sending SYNC...
Jun 22 14:24:09 localhost kernel: [ 1492.115147] DCCP: Step 6 failed for 

DATA packet, (LSWL(6279674225) <= P.seqno(6279674750) <= S.SWH(6279674324)) and (P.ackno doesn't exist or LAWL(18798206530) <= P.ackno(1125899906842620) <= S.AWH(18798206549), sending SYNC...

I went to alter the default sysctl and it didn't take for new sockets. Below patch fixes this.

I think the default is too low but it is what the DCCP spec specifies.

As a side effect of this my rx speed using iperf goes from about 2.8 Mbits/sec to 3.5. This is still far too slow but it is a step in the right direction.

Compile tested only for IPv6 but not particularly complex change.

---

net/dccp/ipv4.c +3 -2
index f2c011f..3119804 100644
@@ -32,6 +32,8 @@ #include "ccid.h"
  #include "dccp.h"
  #include "feat.h"
 
+extern int dccp_feat_default_sequence_window;
+
  /*
   * This is the global socket data structure used for responding to
   * the Out-of-the-blue (OOTB) packets. A control sock will be created
@@ -505,8 +507,7 @@ int dccp_v4_conn_request(struct sock *sk
  	ireq = inet_rsk(req);
  	ireq->loc_addr = daddr;
  	ireq->rmt_addr = saddr;
-	req->rcv_wnd	= 100; /* Fake, option parsing will get the
-				  right value */
+	req->rcv_wnd	= dccp_feat_default_sequence_window;
  	ireq->opt	= NULL;
 
  	/*
net/dccp/ipv6.c +3 -2
index 65e2ab0..aa147f4 100644
@@ -33,6 +33,8 @@ #include <net/xfrm.h>
  #include "dccp.h"
  #include "ipv6.h"
 
+extern int dccp_feat_default_sequence_window;
+
  /* Socket used for sending RSTs and ACKs */
  static struct socket *dccp_v6_ctl_socket;
 
@@ -708,8 +710,7 @@ static int dccp_v6_conn_request(struct s
  	ireq = inet_rsk(req);
  	ipv6_addr_copy(&ireq6->rmt_addr, &skb->nh.ipv6h->saddr);
  	ipv6_addr_copy(&ireq6->loc_addr, &skb->nh.ipv6h->daddr);
-	req->rcv_wnd	= 100; /* Fake, option parsing will get the
-				  right value */
+	req->rcv_wnd	= dccp_feat_default_sequence_window;
  	ireq6->pktopts	= NULL;
 
  	if (ipv6_opt_accepted(sk, skb) ||
net/dccp/options.c +2 -0
index e9feb2a..6409561 100644
@@ -30,6 +30,8 @@ int dccp_feat_default_ack_ratio	        int dccp_feat_default_send_ack_vector = DCCPF_INITIAL_SEND_ACK_VECTOR;
  int dccp_feat_default_send_ndp_count  = DCCPF_INITIAL_SEND_NDP_COUNT;
 
+EXPORT_SYMBOL_GPL(dccp_feat_default_sequence_window);
+
  void dccp_minisock_init(struct dccp_minisock *dmsk)
  {
  	dmsk->dccpms_sequence_window = dccp_feat_default_sequence_window;
 
#1 lore raw
Quoted 7 lines · Ian McDonald

When using the default sequence window size (100) I got the following in my logs:

Jun 22 14:24:09 localhost kernel: [ 1492.114775] DCCP: Step 6 failed for
DATA packet, (LSWL(6279674225) <= P.seqno(6279674749) <> S.SWH(6279674324)) and (P.ackno doesn't exist or LAWL(18798206530) <> P.ackno(1125899906842620) <= S.AWH(18798206548), sending SYNC...
Jun 22 14:24:09 localhost kernel: [ 1492.115147] DCCP: Step 6 failed for

DATA packet, (LSWL(6279674225) <= P.seqno(6279674750) <> S.SWH(6279674324)) and (P.ackno doesn't exist or LAWL(18798206530) <> P.ackno(1125899906842620) <= S.AWH(18798206549), sending SYNC...

Quoted 8 lines

I went to alter the default sysctl and it didn't take for new sockets. Below patch fixes this.

I think the default is too low but it is what the DCCP spec specifies.

As a side effect of this my rx speed using iperf goes from about 2.8 Mbits/sec to 3.5. This is still far too slow but it is a step in the right direction.

Agreed, minor nitpick below...

Quoted 11 lines

Compile tested only for IPv6 but not particularly complex change.

---

net/dccp/ipv4.c +0 -0
index f2c011f..3119804 100644

net/dccp/ipv4.c #include "ccid.h" · line 36

Quoted 5 lines
net/dccp/ipv4.c +2 -0
@@ -32,6 +32,8 @@ #include "ccid.h"
  #include "dccp.h"
  #include "feat.h"
 
+extern int dccp_feat_default_sequence_window;
+

Could you please add this one in feat.h? Then I'll be OK with this one and will ask Dave to merge it.

Thanks,

- Arnaldo

Quoted 18 lines
net/dccp/ipv4.c +1 -2
  /*
   * This is the global socket data structure used for responding to
   * the Out-of-the-blue (OOTB) packets. A control sock will be created
@@ -505,8 +507,7 @@ int dccp_v4_conn_request(struct sock *sk
        ireq = inet_rsk(req);
        ireq->loc_addr = daddr;
        ireq->rmt_addr = saddr;
-       req->rcv_wnd    = 100; /* Fake, option parsing will get the
-                                 right value */
+       req->rcv_wnd    = dccp_feat_default_sequence_window;
        ireq->opt       = NULL;
 
        /*
net/dccp/ipv6.c +0 -0
index 65e2ab0..aa147f4 100644

net/dccp/ipv6.c #include <net/xfrm.h> · line 37

Quoted 5 lines
net/dccp/ipv6.c +2 -0
@@ -33,6 +33,8 @@ #include <net/xfrm.h>
  #include "dccp.h"
  #include "ipv6.h"
 
+extern int dccp_feat_default_sequence_window;
+

See? :-)

#2 lore raw
In reply to Ian McDonald
Quoted 3 lines

As a side effect of this my rx speed using iperf goes from about 2.8 Mbits/sec to 3.5. This is still far too slow but it is a step in the right direction.

I got a bunch of fixes i need to commit. I'll try to send out patches this week. They should make things go faster. What is your test setup like?

I was able to do 1Gb/s with 0rtt. As soon as I add delay with netem, I could only do ~75Mbit/s. Still investigating why.

Also make sure you change the socket buffer wmem sysctl.

#3 lore raw

PATCH 1/1 : Fix default sequence window size (revised)

In reply to Ian McDonald

When using the default sequence window size (100) I got the following in my logs:

Jun 22 14:24:09 localhost kernel: [ 1492.114775] DCCP: Step 6 failed for 
DATA packet, (LSWL(6279674225) <= P.seqno(6279674749) <= 
S.SWH(6279674324)) and (P.ackno doesn't exist or LAWL(18798206530) <= 
P.ackno(1125899906842620) <= S.AWH(18798206548), sending SYNC...
Jun 22 14:24:09 localhost kernel: [ 1492.115147] DCCP: Step 6 failed for 

DATA packet, (LSWL(6279674225) <= P.seqno(6279674750) <= S.SWH(6279674324)) and (P.ackno doesn't exist or LAWL(18798206530) <= P.ackno(1125899906842620) <= S.AWH(18798206549), sending SYNC...

I went to alter the default sysctl and it didn't take for new sockets. Below patch fixes this.

I think the default is too low but it is what the DCCP spec specifies.

As a side effect of this my rx speed using iperf goes from about 2.8 Mbits/sec to 3.5. This is still far too slow but it is a step in the right direction.

Compile tested only for IPv6 but not particularly complex change.

---

net/dccp/feat.h +2 -0
index 6048373..b44c455 100644
@@ -26,4 +26,6 @@ extern void dccp_feat_clean(struct dccp_
  extern int  dccp_feat_clone(struct sock *oldsk, struct sock *newsk);
  extern int  dccp_feat_init(struct dccp_minisock *dmsk);
 
+extern int  dccp_feat_default_sequence_window;
+
  #endif /* _DCCP_FEAT_H */
net/dccp/ipv4.c +1 -2
index f2c011f..9307926 100644
@@ -505,8 +505,7 @@ int dccp_v4_conn_request(struct sock *sk
  	ireq = inet_rsk(req);
  	ireq->loc_addr = daddr;
  	ireq->rmt_addr = saddr;
-	req->rcv_wnd	= 100; /* Fake, option parsing will get the
-				  right value */
+	req->rcv_wnd	= dccp_feat_default_sequence_window;
  	ireq->opt	= NULL;
 
  	/*
net/dccp/ipv6.c +2 -2
index 65e2ab0..c7b3a22 100644
@@ -32,6 +32,7 @@ #include <net/xfrm.h>
 
  #include "dccp.h"
  #include "ipv6.h"
+#include "feat.h"
 
  /* Socket used for sending RSTs and ACKs */
  static struct socket *dccp_v6_ctl_socket;
@@ -708,8 +709,7 @@ static int dccp_v6_conn_request(struct s
  	ireq = inet_rsk(req);
  	ipv6_addr_copy(&ireq6->rmt_addr, &skb->nh.ipv6h->saddr);
  	ipv6_addr_copy(&ireq6->loc_addr, &skb->nh.ipv6h->daddr);
-	req->rcv_wnd	= 100; /* Fake, option parsing will get the
-				  right value */
+	req->rcv_wnd	= dccp_feat_default_sequence_window;
  	ireq6->pktopts	= NULL;
 
  	if (ipv6_opt_accepted(sk, skb) ||
net/dccp/options.c +2 -0
index e9feb2a..6409561 100644
@@ -30,6 +30,8 @@ int dccp_feat_default_ack_ratio	        int dccp_feat_default_send_ack_vector = DCCPF_INITIAL_SEND_ACK_VECTOR;
  int dccp_feat_default_send_ndp_count  = DCCPF_INITIAL_SEND_NDP_COUNT;
 
+EXPORT_SYMBOL_GPL(dccp_feat_default_sequence_window);
+
  void dccp_minisock_init(struct dccp_minisock *dmsk)
  {
  	dmsk->dccpms_sequence_window = dccp_feat_default_sequence_window;
#4 lore raw

PATCH 1/1 : Fix default sequence window size

In reply to Ian McDonald

Resent to apply cleanly on latest tree. Bug fix - for 2.6.18

When using the default sequence window size (100) I got the following in my logs:

Jun 22 14:24:09 localhost kernel: [ 1492.114775] DCCP: Step 6 failed for
DATA packet, (LSWL(6279674225) <= P.seqno(6279674749) <S.SWH(6279674324)) and (P.ackno doesn't exist or LAWL(18798206530) <P.ackno(1125899906842620) <= S.AWH(18798206548), sending SYNC...
Jun 22 14:24:09 localhost kernel: [ 1492.115147] DCCP: Step 6 failed for

DATA packet, (LSWL(6279674225) <= P.seqno(6279674750) <S.SWH(6279674324)) and (P.ackno doesn't exist or LAWL(18798206530) <P.ackno(1125899906842620) <= S.AWH(18798206549), sending SYNC...

I went to alter the default sysctl and it didn't take for new sockets. Below patch fixes this.

I think the default is too low but it is what the DCCP spec specifies.

As a side effect of this my rx speed using iperf goes from about 2.8 Mbits/sec to 3.5. This is still far too slow but it is a step in the right direction.

Compile tested only for IPv6 but not particularly complex change.

Signed off by: Ian McDonald <[email protected]>
---

net/dccp/feat.h +2 -0
index 6048373..b44c455 100644
@@ -26,4 +26,6 @@ extern void dccp_feat_clean(struct dccp_
 extern int  dccp_feat_clone(struct sock *oldsk, struct sock *newsk);
 extern int  dccp_feat_init(struct dccp_minisock *dmsk);
 
+extern int  dccp_feat_default_sequence_window;
+
 #endif /* _DCCP_FEAT_H */
net/dccp/ipv4.c +1 -2
index c3073e7..7f56f7e 100644
@@ -504,8 +504,7 @@ int dccp_v4_conn_request(struct sock *sk
 	ireq = inet_rsk(req);
 	ireq->loc_addr = daddr;
 	ireq->rmt_addr = saddr;
-	req->rcv_wnd	= 100; /* Fake, option parsing will get the
-				  right value */
+	req->rcv_wnd	= dccp_feat_default_sequence_window;
 	ireq->opt	= NULL;
 
 	/* 
net/dccp/ipv6.c +2 -2
index ff42bc4..9f3d4d7 100644
@@ -31,6 +31,7 @@ #include <net/xfrm.h>
 
 #include "dccp.h"
 #include "ipv6.h"
+#include "feat.h"
 
 /* Socket used for sending RSTs and ACKs */
 static struct socket *dccp_v6_ctl_socket;
@@ -707,8 +708,7 @@ static int dccp_v6_conn_request(struct s
 	ireq = inet_rsk(req);
 	ipv6_addr_copy(&ireq6->rmt_addr, &skb->nh.ipv6h->saddr);
 	ipv6_addr_copy(&ireq6->loc_addr, &skb->nh.ipv6h->daddr);
-	req->rcv_wnd	= 100; /* Fake, option parsing will get the
-				  right value */
+	req->rcv_wnd	= dccp_feat_default_sequence_window;
 	ireq6->pktopts	= NULL;
 
 	if (ipv6_opt_accepted(sk, skb) ||
net/dccp/options.c +2 -0
index c3cda1e..daf72bb 100644
@@ -29,6 +29,8 @@ int dccp_feat_default_ack_ratio	      = 
 int dccp_feat_default_send_ack_vector = DCCPF_INITIAL_SEND_ACK_VECTOR;
 int dccp_feat_default_send_ndp_count  = DCCPF_INITIAL_SEND_NDP_COUNT;
 
+EXPORT_SYMBOL_GPL(dccp_feat_default_sequence_window);
+
 void dccp_minisock_init(struct dccp_minisock *dmsk)
 {
 	dmsk->dccpms_sequence_window = dccp_feat_default_sequence_window;