sctp: implement RFC8899: Packetization Layer Path MTU Discovery for SCTP transport
Subsystems (4)
Xin Long
maintainerv2 cover sctp: implement RFC8899: Packetization Layer Path MTU Discovery for SCTP transport
Overview(From RFC8899):
In contrast to PMTUD, Packetization Layer Path MTU Discovery (PLPMTUD) [RFC4821] introduces a method that does not rely upon reception and validation of PTB messages. It is therefore more robust than Classical PMTUD. This has become the recommended approach for implementing discovery of the PMTU [BCP145].
It uses a general strategy in which the PL sends probe packets to search for the largest size of unfragmented datagram that can be sent over a network path. Probe packets are sent to explore using a larger packet size. If a probe packet is successfully delivered (as determined by the PL), then the PLPMTU is raised to the size of the successful probe. If a black hole is detected (e.g., where packets of size PLPMTU are consistently not received), the method reduces the PLPMTU.
SCTP Probe Packets:
As the RFC suggested, the probe packets consist of an SCTP common header followed by a HEARTBEAT chunk and a PAD chunk. The PAD chunk is used to control the length of the probe packet. The HEARTBEAT chunk is used to trigger the sending of a HEARTBEAT ACK chunk to confirm this probe on the HEARTBEAT sender.
The HEARTBEAT chunk also carries a Heartbeat Information parameter that includes the probe size to help an implementation associate a HEARTBEAT ACK with the size of probe that was sent. The sender use the nonce and the probe size to verify the information returned.
Detailed Implementation on SCTP:
+------+
+------->| Base |-----------------+ Connectivity
| +------+ | or BASE_PLPMTU
| | | confirmation failed
| | v
| | Connectivity +-------+
| | and BASE_PLPMTU | Error |
| | confirmed +-------+
| | | Consistent
| v | connectivity
Black Hole | +--------+ | and BASE_PLPMTU
detected | | Search |<---------------+ confirmed
| +--------+
| ^ |
| | |
| Raise | | Search
| timer | | algorithm
| expired | | completed
| | |
| | v
| +-----------------+
+---| Search Complete |
+-----------------+ When PLPMTUD is enabled, it's in Base state, and starts to probe with BASE_PLPMTU (1200). If this probe succeeds, it goes to Search state; If this probe fails, it goes to Error state under which pl.pmtu goes down to MIN_PLPMTU (512) and keeps probing with BASE_PLPMTU until it succeeds and goes to Search state.
During the Search state, the probe size is growing by a Big step (32) every time when the last probe succeeds at the beginning. Once a probe (such as 1420) fails after trying MAX_PROBES (3) times, the probe_size goes back to the last one (1420 - 32 = 1388), meanwhile 'probe_high' is set to 1420 and the growing step becomes a Small one (4). Then the probe is continuing with a Small step grown each round. Until it gets the optimal size (such as 1400) when probe with its next probe size (1404) fails, it sync this size to pathmtu and goes to Complete state.
In Complete state, it will only does a probe check for the pathmtu just set, if it fails, which means a Black Hole is detected and it goes back to Base state. If it succeeds, it goes back to Search state again, and probe is continuing with growing a Small step (1400 + 4). If this probe fails, probe_high is set and goes back to 1388 and then Complete state, which is kind of a loop normally. However if the env's pathmtu changes to a big size somehow, this probe will succeed and then probe continues with growing a Big step (1400 + 32) each round until another probe fails.
PTB Messages Process:
PLPMTUD doesn't rely on these package to find the pmtu, and shouldn't trust it either. When processing them, it only changes the probe_size to PL_PTB_SIZE(info - hlen) if 'pl.pmtu < PL_PTB_SIZE < the current probe_size' druing Search state. As this could help probe_size to get to the optimal size faster, for exmaple:
pl.pmtu = 1388, probe_size = 1420, while the env's pathmtu = 1400. When probe_size is 1420, a Toobig packet with 1400 comes back. If probe size changes to use 1400, it will save quite a few rounds to get there. But of course after having this value, PLPMTUD will still verify it on its own before using it.
Patches:
- Patch 1-6: introduce some new constants/variables from the RFC, systcl and members in transport, APIs for the following patches, chunks and a timer for the probe sending and some codes for the probe receiving.
- Patch 7-9: implement the state transition on the tx path, rx path and toobig ICMP packet processing. This is the main algorithm part.
- Patch 10: activate this feature
- Patch 11-14: improve the process for ICMP packets for SCTP over UDP, so that it can also be covered by this feature.
Tests:
- do sysctl and setsockopt tests for this feature's enabling and disabling.
- get these pr_debug points for this feature by
# cat /sys/kernel/debug/dynamic_debug/control | grep PLP
and enable them on kernel dynamic debug, then play with the pathmtu and
check if the state transition and plpmtu change match the RFC.- do the above tests for SCTP over IPv4/IPv6 and SCTP over UDP.
v1->v2:
- See Patch 06/14.
Xin Long (14):
sctp: add pad chunk and its make function and event table
sctp: add probe_interval in sysctl and sock/asoc/transport
sctp: add SCTP_PLPMTUD_PROBE_INTERVAL sockopt for sock/asoc/transport
sctp: add the constants/variables and states and some APIs for
transport
sctp: add the probe timer in transport for PLPMTUD
sctp: do the basic send and recv for PLPMTUD probe
sctp: do state transition when PROBE_COUNT == MAX_PROBES on HB send
path
sctp: do state transition when a probe succeeds on HB ACK recv path
sctp: do state transition when receiving an icmp TOOBIG packet
sctp: enable PLPMTUD when the transport is ready
sctp: remove the unessessary hold for idev in sctp_v6_err
sctp: extract sctp_v6_err_handle function from sctp_v6_err
sctp: extract sctp_v4_err_handle function from sctp_v4_err
sctp: process sctp over udp icmp err on sctp side
Documentation/networking/ip-sysctl.rst | 8 ++ include/linux/sctp.h | 7 ++ include/net/netns/sctp.h | 3 + include/net/sctp/command.h | 1 + include/net/sctp/constants.h | 20 ++++ include/net/sctp/sctp.h | 57 ++++++++- include/net/sctp/sm.h | 6 +- include/net/sctp/structs.h | 19 +++ include/uapi/linux/sctp.h | 8 ++ net/sctp/associola.c | 6 + net/sctp/debug.c | 1 + net/sctp/input.c | 132 ++++++++++++--------- net/sctp/ipv6.c | 112 +++++++++++------- net/sctp/output.c | 33 +++++- net/sctp/outqueue.c | 13 ++- net/sctp/protocol.c | 21 +--- net/sctp/sm_make_chunk.c | 31 ++++- net/sctp/sm_sideeffect.c | 37 ++++++ net/sctp/sm_statefuns.c | 37 +++++- net/sctp/sm_statetable.c | 43 +++++++ net/sctp/socket.c | 123 ++++++++++++++++++++ net/sctp/sysctl.c | 35 ++++++ net/sctp/transport.c | 153 ++++++++++++++++++++++++- 23 files changed, 779 insertions(+), 127 deletions(-)
Signature · 1 line
2.27.0
Xin Long
maintainerPATCH v2 1/14 sctp: add pad chunk and its make function and event table
This chunk is defined in rfc4820#section-3, and used to pad an SCTP packet. The receiver must discard this chunk and continue processing the rest of the chunks in the packet.
Add it now, as it will be bundled with a heartbeat chunk to probe pmtu in the following patches.
--- include/linux/sctp.h | 7 +++++++ include/net/sctp/sm.h | 1 + net/sctp/sm_make_chunk.c | 26 ++++++++++++++++++++++++++ net/sctp/sm_statetable.c | 23 +++++++++++++++++++++++ 4 files changed, 57 insertions(+)
include/linux/sctp.h +7 -0
@@ -98,6 +98,7 @@ enum sctp_cid {SCTP_CID_I_FWD_TSN =0xC2 ,SCTP_CID_ASCONF_ACK =0x80 ,SCTP_CID_RECONF =0x82 , + SCTP_CID_PAD = 0x84, }; /* enum */
@@ -410,6 +411,12 @@ struct sctp_heartbeat_chunk { }; +/* PAD chunk could be bundled with heartbeat chunk to probe pmtu */ +struct sctp_pad_chunk { +struct sctp_chunkhdr uh; +}; + +/* For the abort and shutdown ACK we must carry the init tag in the * common header. Just the common header is all that is needed with a * chunk descriptor.
include/net/sctp/sm.h +1 -0
@@ -230,6 +230,7 @@ struct sctp_chunk *sctp_make_heartbeat_ack(const struct sctp_association *asoc,const struct sctp_chunk *chunk, const void *payload, const size_t paylen); +struct sctp_chunk *sctp_make_pad (const struct sctp_association *asoc,int len); struct sctp_chunk *sctp_make_op_error(const struct sctp_association *asoc, const struct sctp_chunk *chunk, __be16 cause_code, const void *payload,
net/sctp/sm_make_chunk.c +26 -0
@@ -1218,6 +1218,32 @@ struct sctp_chunk *sctp_make_heartbeat_ack(const struct sctp_association *asoc,return retval; } +/* RFC4820 3. Padding Chunk (PAD) +* 0 1 2 3 +* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +* | Type = 0x84 | Flags=0 | Length | +* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +* | | +* \ Padding Data / +* / \ +* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +*/ +struct sctp_chunk *sctp_make_pad (const struct sctp_association *asoc,int len) +{ +struct sctp_chunk *retval; + + retval =sctp_make_control (asoc,SCTP_CID_PAD ,0 , len,GFP_ATOMIC ); +if (!retval) +return NULL ; + +skb_put_zero (retval->skb, len); + retval->chunk_hdr->length =htons (ntohs (retval->chunk_hdr->length) + len); + retval->chunk_end =skb_tail_pointer (retval->skb); + +return retval; +} +/* Create an Operation Error chunk with the specified space reserved. * This routine can be used for containing multiple causes in the chunk. */
net/sctp/sm_statetable.c +23 -0
@@ -526,6 +526,26 @@ auth_chunk_event_table[SCTP_NUM_AUTH_CHUNK_TYPES][SCTP_STATE_NUM_STATES] = { TYPE_SCTP_AUTH, };/*state_fn_t auth_chunk_event_table[][] */ +static const struct sctp_sm_table_entry +pad_chunk_event_table[SCTP_STATE_NUM_STATES ] = { +/* SCTP_STATE_CLOSED */ +TYPE_SCTP_FUNC (sctp_sf_discard_chunk), +/* SCTP_STATE_COOKIE_WAIT */ +TYPE_SCTP_FUNC (sctp_sf_discard_chunk), +/* SCTP_STATE_COOKIE_ECHOED */ +TYPE_SCTP_FUNC (sctp_sf_discard_chunk), +/* SCTP_STATE_ESTABLISHED */ +TYPE_SCTP_FUNC (sctp_sf_discard_chunk), +/* SCTP_STATE_SHUTDOWN_PENDING */ +TYPE_SCTP_FUNC (sctp_sf_discard_chunk), +/* SCTP_STATE_SHUTDOWN_SENT */ +TYPE_SCTP_FUNC (sctp_sf_discard_chunk), +/* SCTP_STATE_SHUTDOWN_RECEIVED */ +TYPE_SCTP_FUNC (sctp_sf_discard_chunk), +/* SCTP_STATE_SHUTDOWN_ACK_SENT */ +TYPE_SCTP_FUNC (sctp_sf_discard_chunk), +};/* chunk pad */ +static const struct sctp_sm_table_entry chunk_event_table_unknown[SCTP_STATE_NUM_STATES ] = {/* SCTP_STATE_CLOSED */
@@ -992,6 +1012,9 @@ static const struct sctp_sm_table_entry *sctp_chunk_event_lookup(case SCTP_CID_AUTH :return &auth_chunk_event_table[0 ][state]; + +case SCTP_CID_PAD : +return &pad_chunk_event_table[state]; }return &chunk_event_table_unknown[state];
Signature · 1 line
2.27.0
Xin Long
maintainerPATCH v2 2/14 sctp: add probe_interval in sysctl and sock/asoc/transport
In reply to Xin LongPLPMTUD can be enabled by doing 'sysctl -w net.sctp.probe_interval=n'. 'n' is the interval for PLPMTUD probe timer in milliseconds, and it can't be less than 5000 if it's not 0.
All asoc/transport's PLPMTUD in a new socket will be enabled by default.
--- Documentation/networking/ip-sysctl.rst | 8 ++++++ include/net/netns/sctp.h | 3 +++ include/net/sctp/constants.h | 2 ++ include/net/sctp/structs.h | 3 +++ net/sctp/associola.c | 2 ++ net/sctp/socket.c | 1 + net/sctp/sysctl.c | 35 ++++++++++++++++++++++++++ 7 files changed, 54 insertions(+)
Documentation/networking/ip-sysctl.rst +8 -0
@@ -2834,6 +2834,14 @@ encap_port - INTEGER Default: 0 +plpmtud_probe_interval - INTEGER + The time interval (in milliseconds) for sending PLPMTUD probe chunks. + These chunks are sent at the specified interval with a variable size + to probe the mtu of a given path between 2 endpoints. PLPMTUD will + be disabled when 0 is set, and other values for it must be >= 5000. + + Default: 0 + ``/proc/sys/net/core/*`` ========================
include/net/netns/sctp.h +3 -0
@@ -84,6 +84,9 @@ struct netns_sctp {/* HB.interval - 30 seconds */ unsigned int hb_interval; +/* The interval for PLPMTUD probe timer */ +unsigned int probe_interval; +/* Association.Max.Retrans - 10 attempts * Path.Max.Retrans - 5 attempts (per destination address) * Max.Init.Retransmits - 8 attempts
include/net/sctp/constants.h +2 -0
@@ -424,4 +424,6 @@ enum {*/ #define SCTP_AUTH_RANDOM_LENGTH 32 +#define SCTP_PROBE_TIMER_MIN 5000 +#endif /* __sctp_constants_h__ */
include/net/sctp/structs.h +3 -0
@@ -177,6 +177,7 @@ struct sctp_sock {* will be inherited by all new associations. */ __u32 hbinterval; +__u32 probe_interval;__be16 udp_port;__be16 encap_port;
@@ -858,6 +859,7 @@ struct sctp_transport {* the destination address every heartbeat interval. */ unsigned long hbinterval; +unsigned long probe_interval;/* SACK delay timeout */ unsigned long sackdelay;
@@ -1795,6 +1797,7 @@ struct sctp_association {* will be inherited by all new transports. */ unsigned long hbinterval; +unsigned long probe_interval;__be16 encap_port;
net/sctp/associola.c +2 -0
@@ -98,6 +98,7 @@ static struct sctp_association *sctp_association_init(* sock configured value. */ asoc->hbinterval =msecs_to_jiffies (sp->hbinterval); + asoc->probe_interval =msecs_to_jiffies (sp->probe_interval); asoc->encap_port = sp->encap_port;
@@ -625,6 +626,7 @@ struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *asoc,* association configured value. */ peer->hbinterval = asoc->hbinterval; + peer->probe_interval = asoc->probe_interval; peer->encap_port = asoc->encap_port;
net/sctp/socket.c +1 -0
@@ -4989,6 +4989,7 @@ static int sctp_init_sock(struct sock *sk)atomic_set (&sp->pd_mode,0 );skb_queue_head_init (&sp->pd_lobby); sp->frag_interleave =0 ; + sp->probe_interval = net->sctp.probe_interval;/* Create a per socket endpoint structure. Even if we * change the data structure relationships, this may still
net/sctp/sysctl.c +35 -0
@@ -55,6 +55,8 @@ static int proc_sctp_do_alpha_beta(struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos);static int proc_sctp_do_auth (struct ctl_table *ctl,int write,void *buffer,size_t *lenp,loff_t *ppos); +static int proc_sctp_do_probe_interval (struct ctl_table *ctl,int write, +void *buffer,size_t *lenp,loff_t *ppos);static struct ctl_table sctp_table[] = { {
@@ -293,6 +295,13 @@ static struct ctl_table sctp_net_table[] = { .mode = 0644, .proc_handler = proc_dointvec, }, + { + .procname = "plpmtud_probe_interval", + .data = &init_net.sctp.probe_interval, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = proc_sctp_do_probe_interval, + }, { .procname = "udp_port", .data = &init_net.sctp.udp_port,
@@ -539,6 +548,32 @@ static int proc_sctp_do_udp_port(struct ctl_table *ctl, int write,return ret; } +static int proc_sctp_do_probe_interval (struct ctl_table *ctl,int write, +void *buffer,size_t *lenp,loff_t *ppos) +{ +struct net *net = current->nsproxy->net_ns; +struct ctl_table tbl; +int ret, new_value; + +memset (&tbl,0 ,sizeof (struct ctl_table )); + tbl.maxlen =sizeof (unsigned int ); + +if (write) + tbl.data = &new_value; +else + tbl.data = &net->sctp.probe_interval; + + ret =proc_dointvec (&tbl, write, buffer, lenp, ppos); +if (write && ret ==0 ) { +if (new_value && new_value <SCTP_PROBE_TIMER_MIN ) +return -EINVAL ; + + net->sctp.probe_interval = new_value; + } + +return ret; +} +int sctp_sysctl_net_register (struct net *net) {struct ctl_table *table;
Signature · 1 line
2.27.0
Xin Long
maintainerPATCH v2 3/14 sctp: add SCTP_PLPMTUD_PROBE_INTERVAL sockopt for sock/asoc/transport
In reply to Xin LongWith this socket option, users can change probe_interval for a transport, asoc or sock after it's created.
Note that if the change is for an asoc, also apply the change to each transport in this asoc.
--- include/uapi/linux/sctp.h | 8 +++ net/sctp/socket.c | 118 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 126 insertions(+)
include/uapi/linux/sctp.h +8 -0
@@ -141,6 +141,7 @@ typedef __s32 sctp_assoc_t;#define SCTP_EXPOSE_POTENTIALLY_FAILED_STATE 131#define SCTP_EXPOSE_PF_STATE SCTP_EXPOSE_POTENTIALLY_FAILED_STATE#define SCTP_REMOTE_UDP_ENCAPS_PORT 132 +#define SCTP_PLPMTUD_PROBE_INTERVAL 133/* PR-SCTP policies */ #define SCTP_PR_SCTP_NONE 0x0000
@@ -1213,4 +1214,11 @@ enum sctp_sched_type {SCTP_SS_MAX =SCTP_SS_RR }; +/* Probe Interval socket option */ +struct sctp_probeinterval { +sctp_assoc_t spi_assoc_id; +struct sockaddr_storage spi_address; +__u32 spi_interval; +}; +#endif /* _UAPI_SCTP_H */
net/sctp/socket.c +118 -0
142 lines not on this page · raw message
Signature · 1 line
2.27.0
Xin Long
maintainerPATCH v2 4/14 sctp: add the constants/variables and states and some APIs for transport
In reply to Xin LongThese are 4 constants described in rfc8899#section-5.1.2:
MAX_PROBES, MIN_PLPMTU, MAX_PLPMTU, BASE_PLPMTU;
And 2 variables described in rfc8899#section-5.1.3:
PROBED_SIZE, PROBE_COUNT;
And 5 states described in rfc8899#section-5.2:
DISABLED, BASE, SEARCH, SEARCH_COMPLETE, ERROR;
And these 4 APIs are used to reset/update PLPMTUD, check if PLPMTUD is enabled, and calculate the additional headers length for a transport.
Note the member 'probe_high' in transport will be set to the probe size when a probe fails with this probe size in the next patches.
--- include/net/sctp/constants.h | 17 +++++++++++++ include/net/sctp/sctp.h | 48 +++++++++++++++++++++++++++++++++--- include/net/sctp/structs.h | 8 ++++++ 3 files changed, 70 insertions(+), 3 deletions(-)
include/net/sctp/constants.h +17 -0
@@ -200,6 +200,23 @@ enum sctp_sock_state { SCTP_SS_CLOSING = TCP_CLOSE_WAIT, }; +enum sctp_plpmtud_state { +SCTP_PL_DISABLED , +SCTP_PL_BASE , +SCTP_PL_SEARCH , +SCTP_PL_COMPLETE , +SCTP_PL_ERROR , +}; + +#define SCTP_BASE_PLPMTU 1200 +#define SCTP_MAX_PLPMTU 9000 +#define SCTP_MIN_PLPMTU 512 + +#define SCTP_MAX_PROBES 3 + +#define SCTP_PL_BIG_STEP 32 +#define SCTP_PL_MIN_STEP 4 +/* These functions map various type to printable names. */ const char *sctp_cname (const union sctp_subtype id);/* chunk types */ const char *sctp_oname (const union sctp_subtype id);/* other events */
include/net/sctp/sctp.h +45 -3
71 lines not on this page · raw message
include/net/sctp/structs.h +8 -0
@@ -978,6 +978,14 @@ struct sctp_transport {char cacc_saw_newack; } cacc; +struct { +__u16 pmtu; +__u16 probe_size; +__u16 probe_high; +__u8 probe_count; +__u8 state; + } pl;/* plpmtud related */ +/* 64-bit random number sent with heartbeat. */ __u64 hb_nonce;
Signature · 1 line
2.27.0
Xin Long
maintainerPATCH v2 5/14 sctp: add the probe timer in transport for PLPMTUD
In reply to Xin LongThere are 3 timers described in rfc8899#section-5.1.1:
PROBE_TIMER, PMTU_RAISE_TIMER, CONFIRMATION_TIMER
This patches adds a 'probe_timer' in transport, and it works as either PROBE_TIMER or PMTU_RAISE_TIMER. At most time, it works as PROBE_TIMER and expires every a 'probe_interval' time to send the HB probe packet. When transport pl enters COMPLETE state, it works as PMTU_RAISE_TIMER and expires in 'probe_interval * 30' time to go back to SEARCH state and do searching again.
SCTP HB is an acknowledged packet, CONFIRMATION_TIMER is not needed.
The timer will start when transport pl enters BASE state and stop when it enters DISABLED state.
--- include/net/sctp/command.h | 1 + include/net/sctp/constants.h | 1 + include/net/sctp/sctp.h | 9 ++++++++- include/net/sctp/sm.h | 2 ++ include/net/sctp/structs.h | 4 ++++ net/sctp/debug.c | 1 + net/sctp/sm_sideeffect.c | 37 ++++++++++++++++++++++++++++++++++++ net/sctp/sm_statefuns.c | 17 +++++++++++++++++ net/sctp/sm_statetable.c | 20 +++++++++++++++++++ net/sctp/transport.c | 18 ++++++++++++++++++ 10 files changed, 109 insertions(+), 1 deletion(-)
include/net/sctp/command.h +1 -0
@@ -59,6 +59,7 @@ enum sctp_verb {SCTP_CMD_HB_TIMERS_START ,/* Start the heartbeat timers. */ SCTP_CMD_HB_TIMER_UPDATE ,/* Update a heartbeat timers. */ SCTP_CMD_HB_TIMERS_STOP ,/* Stop the heartbeat timers. */ +SCTP_CMD_PROBE_TIMER_UPDATE ,/* Update a probe timer. */ SCTP_CMD_TRANSPORT_HB_SENT ,/* Reset the status of a transport. */ SCTP_CMD_TRANSPORT_IDLE ,/* Do manipulations on idle transport */ SCTP_CMD_TRANSPORT_ON, /* Mark the transport as active. */
include/net/sctp/constants.h +1 -0
@@ -77,6 +77,7 @@ enum sctp_event_timeout {SCTP_EVENT_TIMEOUT_T5_SHUTDOWN_GUARD ,SCTP_EVENT_TIMEOUT_HEARTBEAT ,SCTP_EVENT_TIMEOUT_RECONF , +SCTP_EVENT_TIMEOUT_PROBE ,SCTP_EVENT_TIMEOUT_SACK , SCTP_EVENT_TIMEOUT_AUTOCLOSE, };
include/net/sctp/sctp.h +8 -1
@@ -635,10 +635,14 @@ static inline void sctp_transport_pl_reset(struct sctp_transport *t) t->pl.state =SCTP_PL_BASE ; t->pl.pmtu =SCTP_BASE_PLPMTU ; t->pl.probe_size =SCTP_BASE_PLPMTU ; +sctp_transport_reset_probe_timer (t); } }else { -if (t->pl.state !=SCTP_PL_DISABLED ) +if (t->pl.state !=SCTP_PL_DISABLED ) { +if (del_timer (&t->probe_timer)) +sctp_transport_put (t); t->pl.state =SCTP_PL_DISABLED ; + } } }
@@ -647,6 +651,9 @@ static inline void sctp_transport_pl_update(struct sctp_transport *t)if (t->pl.state ==SCTP_PL_DISABLED )return ; +if (del_timer (&t->probe_timer)) +sctp_transport_put (t); + t->pl.state =SCTP_PL_BASE ; t->pl.pmtu =SCTP_BASE_PLPMTU ; t->pl.probe_size =SCTP_BASE_PLPMTU ;
include/net/sctp/sm.h +2 -0
@@ -151,6 +151,7 @@ sctp_state_fn_t sctp_sf_cookie_wait_icmp_abort;/* Prototypes for timeout event state functions. */ sctp_state_fn_t sctp_sf_do_6_3_3_rtx;sctp_state_fn_t sctp_sf_send_reconf; +sctp_state_fn_t sctp_sf_send_probe;sctp_state_fn_t sctp_sf_do_6_2_sack;sctp_state_fn_t sctp_sf_autoclose_timer_expire;
@@ -311,6 +312,7 @@ int sctp_do_sm(struct net *net, enum sctp_event_type event_type,void sctp_generate_t3_rtx_event (struct timer_list *t);void sctp_generate_heartbeat_event (struct timer_list *t);void sctp_generate_reconf_event (struct timer_list *t); +void sctp_generate_probe_event (struct timer_list *t);void sctp_generate_proto_unreach_event (struct timer_list *t);void sctp_ootb_pkt_free (struct sctp_packet *packet);
include/net/sctp/structs.h +4 -0
@@ -936,6 +936,9 @@ struct sctp_transport {/* Timer to handler reconf chunk rtx */ struct timer_list reconf_timer; +/* Timer to send a probe HB packet for PLPMTUD */ +struct timer_list probe_timer; +/* Since we're using per-destination retransmission timers * (see above), we're also using per-destination "transmitted" * queues. This probably ought to be a private struct
@@ -1003,6 +1006,7 @@ void sctp_transport_free(struct sctp_transport *);void sctp_transport_reset_t3_rtx (struct sctp_transport *);void sctp_transport_reset_hb_timer (struct sctp_transport *);void sctp_transport_reset_reconf_timer (struct sctp_transport *transport); +void sctp_transport_reset_probe_timer (struct sctp_transport *transport);int sctp_transport_hold (struct sctp_transport *);void sctp_transport_put (struct sctp_transport *);void sctp_transport_update_rto (struct sctp_transport *,__u32 );
net/sctp/debug.c +1 -0
@@ -154,6 +154,7 @@ static const char *const sctp_timer_tbl[] = {"TIMEOUT_T5_SHUTDOWN_GUARD" ,"TIMEOUT_HEARTBEAT" ,"TIMEOUT_RECONF" , +"TIMEOUT_PROBE" ,"TIMEOUT_SACK" , "TIMEOUT_AUTOCLOSE", };
net/sctp/sm_sideeffect.c +37 -0
@@ -471,6 +471,38 @@ void sctp_generate_reconf_event(struct timer_list *t)sctp_transport_put (transport); } +/* Handle the timeout of the probe timer. */ +void sctp_generate_probe_event (struct timer_list *t) +{ +struct sctp_transport *transport =from_timer (transport, t, probe_timer); +struct sctp_association *asoc = transport->asoc; +struct sock *sk = asoc->base.sk; +struct net *net =sock_net (sk); +int error =0 ; + +bh_lock_sock (sk); +if (sock_owned_by_user (sk)) { +pr_debug ("%s: sock is busy\n" , __func__); + +/* Try again later. */ +if (!mod_timer (&transport->probe_timer, jiffies + (HZ /20 ))) +sctp_transport_hold (transport); + goto out_unlock; + } + + error =sctp_do_sm (net,SCTP_EVENT_T_TIMEOUT , +SCTP_ST_TIMEOUT (SCTP_EVENT_TIMEOUT_PROBE ), + asoc->state, asoc->ep, asoc, + transport,GFP_ATOMIC ); + +if (error) + sk->sk_err = -error; + +out_unlock: +bh_unlock_sock (sk); +sctp_transport_put (transport); +} +/* Inject a SACK Timeout event into the state machine. */ static void sctp_generate_sack_event (struct timer_list *t) {
@@ -1641,6 +1673,11 @@ static int sctp_cmd_interpreter(enum sctp_event_type event_type,sctp_cmd_hb_timers_stop (commands, asoc);break ; +case SCTP_CMD_PROBE_TIMER_UPDATE : + t = cmd->obj.transport; +sctp_transport_reset_probe_timer (t); +break ; +case SCTP_CMD_REPORT_ERROR : error = cmd->obj.error;break ;
net/sctp/sm_statefuns.c +17 -0
@@ -1095,6 +1095,23 @@ enum sctp_disposition sctp_sf_send_reconf(struct net *net,return SCTP_DISPOSITION_CONSUME ; } +/* send hb chunk with padding for PLPMUTD. */ +enum sctp_disposition sctp_sf_send_probe (struct net *net, +const struct sctp_endpoint *ep, +const struct sctp_association *asoc, +const union sctp_subtype type, +void *arg, +struct sctp_cmd_seq *commands) +{ +struct sctp_transport *transport = (struct sctp_transport *)arg; + +/* The actual handling will be performed here in a later patch. */ +sctp_add_cmd_sf (commands,SCTP_CMD_PROBE_TIMER_UPDATE , +SCTP_TRANSPORT (transport)); + +return SCTP_DISPOSITION_CONSUME ; +} +/* * Process an heartbeat request. *
net/sctp/sm_statetable.c +20 -0
@@ -967,6 +967,25 @@ other_event_table[SCTP_NUM_OTHER_TYPES][SCTP_STATE_NUM_STATES] = { TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ } +#define TYPE_SCTP_EVENT_TIMEOUT_PROBE { \ +/* SCTP_STATE_CLOSED */ \ +TYPE_SCTP_FUNC (sctp_sf_timer_ignore), \ +/* SCTP_STATE_COOKIE_WAIT */ \ +TYPE_SCTP_FUNC (sctp_sf_timer_ignore ), \ +/* SCTP_STATE_COOKIE_ECHOED */ \ +TYPE_SCTP_FUNC (sctp_sf_timer_ignore ), \ +/* SCTP_STATE_ESTABLISHED */ \ +TYPE_SCTP_FUNC (sctp_sf_send_probe ), \ +/* SCTP_STATE_SHUTDOWN_PENDING */ \ +TYPE_SCTP_FUNC (sctp_sf_timer_ignore ), \ +/* SCTP_STATE_SHUTDOWN_SENT */ \ +TYPE_SCTP_FUNC (sctp_sf_timer_ignore ), \ +/* SCTP_STATE_SHUTDOWN_RECEIVED */ \ +TYPE_SCTP_FUNC (sctp_sf_timer_ignore ), \ +/* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ +TYPE_SCTP_FUNC (sctp_sf_timer_ignore ), \ +} + static const struct sctp_sm_table_entry timeout_event_table[SCTP_NUM_TIMEOUT_TYPES ][SCTP_STATE_NUM_STATES ] = {TYPE_SCTP_EVENT_TIMEOUT_NONE ,
@@ -978,6 +997,7 @@ timeout_event_table[SCTP_NUM_TIMEOUT_TYPES][SCTP_STATE_NUM_STATES] = {TYPE_SCTP_EVENT_TIMEOUT_T5_SHUTDOWN_GUARD ,TYPE_SCTP_EVENT_TIMEOUT_HEARTBEAT ,TYPE_SCTP_EVENT_TIMEOUT_RECONF , +TYPE_SCTP_EVENT_TIMEOUT_PROBE ,TYPE_SCTP_EVENT_TIMEOUT_SACK , TYPE_SCTP_EVENT_TIMEOUT_AUTOCLOSE, };
net/sctp/transport.c +18 -0
@@ -75,6 +75,7 @@ static struct sctp_transport *sctp_transport_init(struct net *net,timer_setup (&peer->T3_rtx_timer, sctp_generate_t3_rtx_event,0 );timer_setup (&peer->hb_timer, sctp_generate_heartbeat_event,0 );timer_setup (&peer->reconf_timer, sctp_generate_reconf_event,0 ); +timer_setup (&peer->probe_timer, sctp_generate_probe_event,0 );timer_setup (&peer->proto_unreach_timer, sctp_generate_proto_unreach_event,0 );
@@ -131,6 +132,9 @@ void sctp_transport_free(struct sctp_transport *transport)if (del_timer (&transport->reconf_timer))sctp_transport_put (transport); +if (del_timer (&transport->probe_timer)) +sctp_transport_put (transport); +/* Delete the ICMP proto unreachable timer if it's active. */ if (del_timer (&transport->proto_unreach_timer))sctp_transport_put (transport);
@@ -207,6 +211,20 @@ void sctp_transport_reset_reconf_timer(struct sctp_transport *transport)sctp_transport_hold (transport); } +void sctp_transport_reset_probe_timer (struct sctp_transport *transport) +{ +int scale =1 ; + +if (timer_pending (&transport->probe_timer)) +return ; +if (transport->pl.state ==SCTP_PL_COMPLETE && + transport->pl.probe_count ==1 ) + scale =30 ;/* works as PMTU_RAISE_TIMER */ +if (!mod_timer (&transport->probe_timer, + jiffies + transport->probe_interval * scale)) +sctp_transport_hold (transport); +} +/* This transport has been assigned to an association. * Initialize fields from the association or from the sock itself. * Register the reference count in the association.
Signature · 1 line
2.27.0
Xin Long
maintainerPATCH v2 6/14 sctp: do the basic send and recv for PLPMTUD probe
In reply to Xin LongThis patch does exactly what rfc8899#section-6.2.1.2 says:
The SCTP sender needs to be able to determine the total size of a probe packet. The HEARTBEAT chunk could carry a Heartbeat Information parameter that includes, besides the information suggested in [RFC4960], the probe size to help an implementation associate a HEARTBEAT ACK with the size of probe that was sent. The sender could also use other methods, such as sending a nonce and verifying the information returned also contains the corresponding nonce. The length of the PAD chunk is computed by reducing the probing size by the size of the SCTP common header and the HEARTBEAT chunk.
Note that HB ACK chunk will carry back whatever HB chunk carried, including the probe_size we put it in; We also check hbinfo->probe_size in the HB ACK against link->pl.probe_size to validate this HB ACK chunk.
v1->v2:
- Remove the unused 'sp' and add static for sctp_packet_bundle_pad().
--- include/net/sctp/sm.h | 3 ++- include/net/sctp/structs.h | 2 ++ net/sctp/output.c | 30 +++++++++++++++++++++++++++++- net/sctp/outqueue.c | 13 +++++++++++-- net/sctp/sm_make_chunk.c | 5 ++++- net/sctp/sm_statefuns.c | 20 ++++++++++++++++++-- 6 files changed, 66 insertions(+), 7 deletions(-)
include/net/sctp/sm.h +2 -1
@@ -226,7 +226,8 @@ struct sctp_chunk *sctp_make_new_encap_port(const struct sctp_association *asoc, const struct sctp_chunk *chunk);struct sctp_chunk *sctp_make_heartbeat (const struct sctp_association *asoc, -const struct sctp_transport *transport); +const struct sctp_transport *transport, +__u32 probe_size); struct sctp_chunk *sctp_make_heartbeat_ack(const struct sctp_association *asoc, const struct sctp_chunk *chunk, const void *payload,
include/net/sctp/structs.h +2 -0
@@ -386,6 +386,7 @@ struct sctp_sender_hb_info {union sctp_addr daddr;unsigned long sent_at;__u64 hb_nonce; +__u32 probe_size; }; int sctp_stream_init(struct sctp_stream *stream, __u16 outcnt, __u16 incnt,
@@ -657,6 +658,7 @@ struct sctp_chunk { data_accepted:1, /* At least 1 chunk accepted */ auth:1, /* IN: was auth'ed | OUT: needs auth */ has_asconf:1, /* IN: have seen an asconf before */ + pmtu_probe:1, /* Used by PLPMTUD, can be set in s HB chunk */ tsn_missing_report:2, /* Data chunk missing counter. */ fast_retransmit:2; /* Is this chunk fast retransmitted? */ };
net/sctp/output.c +29 -1
@@ -211,6 +211,30 @@ enum sctp_xmit sctp_packet_transmit_chunk(struct sctp_packet *packet,return retval; } +/* Try to bundle a pad chunk into a packet with a heartbeat chunk for PLPMTUTD probe */ +static enum sctp_xmit sctp_packet_bundle_pad (struct sctp_packet *pkt,struct sctp_chunk *chunk) +{ +struct sctp_transport *t = pkt->transport; +struct sctp_chunk *pad; +int overhead =0 ; + +if (!chunk->pmtu_probe) +return SCTP_XMIT_OK ; + +/* calculate the Padding Data size for the pad chunk */ + overhead +=sizeof (struct sctphdr ) +sizeof (struct sctp_chunkhdr ); + overhead +=sizeof (struct sctp_sender_hb_info ) +sizeof (struct sctp_pad_chunk ); + pad =sctp_make_pad (t->asoc, t->pl.probe_size - overhead); +if (!pad) +return SCTP_XMIT_DELAY ; + +list_add_tail (&pad->list, &pkt->chunk_list); + pkt->size +=SCTP_PAD4 (ntohs (pad->chunk_hdr->length)); + chunk->transport = t; + +return SCTP_XMIT_OK ; +} +/* Try to bundle an auth chunk into the packet. */ static enum sctp_xmit sctp_packet_bundle_auth (struct sctp_packet *pkt,struct sctp_chunk *chunk)
@@ -382,6 +406,10 @@ enum sctp_xmit sctp_packet_append_chunk(struct sctp_packet *packet, goto finish; retval =__sctp_packet_append_chunk (packet, chunk); +if (retval !=SCTP_XMIT_OK ) + goto finish; + + retval =sctp_packet_bundle_pad (packet, chunk); finish:return retval;
@@ -553,7 +581,7 @@ int sctp_packet_transmit(struct sctp_packet *packet, gfp_t gfp) sk = chunk->skb->sk;/* check gso */ -if (packet->size > tp->pathmtu && !packet->ipfragok) { +if (packet->size > tp->pathmtu && !packet->ipfragok && !chunk->pmtu_probe) {if (!sk_can_gso (sk)) {pr_err_once ("Trying to GSO but underlying device doesn't support it." ); goto out;
net/sctp/outqueue.c +11 -2
@@ -769,7 +769,11 @@ static int sctp_packet_singleton(struct sctp_transport *transport,sctp_packet_init (&singleton, transport, sport, dport);sctp_packet_config (&singleton, vtag,0 ); -sctp_packet_append_chunk (&singleton, chunk); +if (sctp_packet_append_chunk (&singleton, chunk) !=SCTP_XMIT_OK ) { +list_del_init (&chunk->list); +sctp_chunk_free (chunk); +return -ENOMEM ; + }return sctp_packet_transmit (&singleton, gfp); }
@@ -929,8 +933,13 @@ static void sctp_outq_flush_ctrl(struct sctp_flush_ctx *ctx) one_packet =1 ; fallthrough; -case SCTP_CID_SACK :case SCTP_CID_HEARTBEAT : +if (chunk->pmtu_probe) { +sctp_packet_singleton (ctx->transport, chunk, ctx->gfp); +break ; + } + fallthrough; +case SCTP_CID_SACK :case SCTP_CID_SHUTDOWN :case SCTP_CID_ECN_ECNE :case SCTP_CID_ASCONF :
net/sctp/sm_make_chunk.c +4 -1
@@ -1160,7 +1160,8 @@ struct sctp_chunk *sctp_make_new_encap_port(const struct sctp_association *asoc,/* Make a HEARTBEAT chunk. */ struct sctp_chunk *sctp_make_heartbeat (const struct sctp_association *asoc, -const struct sctp_transport *transport) +const struct sctp_transport *transport, +__u32 probe_size) {struct sctp_sender_hb_info hbinfo;struct sctp_chunk *retval;
@@ -1176,6 +1177,7 @@ struct sctp_chunk *sctp_make_heartbeat(const struct sctp_association *asoc, hbinfo.daddr = transport->ipaddr; hbinfo.sent_at = jiffies; hbinfo.hb_nonce = transport->hb_nonce; + hbinfo.probe_size = probe_size;/* Cast away the 'const', as this is just telling the chunk * what transport it belongs to.
@@ -1183,6 +1185,7 @@ struct sctp_chunk *sctp_make_heartbeat(const struct sctp_association *asoc, retval->transport = (struct sctp_transport *) transport; retval->subh.hbs_hdr =sctp_addto_chunk (retval,sizeof (hbinfo), &hbinfo); + retval->pmtu_probe = !!probe_size; nodata:return retval;
net/sctp/sm_statefuns.c +18 -2
@@ -1004,7 +1004,7 @@ static enum sctp_disposition sctp_sf_heartbeat(struct sctp_chunk *reply;/* Send a heartbeat to our peer. */ - reply =sctp_make_heartbeat (asoc, transport); + reply =sctp_make_heartbeat (asoc, transport,0 );if (!reply)return SCTP_DISPOSITION_NOMEM ;
@@ -1104,8 +1104,15 @@ enum sctp_disposition sctp_sf_send_probe(struct net *net, struct sctp_cmd_seq *commands) {struct sctp_transport *transport = (struct sctp_transport *)arg; +struct sctp_chunk *reply; + +if (!sctp_transport_pl_enabled (transport)) +return SCTP_DISPOSITION_CONSUME ; -/* The actual handling will be performed here in a later patch. */ + reply =sctp_make_heartbeat (asoc, transport, transport->pl.probe_size); +if (!reply) +return SCTP_DISPOSITION_NOMEM ; +sctp_add_cmd_sf (commands,SCTP_CMD_REPLY ,SCTP_CHUNK (reply));sctp_add_cmd_sf (commands,SCTP_CMD_PROBE_TIMER_UPDATE ,SCTP_TRANSPORT (transport));
@@ -1260,6 +1267,15 @@ enum sctp_disposition sctp_sf_backbeat_8_3(struct net *net,if (hbinfo->hb_nonce != link->hb_nonce)return SCTP_DISPOSITION_DISCARD ; +if (hbinfo->probe_size) { +if (hbinfo->probe_size != link->pl.probe_size || + !sctp_transport_pl_enabled (link)) +return SCTP_DISPOSITION_DISCARD ; + +/* The actual handling will be performed here in a later patch. */ +return SCTP_DISPOSITION_CONSUME ; + } + max_interval = link->hbinterval + link->rto;/* Check if the timestamp looks valid. */
Signature · 1 line
2.27.0
Xin Long
maintainerPATCH v2 7/14 sctp: do state transition when PROBE_COUNT == MAX_PROBES on HB send path
In reply to Xin LongThe state transition is described in rfc8899#section-5.2, PROBE_COUNT == MAX_PROBES means the probe fails for MAX times, and the state transition includes:
- Base -> Error, occurs when BASE_PLPMTU Confirmation Fails, pl.pmtu is set to SCTP_MIN_PLPMTU,
probe_size is still SCTP_BASE_PLPMTU;
- Search -> Base, occurs when Black Hole Detected, pl.pmtu is set to SCTP_BASE_PLPMTU, probe_size is set back to SCTP_BASE_PLPMTU;
- Search Complete -> Base, occurs when Black Hole Detected pl.pmtu is set to SCTP_BASE_PLPMTU,
probe_size is set back to SCTP_BASE_PLPMTU;
Note a black hole is encountered when a sender is unaware that packets are not being delivered to the destination endpoint. So it includes the probe failures with equal probe_size to pl.pmtu, and definitely not include that with greater probe_size than pl.pmtu. The later one is the normal probe failure where probe_size should decrease back to pl.pmtu and pl.probe_high is set. pl.probe_high would be used on HB ACK recv path in the next patch.
--- include/net/sctp/structs.h | 1 + net/sctp/sm_statefuns.c | 2 ++ net/sctp/transport.c | 44 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+)
include/net/sctp/structs.h +1 -0
@@ -1023,6 +1023,7 @@ bool sctp_transport_update_pmtu(struct sctp_transport *t, u32 pmtu);void sctp_transport_immediate_rtx (struct sctp_transport *);void sctp_transport_dst_release (struct sctp_transport *t);void sctp_transport_dst_confirm (struct sctp_transport *t); +void sctp_transport_pl_send (struct sctp_transport *t);/* This is the structure we use to queue packets as they come into
net/sctp/sm_statefuns.c +2 -0
@@ -1109,6 +1109,8 @@ enum sctp_disposition sctp_sf_send_probe(struct net *net,if (!sctp_transport_pl_enabled (transport))return SCTP_DISPOSITION_CONSUME ; +sctp_transport_pl_send (transport); + reply =sctp_make_heartbeat (asoc, transport, transport->pl.probe_size);if (!reply)return SCTP_DISPOSITION_NOMEM ;
net/sctp/transport.c +44 -0
50 lines not on this page · raw message
Signature · 1 line
2.27.0
Xin Long
maintainerPATCH v2 8/14 sctp: do state transition when a probe succeeds on HB ACK recv path
In reply to Xin LongAs described in rfc8899#section-5.2, when a probe succeeds, there might be the following state transitions:
- Base -> Search, occurs when probe succeeds with BASE_PLPMTU, pl.pmtu is not changing,
pl.probe_size increases by SCTP_PL_BIG_STEP,
- Error -> Search, occurs when probe succeeds with BASE_PLPMTU, pl.pmtu is changed from SCTP_MIN_PLPMTU to SCTP_BASE_PLPMTU, pl.probe_size increases by SCTP_PL_BIG_STEP.
- Search -> Search Complete, occurs when probe succeeds with the probe size SCTP_MAX_PLPMTU less than pl.probe_high,
pl.pmtu is not changing, but update *pathmtu* with it, pl.probe_size is set back to pl.pmtu to double check it.
- Search Complete -> Search, occurs when probe succeeds with the probe size equal to pl.pmtu,
pl.pmtu is not changing,
pl.probe_size increases by SCTP_PL_MIN_STEP.
So search process can be described as:
1. When it just enters 'Search' state, *pathmtu* is not updated with pl.pmtu, and probe_size increases by a big step (SCTP_PL_BIG_STEP) each round.
2. Until pl.probe_high is set when a probe fails, and probe_size decreases back to pl.pmtu, as described in the last patch.
3. When the probe with the new size succeeds, probe_size changes to increase by a small step (SCTP_PL_MIN_STEP) due to pl.probe_high is set.
4. Until probe_size is next to pl.probe_high, the searching finishes and it goes to 'Complete' state and updates *pathmtu* with pl.pmtu, and then probe_size is set to pl.pmtu to confirm by once more probe.
5. This probe occurs after "30 * probe_inteval", a much longer time than that in Search state. Once it is done it goes to 'Search' state again with probe_size increased by SCTP_PL_MIN_STEP.
As we can see above, during the searching, pl.pmtu changes while *pathmtu* doesn't. *pathmtu* is only updated when the search finishes by which it gets an optimal value for it. A big step is used at the beginning until it gets close to the optimal value, then it changes to a small step until it has this optimal value.
The small step is also used in 'Complete' until it goes to 'Search' state again and the probe with 'pmtu + the small step' succeeds, which means a higher size could be used. Then probe_size changes to increase by a big step again until it gets close to the next optimal value.
Note that anytime when black hole is detected, it goes directly to 'Base' state with pl.pmtu set to SCTP_BASE_PLPMTU, as described in the last patch.
--- include/net/sctp/structs.h | 1 + net/sctp/sm_statefuns.c | 2 +- net/sctp/transport.c | 38 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 1 deletion(-)
include/net/sctp/structs.h +1 -0
@@ -1024,6 +1024,7 @@ void sctp_transport_immediate_rtx(struct sctp_transport *);void sctp_transport_dst_release (struct sctp_transport *t);void sctp_transport_dst_confirm (struct sctp_transport *t);void sctp_transport_pl_send (struct sctp_transport *t); +void sctp_transport_pl_recv (struct sctp_transport *t);/* This is the structure we use to queue packets as they come into
net/sctp/sm_statefuns.c +1 -1
@@ -1274,7 +1274,7 @@ enum sctp_disposition sctp_sf_backbeat_8_3(struct net *net, !sctp_transport_pl_enabled(link))return SCTP_DISPOSITION_DISCARD ; -/* The actual handling will be performed here in a later patch. */ +sctp_transport_pl_recv (link);return SCTP_DISPOSITION_CONSUME ; }
net/sctp/transport.c +38 -0
@@ -305,6 +305,44 @@ void sctp_transport_pl_send(struct sctp_transport *t) t->pl.probe_count =1 ; } +void sctp_transport_pl_recv (struct sctp_transport *t) +{ +pr_debug ("%s: PLPMTUD: transport: %p, state: %d, pmtu: %d, size: %d, high: %d\n" , + __func__, t, t->pl.state, t->pl.pmtu, t->pl.probe_size, t->pl.probe_high); + + t->pl.pmtu = t->pl.probe_size; + t->pl.probe_count =0 ; +if (t->pl.state ==SCTP_PL_BASE ) { + t->pl.state =SCTP_PL_SEARCH ;/* Base -> Search */ + t->pl.probe_size +=SCTP_PL_BIG_STEP ; + }else if (t->pl.state ==SCTP_PL_ERROR ) { + t->pl.state =SCTP_PL_SEARCH ;/* Error -> Search */ + + t->pl.pmtu = t->pl.probe_size; + t->pathmtu = t->pl.pmtu +sctp_transport_pl_hlen (t); +sctp_assoc_sync_pmtu (t->asoc); + t->pl.probe_size +=SCTP_PL_BIG_STEP ; + }else if (t->pl.state ==SCTP_PL_SEARCH ) { +if (!t->pl.probe_high) { + t->pl.probe_size =min (t->pl.probe_size +SCTP_PL_BIG_STEP , +SCTP_MAX_PLPMTU ); +return ; + } + t->pl.probe_size +=SCTP_PL_MIN_STEP ; +if (t->pl.probe_size >= t->pl.probe_high) { + t->pl.probe_high =0 ; + t->pl.state =SCTP_PL_COMPLETE ;/* Search -> Search Complete */ + + t->pl.probe_size = t->pl.pmtu; + t->pathmtu = t->pl.pmtu +sctp_transport_pl_hlen (t); +sctp_assoc_sync_pmtu (t->asoc); + } + }else if (t->pl.state ==SCTP_PL_COMPLETE ) { + t->pl.state =SCTP_PL_SEARCH ;/* Search Complete -> Search */ + t->pl.probe_size +=SCTP_PL_MIN_STEP ; + } +} +bool sctp_transport_update_pmtu (struct sctp_transport *t,u32 pmtu) {struct dst_entry *dst =sctp_transport_dst_check (t);
Signature · 1 line
2.27.0
Xin Long
maintainerPATCH v2 9/14 sctp: do state transition when receiving an icmp TOOBIG packet
In reply to Xin LongPLPMTUD will short-circuit the old process for icmp TOOBIG packets. This part is described in rfc8899#section-4.6.2 (PL_PTB_SIZE = PTB_SIZE - other_headers_len). Note that from rfc8899#section-5.2 State Machine, each case below is for some specific states only:
a) PL_PTB_SIZE < MIN_PLPMTU || PL_PTB_SIZE >= PROBED_SIZE, discard it, for any state
b) MIN_PLPMTU < PL_PTB_SIZE < BASE_PLPMTU,
Base -> Error, for Base state
c) BASE_PLPMTU <= PL_PTB_SIZE < PLPMTU,
Search -> Base or Complete -> Base, for Search and Complete states.
d) PLPMTU < PL_PTB_SIZE < PROBED_SIZE,
set pl.probe_size to PL_PTB_SIZE then verify it, for Search state.
The most important one is case d), which will help find the optimal fast during searching. Like when pathmtu = 1392 for SCTP over IPv4, the search will be (20 is iphdr_len):
1. probe with 1200 - 20
2. probe with 1232 - 20
3. probe with 1264 - 20
...
7. probe with 1388 - 20
8. probe with 1420 - 20
When sending the probe with 1420 - 20, TOOBIG may come with PL_PTB_SIZE = 1392 - 20. Then it matches case d), and saves some rounds to try with the 1392 - 20 probe. But of course, PLPMTUD doesn't trust TOOBIG packets, and it will go back to the common searching once the probe with the new size can't be verified.
--- net/sctp/input.c | 4 +++- net/sctp/transport.c | 51 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 53 insertions(+), 2 deletions(-)
net/sctp/input.c +3 -1
@@ -385,7 +385,9 @@ static int sctp_add_backlog(struct sock *sk, struct sk_buff *skb)void sctp_icmp_frag_needed (struct sock *sk,struct sctp_association *asoc,struct sctp_transport *t,__u32 pmtu) { -if (!t || (t->pathmtu <= pmtu)) +if (!t || + (t->pathmtu <= pmtu && + t->pl.probe_size +sctp_transport_pl_hlen (t) <= pmtu))return ;if (sock_owned_by_user (sk)) {
net/sctp/transport.c +50 -1
66 lines not on this page · raw message
Signature · 1 line
2.27.0
Xin Long
maintainerPATCH v2 10/14 sctp: enable PLPMTUD when the transport is ready
In reply to Xin Longsctp_transport_pl_reset() is called whenever any of these 3 members in transport is changed:
- probe_interval
- param_flags & SPP_PMTUD_ENABLE
- state == ACTIVE
If all are true, start the PLPMTUD when it's not yet started. If any of these is false, stop the PLPMTUD when it's already running.
sctp_transport_pl_update() is called when the transport dst has changed. It will restart the PLPMTUD probe. Again, the pathmtu won't change but use the dst's mtu until the Search phase is done.
Note that after using PLPMTUD, the pathmtu is only initialized with the dst mtu when the transport dst changes. At other time it is updated by pl.pmtu. So sctp_transport_pmtu_check() will be called only when PLPMTUD is disabled in sctp_packet_config().
After this patch, the PLPMTUD feature from RFC8899 will be activated and can be used by users.
--- net/sctp/associola.c | 4 ++++ net/sctp/output.c | 3 ++- net/sctp/socket.c | 6 +++++- net/sctp/transport.c | 2 ++ 4 files changed, 13 insertions(+), 2 deletions(-)
net/sctp/associola.c +4 -0
@@ -716,6 +716,8 @@ struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *asoc,return NULL ; } +sctp_transport_pl_reset (peer); +/* Attach the remote transport to our asoc. */ list_add_tail_rcu (&peer->transports, &asoc->peer.transport_addr_list); asoc->peer.transport_count++;
@@ -814,6 +816,7 @@ void sctp_assoc_control_transport(struct sctp_association *asoc, spc_state =SCTP_ADDR_CONFIRMED ; transport->state =SCTP_ACTIVE ; +sctp_transport_pl_reset (transport);break ;case SCTP_TRANSPORT_DOWN :
@@ -823,6 +826,7 @@ void sctp_assoc_control_transport(struct sctp_association *asoc,*/ if (transport->state !=SCTP_UNCONFIRMED ) { transport->state =SCTP_INACTIVE ; +sctp_transport_pl_reset (transport); spc_state =SCTP_ADDR_UNREACHABLE ; }else {sctp_transport_dst_release (transport);
net/sctp/output.c +2 -1
@@ -103,7 +103,8 @@ void sctp_packet_config(struct sctp_packet *packet, __u32 vtag,sctp_transport_route (tp,NULL , sp);if (asoc->param_flags &SPP_PMTUD_ENABLE )sctp_assoc_sync_pmtu (asoc); - }else if (!sctp_transport_pmtu_check (tp)) { + }else if (!sctp_transport_pl_enabled (tp) && + !sctp_transport_pmtu_check (tp)) {if (asoc->param_flags &SPP_PMTUD_ENABLE )sctp_assoc_sync_pmtu (asoc); }
net/sctp/socket.c +5 -1
@@ -2496,6 +2496,7 @@ static int sctp_apply_peer_addr_params(struct sctp_paddrparams *params,sctp_transport_pmtu (trans,sctp_opt2sk (sp));sctp_assoc_sync_pmtu (asoc); } +sctp_transport_pl_reset (trans); }else if (asoc) { asoc->param_flags = (asoc->param_flags & ~SPP_PMTUD ) | pmtud_change;
@@ -4506,6 +4507,7 @@ static int sctp_setsockopt_probe_interval(struct sock *sk,return -EINVAL ; t->probe_interval =msecs_to_jiffies (probe_interval); +sctp_transport_pl_reset (t);return 0 ; }
@@ -4522,8 +4524,10 @@ static int sctp_setsockopt_probe_interval(struct sock *sk,* each transport. */ if (asoc) { -list_for_each_entry (t, &asoc->peer.transport_addr_list, transports) +list_for_each_entry (t, &asoc->peer.transport_addr_list, transports) { t->probe_interval =msecs_to_jiffies (probe_interval); +sctp_transport_pl_reset (t); + } asoc->probe_interval =msecs_to_jiffies (probe_interval);return 0 ;
net/sctp/transport.c +2 -0
@@ -259,6 +259,8 @@ void sctp_transport_pmtu(struct sctp_transport *transport, struct sock *sk) transport->pathmtu =sctp_dst_mtu (transport->dst); else transport->pathmtu = SCTP_DEFAULT_MAXSEGMENT; + +sctp_transport_pl_update (transport); }void sctp_transport_pl_send (struct sctp_transport *t)
Signature · 1 line
2.27.0
Xin Long
maintainerPATCH v2 11/14 sctp: remove the unessessary hold for idev in sctp_v6_err
In reply to Xin LongSame as in tcp_v6_err() and __udp6_lib_err(), there's no need to hold idev in sctp_v6_err(), so just call __in6_dev_get() instead.
--- net/sctp/ipv6.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-)
net/sctp/ipv6.c +2 -10
@@ -126,7 +126,6 @@ static struct notifier_block sctp_inet6addr_notifier = {static int sctp_v6_err (struct sk_buff *skb,struct inet6_skb_parm *opt,u8 type,u8 code,int offset,__be32 info) { -struct inet6_dev *idev;struct sock *sk;struct sctp_association *asoc;struct sctp_transport *transport;
@@ -135,8 +134,6 @@ static int sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,int err, ret =0 ;struct net *net =dev_net (skb->dev); - idev =in6_dev_get (skb->dev); -/* Fix up skb to look at the embedded net header. */ saveip = skb->network_header; savesctp = skb->transport_header;
@@ -147,9 +144,8 @@ static int sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, skb->network_header = saveip; skb->transport_header = savesctp;if (!sk) { -__ICMP6_INC_STATS (net, idev,ICMP6_MIB_INERRORS ); - ret = -ENOENT ; - goto out; +__ICMP6_INC_STATS (net,__in6_dev_get (skb->dev),ICMP6_MIB_INERRORS ); +return -ENOENT ; }/* Warning: The sock lock is held. Remember to call
@@ -185,10 +181,6 @@ static int sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, out_unlock:sctp_err_finish (sk, transport); -out: -if (likely (idev !=NULL )) -in6_dev_put (idev); -return ret; }
Signature · 1 line
2.27.0
Xin Long
maintainerPATCH v2 12/14 sctp: extract sctp_v6_err_handle function from sctp_v6_err
In reply to Xin LongThis patch is to extract sctp_v6_err_handle() from sctp_v6_err() to only handle the icmp err after the sock lookup, and it also makes the code clearer.
sctp_v6_err_handle() will be used in sctp over udp's err handling in the following patch.
--- net/sctp/ipv6.c | 76 ++++++++++++++++++++++++++----------------------- 1 file changed, 40 insertions(+), 36 deletions(-)
net/sctp/ipv6.c +40 -36
@@ -122,50 +122,28 @@ static struct notifier_block sctp_inet6addr_notifier = { .notifier_call = sctp_inet6addr_event, }; -/* ICMP error handler. */ -static int sctp_v6_err (struct sk_buff *skb,struct inet6_skb_parm *opt, -u8 type,u8 code,int offset,__be32 info) +static void sctp_v6_err_handle (struct sctp_transport *t,struct sk_buff *skb, +__u8 type,__u8 code,__u32 info) { -struct sock *sk; -struct sctp_association *asoc; -struct sctp_transport *transport; +struct sctp_association *asoc = t->asoc; +struct sock *sk = asoc->base.sk;struct ipv6_pinfo *np; -__u16 saveip, savesctp; -int err, ret =0 ; -struct net *net =dev_net (skb->dev); - -/* Fix up skb to look at the embedded net header. */ - saveip = skb->network_header; - savesctp = skb->transport_header; -skb_reset_network_header (skb); -skb_set_transport_header (skb, offset); - sk =sctp_err_lookup (net,AF_INET6 , skb,sctp_hdr (skb), &asoc, &transport); -/* Put back, the original pointers. */ - skb->network_header = saveip; - skb->transport_header = savesctp; -if (!sk) { -__ICMP6_INC_STATS (net,__in6_dev_get (skb->dev),ICMP6_MIB_INERRORS ); -return -ENOENT ; - } - -/* Warning: The sock lock is held. Remember to call -* sctp_err_finish! -*/ +int err =0 ;switch (type) {case ICMPV6_PKT_TOOBIG :if (ip6_sk_accept_pmtu (sk)) -sctp_icmp_frag_needed (sk, asoc, transport,ntohl (info)); - goto out_unlock; +sctp_icmp_frag_needed (sk, asoc, t, info); +return ;case ICMPV6_PARAMPROB :if (ICMPV6_UNK_NEXTHDR == code) { -sctp_icmp_proto_unreachable (sk, asoc, transport); - goto out_unlock; +sctp_icmp_proto_unreachable (sk, asoc, t); +return ; }break ;case NDISC_REDIRECT : -sctp_icmp_redirect (sk, transport, skb); - goto out_unlock; +sctp_icmp_redirect (sk, t, skb); +return ;default :break ; }
@@ -175,13 +153,39 @@ static int sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,if (!sock_owned_by_user (sk) && np->recverr) { sk->sk_err = err; sk->sk_error_report (sk); - }else {/* Only an error on timeout */ + }else { sk->sk_err_soft = err; } +} + +/* ICMP error handler. */ +static int sctp_v6_err (struct sk_buff *skb,struct inet6_skb_parm *opt, +u8 type,u8 code,int offset,__be32 info) +{ +struct net *net =dev_net (skb->dev); +struct sctp_transport *transport; +struct sctp_association *asoc; +__u16 saveip, savesctp; +struct sock *sk; + +/* Fix up skb to look at the embedded net header. */ + saveip = skb->network_header; + savesctp = skb->transport_header; +skb_reset_network_header (skb); +skb_set_transport_header (skb, offset); + sk =sctp_err_lookup (net,AF_INET6 , skb,sctp_hdr (skb), &asoc, &transport); +/* Put back, the original pointers. */ + skb->network_header = saveip; + skb->transport_header = savesctp; +if (!sk) { +__ICMP6_INC_STATS (net,__in6_dev_get (skb->dev),ICMP6_MIB_INERRORS ); +return -ENOENT ; + } -out_unlock: +sctp_v6_err_handle (transport, skb, type, code,ntohl (info));sctp_err_finish (sk, transport); -return ret; + +return 0 ; }static int sctp_v6_xmit (struct sk_buff *skb,struct sctp_transport *t)
Signature · 1 line
2.27.0
Xin Long
maintainerPATCH v2 13/14 sctp: extract sctp_v4_err_handle function from sctp_v4_err
In reply to Xin LongThis patch is to extract sctp_v4_err_handle() from sctp_v4_err() to only handle the icmp err after the sock lookup, and it also makes the code clearer.
sctp_v4_err_handle() will be used in sctp over udp's err handling in the following patch.
--- net/sctp/input.c | 106 ++++++++++++++++++++++------------------------- 1 file changed, 49 insertions(+), 57 deletions(-)
net/sctp/input.c +49 -57
@@ -556,6 +556,49 @@ void sctp_err_finish(struct sock *sk, struct sctp_transport *t)sctp_transport_put (t); } +static void sctp_v4_err_handle (struct sctp_transport *t,struct sk_buff *skb, +__u8 type,__u8 code,__u32 info) +{ +struct sctp_association *asoc = t->asoc; +struct sock *sk = asoc->base.sk; +int err =0 ; + +switch (type) { +case ICMP_PARAMETERPROB : + err =EPROTO ; +break ; +case ICMP_DEST_UNREACH : +if (code >NR_ICMP_UNREACH ) +return ; +if (code ==ICMP_FRAG_NEEDED ) { +sctp_icmp_frag_needed (sk, asoc, t,SCTP_TRUNC4 (info)); +return ; + } +if (code ==ICMP_PROT_UNREACH ) { +sctp_icmp_proto_unreachable (sk, asoc, t); +return ; + } + err = icmp_err_convert[code].errno; +break ; +case ICMP_TIME_EXCEEDED : +if (code ==ICMP_EXC_FRAGTIME ) +return ; + + err =EHOSTUNREACH ; +break ; +case ICMP_REDIRECT : +sctp_icmp_redirect (sk, t, skb); +default : +return ; + } +if (!sock_owned_by_user (sk) &&inet_sk (sk)->recverr) { + sk->sk_err = err; + sk->sk_error_report (sk); + }else {/* Only an error on timeout */ + sk->sk_err_soft = err; + } +} +/* * This routine is called by the ICMP module when it gets some * sort of error condition. If err < 0 then the socket should
@@ -574,22 +617,19 @@ void sctp_err_finish(struct sock *sk, struct sctp_transport *t)int sctp_v4_err (struct sk_buff *skb,__u32 info) {const struct iphdr *iph = (const struct iphdr *)skb->data; -const int ihlen = iph->ihl *4 ;const int type =icmp_hdr (skb)->type;const int code =icmp_hdr (skb)->code; -struct sock *sk; -struct sctp_association *asoc =NULL ; +struct net *net =dev_net (skb->dev);struct sctp_transport *transport; -struct inet_sock *inet; +struct sctp_association *asoc;__u16 saveip, savesctp; -int err; -struct net *net =dev_net (skb->dev); +struct sock *sk;/* Fix up skb to look at the embedded net header. */ saveip = skb->network_header; savesctp = skb->transport_header;skb_reset_network_header (skb); -skb_set_transport_header (skb, ihlen); +skb_set_transport_header (skb, iph->ihl *4 ); sk =sctp_err_lookup (net,AF_INET , skb,sctp_hdr (skb), &asoc, &transport);/* Put back, the original values. */ skb->network_header = saveip;
@@ -598,58 +638,10 @@ int sctp_v4_err(struct sk_buff *skb, __u32 info)__ICMP_INC_STATS (net,ICMP_MIB_INERRORS );return -ENOENT ; } -/* Warning: The sock lock is held. Remember to call -* sctp_err_finish! -*/ -switch (type) { -case ICMP_PARAMETERPROB : - err =EPROTO ; -break ; -case ICMP_DEST_UNREACH : -if (code >NR_ICMP_UNREACH ) - goto out_unlock; - -/* PMTU discovery (RFC1191) */ -if (ICMP_FRAG_NEEDED == code) { -sctp_icmp_frag_needed (sk, asoc, transport, -SCTP_TRUNC4 (info)); - goto out_unlock; - }else { -if (ICMP_PROT_UNREACH == code) { -sctp_icmp_proto_unreachable (sk, asoc, - transport); - goto out_unlock; - } - } - err = icmp_err_convert[code].errno; -break ; -case ICMP_TIME_EXCEEDED : -/* Ignore any time exceeded errors due to fragment reassembly -* timeouts. -*/ -if (ICMP_EXC_FRAGTIME == code) - goto out_unlock; - - err =EHOSTUNREACH ; -break ; -case ICMP_REDIRECT : -sctp_icmp_redirect (sk, transport, skb); -/* Fall through to out_unlock. */ -default : - goto out_unlock; - } - - inet =inet_sk (sk); -if (!sock_owned_by_user (sk) && inet->recverr) { - sk->sk_err = err; - sk->sk_error_report (sk); - }else {/* Only an error on timeout */ - sk->sk_err_soft = err; - } - -out_unlock: +sctp_v4_err_handle (transport, skb, type, code, info);sctp_err_finish (sk, transport); +return 0 ; }
Signature · 1 line
2.27.0
Xin Long
maintainerPATCH v2 14/14 sctp: process sctp over udp icmp err on sctp side
In reply to Xin LongPreviously, sctp over udp was using udp tunnel's icmp err process, which only does sk lookup on sctp side. However for sctp's icmp error process, there are more things to do, like syncing assoc pmtu/retransmit packets for toobig type err, and starting proto_unreach_timer for unreach type err etc.
Now after adding PLPMTUD, which also requires to process toobig type err on sctp side. This patch is to process icmp err on sctp side by parsing the type/code/info in .encap_err_lookup and call sctp's icmp processing functions. Note as the 'redirect' err process needs to know the outer ip(v6) header's, we have to leave it to udp(v6)_err to handle it.
--- include/net/sctp/sctp.h | 2 ++ net/sctp/input.c | 30 ++++++++++++++++++++++++++++++ net/sctp/ipv6.c | 30 ++++++++++++++++++++++++++++++ net/sctp/protocol.c | 21 ++------------------- 4 files changed, 64 insertions(+), 19 deletions(-)
include/net/sctp/sctp.h +2 -0
@@ -145,6 +145,8 @@ struct sock *sctp_err_lookup(struct net *net, int family, struct sk_buff *, struct sctphdr *, struct sctp_association **, struct sctp_transport **);void sctp_err_finish (struct sock *,struct sctp_transport *); +int sctp_udp_v4_err (struct sock *sk,struct sk_buff *skb); +int sctp_udp_v6_err (struct sock *sk,struct sk_buff *skb);void sctp_icmp_frag_needed (struct sock *,struct sctp_association *,struct sctp_transport *t,__u32 pmtu); void sctp_icmp_redirect(struct sock *, struct sctp_transport *,
net/sctp/input.c +30 -0
@@ -645,6 +645,36 @@ int sctp_v4_err(struct sk_buff *skb, __u32 info)return 0 ; } +int sctp_udp_v4_err (struct sock *sk,struct sk_buff *skb) +{ +struct net *net =dev_net (skb->dev); +struct sctp_association *asoc; +struct sctp_transport *t; +struct icmphdr *hdr; +__u32 info =0 ; + + skb->transport_header +=sizeof (struct udphdr ); + sk =sctp_err_lookup (net,AF_INET , skb,sctp_hdr (skb), &asoc, &t); +if (!sk) { +__ICMP_INC_STATS (net,ICMP_MIB_INERRORS ); +return -ENOENT ; + } + + skb->transport_header -=sizeof (struct udphdr ); + hdr = (struct icmphdr *)(skb_network_header (skb) -sizeof (struct icmphdr )); +if (hdr->type ==ICMP_REDIRECT ) { +/* can't be handled without outer iphdr known, leave it to udp_err */ +sctp_err_finish (sk, t); +return 0 ; + } +if (hdr->type ==ICMP_DEST_UNREACH && hdr->code ==ICMP_FRAG_NEEDED ) + info =ntohs (hdr->un.frag.mtu); +sctp_v4_err_handle (t, skb, hdr->type, hdr->code, info); + +sctp_err_finish (sk, t); +return 1 ; +} +/* * RFC 2960, 8.4 - Handle "Out of the blue" Packets. *
net/sctp/ipv6.c +30 -0
@@ -188,6 +188,36 @@ static int sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,return 0 ; } +int sctp_udp_v6_err (struct sock *sk,struct sk_buff *skb) +{ +struct net *net =dev_net (skb->dev); +struct sctp_association *asoc; +struct sctp_transport *t; +struct icmp6hdr *hdr; +__u32 info =0 ; + + skb->transport_header +=sizeof (struct udphdr ); + sk =sctp_err_lookup (net,AF_INET6 , skb,sctp_hdr (skb), &asoc, &t); +if (!sk) { +__ICMP6_INC_STATS (net,__in6_dev_get (skb->dev),ICMP6_MIB_INERRORS ); +return -ENOENT ; + } + + skb->transport_header -=sizeof (struct udphdr ); + hdr = (struct icmp6hdr *)(skb_network_header (skb) -sizeof (struct icmp6hdr )); +if (hdr->icmp6_type ==NDISC_REDIRECT ) { +/* can't be handled without outer ip6hdr known, leave it to udpv6_err */ +sctp_err_finish (sk, t); +return 0 ; + } +if (hdr->icmp6_type ==ICMPV6_PKT_TOOBIG ) + info =ntohl (hdr->icmp6_mtu); +sctp_v6_err_handle (t, skb, hdr->icmp6_type, hdr->icmp6_code, info); + +sctp_err_finish (sk, t); +return 1 ; +} +static int sctp_v6_xmit (struct sk_buff *skb,struct sctp_transport *t) {struct dst_entry *dst =dst_clone (t->dst);
net/sctp/protocol.c +2 -19
@@ -850,23 +850,6 @@ static int sctp_udp_rcv(struct sock *sk, struct sk_buff *skb)return 0 ; } -static int sctp_udp_err_lookup (struct sock *sk,struct sk_buff *skb) -{ -struct sctp_association *asoc; -struct sctp_transport *t; -int family; - - skb->transport_header +=sizeof (struct udphdr ); - family = (ip_hdr (skb)->version ==4 ) ?AF_INET :AF_INET6 ; - sk =sctp_err_lookup (dev_net (skb->dev), family, skb,sctp_hdr (skb), - &asoc, &t); -if (!sk) -return -ENOENT ; - -sctp_err_finish (sk, t); -return 0 ; -} -int sctp_udp_sock_start (struct net *net) {struct udp_tunnel_sock_cfg tuncfg = {NULL };
@@ -885,7 +868,7 @@ int sctp_udp_sock_start(struct net *net) tuncfg.encap_type =1 ; tuncfg.encap_rcv = sctp_udp_rcv; - tuncfg.encap_err_lookup = sctp_udp_err_lookup; + tuncfg.encap_err_lookup = sctp_udp_v4_err;setup_udp_tunnel_sock (net, sock, &tuncfg); net->sctp.udp4_sock = sock->sk;
@@ -907,7 +890,7 @@ int sctp_udp_sock_start(struct net *net) tuncfg.encap_type =1 ; tuncfg.encap_rcv = sctp_udp_rcv; - tuncfg.encap_err_lookup = sctp_udp_err_lookup; + tuncfg.encap_err_lookup = sctp_udp_v6_err;setup_udp_tunnel_sock (net, sock, &tuncfg); net->sctp.udp6_sock = sock->sk;#endif
Signature · 1 line
2.27.0
This series was applied to netdev/net-next.git (refs/heads/master):
Hello:
This series was applied to netdev/net-next.git (refs/heads/master):
Quoted 9 lines · On Tue, 22 Jun 2021 14:04:46 -0400 you wrote:
Overview(From RFC8899):
In contrast to PMTUD, Packetization Layer Path MTU Discovery (PLPMTUD) [RFC4821] introduces a method that does not rely upon reception and validation of PTB messages. It is therefore more robust than Classical PMTUD. This has become the recommended approach for implementing discovery of the PMTU [BCP145].
[...]
Here is the summary with links:
- [PATCHv2,net-next,01/14] sctp: add pad chunk and its make function and event table
https://git.kernel.org/netdev/net-next/c/745a32117b5a - [PATCHv2,net-next,02/14] sctp: add probe_interval in sysctl and sock/asoc/transport https://git.kernel.org/netdev/net-next/c/d1e462a7a5f3 - [PATCHv2,net-next,03/14] sctp: add SCTP_PLPMTUD_PROBE_INTERVAL sockopt for sock/asoc/transport https://git.kernel.org/netdev/net-next/c/3190b649b4d9 - [PATCHv2,net-next,04/14] sctp: add the constants/variables and states and some APIs for transport https://git.kernel.org/netdev/net-next/c/d9e2e410ae30 - [PATCHv2,net-next,05/14] sctp: add the probe timer in transport for PLPMTUD https://git.kernel.org/netdev/net-next/c/92548ec2f1f9 - [PATCHv2,net-next,06/14] sctp: do the basic send and recv for PLPMTUD probe https://git.kernel.org/netdev/net-next/c/fe59379b9ab7 - [PATCHv2,net-next,07/14] sctp: do state transition when PROBE_COUNT == MAX_PROBES on HB send path https://git.kernel.org/netdev/net-next/c/1dc68c194571 - [PATCHv2,net-next,08/14] sctp: do state transition when a probe succeeds on HB ACK recv path https://git.kernel.org/netdev/net-next/c/b87641aff9e7 - [PATCHv2,net-next,09/14] sctp: do state transition when receiving an icmp TOOBIG packet https://git.kernel.org/netdev/net-next/c/836964083177 - [PATCHv2,net-next,10/14] sctp: enable PLPMTUD when the transport is ready https://git.kernel.org/netdev/net-next/c/7307e4fa4d29 - [PATCHv2,net-next,11/14] sctp: remove the unessessary hold for idev in sctp_v6_err https://git.kernel.org/netdev/net-next/c/237a6a2e318c - [PATCHv2,net-next,12/14] sctp: extract sctp_v6_err_handle function from sctp_v6_err https://git.kernel.org/netdev/net-next/c/f6549bd37b92 - [PATCHv2,net-next,13/14] sctp: extract sctp_v4_err_handle function from sctp_v4_err https://git.kernel.org/netdev/net-next/c/d83060759a65 - [PATCHv2,net-next,14/14] sctp: process sctp over udp icmp err on sctp side https://git.kernel.org/netdev/net-next/c/9e47df005cab
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
From: Xin Long
Quoted 10 lines
Sent: 22 June 2021 19:05
Overview(From RFC8899):
In contrast to PMTUD, Packetization Layer Path MTU Discovery (PLPMTUD) [RFC4821] introduces a method that does not rely upon reception and validation of PTB messages. It is therefore more robust than Classical PMTUD. This has become the recommended approach for implementing discovery of the PMTU [BCP145].
Quoted 8 lines
It uses a general strategy in which the PL sends probe packets to search for the largest size of unfragmented datagram that can be sent over a network path. Probe packets are sent to explore using a larger packet size. If a probe packet is successfully delivered (as determined by the PL), then the PLPMTU is raised to the size of the successful probe. If a black hole is detected (e.g., where packets of size PLPMTU are consistently not received), the method reduces the PLPMTU.
This seems to take a long time (probably well over a minute) to determine the mtu.
What is used for the actual mtu while this is in progress?
Does packet loss and packet retransmission cause the mtu to be reduced as well?
I can imagine that there is an expectation (from the application) that the mtu is that of an ethernet link - perhaps less a PPPoE header.
Starting with an mtu of 1200 will break this assumption and may have odd side effects.
For TCP/UDP the ICMP segmentation required error is immediate and gets used for the retransmissions.
This code seems to be looking at separate timeouts - so a lot of packets could get discarded and application timers expire before if determines the correct mtu.
Maybe I missed something about this only being done on inactive paths?
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)
Xin Long
maintainerQuoted 21 lines · David Laight
From: Xin Long
Quoted 10 lines
Sent: 22 June 2021 19:05
Overview(From RFC8899):
In contrast to PMTUD, Packetization Layer Path MTU Discovery (PLPMTUD) [RFC4821] introduces a method that does not rely upon reception and validation of PTB messages. It is therefore more robust than Classical PMTUD. This has become the recommended approach for implementing discovery of the PMTU [BCP145].
Quoted 8 lines
It uses a general strategy in which the PL sends probe packets to search for the largest size of unfragmented datagram that can be sent over a network path. Probe packets are sent to explore using a larger packet size. If a probe packet is successfully delivered (as determined by the PL), then the PLPMTU is raised to the size of the successful probe. If a black hole is detected (e.g., where packets of size PLPMTU are consistently not received), the method reduces the PLPMTU.
Quoted 2 lines
This seems to take a long time (probably well over a minute) to determine the mtu.
I just noticed this is a misread of RFC8899, and the next probe packet should be sent immediately once the ACK of the last probe is received, instead of waiting the timeout, which should be for the missing probe.
I will fix this with:
net/sctp/sm_statefuns.c +0 -0
@@ -1275,6 +1275,8 @@ enum sctp_disposition
sctp_sf_backbeat_8_3(struct net *net,
return SCTP_DISPOSITION_DISCARD;
sctp_transport_pl_recv(link);
+ sctp_add_cmd_sf(commands, SCTP_CMD_PROBE_TIMER_UPDATE,
+ SCTP_TRANSPORT(link));
return SCTP_DISPOSITION_CONSUME;
}net/sctp/transport.c +0 -0
@@ -215,6 +215,11 @@ void sctp_transport_reset_probe_timer(struct
sctp_transport *transport)
{
int scale = 1;+ if (transport->pl.probe_count == 0) {
+ if (!mod_timer(&transport->probe_timer, jiffies +transport->rto))
+ sctp_transport_hold(transport);
+ return;
+ }
if (timer_pending(&transport->probe_timer))
return;
if (transport->pl.state == SCTP_PL_COMPLETE &&Thanks for the comment.
Quoted 5 lines
What is used for the actual mtu while this is in progress?
Does packet loss and packet retransmission cause the mtu to be reduced as well?
No, the data packet is not a probe in this implementation.
Quoted 6 lines
I can imagine that there is an expectation (from the application) that the mtu is that of an ethernet link - perhaps less a PPPoE header.
Starting with an mtu of 1200 will break this assumption and may have odd side effects.
Starting searching from mtu of 1200, but the real pmtu will only be updated when the search is done and optimal mtu is found.
So at the beginning, it will still use the dst mtu as before.
Quoted 5 lines
For TCP/UDP the ICMP segmentation required error is immediate and gets used for the retransmissions.
This code seems to be looking at separate timeouts - so a lot of packets could get discarded and application timers expire before if determines the correct mtu.
This patch will also process ICMP error msg, and gets the 'mtu' size from it but before using it, it will verify(probe) it first:
see Patch: sctp: do state transition when receiving an icmp TOOBIG packet
Quoted 10 lines
Maybe I missed something about this only being done on inactive paths?
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)
Xin Long
maintainerQuoted 64 lines · Xin Long
Quoted 21 lines · David Laight
From: Xin Long
Quoted 10 lines
Sent: 22 June 2021 19:05
Overview(From RFC8899):
In contrast to PMTUD, Packetization Layer Path MTU Discovery (PLPMTUD) [RFC4821] introduces a method that does not rely upon reception and validation of PTB messages. It is therefore more robust than Classical PMTUD. This has become the recommended approach for implementing discovery of the PMTU [BCP145].
Quoted 8 lines
It uses a general strategy in which the PL sends probe packets to search for the largest size of unfragmented datagram that can be sent over a network path. Probe packets are sent to explore using a larger packet size. If a probe packet is successfully delivered (as determined by the PL), then the PLPMTU is raised to the size of the successful probe. If a black hole is detected (e.g., where packets of size PLPMTU are consistently not received), the method reduces the PLPMTU.
Quoted 2 lines
This seems to take a long time (probably well over a minute) to determine the mtu.
I just noticed this is a misread of RFC8899, and the next probe packet should be sent immediately once the ACK of the last probe is received, instead of waiting the timeout, which should be for the missing probe.
I will fix this with:
net/sctp/sm_statefuns.c +2
-0@@ -1275,6 +1275,8 @@ enum sctp_disposition sctp_sf_backbeat_8_3(struct net *net, return SCTP_DISPOSITION_DISCARD;sctp_transport_pl_recv (link); +sctp_add_cmd_sf (commands,SCTP_CMD_PROBE_TIMER_UPDATE , +SCTP_TRANSPORT (link));return SCTP_DISPOSITION_CONSUME ; }net/sctp/transport.c +5
-0@@ -215,6 +215,11 @@ void sctp_transport_reset_probe_timer(struct sctp_transport *transport) {int scale =1 ; +if (transport->pl.probe_count ==0 ) { +if (!mod_timer (&transport->probe_timer, jiffies + transport->rto)) +sctp_transport_hold (transport); +return ; + }if (timer_pending (&transport->probe_timer))return; if (transport->pl.state == SCTP_PL_COMPLETE &&
Quoted 1 line
Thanks for the comment.
A more efficient improvement:
net/sctp/sm_statefuns.c +0 -0
@@ -1275,7 +1275,13 @@ enum sctp_disposition
sctp_sf_backbeat_8_3(struct net *net,
return SCTP_DISPOSITION_DISCARD;
sctp_transport_pl_recv(link);- return SCTP_DISPOSITION_CONSUME;
+
+ if (link->pl.state == SCTP_PL_COMPLETE) {
+ sctp_add_cmd_sf(commands, SCTP_CMD_PROBE_TIMER_UPDATE,
+ SCTP_TRANSPORT(link));
+ return SCTP_DISPOSITION_CONSUME;
+ }
+ return sctp_sf_send_probe(net, ep, asoc, type, link, commands);
}
max_interval = link->hbinterval + link->rto;net/sctp/transport.c +0 -0
@@ -215,10 +215,8 @@ void sctp_transport_reset_probe_timer(struct
sctp_transport *transport)
{
int scale = 1;- if (timer_pending(&transport->probe_timer))
- return;
if (transport->pl.state == SCTP_PL_COMPLETE &&
- transport->pl.probe_count == 1)
+ transport->pl.probe_count == 0)
scale = 30; /* works as PMTU_RAISE_TIMER */
if (!mod_timer(&transport->probe_timer,
jiffies + transport->probe_interval * scale))[103] pl_send: PLPMTUD: state: 1, size: 1200, high: 0 <--[a]
[103] pl_recv: PLPMTUD: state: 1, size: 1200, high: 0
[103] pl_send: PLPMTUD: state: 2, size: 1232, high: 0
[103] pl_recv: PLPMTUD: state: 2, size: 1232, high: 0
[103] pl_send: PLPMTUD: state: 2, size: 1264, high: 0
[103] pl_recv: PLPMTUD: state: 2, size: 1264, high: 0
[103] pl_send: PLPMTUD: state: 2, size: 1296, high: 0
[103] pl_recv: PLPMTUD: state: 2, size: 1296, high: 0
[103] pl_send: PLPMTUD: state: 2, size: 1328, high: 0
[103] pl_recv: PLPMTUD: state: 2, size: 1328, high: 0
[103] pl_send: PLPMTUD: state: 2, size: 1360, high: 0
[103] pl_recv: PLPMTUD: state: 2, size: 1360, high: 0
[103] pl_send: PLPMTUD: state: 2, size: 1392, high: 0
[103] pl_recv: PLPMTUD: state: 2, size: 1392, high: 0
[103] pl_send: PLPMTUD: state: 2, size: 1424, high: 0
[103] pl_recv: PLPMTUD: state: 2, size: 1424, high: 0
[103] pl_send: PLPMTUD: state: 2, size: 1456, high: 0
[103] pl_recv: PLPMTUD: state: 2, size: 1456, high: 0 <--[b]
[103] pl_send: PLPMTUD: state: 2, size: 1488, high: 0
[108] pl_send: PLPMTUD: state: 2, size: 1488, high: 0
[113] pl_send: PLPMTUD: state: 2, size: 1488, high: 0
[118] pl_send: PLPMTUD: state: 2, size: 1488, high: 0
[118] pl_recv: PLPMTUD: state: 2, size: 1456, high: 1488 <---[c]
[118] pl_send: PLPMTUD: state: 2, size: 1460, high: 1488
[118] pl_recv: PLPMTUD: state: 2, size: 1460, high: 1488 <--- [d]
[118] pl_send: PLPMTUD: state: 2, size: 1464, high: 1488
[124] pl_send: PLPMTUD: state: 2, size: 1464, high: 1488
[129] pl_send: PLPMTUD: state: 2, size: 1464, high: 1488
[134] pl_send: PLPMTUD: state: 2, size: 1464, high: 1488
[134] pl_recv: PLPMTUD: state: 2, size: 1460, high: 1464 <-- around 30s "search complete from 1200 bytes"
[287] pl_send: PLPMTUD: state: 3, size: 1460, high: 0
[287] pl_recv: PLPMTUD: state: 3, size: 1460, high: 0
[287] pl_send: PLPMTUD: state: 2, size: 1464, high: 0 <-- [aa]
[292] pl_send: PLPMTUD: state: 2, size: 1464, high: 0
[298] pl_send: PLPMTUD: state: 2, size: 1464, high: 0
[303] pl_send: PLPMTUD: state: 2, size: 1464, high: 0
[303] pl_recv: PLPMTUD: state: 2, size: 1460, high: 1464 <--[bb] <-- around 15s "re-search complete from current pmtu"
So since no interval to send the next probe when the ACK is received for the last one,
it won't take much time from [a] to [b], and [c] to [d], and there are at most 2 failures to find the right pmtu, each failure takes 5s * 3 = 15s.
when it goes back to search from search complete after a long timeout, it will take only 1 failure to get the right pmtu from [aa] to [bb].
Thanks.
Quoted 37 lines
Quoted 5 lines
What is used for the actual mtu while this is in progress?
Does packet loss and packet retransmission cause the mtu to be reduced as well?
No, the data packet is not a probe in this implementation.
Quoted 6 lines
I can imagine that there is an expectation (from the application) that the mtu is that of an ethernet link - perhaps less a PPPoE header.
Starting with an mtu of 1200 will break this assumption and may have odd side effects.Starting searching from mtu of 1200, but the real pmtu will only be updated when the search is done and optimal mtu is found.
So at the beginning, it will still use the dst mtu as before.Quoted 5 lines
For TCP/UDP the ICMP segmentation required error is immediate and gets used for the retransmissions.
This code seems to be looking at separate timeouts - so a lot of packets could get discarded and application timers expire before if determines the correct mtu.This patch will also process ICMP error msg, and gets the 'mtu' size from it but before using it, it will verify(probe) it first:
see Patch: sctp: do state transition when receiving an icmp TOOBIG packet
Quoted 10 lines
Maybe I missed something about this only being done on inactive paths?
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)
From: Xin Long
Quoted 1 line
Sent: 23 June 2021 04:49
...
Quoted 2 lines
[103]
pl_send: PLPMTUD: state: 1, size: 1200, high: 0 <--[a]
[103]pl_recv: PLPMTUD: state: 1, size: 1200, high: 0
...
Quoted 24 lines
[103]
pl_send: PLPMTUD: state: 2, size: 1456, high: 0
[103]pl_recv: PLPMTUD: state: 2, size: 1456, high: 0 <--[b]
[103]pl_send: PLPMTUD: state: 2, size: 1488, high: 0
[108]pl_send: PLPMTUD: state: 2, size: 1488, high: 0
[113]pl_send: PLPMTUD: state: 2, size: 1488, high: 0
[118]pl_send: PLPMTUD: state: 2, size: 1488, high: 0
[118]pl_recv: PLPMTUD: state: 2, size: 1456, high: 1488 <---[c]
[118]pl_send: PLPMTUD: state: 2, size: 1460, high: 1488
[118]pl_recv: PLPMTUD: state: 2, size: 1460, high: 1488 <--- [d]
[118]pl_send: PLPMTUD: state: 2, size: 1464, high: 1488
[124]pl_send: PLPMTUD: state: 2, size: 1464, high: 1488
[129]pl_send: PLPMTUD: state: 2, size: 1464, high: 1488
[134]pl_send: PLPMTUD: state: 2, size: 1464, high: 1488
[134]pl_recv: PLPMTUD: state: 2, size: 1460, high: 1464 <-- around 30s "search complete from 1200 bytes"
[287]pl_send: PLPMTUD: state: 3, size: 1460, high: 0
[287]pl_recv: PLPMTUD: state: 3, size: 1460, high: 0
[287]pl_send: PLPMTUD: state: 2, size: 1464, high: 0 <-- [aa]
[292]pl_send: PLPMTUD: state: 2, size: 1464, high: 0
[298]pl_send: PLPMTUD: state: 2, size: 1464, high: 0
[303]pl_send: PLPMTUD: state: 2, size: 1464, high: 0
[303]pl_recv: PLPMTUD: state: 2, size: 1460, high: 1464 <--[bb] <-- around 15s "re-search complete from current pmtu"
Quoted 8 lines
So since no interval to send the next probe when the ACK is received for the last one,
it won't take much time from [a] to [b], and [c] to [d], and there are at most 2 failures to find the right pmtu, each failure takes 5s * 3 = 15s.when it goes back to search from search complete after a long timeout, it will take only 1 failure to get the right pmtu from [aa] to [bb].
What mtu is being used during the 'failures' ?
I hope it is the last working one.
Also, what actually happen if the network route changes from one that supports 1460 bytes to one that only supports 1200 and where ICMP errors are not generated?
The first protocol retry is (probably) after 2 seconds. But it will use the 1460 byte mtu and fail again.
Notwithstanding the standards, what pmtu actually exist 'in the wild' for normal networks?
Are there actually any others apart from 'full sized ethernet' and 'PPPoE'?
So would it actually better to send two probes one for each of those two sizes and see which ones respond?
(I'm not sure we ever manage to send full length packets. Our data is M3UA (mostly SMS) and sent with Nagle disabled. So even the customers sending 1000s of SMS/sec are unlikely to fill packets.)
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)
Xin Long
maintainerQuoted 37 lines · David Laight
From: Xin Long
Quoted 1 line
Sent: 23 June 2021 04:49
...
Quoted 2 lines
[103]
pl_send: PLPMTUD: state: 1, size: 1200, high: 0 <--[a]
[103]pl_recv: PLPMTUD: state: 1, size: 1200, high: 0...
Quoted 30 lines
[103]
pl_send: PLPMTUD: state: 2, size: 1456, high: 0
[103]pl_recv: PLPMTUD: state: 2, size: 1456, high: 0 <--[b]
[103]pl_send: PLPMTUD: state: 2, size: 1488, high: 0
[108]pl_send: PLPMTUD: state: 2, size: 1488, high: 0
[113]pl_send: PLPMTUD: state: 2, size: 1488, high: 0
[118]pl_send: PLPMTUD: state: 2, size: 1488, high: 0
[118]pl_recv: PLPMTUD: state: 2, size: 1456, high: 1488 <---[c]
[118]pl_send: PLPMTUD: state: 2, size: 1460, high: 1488
[118]pl_recv: PLPMTUD: state: 2, size: 1460, high: 1488 <--- [d]
[118]pl_send: PLPMTUD: state: 2, size: 1464, high: 1488
[124]pl_send: PLPMTUD: state: 2, size: 1464, high: 1488
[129]pl_send: PLPMTUD: state: 2, size: 1464, high: 1488
[134]pl_send: PLPMTUD: state: 2, size: 1464, high: 1488
[134]pl_recv: PLPMTUD: state: 2, size: 1460, high: 1464 <-- around 30s "search complete from 1200 bytes"
[287]pl_send: PLPMTUD: state: 3, size: 1460, high: 0
[287]pl_recv: PLPMTUD: state: 3, size: 1460, high: 0
[287]pl_send: PLPMTUD: state: 2, size: 1464, high: 0 <-- [aa]
[292]pl_send: PLPMTUD: state: 2, size: 1464, high: 0
[298]pl_send: PLPMTUD: state: 2, size: 1464, high: 0
[303]pl_send: PLPMTUD: state: 2, size: 1464, high: 0
[303]pl_recv: PLPMTUD: state: 2, size: 1460, high: 1464 <--[bb] <-- around 15s "re-search complete from current pmtu"So since no interval to send the next probe when the ACK is received for the last one,
it won't take much time from [a] to [b], and [c] to [d], and there are at most 2 failures to find the right pmtu, each failure takes 5s * 3 = 15s.
Quoted 5 lines
Quoted 2 lines
when it goes back to search from search complete after a long timeout, it will take only 1 failure to get the right pmtu from [aa] to [bb].
What mtu is being used during the 'failures' ?
I hope it is the last working one.
Yes, it's always the working one, which was set in search complete state. More specifically, it changes in 3 cases:
a) at the beginning, it's using the dst->mtu;
b) set to the optimal one in search complete state after searching is done.
c) 'black hole' found, it sets to 1200, and starts to probe from 1200.
d) if still fails with 1200, the mtu is set to MIN_PLPMTU, but still probes with 1200 until it succeeds.
Quoted 4 lines
Also, what actually happen if the network route changes from one that supports 1460 bytes to one that only supports 1200 and where ICMP errors are not generated?
then it's the case c) and d) above.
For the "black hole" detection, I'd like to probe it with the current mtu and 3 times (15s in total)
Quoted 3 lines
The first protocol retry is (probably) after 2 seconds. But it will use the 1460 byte mtu and fail again.
yeah, but 15s is the time we have to wait for confirming this is caused by really the mtu change.
Quoted 3 lines
Notwithstanding the standards, what pmtu actually exist 'in the wild' for normal networks?
PLPMTUD is trying to probe the max payload of SCTP, not the real pmtu.
Quoted 2 lines
Are there actually any others apart from 'full sized ethernet' and 'PPPoE'?
sctp over UDP if that's what you mean.
With the probe, we don't really care about the outer header, because what we get with the probe is the real available size for sctp payload.
Like we probe with 1400, if it gets ACKed from the peer, the payload 1400 will be able to go though the path.
Quoted 2 lines
So would it actually better to send two probes one for each of those two sizes and see which ones respond?
we could only if regardless of the RFC8899:
"To avoid excessive load, the interval between individual probe packets MUST be at least one RTT..."
Quoted 11 lines
(I'm not sure we ever manage to send full length packets. Our data is M3UA (mostly SMS) and sent with Nagle disabled. So even the customers sending 1000s of SMS/sec are unlikely to fill packets.)
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)