Insights into the performance and configuration of TCP in ...€¦ · 3.Guidelines for configuring...

24
Insights into the performance and configuration of TCP in Automotive Ethernet Networks Jörn MIGGE, RealTime-at-Work (RTaW) Nicolas NAVET, University of Luxembourg 2018 IEEE Standards Association (IEEE-SA) Ethernet & IP @ Automotive Technology Day 9-10 October 2018 | London, England

Transcript of Insights into the performance and configuration of TCP in ...€¦ · 3.Guidelines for configuring...

Page 1: Insights into the performance and configuration of TCP in ...€¦ · 3.Guidelines for configuring AUTOSAR TCP/IP for on‐board communication 4.Impact of shapers on TCP traffic:

Insights into the performance and configuration of TCP in Automotive Ethernet Networks

Jörn MIGGE, RealTime-at-Work (RTaW)Nicolas NAVET, University of Luxembourg

2018 IEEE Standards Association (IEEE-SA) Ethernet & IP @ Automotive Technology Day

9-10 October 2018 | London, England

Page 2: Insights into the performance and configuration of TCP in ...€¦ · 3.Guidelines for configuring AUTOSAR TCP/IP for on‐board communication 4.Impact of shapers on TCP traffic:

Use-cases for TCP in future vehicles

2

Service‐OrientedArchitectures

Diagnostics & flashingAny TCP‐based applications or protocols

Ethernet TSN

DoIPXCP

Some/IP

e.g.: FTP, HTTP, SSH, SIP, car2x, cloud‐based services, electric vehicle charging, 

Standard TCP/IP protocols +  sockets speed‐up the development of applications 

requiring off/on‐board reliable communications

Page 3: Insights into the performance and configuration of TCP in ...€¦ · 3.Guidelines for configuring AUTOSAR TCP/IP for on‐board communication 4.Impact of shapers on TCP traffic:

AUTOSAR TCP/IP stacks

TCP in Automotive Ethernet Networks 3

Applications – AUTOSAR SWCs

AUTOSAR RTE

AUTOSAR TCP/IP

Socket Adaptor

signals

PDUs

sockets

TCPTCPUDPUDP

IPv4 / IPv6IPv4 / IPv6

Ethernet interface

datagrams

ADAPTIVE AUTOSAR OS TCP/IP

Ethernet interface

datagrams

TCPTCPUDPUDP

IPv4 / IPv6IPv4 / IPv6

Adaptive Applications

sockets

network bindingAUTOSAR ARA

Runtime for Adaptive Applications

Page 4: Insights into the performance and configuration of TCP in ...€¦ · 3.Guidelines for configuring AUTOSAR TCP/IP for on‐board communication 4.Impact of shapers on TCP traffic:

Objectives

TCP in Automotive Ethernet Networks 4

1. AUTOSAR TCP/IP design choices

2. Maximum achievable TCP performances with & without interfering traffic 

3. Guidelines for configuring AUTOSAR TCP/IP for on‐board communication

4. Impact of shapers on TCP traffic: illustration with CBS used for video

TCP performances and configuration has been studied for 40+ years,  but what about TCP – as specified by AUTOSAR – for in‐vehicle communication ?

Important study in the literature: “On AUTOSAR TCP/IP Performance in In‐Vehicle Network Environments”, in IEEE Communications Magazine, vol. 54, no. 12, pp. 168‐173, Dec. 2016.

Page 5: Insights into the performance and configuration of TCP in ...€¦ · 3.Guidelines for configuring AUTOSAR TCP/IP for on‐board communication 4.Impact of shapers on TCP traffic:

Techniques & toolset

TCP in Automotive Ethernet Networks 5

– Worst‐case Traversal Time (WCTT) analysis – for hard deadline constraints – Timing‐accurate Simulation – for TCP throughput constraints– Optimization algorithms for setting the parameters of all supported protocols

– RTaW‐Pegase: modeling / analysis / configuration of automotive Ethernet TSN

– AUTOSAR TCP/IP stack model implemented in RTaW‐Pegase

Toolset

