grep * wildcard

to match repetitions of a character a star is used.

$cat samsung
id proof
license copy
check leaf 1



$grep *p* samsung
$grep p* samsung
id proof
license copy
check leaf 1



$grep p samsung
id proof
license copy
$grep *p samsung
$grep * samsung
Binary file PCBSD8.0-x86-bootonly.iso matches
$grep "*"  samsung
$grep "p*"  samsung
id proof
license copy
check leaf 1



$grep "*p*"  samsung
$

terminfo is a database of terminal capabilities

$cd /lib/terminfo/
$ls
a  c  d  E  h  l  m  p  r  s  v  w  x
$pwd
/lib/terminfo
$cd l/
$infocmp linux
$infocmp linux
#       Reconstructed via infocmp from file: /lib/terminfo/l/linux
linux|linux console,
        am, bce, ccc, eo, mir, msgr, xenl, xon,
        colors#8, it#8, ncv#18, pairs#64,

Terminfo (formerly Termcap) is a database of terminal capabilities and more. For every (well almost) model of terminal it tells application programs what the terminal is capable of doing. It tells what escape sequences (or control characters) to send to the terminal in order to do things such as move the cursor to a new location, erase part of the screen, scroll the screen, change modes, change appearance (colors, brightness, blinking, underlining, reverse video etc.). After about 1980, many terminals supported over a hundred different commands (some of which take numeric parameters).

Copyright 1998-2010 by David S. Lawyer. dave@lafn.org

grepping through ncurses sources.
$grep terminfo  infocmp.c
 * terminfo entries, completely determine the actions of the program.
static ENTRY *entries;          /* terminfo entries */

$grep ENTRY dump_entry.h
#ifndef DUMP_ENTRY_H
#define DUMP_ENTRY_H 1
#endif /* DUMP_ENTRY_H */
$


duplicate selective acknowledgement

$cat /proc/sys/net/ipv4/tcp_dsack
1
$
tcp_dsack - BOOLEAN
Allows TCP to send "duplicate" SACKs.

This option is required to send duplicate SACKs which was briefly described in the tcp_sack variable explanation. This is described in detail within the RFC 2883. This RFC document explains in detail how to handle situations where a packet is received twice or out of order. D-SACK is an extension to standard SACK and is used to tell the sender when a packet was received twice (ie, it was duplicated). The D-SACK data can then be used by the transmitter to improve network settings and so on. This should be 100% backwards compatible with older implementations as long as the previous implementors have not tried to implement this into the old SACK option in their own fashion. This is extremely rare and should not be a problem for anyone.

Copyright © 2002 by Oskar Andreasson

http://www.icir.org/floyd/sacks.html

grepping through the linux kernel source 2.6.32
selected parts.
$grep -r tcp_dsack *
sysctl_net_ipv4.c:              .procname       = "tcp_dsack",
tcp_input.c:int sysctl_tcp_dsack __read_mostly = 1

Problem : find what is sysctl in the linux kernel code.

congestion control algorithm to be used for new connections

ahiliation:~$cat /proc/sys/net/ipv4/tcp_congestion_control
cubic
ahiliation:~$echo reno >  /proc/sys/net/ipv4/tcp_congestion_control
bash: /proc/sys/net/ipv4/tcp_congestion_control: Permission denied
ahiliation:~$su -
Password:
debianlabs:~# echo reno >  /proc/sys/net/ipv4/tcp_congestion_control
debianlabs:~# cat  /proc/sys/net/ipv4/tcp_congestion_control
reno
debianlabs:~# echo dreno >  /proc/sys/net/ipv4/tcp_congestion_control
-su: echo: write error: No such file or directory
Set the congestion control algorithm to be used for new
connections. The algorithm "reno" is always available, but
additional choices may be available based on kernel configuration.
Default is set as part of kernel configuration.
[ linux kernel source tcp_yeah.c ]
else if (!yeah->doing_reno_now) {
 /* Scalable */
tp->snd_cwnd_cnt += yeah->pkts_acked;
grepping through linux kernel source 2.6.32
sysctl_net_ipv4.c:              .procname       = "tcp_congestion_control",
sysctl_net_ipv4.c:              .proc_handler   = proc_tcp_congestion_control,
sysctl_net_ipv4.c:              .strategy       = sysctl_tcp_congestion_control,

Problem : Find exactly where the default algorithm is done in code

The initial value of search_low to be used by the packetization layer

$cat /proc/sys/net/ipv4/tcp_base_mss
512
$
tcp_base_mss - INTEGER
        The initial value of search_low to be used by the packetization layer
        Path MTU discovery (MTU probing).  If MTU probing is enabled,
        this is the initial MSS used by the connection.
grepping through linux kernel source 2.6.32

sysctl_net_ipv4.c:              .procname       = "tcp_base_mss",
sysctl_net_ipv4.c:              .data           = &sysctl_tcp_base_mss,

tcp_output.c:int sysctl_tcp_base_mss __read_mostly = 512;

scale factor for portion of window reserved for buffering overhead

$cat /proc/sys/net/ipv4/tcp_app_win
31
$

Scale factor for portion of window reserved for buffering overhead. Reserve max(window / 2 ^ tcp_app_win, mss) of window for application buffer. Value 0 is special, it means that nothing is reserved. The default value is 31.
[ wireshark ]
Frame 1 (1496 bytes on wire, 1496 bytes captured)
Ethernet II, Src: Netgear_b4:91:1a (00:1f:33:b4:91:1a), Dst: Giga-Byt_f2:71:b6 (00:1a:4d:f2:71:b6)
Internet Protocol, Src: 122.166.110.18 (122.166.110.18), Dst: 10.0.0.2 (10.0.0.2)
Transmission Control Protocol, Src Port: http (80), Dst Port: 51385 (51385), Seq: 1, Ack: 1, Len: 1430
Flags: 0x10 (ACK)

Window size: 514

Checksum: 0x9e3e [validation disabled]
Options: (12 bytes)
SEQ/ACK analysis
Hypertext Transfer Protocol
grepping through linux kernel source 2.6.32

sysctl_net_ipv4.c:              .procname       = "tcp_app_win",
sysctl_net_ipv4.c:              .data           = &sysctl_tcp_app_win,

tcp_input.c:int sysctl_tcp_app_win __read_mostly = 31;