Verified Commit 274d9406 authored by Jeffrey H. Johnson's avatar Jeffrey H. Johnson
Browse files

MTU tuning, dependency tracking.

parent 4705ec56
......@@ -23,26 +23,26 @@ import (
// Gfcp protocol constants
const (
GfcpRtoNdl = 20 // GfcpRtoNdl: NoDelay min RTO
GfcpRtoMin = 220 // GfcpRtoMin: Regular min RTO
GfcpRtoMin = 120 // GfcpRtoMin: Regular min RTO
GfcpRtoDef = 340
GfcpRtoMax = 10000
GfcpRtoMax = 60000
GfcpCmdPush = 81 // GfcpCmdPush: Push data
GfcpCmdAck = 82 // GfcpCmdAck: Ack
GfcpCmdWask = 83 // GfcpCmdWask: Get Window Size
GfcpCmdWins = 84 // GfcpCmdWins: Set window Size
GfcpAskSend = 1 // GfcpAskSend: Need to send GfcpCmdWask
GfcpAskTell = 2 // GfcpAskTell: Need to send GfcpCmdWins
GfcpWndSnd = 64
GfcpWndRcv = 64
GfcpWndSnd = 32
GfcpWndRcv = 32
GfcpMtuDef = 1480
GfcpAckFast = 2
GfcpInterval = 70
GfcpAckFast = 3
GfcpInterval = 100
GfcpOverhead = 24
GfcpDeadLink = 12
GfcpThreshInit = 3
GfcpDeadLink = 20
GfcpThreshInit = 2
GfcpThreshMin = 2
GfcpProbeInit = 7000 // 7s initial probe window
GfcpProbeLimit = 90000 // 90s hard probe timeout
GfcpProbeInit = 7000 // 7s initial probe window
GfcpProbeLimit = 102000 // 120s hard probe timeout
)
 
type outputCallback func(
......@@ -1397,7 +1397,6 @@ func (
}
 
// SetMtu changes MTU size.
// Defult MTU is 1480 byes.
func (
GFcp *GFCP,
) SetMtu(
......@@ -1417,7 +1416,7 @@ func (
)
/*if buffer == nil {
return -2
}*/ // XXX(jhj): buffer can't be nil
}*/ // XXX(jhj): buffer can't be nil?
GFcp.mtu = uint32(
mtu,
)
......
......@@ -18,7 +18,7 @@ import (
"go.gridfinity.dev/gfcp"
)
 
func BenchmarkFECDecode(
func BenchmarkFECDecode1500(
b *testing.B,
) {
const (
......@@ -64,7 +64,7 @@ func BenchmarkFECDecode(
}
}
 
func BenchmarkFECEncode(
func BenchmarkFECEncode1500(
b *testing.B,
) {
const dataSize = 10
......@@ -89,3 +89,75 @@ func BenchmarkFECEncode(
)
}
}
func BenchmarkFECDecode9000(
b *testing.B,
) {
const (
dataSize = 10
paritySize = 3
payLoad = 9000
)
decoder := gfcp.NewFECDecoder(
1024,
dataSize,
paritySize,
)
b.ReportAllocs()
b.SetBytes(
payLoad,
)
for i := 0; i < b.N; i++ {
if rand.Int()%(dataSize+paritySize) == 0 {
continue
}
pkt := make(
[]byte,
payLoad,
)
binary.LittleEndian.PutUint32(
pkt,
uint32(i),
)
if i%(dataSize+paritySize) >= dataSize {
binary.LittleEndian.PutUint16(
pkt[4:],
gfcp.KTypeParity,
)
} else {
binary.LittleEndian.PutUint16(
pkt[4:],
gfcp.KTypeData,
)
}
decoder.Decode(
pkt,
)
}
}
func BenchmarkFECEncode9000(
b *testing.B,
) {
const dataSize = 10
const paritySize = 3
const payLoad = 9000
b.ReportAllocs()
b.SetBytes(
payLoad,
)
Encoder := gfcp.NewFECEncoder(
dataSize,
paritySize,
0,
)
for i := 0; i < b.N; i++ {
data := make(
[]byte,
payLoad,
)
Encoder.Encode(
data,
)
}
}
......@@ -48,7 +48,7 @@ func (
 
const (
// GFcpMtuLimit ...
GFcpMtuLimit = 9000
GFcpMtuLimit = 1500
rxFECMulti = 3
acceptBacklog = 1024
)
......
......@@ -6,7 +6,7 @@ require (
github.com/klauspost/cpuid/v2 v2.0.3 // indirect
github.com/klauspost/reedsolomon v1.9.10
github.com/pkg/errors v0.9.2-0.20201214064552-5dd12d0cfe7f
go.gridfinity.dev/leaktestfe v0.0.0-20210101234129-539e2e8b4621
go.gridfinity.dev/leaktestfe v0.0.0-20210103150642-9963c3c0f51e
go4.org v0.0.0-20201209231011-d4a079459e60
golang.org/x/net v0.0.0-20201224014010-6772e930b67b
golang.org/x/sys v0.0.0-20201231184435-2d18734c6014 // indirect
......
......@@ -24,7 +24,6 @@ github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMn
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
......@@ -82,14 +81,12 @@ github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd/go.mod h1:hPqNNc0+uJM6H+SuU8sEs5K5IQeKccPqeSjfgcKGgPk=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.3.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.6.2-0.20201103103935-92707c0b2d50 h1:aQdElrdadJZjGar4PipPBSpVh3yyDIuDSaM5PbMn6o8=
github.com/stretchr/testify v1.6.2-0.20201103103935-92707c0b2d50/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
go.gridfinity.dev/leaktestfe v0.0.0-20210101234129-539e2e8b4621 h1:Up89t4QvmtOna3NaNokLiKAzueluRljCfCfZ4Vn4mDI=
go.gridfinity.dev/leaktestfe v0.0.0-20210101234129-539e2e8b4621/go.mod h1:QG+LArPjx2D/sz3nmogm5H0VP72bD6TD1mdV69RlUgU=
go.gridfinity.dev/leaktestfe v0.0.0-20210103150642-9963c3c0f51e h1:EKTVjh0L7Oo80qvFuAJOXSzCc0o0bYpbI+RUgwKc3oY=
go.gridfinity.dev/leaktestfe v0.0.0-20210103150642-9963c3c0f51e/go.mod h1:CwBxN+58KNDPlPRa3hWtAcrGdrxN6shIqJQaLnXw9Dc=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
......@@ -211,8 +208,8 @@ golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapK
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20210101214203-2dba1e4ea05c h1:dS09fXwOFF9cXBnIzZexIuUBj95U1NyQjkEhkgidDow=
golang.org/x/tools v0.0.0-20210101214203-2dba1e4ea05c/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20210102185154-773b96fafca2 h1:crjwvdT+rSAILpNOKhk/BNmefsucqGTeeRX2YBK/6Jg=
golang.org/x/tools v0.0.0-20210102185154-773b96fafca2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment