You are on page 1of 55

Understanding TCP testing

By François Marcotte, SME

1
EXFO Solution

© 2018 EXFO Inc. All rights reserved. 2


Agenda
• Differences between UDP and TCP services

• The TCP protocol

• Testing TCP

• Troubleshooting E2E service with TCP

© 2017 EXFO Inc. All rights reserved. 3


The concept of communications

Data from storage

Accessing resources from the


network Emails from server

Network
Social networking

Video streaming
The structure of networking

Accessing resources from the


network

Emails from server

Network
• We have a link Physical Layer 1 • The server link is active
Layer Layer
• Our ID is a MAC address 2 2 • It is identified with a MAC address

• We are behind a router; we need an IP Layer Layer


• The domain server has an IP address
3 3
address to be identified by the network
The structure of networking

Accessing resources from the


network

Emails from server

Network
How are the emails transferred?
Can it suffer some frame loss?
Are retransmissions allowed?
What is managing all of this?
The structure of networking

Accessing resources from the


network

Emails from server

Network
Transport Layer 4
UDP or TCP
OSI and TCP/IP model

TCP or UDP
IP

Ethernet
• Best-effort service
User Datagram Protocol (UDP)

• Packets may be lost


• Packets can be out of order
• Connectionless
• No handshaking between
sender/receiver
• Unreliable
• Send as fast as you can
• Error control: None
• No retransmission delays
• Reliable transport service
Transport Control Protocol (TCP)

• All data must be received


• Uses Acknowledgements
• Connection-oriented
• Handshaking between sender /
receiver
• Connection establishment and
teardown phases
• Error control: Yes
• Retransmission delays
UDP versus TCP

User Datagram Protocol (UDP) Transport Control Protocol (TCP)

Are you I don’t Are you No, slow


getting care…just getting down. I need
my file? send it my file? to fix the file
TCP protocol

© 2018 EXFO Inc. All rights reserved. 12


TCP Process

Application Application
writes data reads data
Socket Socket
layer layer
TCP TCP
Data segment
send buffer receive buffer
ACK segment

Accessing a web page


TCP – Connection Flow

• TCP operates on a client/server model


• The client initiates the connection to the server
• The mechanism used to ensure a reliable
connection is the 3-way handshake
• Once the connection is open, data transfer can
occur in both direction

Now that the TCP Connection is open,


it is ready for a TCP transfer
TCP Connection Establishment (Simplified)
TCP Client TCP Server
Establish TCP session (SYN)

Accept TCP session (SYN-ACK)

Send TCP traffic (TCP Segment)

Acknowledge received TCP traffic (ACK)

Close TCP session (FIN)

Accept closure of TCP session (FIN-ACK)


TCP – Connection Flow

In this example lets assume there is only one


segment (frame) per RTT

Assuming a theoretical RTT of 20ms, we have a


max of 50 frame/s

Taking a frame size of 1518 bytes, we have:

1518 × 8 × 50 ≈ 600 𝑘𝑏𝑖𝑡/𝑠

So regardless if we have 10Mbps or 100Gbps,


the throughput would be limited to 600 kbit/s.
TCP – Connection Flow

Congestion Window (CWND)


CWND = Is the amount of data the TCP can
send into the network before receiving an ACK
(In-flight packets)
Receiver Window (RWND)
RWND = is the advertised amount of data that
the destination side can receive

Note: In the context of testing a service, the RWND is taken out of the equation
TCP – Connection Flow
The amount of data sent during the CWND is obtain with the
Bandwidth-Delay Product or BDP.
BDP = Link Rate x RTT

Example with 100Mbps link


100 Mbit/s and 20 ms RTT:
100 Mbit/s * 20 ms = 2 000 000 bits or 244 kiB

1 Kibi byte = 1024 byte


Impairments That Impact TCP Throughput

Sequence Number

Legend: Data Packet ACK Packet


Time
Impairments That Impact TCP Throughput

?
Impairments That Impact TCP Throughput

Sequence Number

Legend: Data Packet ACK Packet


Time
Impairments That Impact TCP Throughput

Sequence Number

Legend: Data Packet ACK Packet


Time
Impairments That Impact TCP Throughput

Sequence Number

Legend: Data Packet ACK Packet


Time
Impairments That Impact TCP Throughput

Sequence Number

Legend: Data Packet ACK Packet


Time
Impairments That Impact TCP Throughput

Sequence Number

Legend: Data Packet ACK Packet


Time
Impairments That Impact TCP Throughput

Sequence Number

Legend: Data Packet ACK Packet


Time
Impairments That Impact TCP Throughput

Sequence Number

Legend: Data Packet ACK Packet


Time
Congestion control algorithm vs packet loss

2020 EXFO Inc. All rights reserved. 28


Reno, Cubic, BBR and others

• TCP Reno uses an algorithm to quickly respond to


losses while slowly recovering from congestion

• TCP Cubic responds more aggressively to recover


from losses rather than a linear increase

• TCP BBR regulates its congestion window size so


the amount of in-flight packets is a multiple of the
bandwidth-delay product (BDP)

© 2020 EXFO Inc. All rights reserved. 29


Algorithm to use many methods

© 2020 EXFO Inc. All rights reserved. 30


TCP tests