Page 6: Insights into the performance and configuration of TCP in ...€¦ · 3.Guidelines for configuring AUTOSAR TCP/IP for on‐board communication 4.Impact of shapers on TCP traffic:

Case-study : Network topology

6

7 video streams (30 FPS) for vision and ADAS

1Gbit/s

↖18%

↗35% 26%↙

→30%

#Nodes 8#Switches 2#streams 47

+ TCP streamsLoad per link (wo 

TCP streams)Min: <1%,max:35%

Link data rates 100Mbit/s and 1Gbit/s (1 link)

→26%

↖16%

TCP connection from ECU1 to ECU6 

Loads shown for interfering traffic only – not TCP streams

TCP in Automotive Ethernet Networks

Page 7: Insights into the performance and configuration of TCP in ...€¦ · 3.Guidelines for configuring AUTOSAR TCP/IP for on‐board communication 4.Impact of shapers on TCP traffic:

Case-study : Traffic

7

Command & Control (CC)

Video streams

Audio Streams

TCP streams 

32 streams, 256 to 1024 byte frames 5ms to 80ms period and deadlines Hard deadline constraints 

8 streams: 128 and 256 byte frames 1.25ms period and deadline deadline constraints (soft)

3 streams (vision): 30x1400 byte frames every 33ms – deadline = 33ms 4 streams (ADAS): 15x1000bytes frames every 33ms – deadline = 10ms hard and soft deadline constraints

Bulk data = from 64K  to 1MB transfers, or 100ms periodic PDUs data, e.g. from CAN networks

Top priority

Second priority level

Lowest priority

Third priority level

TCP in Automotive Ethernet Networks

Page 8: Insights into the performance and configuration of TCP in ...€¦ · 3.Guidelines for configuring AUTOSAR TCP/IP for on‐board communication 4.Impact of shapers on TCP traffic:

AUTOSAR TCP specification

8TCP in Automotive Ethernet Networks

Page 9: Insights into the performance and configuration of TCP in ...€¦ · 3.Guidelines for configuring AUTOSAR TCP/IP for on‐board communication 4.Impact of shapers on TCP traffic:

AUTOSAR TCP design choices

TCP in Automotive Ethernet Networks 9

– A full‐fledged TCP implementation!

– Not included in the specification: selective ack (sack) and timestamp options, recent congestion control algorithms

Our view: sound design choices but configuration is difficult because‐ application specific‐ subtle interactions between parameters: e.g. send/receive windows size, TCP task period, Nagle’s algorithm on/off, time‐out

Page 10: Insights into the performance and configuration of TCP in ...€¦ · 3.Guidelines for configuring AUTOSAR TCP/IP for on‐board communication 4.Impact of shapers on TCP traffic:

Bulk traffic: Nagle’s algorithm and delayed ack

TCP in Automotive Ethernet Networks 10

– Improve TCP efficiency by postponing both sending of data and sending of ack → buffering on both the sending and receiving sides   

64kB = first 43 segments of 1460bytes … 200ms later comes last segment  because of Nagle’s algorithm, TCP waits for the delayed ack (200ms). Solution in Autosar is to turn off “Nagle”.  

200ms ?!

Page 11: Insights into the performance and configuration of TCP in ...€¦ · 3.Guidelines for configuring AUTOSAR TCP/IP for on‐board communication 4.Impact of shapers on TCP traffic:

PDU traffic: Nagle detrimental as well

TCP in Automotive Ethernet Networks 11

– 3 PDU streams over a TCP connection | 8, 20 and 64bytes at the lowest priority level  – Maximum latency: from the time the PDU is written in the socket, until receiver reads it

0 5 10 15 20 25 30

TCP traffic alone

TCP + interferingtrafic

Maximum latency (ms)

PDU maximum latencies with and without Nagle  

Nagle OFF Nagle ON

For PDU’s as well, solution in 

Autosar is to turn off Nagle’s algorithm  

Page 12: Insights into the performance and configuration of TCP in ...€¦ · 3.Guidelines for configuring AUTOSAR TCP/IP for on‐board communication 4.Impact of shapers on TCP traffic:

Max. achievable performances with TCP– throughput for bulk traffic– latencies for PDU traffic

12TCP in Automotive Ethernet Networks

