W5100S Send시 RST, ACK가 계속 발생합니다.
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Share projects and connect with makers.
Joined before the site update? first.
New to WIZnet Makers?
We sent a verification link to your address. Open it to activate your account, then log in.
Accounts from this email provider are reviewed by an administrator after verification. Approval usually takes one business day.
Already have an account?
Enter your email address. If it belongs to an account, we'll send a link to set a new password. Members who joined before the site update use this to set their password.
If an account uses that address, we sent a link to set a new password. The link works once and expires in 30 minutes.
Know your password?
Need an account?
RE: W5100S Send시 RST, ACK가 계속 발생합니다.
by Eugeny ·
This means that at the time when packet arrives W5100S is having related socket closed, or in any other state not accepting the data from the remote host.
Connection is being established in packets 4-6, then client sends 1 character to the server (W5100S) in packet 11, it does not receive ACK, and performs keep-alive. At the time when keep-alive packet is received, socket is closed.
Why it is closed - dig into your code or put diagnostic output to see how program works and the transition of the socket state.
RE: RE: W5100S Send시 RST, ACK가 계속 발생합니다.
by Member 11166 ·
TCP서버쪽에서 send만 안되는것이 아니고 Receive도 안된다는 뜻인가요?? 서버에서 HEX값 38을 못받았다는 건가요??
RE: W5100S Send시 RST, ACK가 계속 발생합니다.
by Eugeny ·
Let’s look at the Wireshark log:
4 - client sends SYN packet to server (W5100S)
5 - server (W5100S) replies with SYN/ACK to the client, confirming it has got SYN packet
6 - client informs server (W5100S) that it has got SYN reply packet, and from now on connection is established.
11 - client sends single character to the server with push flag set, I guess this is ‘8’ which we see in the picture.
Then server does not reply with ACK packet to this ‘8’ being sent. In packet 23 client again sends one character to the server (same seq=1 ack=1 and len=1), and server replies with RST for this seq=1 and ack=1. I have no explanation why wireshark says “tcp keep-alive”, must look into the packet structure/data to see what it is about.
Therefore something wrong is happening in the server after it has connection established. Why S5100S does not reply with ACK to the packet 11 in the first place - also a good question.
Also your picture shows “connection refused by remote host”, but in wireshark log you attached connection went well, the problem happened on the data transfer.
As I said before - put diag output into your code to see how it flows, and log several connection attempts using wireshark to see several logs and probably getting the idea using more data that just one log.
Connect W5100S to your hercules PC directly. This will eliminate issues which may happen in the routing equipment. I do not say problem is there, but it seems packets are simply being lost in the wireshark output.
RE: W5100S Send시 RST, ACK가 계속 발생합니다.
by Member 11166 ·
W5100S는 hercules PC와 직접 연결하여 테스트 하고 있습니다. wireshark값을 비교하였고 [ACK]라고 수신까지 받았습니다.
하지만 이것이 프로그램 함수를 제거하니깐 정상적으로 동작되는것? 같아요
recv함수 없이 제가 수신된 값을 읽을 수 있는 방법이 있나요?
uint16 recv(
SOCKET s, /< socket index */
uint8 * buf, /< a pointer to copy the data to be received */
uint16 len /**< the data size to be read */
)
{
uint16 ret=0;
#ifdef DEF_IINCHIP_DBG
printf(“recv()\r\n”);
#endif
if ( len > 0 )
{
//recv_data_processing(s, buf, len);
IINCHIP_WRITE(Sn_CR(s),Sn_CR_RECV);
}
return ret;
}
rece함수 내부의 recv_data_processing(s, buf, len);을 주석처리하니깐 RST,ACK가 발생하지 않습니다.
void recv_data_processing(SOCKET s, uint8 *data, uint16 len)
{
uint16 ptr;
ptr = IINCHIP_READ(Sn_RX_RD0(s));
ptr = ((ptr & 0x00ff) << 8) + IINCHIP_READ(Sn_RX_RD0(s) + 1);
}
이 함수가 잘못된 것인가요? 예제의 라이브러리입니다…
RE: W5100S Send시 RST, ACK가 계속 발생합니다.
by Eugeny ·
This is very good finding! If you look at the wireshark output, you see that window size decreases - to 2047 from 2048 when it received one char, and then to 2037 when it receives another 10 chars. And Ack is being advanced accordingly. This is because you commented the receive action and W5100S is having its RX buffer filled.
Now the main question - why calling this function
recv_data_processingcauses the issue? In my opinion, the first thing I would look at (not in your posted code) is value oflen. How do you obtain it? May it have invalid, wrong value?RE: W5100S Send시 RST, ACK가 계속 발생합니다.
by Member 11166 ·
감사합니다. 현재는 recv시 값이 수신버퍼에 정상적으로 쌓이는것을 확인했습니다.
문제는 함수안의 코드를 변경한 것인데 동작원리를 알아야 할 것 같습니다.
if문 안에 있는데 주석되어 있는 6개가 기존 코드인데 그 부분만 변경해봤습니다.
(* Send도 마찬 가지로 Keep-alive가 발생하네요… recv처럼 변경하였지만 잘 되지 않네요, 현재 계속 디버깅 중입니다,)
void read_data(SOCKET s, vuint8 * src, vuint8 * dst, uint16 len)
{
uint16 size;
uint16 src_mask;
uint8 * src_ptr;
}
RE: W5100S Send시 RST, ACK가 계속 발생합니다.
by Eugeny ·
To understand the meaning and how code works please refer to the datasheet chapter 4. The code you commented just gets data through the boundary of the socket buffer. The RX pointers must have been managed in the
wiz_read_buf()call. What I would do in this situation - display and verify all the values all the functions being called return, and check against register descriptions in datasheet to ensure there’s no misconfiguration and values are correct.