---
title: "Retransmission and RST before RTR timeout"
url: "https://maker.wiznet.io/forum/15179"
markdown_url: "https://maker.wiznet.io/forum/15179/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "mwiz"
created: "2024-03-22T17:46:52+09:00"
last_activity: "2024-04-04T16:02:37+09:00"
language: "en"
views: 177
replies: 4
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# Retransmission and RST before RTR timeout

## Question

Asked by mwiz on 2024-03-22 in Ethernet Chips.

I’m using the W5500. RTR and RCR are set as follows:

timeout_info.retry_cnt = 1;
timeout_info.time_100us = 0x07D0; // timeout value = 200ms
wizchip_settimeout(&timeout_info);

Sometimes I get unexplained socket closures. I captured this one with Wireshark. The W550, my PC running Wireshark, and a network switch are connected with an ethernet 3-way port mirroring switch. The switch is connected to our router.

W5500 ip address: 192.168.1.11
Server ip address: 20.49.109.146

Packet 19: MQTT Publish message from server
Packet 20: MQTT PUBACK back to server
Packet 21: Re-transmission of PUBACK (only 23 msec later)
Packet 22: Ack from server (23 msec after re-trans)
Packet 23: RST from W5500 (only 23 msec after re-trans)

Shouldn’t the W5500 wait 200 msec before re-transmission?
Shouldn’t there be more than one re-transmission before closing the socket?

[![image](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/7/7b66bd851cb3bb1c053415d5278d85c41db7365c.png) image1869×118 11.6 KB](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/7/7b66bd851cb3bb1c053415d5278d85c41db7365c.png)

Thanks.

## Replies

### Reply 1 by Eugeny, 2024-03-22

More troubleshooting is needed. As I understood your PC is a “server”. What your PC sees is receiving retransmission of the packet. It does not state who did the retransmission, it could be a switch on behalf of W5500. Connect PC and W5500 directly without any gateways and switches (putting them in same subnetwork of course) and try again.

### Reply 2 by mwiz, 2024-03-25

PC and W5500 are on the same subnetwork, and are connected through a mirror port.

W5500 ------------ Ethernet Port Mirroring Switch --------- Switch ----------Router ------ Internet -----Server
PC ---------------------------^

So the PC sees everything the W5500 sends or receives.
Mary

### Reply 3 by Eugeny, 2024-03-25 (in reply to reply 2)

![](https://avatars.discourse-cdn.com/v4/letter/m/90db22/48.png) mwiz:

> So the PC sees everything the W5500 sends or receives.

This is severe assumption which may be dramatically wrong.

### Reply 4 by mwiz, 2024-04-04

I found my problem: see [W5500 gets TCP timeout even when peer has sent the ACK within timelimit (200 ms) - #2 by Eugeny](https://forum.wiznet.io/t/topic/2636/2)

The retry_count, which sets the RCR register, must be 3 or greater. Less than 3 leads to ‘unpredictable’ behavior.

Wish that was in the data sheet.

---

Source: https://maker.wiznet.io/forum/15179
