3.中间的一些分片等,可参阅相关文档。基本思想是,当报文的长度大于mtu,gso的长度不为0就会调用 ip_fragment 进行分片,否则就会调用ip_finish_output2把数据发送出去。ip_fragment 函数中,会检查 IP_DF 标志位,如果待分片IP数据包禁止分片,则调用 icmp_send()向发送方发送一个原因为需要分片而设置了不分片标志的...
3.中间的一些分片等,可参阅相关文档。基本思想是,当报文的长度大于mtu,gso的长度不为0就会调用 ip_fragment 进行分片,否则就会调用ip_finish_output2把数据发送出去。ip_fragment 函数中,会检查 IP_DF 标志位,如果待分片IP数据包禁止分片,则调用 icmp_send()向发送方发送一个原因为需要分片而设置了不分片标志的...
In this case, you can run the mtu command to set the size of a fragment. Therefore, a proper MTU is a prerequisite for normal communication on a network. If the configured MTU is excessively small and the packet size is larger, packets are discarded when being forwarded through the ...
会调用 ip_route_input 来更新路由,然后查找 route,决定该会被发到本机还是会被转发还是丢弃: 如果发到本机的话,调用 ip_local_deliver 函数,可能会做 de-fragment(合并多个包),并调用ip_local_deliver_finish。最后调用下一层接口,包括 tcp_v4_rcv (TCP), udp_rcv (UDP),icmp_rcv (ICMP),igmp_rcv(IGM...
如果是发到本机的话,调用ip_local_deliver 函数,可能会做 de-fragment(合并多个 IP packet),然后调用ip_local_deliver函数。该函数根据 package 的下一个处理层的 protocal number,调用下一层接口,包括 tcp_v4_rcv (TCP), udp_rcv (UDP),icmp_rcv (ICMP),igmp_rcv(IGMP)。对于 TCP 来说,函数 tcp_v4_...
In this case, you can run the mtu command to set the size of a fragment. Therefore, a proper MTU is a prerequisite for normal communication on a network. If the configured MTU is excessively small and the packet size is larger, packets are discarded when being forwarded through the ...
如果是发到本机的话,调用ip_local_deliver 函数,可能会做 de-fragment(合并多个 IP packet),然后调用ip_local_deliver函数。该函数根据 package 的下一个处理层的 protocal number,调用下一层接口,包括 tcp_v4_rcv (TCP), udp_rcv (UDP),icmp_rcv (ICMP),igmp_rcv(IGMP)。对于 TCP 来说,函数 tcp_v4_...
如果分片就调用ip_fragment,否则就调用IP_finish_output2函数: 在构造好 ip 头,检查完分片之后,会调用邻居子系统的输出函数 neigh_output 进行输 出。neigh_output函数如下: 输出分为有二层头缓存和没有两种情况,有缓存时调用 neigh_hh_output 进行快速输 出,没有缓存时,则调用邻居子系统的输出回调函数进行慢速...
23 fragmented, 47 fragments, 0 couldn't fragment Bcast: 4055 received, 0 sent Mcast: 0 received, 1637 sent Sent: 59701 generated, 37355184 forwarded Drop: 0 encapsulation failed, 0 unresolved, 0 no adjacency 19 no route, 0 unicast RPF, 0 forced drop 0 options denied Drop: 0 packets with...
ip_queue_xmit()首先为输入包建立IP包头, 经过本地包过滤器后,再将IP包分片输出(ip_fragment)。 1int__ip_queue_xmit(structsock *sk,structsk_buff *skb,structflowi *fl,2__u8 tos)3{4structinet_sock *inet =inet_sk(sk);5structnet *net =sock_net(sk);6structip_options_rcu *inet_opt;7...