随笔分类 - linux tcp/ip
摘要:RACK (draft-ietf-tcpm-rack-01): it is a newer algorithm * (2017-) that checks timing instead of counting DUPACKs. * Essentially a packet is considered
阅读全文
摘要:macvlan 每个虚拟接口是一个拥有独立 MAC 的虚拟设备; 报文根据目的 MAC 做转发; 适用于一些需要独立 MAC 地址的场景,如部分云平台、老旧网络设备下隔离容器网络。 ipvlan 所有接口共享一个 MAC 地址(就是物理接口的); 报文转发根据 目的 IP 地址 做判定; 更适合三层
阅读全文
摘要:在 Macvlan 出现之前,一块以太网卡添加多个 IP 地址,却不能添加多个 MAC 地址,即使使用了创建 ethx:y 这样的方式,这些“网卡”的 MAC 地址和 ethx 都是一样的,本质上,它们还是一块网卡,这将限制很多二层的操作。 Macvlan 允许你在主机的一个网络接口上配置多个虚拟的
阅读全文
摘要:目前 C1容器内的ping -> c1 容器内的网卡eth0 -> 宿主机内的vethacea5a5-> 宿主机内的Linux Bridge -> 宿主机内Bridge 上的vethb7b238f-> C2 容器内的网卡eth0 docker exec xxxx ping 192.168.222.2
阅读全文
摘要:今天处理问题时,发现docker 容器内访问外网不通,tcpdump 抓包发现,只抓到veth 接口上的包,但是报文需要再宿主机物理网卡上转发到外网,此时这部分报文没看到, 目前容器使用桥接模式(Bridge Network) 容器 eth0 (veth0) ↓ veth_xmit() [veth.
阅读全文
摘要:https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/net/ipv4/tcp_input.c?id=124c4c32e9f3b4d89f5be3342897adc8db5c27b8
阅读全文
摘要:以前的印象中,shutdown rd后,就不能从fd里面读到数据,今天测试时和预计的不一样! 可以看到shutdown后 rd后,还是可以read 数据。分析tcp_rcvmsg可以看到确实能读到数据 // 定义一个接收TCP消息的函数 static int tcp_recvmsg_locked(s
阅读全文
摘要:1、收到ecn后调用tcp_fastretrans_alert >tcp_try_to_open >tcp_enter_cwr /* Enter CWR state. Disable cwnd undo since congestion is proven with ECN */ void tcp_
阅读全文
摘要:tcp_notsent_lowat控制发送缓存队列中的未发送数据量。低于此值可发送 也就是对外是epoll_out 内核函数tcp_poll,通过函数sk_stream_is_writeable的结果判定,可通知用户层发送数据的时机。当发送缓存队列的数据流小于notsent_lowat值的时候,由P
阅读全文
摘要:收到ACK时,tcp_slow_start_after_idle ==1;报文都已经被ack,也就是inflight==0 则 检查是否应该tcp_cwnd_restart static int tcp_ack_update_window(struct sock *sk, const struct
阅读全文
摘要:// Test of slow start when not application-limited, so that // the cwnd continues to grow. // In this variant, the receiver sends one ACK per 4 packet
阅读全文
摘要:还是同样的脚本: // Test shifting of newly-SACKed ranges onto the previous already-SACKed skb. // This variant tests non-FACK SACK with SACKs coming in the or
阅读全文
摘要:// Test shifting of newly-SACKed ranges onto the previous already-SACKed skb.// This variant tests non-FACK SACK with SACKs coming in the order// 2 6
阅读全文
摘要:PRR算法(Proportional Rate Reduction)决定在丢包恢复(Loss Recovery)期间,对应于每个ACK报文,可发送的报文数量。目的是:1)快速平稳的从Loss中恢复;2)恢复之后拥塞窗口收敛与ssthresh。主要是为了解决Linux内核之前采用的恢复算法Rate-h
阅读全文
摘要:tcp的struct 解释https://www.cnblogs.com/codestack/p/15578849.html 1、tcp_sock 成员 tp->undo_retrans ;//标记是否发生过真正的重传。如果此标记为 0,则表示没有实际的重传。 在进入 disorder或者recov
阅读全文
摘要:https://beta.computer-networking.info/syllabus/default/exercises/tcp-2.html 转载:https://blog.csdn.net/m0_38068229/article/details/80417503 一次拥塞中丢失多个报文时
阅读全文
摘要:netstat -atnp |grep 8080 tcp 0 0 192.168.1.208:8080 0.0.0.0:* LISTEN 109094/server tcp6 0 0 :::8080 :::* LISTEN 109094/server 在linux 3.9 后引入reuseport
阅读全文
摘要:Add l3mdev index to flow struct and avoid oif reset for port devices VRF和l3mdev核心代码的基本前提是,将套接字绑定到一个设备(l3mdev或带有三层域的网络设备)以指示三层网络的作用域。旧的代码会将flowi_oif(输出
阅读全文
摘要:Here are three connections captured by tcpdump: 127.0.0.1.40002 > 127.0.0.1.9999: Flags [S], seq 2965525191 127.0.0.1.9999 > 127.0.0.1.40002: Flags [S
阅读全文
摘要:SYN handling for PAWS. and SYN+ACK for simultaneous connect /* Does PAWS and seqno based validation of an incoming segment, flags will * play signific
阅读全文