A method for controlling communications between endnodes in a packet-switched computer network includes dynamic window sizing and dynamic packet metering. Dynamic window sizing regularly probes the network to determine whether higher throughput is available at an increased window size, and avoids unnecessary decreases in window size after a packet is dropped or all available data has been transmitted. Dynamic packet metering regularly adjusts the rate at which packets are transmitted in response to changes in the measured propagation rate of packets through the network. To avoid unnecessary ack packets, acks are bundled together and piggybacked on returning data packets when appropriate. The invention provides control even if the address of an endnode changes. The invention also supports multiplexing several logical connections over a single transport session and combining data from several connections in a single packet, as well as construction of packets in a network-layer-independent format.