Page 13: Insights into the performance and configuration of TCP in ...€¦ · 3.Guidelines for configuring AUTOSAR TCP/IP for on‐board communication 4.Impact of shapers on TCP traffic:

Throughput – no interfering traffic

TCP in Automotive Ethernet Networks 13

– Experimental conditions: all mechanisms on but Nagle, event‐triggered management of TCP stacks, receive window larger than data, no packet loss

Max. throughput is quickly reached: 96Mbps of TCP data over 100Mbps links!  With interfering traffic (not shown), remaining available bandwidth can be fully used too  But no exponential increase during slow‐start  ?!

Page 14: Insights into the performance and configuration of TCP in ...€¦ · 3.Guidelines for configuring AUTOSAR TCP/IP for on‐board communication 4.Impact of shapers on TCP traffic:

Almost no “slow-start” phase

TCP in Automotive Ethernet Networks 14

0

10000

20000

30000

40000

50000

60000

70000

0 2000 4000 6000 8000 10000 12000 14000 16000 18000

sequ

ence num

ber

time

"exponential" slow start

usable window

cwnd

sent seq

acked seq

0

10000

20000

30000

40000

50000

60000

70000

0 1000 2000 3000 4000 5000 6000

sequ

ence num

ber

time

"linear" slow start

usable window

queued seq

sent seq

acked seq

cwnd

Expected: throughput growth Observed: max. throughput from start

Reduced automotive round‐trip times changes the usual behavior of TCP Re‐examine what we can expect from TCP in the automotive context

[typical automotive round‐trip times][Round‐trip times of 2ms]

Page 15: Insights into the performance and configuration of TCP in ...€¦ · 3.Guidelines for configuring AUTOSAR TCP/IP for on‐board communication 4.Impact of shapers on TCP traffic:

PDU latencies vs receiver reading period

TCP in Automotive Ethernet Networks 15

– PDU TCP streams = 8, 20 and 64 bytes at the lowest priority level– Maximum latency | Nagle off | window update sent asap after receiver reads buffer

PDU maximum latencies can be controlled by adjusting 

receiver’s reading period 

0

5

10

15

20

25

30

35

5 10 15 20

Maxim

um latency (m

s)

Receiver reading period (ms)

PDU maximum latencies vs receiver reading period

TCP traffic alone TCP + interfering traffic

Maximum latency ≈ traversal time + reading periodTCPMainFunctionmay further delay data transfer to application

Page 16: Insights into the performance and configuration of TCP in ...€¦ · 3.Guidelines for configuring AUTOSAR TCP/IP for on‐board communication 4.Impact of shapers on TCP traffic:

TCP configuration in a TSN network

16TCP in Automotive Ethernet Networks

Page 17: Insights into the performance and configuration of TCP in ...€¦ · 3.Guidelines for configuring AUTOSAR TCP/IP for on‐board communication 4.Impact of shapers on TCP traffic:

Experimental setup

TCP in Automotive Ethernet Networks 17

– Interfering streams configured so as to meet their latency constraints– Video under CBS configured with Tight‐IdleSlope algorithm = minimum Idle‐Slopes allowing to meet deadline constraints

– TCP traffic: 1MB transfers (=685 segments) between ECU1 and ECU6 every 1s– Minimum throughput over all TCP transfers collected over long simulations: sample of 36000 data points (12 hours of functioning)

– Receiver reads TCP buffer every 1ms 

Config #2: End‐to‐end shaping with TSN Credit‐Based Shaper (CBS)

Config #1: video streams not shaped

Page 18: Insights into the performance and configuration of TCP in ...€¦ · 3.Guidelines for configuring AUTOSAR TCP/IP for on‐board communication 4.Impact of shapers on TCP traffic:

Shaping improves TCP throughput and reduces switch memory usage

18

CBS improves TCP throughput (up to 30%)  and reduces memory requirement (up to 14%) for all parameters – larger gains with smaller TCP transfers more subject to bursts of interfering traffic

80

90

100

110

120

130

140

150

160

30 35 40 45 50 55 60 65 70

Mem

ory  used in sw

itche

s (Kb

)

TCP throughput (Mbps)

