• packet duplication


    Duplicate Packets

    Duplicate packets are an often observed network behaviour.

    A packet is duplicated somewhere on the network and received twice at the receiving host. It is very often not desireable to get these duplicates, as the receiving application might think that's "fresh" data (which it isn't).

    If a sending host thinks a packet is not transmitted correctly because of a PacketLoss, it might Retransmit that packet. The receiving host might already got the first packet, and will receive a second one, which is a duplicated packet.

    ConnectionOrientedProtocols such as TCP will detect duplicate packets, and will ignore them completely.

    ConnectionlessProtocols such as UDP won't detect duplicate packets, because there's no information in, for example, the UDP header to identify a packet so that packets can be recognized as duplicates. The data from that packet will be indicated twice (or even more) to the application; it's the responsibility of the application to detect duplicates (perhaps by supplying enough information in its headers to do so) and process them appropriately, if necessary.

    Reasons

    There are two things you could mean be duplicate packets: duplication of the payload (the data being sent) or an exact duplicate of the payload and headers.

    TCP will attempt to resend data that it doesn't receive an ACK (acknowledgement from the receiver that the packet arrived okay) for. However, this leads to the famous "two Generals" problem where you can never be sure of the data actually arrived, or if you just didn't get the ACK because the ACK packet was lost. The receiver could have gotten the packet, replied with an ACK, but the ACK was then lost. In this case, the sender will assume the packet was never received, and send another packet with the same payload duplicated. Because of this case, protocols like TCP need to handle getting the data sent multiple times.

    The second thing duplicate packets could mean an actual 100% duplicate packet (payload and headers). This could happen because of errors in software, hardware, or routing problems or misconfigurations. In this case no, it's a somewhat different problem than TCP intentially sending new packets with duplicate payload from detection of packet loss. In this case the sender only sent one packet, but it was duplicated somewhere along the way by routers or hardware interfaces.

    Solutions

    TCP handle duplicated IP packets problem, so you don't care about them.

    UDP doesn't handle them. When you receive a datagram it's not guaranteed that you didn't have received the same datagram before. You should check it.

  • 相关阅读:
    解決 centos -bash: vim: command not found
    linux环境下安装tomcat6
    由于防火墙限制无法访问linux服务器上的tomcat应用
    linux环境下安装jdk1.6
    JSP输出HTML时产生的大量空格和换行的去除方法
    git使用
    Python+selenium+eclipse+pydev自动化测试环境搭建
    jmeter 打不开 提示“Not able to find Java executable or version”的解决办法
    appium如何解决每次都要安装apk的烦恼
    appium 中手势密码的定位坐标
  • 原文地址:https://www.cnblogs.com/wordchao/p/10749384.html
Copyright © 2020-2023  润新知