• Kernel 源代码 小记


    1.Initial process

    2.Create Namespace

           fork(fork.c) -> do_fork(fork.c) -> copy_process(fork.c) -> copy_namespaces(nsproxy.c) -> create_new_namespaces(nsproxy.c) -> copy_net_ns(net_namespace.c) ->setup_net(net_namespace.c init networkspace)

    3.Receive package( TCP package)

            driver(xx-driver) -> netif_rx (dev.c) -> enqueue_to_backlog(dev.c) -> process_backlog(dev.c) -> __netif_receive_skb(dev.c) -> __netif_receive_skb_core(dev.c [handle_ing -> ing_filter -> qdisc_enqueue_root ]) -> deliver_skb(dev.c) -> ip_rcv(ip_input.c) -> ip_rcv_finish(ip_input.c) -> ip_route_input_noref(route.c) -> ip_route_input_slow(route.c) -> ip_local_deliver(ip_input.c) -> ip_local_deliver_finish(ip_input.c) -> tcp_v4_rcv(tcp_ipv4.c) -> tcp_v4_do_rcv(tcp_ipv4.c) -> tcp_child_process(tcp_minsocks.c) -> __sk_add_backlog(tcp_minsocks.c)

    4.Application -> L4(UDP)

         udp_rcv(udp.c)  -> __udp4_lib_rcv (udp.c)  ->  udp_queue_rcv_skb (udp.c)  -> __udp_queue_rcv_skb (udp.c)  ->  sock_queue_rcv_skb(sock.c)  ->  sock_def_readable [sk_data_ready] (sock.c) -> sock_def_readable (sock.c)  -> udp_sendmsg(udp.c)

    5.L4 (UDP)-> Application

        SYSCALL_DEFINE2[socketall](socket.c)  ->  SYSCALL_DEFINE3[sendmsg] (socket.c)  ->  __sys_sendmmsg(socket.c)  ->  sock_sendmsg(socket.c)  -> __sock_sendmsg(socket.c)  -> __sock_sendmsg_nosec(socket.c)  -> udp_sendmsg(udp.c) -> ip_make_skb(udp.c)  -> __ip_make_skb(ip_output.c)

    6.Transmit package: hp100-driver

       packet_snd(af_packet.c)->dev_queue_xmit(dev.c  ->__dev_xmit_skb [TC]) -> dev_hard_start_xmit(dev.c) -> hp100_start_xmit (hp100.c)-> hp100_start_interface(hp100.c)

    7.TC routine: htb

        qdisc_enqueue_root(sch_generic.h) -> qdisc_enqueue(sch_generic.h) -> htb_enqueue(sch_htb.c) ->htb_classify(sch_htb.c) -> flow_classify(cls_flow.c) -> tcf_exts_exec(pkt_cls.h) ->tcf_action_exec(act_api.c) -> tcf_act_police(act_police.c)

    8. Linux Bridge(Bridge配置IP可进三层路由):

        br_add_if(br_if.c)  -> br_handle_frame(br_input.c)  -> br_handle_frame_finish(br_input.c)  -> br_pass_frame_up(br_input.c)  ->  netif_receive_skb(dev.c)

  • 相关阅读:
    二、Cocos2dx概念介绍(游戏开发中不同的坐标系,cocos2dx锚点)
    (2)入门指南——(7)添加jquery代码(Adding our jQuery code)
    Citrix 服务器虚拟化之三十一 XenApp 6.5负载均衡
    CSS——inline-block属性
    VMware Workstation(虚拟机软件) V10.0 简体中文版可以安装了
    [.NET MVC4 入门系列01]Helloworld MVC 4 第一个MVC4程序
    ElasticSearch NEST笔记
    什么是REST API?
    ArrayList与List<T>笔记
    C# Socket SSL通讯笔记
  • 原文地址:https://www.cnblogs.com/gaozhengwei/p/7099843.html
Copyright © 2020-2023  润新知