共 57 篇文章 |
|
|<---struct ipt_entry--->|<---struct ipt_entry_match + struct ipt/xt_someModule---> (can presence many times)|<---struct ipt_entry_target + struct ipt/xt_someTarget--->(only one)|struct ipt_entry * e;unsigned int size_ipt_entry, size_ipt_entry_match, size_ipt_entry_target, size_ipt_tcp, size_rateinfo... 阅99 转0 评0 公众公开 19-09-19 20:43 |
[root@server-mysql fs]# echo 1000000 > /proc/sys/fs/nr_open[root@server-mysql fs]# cat /proc/sys/fs/nr_open1000000[root@server-mysql fs]# ulimit -n 999999[root@server-mysql fs]# ulimit -n 1000000[root@server-mysql fs]# ulimit -n 1000001-bash: ulimit: open files: cannot modify limit: Operation not permitted.[root@se... 阅787 转1 评0 公众公开 19-09-19 19:39 |
Iptables防火墙规则使用梳理。[root@kvm-server conf]# iptables -t nat -A PREROUTING -p tcp -m tcp --dport 33066 -j DNAT --to-destination 192.168.1.161:3306[root@kvm-server conf]# iptables -t nat -A POSTROUTING -d 192.168.1.161/32 -p tcp -m tcp --sport 3306 -j SNAT --to-source 192.168.1.7[root@kvm-server conf]# iptables ... 阅141 转1 评0 公众公开 19-09-18 12:03 |
ev->ev_timeout为事件触发时间点82 evutil_timeradd(&now, tv, &ev->ev_timeout);83 84 event_debug((85 "event_add: timeout in %ld seconds, call %p",86 tv->tv_sec, ev->ev_callback));87 //加入定时队列88 event_queue_insert(base, ev, EVLIST_TIMEOUT);89 }90 91 return (res);92 }5.event_base_loop. 阅175 转0 评0 公众公开 19-09-18 11:33 |
如下图:主机A发送的报文被送到交换机S1的eth0口,由于eth0与eth1、eth2桥接在一起,故而报文被复制到eth1和eth2,并且发送出去,然后被主机B和交换机S2接收到。br_dev_xmit(skb, dev);交换机S2的eth2口收到报文,并将其转发到eth0、eth1、eth3,并且记录下“主机C由eth2接入”。交换机S1在其eth2和eth3口都会收到报文,eth2口收到的报文又会从... 阅47 转0 评0 公众公开 19-09-17 16:08 |
IP 层的入口函数在 ip_rcv 函数。它首先会调用 ip_route_input 来更新路由,然后查找 route,决定该 package 将会被发到本机还是会被转发还是丢弃:如果是发到本机的话,调用 ip_local_deliver 函数,可能会做 de-fragment(合并多个 IP packet),然后调用 ip_local_deliver 函数。1.2.3 传输层 (TCP/UDP)传输层 TCP 处理入口在 tcp_v4_rcv ... 阅99 转1 评0 公众公开 19-09-17 15:44 |
TPROXY target checks whether there is an established socket for the incoming skb (using the tcp 4-tuples in the skb to search the established sockets), if there is a such socket and the socket has set IP_TRANSPARENT, it sets the fwmark for the skb and associates the skb with the socket and return NF_ACCEPT. If no est... 阅144 转0 评0 公众公开 19-09-12 09:41 |
netlink 套接字。// libnetlink.c 头文件中rtnl_open_byproto函数// 成功返回0, 失败返回-1int rtnl_open_byproto(struct rtnl_handle *rth, unsigned int subscriptions, int protocol){ socklen_t addr_len; int sndbuf = 32768; int one = 1; // 第一步:初值 memset(rth, 0, sizeof(*rth)); // 第二上:填充rth结构 rth->proto = ... 阅232 转0 评0 公众公开 19-09-10 09:47 |
ss-Linux unpv13e # cp config.h /usr/local/includess-Linux unpv13e # cp lib/unp.h /usr/local/includess-Linux unpv13e # sudo cp libunp.a /usr/local/libss-Linux unpv13e # cd intro.ss-Linux intro # ./daytimetcpcli 127.0.0.1connect error: Connection refused.ss-Linux intro # gcc daytimetcpcli.c -o 获取时间 -lunpss-Linux int... 阅259 转0 评0 公众公开 19-09-09 14:45 |
若忽略处理时间和发送确认分组时间,则该信道的利用率为( )0.0566解释:首先知道传递的数据时1200bit. 接下来计算有数据通过的时间,其中把速率的单位化成b/ms的形式,1Mb=1024Kb=1024*1024b=1048576b,1s=1000ms,所以1Mb/s=1048576/1000(b/ms)=1048.576b/ms,取近似1000b/ms 有数据通过的时间=1200/1000=1.2ms 利用率=1.2/(20... 阅606 转0 评0 公众公开 19-08-30 11:08 |