Does a router tells a device to close a TCP connection?

In summary, the conversation is discussing issues with connecting a Qterm-g72 HMI and a Moxa device over TCP Modbus. The HMI is the master and the Moxa is the slave, and it is believed that a computer or router is necessary for the connection to work. The question is whether a computer or router would close the connection to the Moxa if it loses connection from the HMI. Additionally, there is a suggestion to try using a crossover ethernet cable and a clarification that routers do not explicitly request a close operation on any devices. There have been previous issues with Moxa Nport devices and Modbus.
  • #1
btb4198
572
10
Does a router tells a slave device to close a TCP connection, if the router loses connect from the master device ? So, I have a Qterm-g72 HMI and I am trying to connect it to a Moxa over TCP Modbus. This only works if a Computer or a router is between the Moxa and the HMI. I am trying to found out why. So, my question is does a computer or a router close the connection to the Moxa if it lose it from the HMI ? The HMI is the master so it does the talking and the Moxa is the slave. The Moxa does not know to lost the connection if the HMI does not tell is to close with TCP, so I wanted to know if the Computer or Router would do that ?
Also does anyone else think they might know why the HMI and the Moxa will not work with a router or a computer in between?
 
Computer science news on Phys.org
  • #2
Which Moxa device are you using?
We had some serious issues with the Moxa Nport devices and Modbus.

But no a router doesn't provide any functionality other than routing the packets between device.

When you don't have the router installed does it work at all and then stop? Or just not work period?
Have you tried using a cross over ethernet cable?
 
  • #3
@cpscdave Is correct. routers simply take packets and move them around. What makes your think a router is 'telling' some other network object to close a port? Routers are really dumb - they simply filter stuff, and sometimes drop what they have been instructed to - as bad packets. None of this explicitly requests a 'close operation' on anything that I know of.
 
  • #4
Mine allows an automatic internet disconnection depending on idle time and a dayly forced shutdown (with probably an automatic restart.)
 

1. How does a router tell a device to close a TCP connection?

A router tells a device to close a TCP connection by sending a TCP FIN (finish) packet to the device, which indicates that it is ready to close the connection. This is part of the TCP three-way handshake process, where the router and device exchange control messages to establish and terminate a connection.

2. Can a router forcibly close a TCP connection?

Yes, a router can forcibly close a TCP connection by sending a TCP RST (reset) packet to the device. This usually happens when there is a problem with the connection or when the router needs to free up resources. However, this is not a graceful way to close a connection and can lead to data loss.

3. Does a router always initiate the closing of a TCP connection?

No, a router does not always initiate the closing of a TCP connection. In some cases, the device may send a TCP FIN packet to the router to indicate that it wants to close the connection. The router will then respond with a TCP FIN-ACK (finish-acknowledge) packet to confirm the closing of the connection.

4. Can a router keep a TCP connection open indefinitely?

Yes, a router can keep a TCP connection open indefinitely if there is no activity or data exchange between the devices. This is known as a TCP idle timeout, and routers usually have a default timeout period for idle connections. However, this timeout can be configured by the network administrator.

5. What happens if a TCP connection is closed prematurely?

If a TCP connection is closed prematurely, any data that was in transit may be lost. The devices will also need to establish a new connection if they want to continue communication. However, the TCP protocol has mechanisms to detect and recover from such situations, such as retransmitting lost data and re-establishing the connection if necessary.

Similar threads

  • Computing and Technology
Replies
27
Views
2K
  • Programming and Computer Science
Replies
1
Views
742
  • Computing and Technology
Replies
1
Views
1K
  • Computing and Technology
Replies
10
Views
712
  • Differential Equations
Replies
1
Views
702
  • Computing and Technology
Replies
3
Views
13K
Replies
3
Views
2K
Replies
13
Views
1K
  • Programming and Computer Science
Replies
1
Views
587
  • Engineering and Comp Sci Homework Help
Replies
1
Views
622
Back
Top