zoukankan      html  css  js  c++  java
  • 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.

  • 相关阅读:
    作业七—“南通大学教务管理系统微信公众号”用户体验分析
    作业6—成绩录入系统设计(第一阶段)
    作业5-需求分析(EX:南通大学成绩录入系统)
    几次接触Collection排序使用总结
    作业4-两人编程<词频统计>
    ACE智能指针
    Buddy Memorry
    子数组和与积
    数字转化为大写(16位以下)
    【阿里巴巴-飞猪旅行-内推】2020年应届实习生招聘
  • 原文地址:https://www.cnblogs.com/wordchao/p/10749384.html
Copyright © 2011-2022 走看看