Throughput vs maximum memory for varying receive window sizes (rcwnd)

no CBS CBS for video

rcwnd=5MSS

rcwnd=64KB rcwnd values:5MSS8MSS10MSS11MSS20MSS30MSS64KB

Larger rcwndimproves 

throughput but more memory required in the switches to not lose packets

TCP in Automotive Ethernet Networks

Page 19: Insights into the performance and configuration of TCP in ...€¦ · 3.Guidelines for configuring AUTOSAR TCP/IP for on‐board communication 4.Impact of shapers on TCP traffic:

Configuring TCP receive window size – efficiency areas

19

With or without CBS, larger receive windows improve throughput – the gain drops after a threshold that depends on how often receive buffer is read

rcwnd values:5MSS8MSS10MSS11MSS20MSS30MSS64KB

80

90

100

110

120

130

140

150

160

30 35 40 45 50 55 60 65 70

Mem

ory  used in sw

itche

s (Kb

)

TCP throughput (Mbps)

Throughput vs maximum memory for varyingreceive window sizes (rcwnd)

no CBS CBS for video

rcwnd=5MSS

rcwnd=64KB

Increasing rcwnd size is effective:4Mbps per additional MSS

much less effective after threshold:

0.13Mbps per MSS

TCP in Automotive Ethernet Networks

Page 20: Insights into the performance and configuration of TCP in ...€¦ · 3.Guidelines for configuring AUTOSAR TCP/IP for on‐board communication 4.Impact of shapers on TCP traffic:

In practice, larger receive windows can be detrimental!

TCP in Automotive Ethernet Networks 20

– Memory for switch port SW2 to ECU6 set to 30Kb, packet is dropped if memory full– TCP bulk traffic |average latency | Nagle off 

Receive window size should be set wrt switch memory

0

10

20

30

40

50

60

70

20 21 22 23 24 25 26

TCP throug

hput (M

bps)

Receive window size in MSS

TCP throughput vs receive window size

without CBS with CBS

Larger receive windows means 

more “in‐flight” data.Packet losses in switches lead to 

retransmission after time‐out (1s) and 

drop in throughput!

Page 21: Insights into the performance and configuration of TCP in ...€¦ · 3.Guidelines for configuring AUTOSAR TCP/IP for on‐board communication 4.Impact of shapers on TCP traffic:

Takeways

TCP in Automotive Ethernet Networks 21

1

2

3

AUTOSAR TCP is able to use all of the available bandwidth with minimal latencies – if properly configured and enough memory  TCP for soft real‐time only as one can just obtain statistical 

guarantees (i.e., no worst‐case analysis) The use of TSN shapers at higher priority levels improves TCP 

performance and reduces overall memory requirement

AUTOSAR specifies a full‐fledged TCP protocolNeed to re‐examine what we know about TCP in the 

automotive context

AUTOSAR TCP configuration choices make a huge  difference, parameters cannot be set in isolation

E.g. best choices for receive window size & polling period depend on switch memory size

Page 22: Insights into the performance and configuration of TCP in ...€¦ · 3.Guidelines for configuring AUTOSAR TCP/IP for on‐board communication 4.Impact of shapers on TCP traffic:

22

Thank you for your attention!

Questions? Feedback? contact us at [email protected]@uni.lu

TCP in Automotive Ethernet Networks

Page 23: Insights into the performance and configuration of TCP in ...€¦ · 3.Guidelines for configuring AUTOSAR TCP/IP for on‐board communication 4.Impact of shapers on TCP traffic:

References

23TCP in Automotive Ethernet Networks

Page 24: Insights into the performance and configuration of TCP in ...€¦ · 3.Guidelines for configuring AUTOSAR TCP/IP for on‐board communication 4.Impact of shapers on TCP traffic:

References1. S. Han and H. Kim, “On AUTOSAR TCP/IP Performance in In‐Vehicle Network Environments”, in 

IEEE Communications Magazine, vol. 54, no. 12, pp. 168‐173, Dec. 2016.2. AUTOSAR, “Specification of TCP/IP Stack”, release 4.3.1., 2017.

TCP in Automotive Ethernet Networks 24