Changeset d2f7b65 for router


Ignore:
Timestamp:
Oct 25, 2016 1:39:33 PM (4 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
8a84522
Parents:
80966d60
Message:

SSU: Increase max IPv6 MTU (proposal #127)

Location:
router/java/src/net/i2p/router/transport/udp
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/transport/udp/PacketBuilder.java

    r80966d60 rd2f7b65  
    552552        // the packet could have been built before the current mtu got lowered, so
    553553        // compare to LARGE_MTU
    554         if (off + (ipHeaderSize + UDP_HEADER_SIZE) > PeerState.LARGE_MTU) {
     554        int maxMTU = peer.isIPv6() ? PeerState.MAX_IPV6_MTU : PeerState.LARGE_MTU;
     555        if (off + (ipHeaderSize + UDP_HEADER_SIZE) > maxMTU) {
    555556            _log.error("Size is " + off + " for " + packet +
    556557                       " data size " + dataSize +
  • router/java/src/net/i2p/router/transport/udp/PeerState.java

    r80966d60 rd2f7b65  
    254254    private static final int MAX_SEND_MSGS_PENDING = 128;
    255255
    256     /*
     256    /**
     257     * IPv4 Min MTU
     258     *
    257259     * 596 gives us 588 IP byes, 568 UDP bytes, and with an SSU data message,
    258260     * 522 fragment bytes, which is enough to send a tunnel data message in 2
     
    278280     */
    279281    public static final int MIN_IPV6_MTU = 1280;
    280     public static final int MAX_IPV6_MTU = 1472;  // TODO 1488
     282    public static final int MAX_IPV6_MTU = 1488;
    281283    private static final int DEFAULT_MTU = MIN_MTU;
    282284
    283     /*
     285    /**
     286     * IPv4 Max MTU
     287     *
    284288     * based on measurements, 1350 fits nearly all reasonably small I2NP messages
    285289     * (larger I2NP messages may be up to 1900B-4500B, which isn't going to fit
     
    301305     */
    302306    public static final int LARGE_MTU = 1484;
     307   
     308    /**
     309     *  Max of IPv4 and IPv6 max MTUs
     310     *  @since 0.9.28
     311     */
     312    public static final int MAX_MTU = Math.max(LARGE_MTU, MAX_IPV6_MTU);
    303313   
    304314    private static final int MIN_RTO = 100 + ACKSender.ACK_FREQUENCY;
  • router/java/src/net/i2p/router/transport/udp/UDPSender.java

    r80966d60 rd2f7b65  
    190190        if (packet == null || !_keepRunning) return;
    191191        int psz = packet.getPacket().getLength();
    192         if (psz > PeerState.LARGE_MTU) {
     192        if (psz > PeerState.MAX_MTU) {
    193193            _log.error("Dropping large UDP packet " + psz + " bytes: " + packet);
    194194            return;
  • router/java/src/net/i2p/router/transport/udp/UDPTransport.java

    r80966d60 rd2f7b65  
    21442144            }
    21452145        }
    2146         if (mtu < PeerState.LARGE_MTU)
     2146        if (mtu != PeerState.LARGE_MTU)
    21472147            options.setProperty(UDPAddress.PROP_MTU, Integer.toString(mtu));
    21482148
Note: See TracChangeset for help on using the changeset viewer.