© 2018 EXFO Inc. All rights reserved. 31


OSI versus test methodologies

RFC6349
RFC2544
EtherSAM Y.1564

© 2017 EXFO Inc. All rights reserved. 32


TCP Tests

• iPerf test
• RFC-6349
• Speedtest by Ookla
• TCP connectivity

33
© 2020 EXFO Inc. All rights reserved.
iPerf test
Network Core
cloud
iPerf server

Transport
Client
RFC6349 TCP Test Methodology

The RFC 6349:


The main objective is:
Validate TCP performance
levels at specific CIRs and
window sizes for end-to-end
routed networks (IP).

http://www.rfc-base.org/rfc-6349.html
RFC6349 TCP Throughput Test - Steps

0- Conduct a turn-up test

1- Discovery of the Path MTU

2- Measure Baseline Round Trip Time (RTT)

3- Measure the TCP throughput

Note: TCP throughput measurement should not be accomplished when the network is dysfunctional.
5% packet loss and/or 150 ms jitter is considered too high for an accurate measurement
RFC6349 TCP Throughput Test

1- Discovery of the Path MTU


• This is the maximum frame size the link can transmit
without fragmentation.
• This is required for the MSS (maximum segment size)
setup in TCP session.
RFC6349 TCP Throughput Test

2- Measure Baseline Round Trip Time (RTT)

Sequence Number

RTT
RTT Time

Legend: Data Packet ACK Packet

© 2020 EXFO Inc. All rights reserved. 38


RFC6349 TCP Throughput Test

3- TCP Throughput Test


• TCP Throughput
• Based on Bandwidth Delay Product (BDP) derived from
measured RTT & CIR value
• Buffer Delay (represents the increase in RTT during a TCP
Throughput test versus the baseline RTT)
• TCP Efficiency (represents the percentage of Bytes that were not
retransmitted)
Other metrics of RFC6349

TCP Efficiency

This metric represents the percentage of


Bytes that were not retransmitted.

Buffer Delay

This metric represents the increase in RTT during a TCP


Throughput test versus the inherent or baseline RTT.
Core

Transport
Client

The RFC 6349 works in DTS mode


One direction at a time
Server – client and client - server
RFC 6349 test

4
Capture – single connection
Wireshark TCP sessions
Capture – Multiple connections - 16 SYNs all at once
Wireshark TCP sessions
Speedtest by Ookla

Service provider Modem

Server
Network

Download

upload
EX1

Ookla employs multiple TCP connections


TCP throughput

Based on multiple HTTP requests to a designated server


The end results is ignoring the fastest 10% and slowest 30% of the
measurements
45

TCP Troubleshooting
TCP problems
Server configuration
• Bad congestion algorithm
• Interface setup

Service issues: Application using TCP (Netflix, large data server) and
TCP over UDP (I.e. MS Teams)
• Service availability
• Latency, Jitter
• Packet loss
• Refused connections

Throughput issues
• Bottleneck
• Latency, Jitter
• Packet loss
• Refused connections

© 2020 EXFO Inc. All rights reserved.


Use case: Troubleshooting TCP
• TCP testing
• TWAMP monitoring: Frame loss, jitter
and latency monitoring
Network
cloud Client

Outside
cabinet
Core
Patch
Panel

OLT
iPerf server FTTx
TCP/IP

Transport
Service
cloud On demand RFC 6349

Nova Active Verifiers


vProbes & agents

TWAMP reflectors Continuous TWAMP


Jitter and Frame Loss

Jitter

Frame
Loss

© 2020 EXFO Inc. All rights reserved. | 48


Results MTU Test:
Max segment size (is there a frame size requirements)

Pass/Fail based on thresholds

TCP Performance:
- Max Throughput reached
- Window settings to reach these
- Efficiency and Buffer Delay

All results per direction (upstream and Downstream)

Detect and automatically adjust when NAT is detected


Results can be unidirectional or bidirectional

© 2016 EXFO Inc. All rights reserved. | 49


Problem of cloud base server access
Public
cloud

Core

B 100GE D
A Transport Network
cloud
OTU4
112G C
1GE
MEC
10GE

xHaul

EXFO Active Verifiers FTB-1 – 88260 test module


vProbes & agents
Problem of cloud base server access

Public
cloud
Verification of same path from another location

Core d’
B 100GE
D
A Transport Network
cloud
OTU4
112G C
1GE
MEC
a’ 10GE

xHaul

EXFO Active Verifiers FTB-1 – 88260 test module


vProbes & agents
Problem of cloud base server access

Public
Mixed of fixe traffic with TCP cloud

Core d’
Network
cloud RFC6349 B 100GE
D
Traffic Gen
A Transport
OTU4
112G C
1GE
MEC
a’ 10GE

xHaul

EXFO Active Verifiers FTB-1 – 88260 test module


vProbes & agents
TCP: Congestion Algorithm
– A congestion event is detected when 3 duplicate ACKs are received

– If the CWND is smaller than the BDP, the connection is unable to fill the pipe.
TCP: Congestion Algorithm (continued)

Avoids going back to slow start when a congestion


event occurs, unless re-transmission time-out
occurs

Because Receiver is ACKnowledging every packet


received, upon loss, the sender will see duplicate
ACKs, indicating exactly the lost packet

You might also like