13 Dec, 2011

1 commit

  • This patch introduces memory pressure controls for the tcp
    protocol. It uses the generic socket memory pressure code
    introduced in earlier patches, and fills in the
    necessary data in cg_proto struct.

    Signed-off-by: Glauber Costa
    Reviewed-by: KAMEZAWA Hiroyuki
    CC: Eric W. Biederman
    Signed-off-by: David S. Miller

    Glauber Costa
     

10 Dec, 2011

1 commit


14 May, 2011

1 commit

  • This patch adds IPPROTO_ICMP socket kind. It makes it possible to send
    ICMP_ECHO messages and receive the corresponding ICMP_ECHOREPLY messages
    without any special privileges. In other words, the patch makes it
    possible to implement setuid-less and CAP_NET_RAW-less /bin/ping. In
    order not to increase the kernel's attack surface, the new functionality
    is disabled by default, but is enabled at bootup by supporting Linux
    distributions, optionally with restriction to a group or a group range
    (see below).

    Similar functionality is implemented in Mac OS X:
    http://www.manpagez.com/man/4/icmp/

    A new ping socket is created with

    socket(PF_INET, SOCK_DGRAM, PROT_ICMP)

    Message identifiers (octets 4-5 of ICMP header) are interpreted as local
    ports. Addresses are stored in struct sockaddr_in. No port numbers are
    reserved for privileged processes, port 0 is reserved for API ("let the
    kernel pick a free number"). There is no notion of remote ports, remote
    port numbers provided by the user (e.g. in connect()) are ignored.

    Data sent and received include ICMP headers. This is deliberate to:
    1) Avoid the need to transport headers values like sequence numbers by
    other means.
    2) Make it easier to port existing programs using raw sockets.

    ICMP headers given to send() are checked and sanitized. The type must be
    ICMP_ECHO and the code must be zero (future extensions might relax this,
    see below). The id is set to the number (local port) of the socket, the
    checksum is always recomputed.

    ICMP reply packets received from the network are demultiplexed according
    to their id's, and are returned by recv() without any modifications.
    IP header information and ICMP errors of those packets may be obtained
    via ancillary data (IP_RECVTTL, IP_RETOPTS, and IP_RECVERR). ICMP source
    quenches and redirects are reported as fake errors via the error queue
    (IP_RECVERR); the next hop address for redirects is saved to ee_info (in
    network order).

    socket(2) is restricted to the group range specified in
    "/proc/sys/net/ipv4/ping_group_range". It is "1 0" by default, meaning
    that nobody (not even root) may create ping sockets. Setting it to "100
    100" would grant permissions to the single group (to either make
    /sbin/ping g+s and owned by this group or to grant permissions to the
    "netadmins" group), "0 4294967295" would enable it for the world, "100
    4294967295" would enable it for the users, but not daemons.

    The existing code might be (in the unlikely case anyone needs it)
    extended rather easily to handle other similar pairs of ICMP messages
    (Timestamp/Reply, Information Request/Reply, Address Mask Request/Reply
    etc.).

    Userspace ping util & patch for it:
    http://openwall.info/wiki/people/segoon/ping

    For Openwall GNU/*/Linux it was the last step on the road to the
    setuid-less distro. A revision of this patch (for RHEL5/OpenVZ kernels)
    is in use in Owl-current, such as in the 2011/03/12 LiveCD ISOs:
    http://mirrors.kernel.org/openwall/Owl/current/iso/

    Initially this functionality was written by Pavel Kankovsky for
    Linux 2.4.32, but unfortunately it was never made public.

    All ping options (-b, -p, -Q, -R, -s, -t, -T, -M, -I), are tested with
    the patch.

    PATCH v3:
    - switched to flowi4.
    - minor changes to be consistent with raw sockets code.

    PATCH v2:
    - changed ping_debug() to pr_debug().
    - removed CONFIG_IP_PING.
    - removed ping_seq_fops.owner field (unused for procfs).
    - switched to proc_net_fops_create().
    - switched to %pK in seq_printf().

    PATCH v1:
    - fixed checksumming bug.
    - CAP_NET_RAW may not create icmp sockets anymore.

    RFC v2:
    - minor cleanups.
    - introduced sysctl'able group range to restrict socket(2).

    Signed-off-by: Vasiliy Kulikov
    Signed-off-by: David S. Miller

    Vasiliy Kulikov
     

02 Feb, 2011

1 commit

  • The time has finally come to remove the hash based routing table
    implementation in ipv4.

    FIB Trie is mature, well tested, and I've done an audit of it's code
    to confirm that it implements insert, delete, and lookup with the same
    identical semantics as fib_hash did.

    If there are any semantic differences found in fib_trie, we should
    simply fix them.

    I've placed the trie statistic config option under advanced router
    configuration.

    Signed-off-by: David S. Miller
    Acked-by: Stephen Hemminger

    David S. Miller
     

22 Aug, 2010

1 commit

  • PPP: introduce "pptp" module which implements point-to-point tunneling protocol using pppox framework
    NET: introduce the "gre" module for demultiplexing GRE packets on version criteria
    (required to pptp and ip_gre may coexists)
    NET: ip_gre: update to use the "gre" module

    This patch introduces then pptp support to the linux kernel which
    dramatically speeds up pptp vpn connections and decreases cpu usage in
    comparison of existing user-space implementation
    (poptop/pptpclient). There is accel-pptp project
    (https://sourceforge.net/projects/accel-pptp/) to utilize this module,
    it contains plugin for pppd to use pptp in client-mode and modified
    pptpd (poptop) to build high-performance pptp NAS.

    There was many changes from initial submitted patch, most important are:
    1. using rcu instead of read-write locks
    2. using static bitmap instead of dynamically allocated
    3. using vmalloc for memory allocation instead of BITS_PER_LONG + __get_free_pages
    4. fixed many coding style issues
    Thanks to Eric Dumazet.

    Signed-off-by: Dmitry Kozlov
    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Dmitry Kozlov
     

07 Oct, 2008

1 commit

  • Since IPVS now has partial IPv6 support, this patch moves IPVS from
    net/ipv4/ipvs to net/netfilter/ipvs. It's a result of:

    $ git mv net/ipv4/ipvs net/netfilter

    and adapting the relevant Kconfigs/Makefiles to the new path.

    Signed-off-by: Julius Volz
    Signed-off-by: Simon Horman

    Julius Volz
     

29 Jan, 2008

1 commit

  • This includes several cleanups:

    * tune Makefile to compile out this file when SYSCTL=n. Now
    it looks like net/core/sysctl_net_core.c one;
    * move the ipv4_config to af_inet.c to exist all the time;
    * remove additional sysctl_ip_nonlocal_bind declaration
    (it is already declared in net/ip.h);
    * remove no nonger needed ifdefs from this file.

    This is a preparation for using ctl paths for net/ipv4/
    sysctl table.

    Signed-off-by: Pavel Emelyanov
    Signed-off-by: David S. Miller

    Pavel Emelyanov
     

16 Oct, 2007

1 commit

  • There are some objects that are common in all the places
    which are used to keep track of frag queues, they are:

    * hash table
    * LRU list
    * rw lock
    * rnd number for hash function
    * the number of queues
    * the amount of memory occupied by queues
    * secret timer

    Move all this stuff into one structure (struct inet_frags)
    to make it possible use them uniformly in the future. Like
    with the previous patch this mostly consists of hunks like

    - write_lock(&ipfrag_lock);
    + write_lock(&ip4_frags.lock);

    To address the issue with exporting the number of queues and
    the amount of memory occupied by queues outside the .c file
    they are declared in, I introduce a couple of helpers.

    Signed-off-by: Pavel Emelyanov
    Signed-off-by: David S. Miller

    Pavel Emelyanov
     

11 Oct, 2007

1 commit

  • This patch provides generic Large Receive Offload (LRO) functionality
    for IPv4/TCP traffic.

    LRO combines received tcp packets to a single larger tcp packet and
    passes them then to the network stack in order to increase performance
    (throughput). The interface supports two modes: Drivers can either
    pass SKBs or fragment lists to the LRO engine.

    Signed-off-by: Jan-Bernd Themann
    Signed-off-by: David S. Miller

    Jan-Bernd Themann
     

11 Jul, 2007

1 commit


26 Apr, 2007

4 commits

  • This patch moves the SNMP code shared between IPv4/IPv6 from proc.c
    into net/ipv4/af_inet.c. This makes sense because these functions
    aren't specific to /proc.

    As a result we can again skip proc.o if /proc is disabled.

    Signed-off-by: Herbert Xu
    Acked-by: YOSHIFUJI Hideaki
    Signed-off-by: David S. Miller

    Herbert Xu
     
  • Signed-off-by: YOSHIFUJI Hideaki
    Signed-off-by: David S. Miller

    YOSHIFUJI Hideaki
     
  • This is an implementation of TCP Illinois invented by Shao Liu
    at University of Illinois. It is a another variant of Reno which adapts
    the alpha and beta parameters based on RTT. The basic idea is to increase
    window less rapidly as delay approaches the maximum. See the papers
    and talks to get a more complete description.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Stephen Hemminger
     
  • YeAH-TCP is a sender-side high-speed enabled TCP congestion control
    algorithm, which uses a mixed loss/delay approach to compute the
    congestion window. It's design goals target high efficiency, internal,
    RTT and Reno fairness, resilience to link loss while keeping network
    elements load as low as possible.

    For further details look here:
    http://wil.cs.caltech.edu/pfldnet2007/paper/YeAH_TCP.pdf

    Signed-off-by: Angelo P. Castellani
    Signed-off-by: David S. Miller

    Angelo P. Castellani
     

03 Dec, 2006

1 commit

  • This is a revision of the previously submitted patch, which alters
    the way files are organized and compiled in the following manner:

    * UDP and UDP-Lite now use separate object files
    * source file dependencies resolved via header files
    net/ipv{4,6}/udp_impl.h
    * order of inclusion files in udp.c/udplite.c adapted
    accordingly

    [NET/IPv4]: Support for the UDP-Lite protocol (RFC 3828)

    This patch adds support for UDP-Lite to the IPv4 stack, provided as an
    extension to the existing UDPv4 code:
    * generic routines are all located in net/ipv4/udp.c
    * UDP-Lite specific routines are in net/ipv4/udplite.c
    * MIB/statistics support in /proc/net/snmp and /proc/net/udplite
    * shared API with extensions for partial checksum coverage

    [NET/IPv6]: Extension for UDP-Lite over IPv6

    It extends the existing UDPv6 code base with support for UDP-Lite
    in the same manner as per UDPv4. In particular,
    * UDPv6 generic and shared code is in net/ipv6/udp.c
    * UDP-Litev6 specific extensions are in net/ipv6/udplite.c
    * MIB/statistics support in /proc/net/snmp6 and /proc/net/udplite6
    * support for IPV6_ADDRFORM
    * aligned the coding style of protocol initialisation with af_inet6.c
    * made the error handling in udpv6_queue_rcv_skb consistent;
    to return `-1' on error on all error cases
    * consolidation of shared code

    [NET]: UDP-Lite Documentation and basic XFRM/Netfilter support

    The UDP-Lite patch further provides
    * API documentation for UDP-Lite
    * basic xfrm support
    * basic netfilter support for IPv4 and IPv6 (LOG target)

    Signed-off-by: Gerrit Renker
    Signed-off-by: David S. Miller

    Gerrit Renker
     

04 Oct, 2006

1 commit

  • This patch introduces the BEET mode (Bound End-to-End Tunnel) with as
    specified by the ietf draft at the following link:

    http://www.ietf.org/internet-drafts/draft-nikander-esp-beet-mode-06.txt

    The patch provides only single family support (i.e. inner family =
    outer family).

    Signed-off-by: Diego Beltrami
    Signed-off-by: Miika Komu
    Signed-off-by: Herbert Xu
    Signed-off-by: Abhinav Pathak
    Signed-off-by: Jeff Ahrenholz
    Signed-off-by: David S. Miller

    Diego Beltrami
     

23 Sep, 2006

1 commit

  • Add support for the Commercial IP Security Option (CIPSO) to the IPv4
    network stack. CIPSO has become a de-facto standard for
    trusted/labeled networking amongst existing Trusted Operating Systems
    such as Trusted Solaris, HP-UX CMW, etc. This implementation is
    designed to be used with the NetLabel subsystem to provide explicit
    packet labeling to LSM developers.

    The CIPSO/IPv4 packet labeling works by the LSM calling a NetLabel API
    function which attaches a CIPSO label (IPv4 option) to a given socket;
    this in turn attaches the CIPSO label to every packet leaving the
    socket without any extra processing on the outbound side. On the
    inbound side the individual packet's sk_buff is examined through a
    call to a NetLabel API function to determine if a CIPSO/IPv4 label is
    present and if so the security attributes of the CIPSO label are
    returned to the caller of the NetLabel API function.

    Signed-off-by: Paul Moore
    Signed-off-by: David S. Miller

    Paul Moore
     

11 Jul, 2006

1 commit

  • This reverts: f890f921040fef6a35e39d15b729af1fd1a35f29

    The inclusion of TCP Compound needs to be reverted at this time
    because it is not 100% certain that this code conforms to the
    requirements of Developer's Certificate of Origin 1.1 paragraph (b).

    Signed-off-by: David S. Miller

    David S. Miller
     

18 Jun, 2006

5 commits

  • This adds a new module for tracking TCP state variables non-intrusively
    using kprobes. It has a simple /proc interface that outputs one line
    for each packet received. A sample usage is to collect congestion
    window and ssthresh over time graphs.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Stephen Hemminger
     
  • TCP Compound is a sender-side only change to TCP that uses
    a mixed Reno/Vegas approach to calculate the cwnd.

    For further details look here:
    ftp://ftp.research.microsoft.com/pub/tr/TR-2005-86.pdf

    Signed-off-by: Angelo P. Castellani
    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Angelo P. Castellani
     
  • TCP Veno module is a new congestion control module to improve TCP
    performance over wireless networks. The key innovation in TCP Veno is
    the enhancement of TCP Reno/Sack congestion control algorithm by using
    the estimated state of a connection based on TCP Vegas. This scheme
    significantly reduces "blind" reduction of TCP window regardless of
    the cause of packet loss.

    This work is based on the research paper "TCP Veno: TCP Enhancement
    for Transmission over Wireless Access Networks." C. P. Fu, S. C. Liew,
    IEEE Journal on Selected Areas in Communication, Feb. 2003.

    Original paper and many latest research works on veno:
    http://www.ntu.edu.sg/home/ascpfu/veno/veno.html

    Signed-off-by: Bin Zhou
    Cheng Peng Fu
    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Bin Zhou
     
  • TCP Low Priority is a distributed algorithm whose goal is to utilize only
    the excess network bandwidth as compared to the ``fair share`` of
    bandwidth as targeted by TCP. Available from:
    http://www.ece.rice.edu/~akuzma/Doc/akuzma/TCP-LP.pdf

    Original Author:
    Aleksandar Kuzmanovic

    See http://www-ece.rice.edu/networks/TCP-LP/ for their implementation.
    As of 2.6.13, Linux supports pluggable congestion control algorithms.
    Due to the limitation of the API, we take the following changes from
    the original TCP-LP implementation:
    o We use newReno in most core CA handling. Only add some checking
    within cong_avoid.
    o Error correcting in remote HZ, therefore remote HZ will be keeped
    on checking and updating.
    o Handling calculation of One-Way-Delay (OWD) within rtt_sample, sicne
    OWD have a similar meaning as RTT. Also correct the buggy formular.
    o Handle reaction for Early Congestion Indication (ECI) within
    pkts_acked, as mentioned within pseudo code.
    o OWD is handled in relative format, where local time stamp will in
    tcp_time_stamp format.

    Port from 2.4.19 to 2.6.16 as module by:
    Wong Hoi Sing Edison
    Hung Hing Lun

    Signed-off-by: Wong Hoi Sing Edison
    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Wong Hoi Sing Edison
     
  • This patch adds the structure xfrm_mode. It is meant to represent
    the operations carried out by transport/tunnel modes.

    By doing this we allow additional encapsulation modes to be added
    without clogging up the xfrm_input/xfrm_output paths.

    Candidate modes include 4-to-6 tunnel mode, 6-to-4 tunnel mode, and
    BEET modes.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     

29 Mar, 2006

1 commit

  • Basically this patch moves the generic tunnel protocol stuff out of
    xfrm4_tunnel/xfrm6_tunnel and moves it into the new files of tunnel4.c
    and tunnel6 respectively.

    The reason for this is that the problem that Hugo uncovered is only
    the tip of the iceberg. The real problem is that when we removed the
    dependency of ipip on xfrm4_tunnel we didn't really consider the module
    case at all.

    For instance, as it is it's possible to build both ipip and xfrm4_tunnel
    as modules and if the latter is loaded then ipip simply won't load.

    After considering the alternatives I've decided that the best way out of
    this is to restore the dependency of ipip on the non-xfrm-specific part
    of xfrm4_tunnel. This is acceptable IMHO because the intention of the
    removal was really to be able to use ipip without the xfrm subsystem.
    This is still preserved by this patch.

    So now both ipip/xfrm4_tunnel depend on the new tunnel4.c which handles
    the arbitration between the two. The order of processing is determined
    by a simple integer which ensures that ipip gets processed before
    xfrm4_tunnel.

    The situation for ICMP handling is a little bit more complicated since
    we may not have enough information to determine who it's for. It's not
    a big deal at the moment since the xfrm ICMP handlers are basically
    no-ops. In future we can deal with this when we look at ICMP caching
    in general.

    The user-visible change to this is the removal of the TUNNEL Kconfig
    prompts. This makes sense because it can only be used through IPCOMP
    as it stands.

    The addition of the new modules shouldn't introduce any problems since
    module dependency will cause them to be loaded.

    Oh and I also turned some unnecessary pskb's in IPv6 related to this
    patch to skb's.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     

11 Jan, 2006

1 commit


04 Jan, 2006

1 commit

  • Replace existing BIC version 1.1 with new version 2.0.
    The main change is to replace the window growth function
    with a cubic function as described in:
    http://www.csc.ncsu.edu/faculty/rhee/export/bitcp/cubic-paper.pdf

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Stephen Hemminger
     

30 Aug, 2005

7 commits


28 Jul, 2005

1 commit


24 Jun, 2005

6 commits

  • This patch implements Tom Kelly's Scalable TCP congestion control algorithm
    for the modular framework.

    The algorithm has some nice scaling properties, and has been used a fair bit
    in research, though is known to have significant fairness issues, so it's not
    really suitable for general purpose use.

    Signed-off-by: John Heffner
    Signed-off-by: David S. Miller

    John Heffner
     
  • H-TCP is a congestion control algorithm developed at the Hamilton Institute, by
    Douglas Leith and Robert Shorten. It is extending the standard Reno algorithm
    with mode switching is thus a relatively simple modification.

    H-TCP is defined in a layered manner as it is still a research platform. The
    basic form includes the modification of beta according to the ratio of maxRTT
    to min RTT and the alpha=2*factor*(1-beta) relation, where factor is dependant
    on the time since last congestion.

    The other layers improve convergence by adding appropriate factors to alpha.

    The following patch implements the H-TCP algorithm in it's basic form.

    Signed-Off-By: Baruch Even
    Signed-off-by: David S. Miller

    Baruch Even
     
  • TCP Vegas code modified for the new TCP infrastructure.
    Vegas now uses microsecond resolution timestamps for
    better estimation of performance over higher speed links.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Stephen Hemminger
     
  • TCP Hybla congestion avoidance.

    - "In heterogeneous networks, TCP connections that incorporate a
    terrestrial or satellite radio link are greatly disadvantaged with
    respect to entirely wired connections, because of their longer round
    trip times (RTTs). To cope with this problem, a new TCP proposal, the
    TCP Hybla, is presented and discussed in the paper[1]. It stems from an
    analytical evaluation of the congestion window dynamics in the TCP
    standard versions (Tahoe, Reno, NewReno), which suggests the necessary
    modifications to remove the performance dependence on RTT.[...]"[1]

    [1]: Carlo Caini, Rosario Firrincieli, "TCP Hybla: a TCP enhancement for
    heterogeneous networks",
    International Journal of Satellite Communications and Networking
    Volume 22, Issue 5 , Pages 547 - 566. September 2004.

    Signed-off-by: Daniele Lacamera (root at danielinux.net)net
    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Daniele Lacamera
     
  • Sally Floyd's high speed TCP congestion control.
    This is useful for comparison and research.

    Signed-off-by: John Heffner
    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    John Heffner
     
  • This is the existing 2.6.12 Westwood code moved from tcp_input
    to the new congestion framework. A lot of the inline functions
    have been eliminated to try and make it clearer.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Stephen Hemminger