Three. Deep analysis of network subsystem
The user program sends this network packet over the network
Pass
Sci
Protocol-Independent Interfaces
Protocol stack the implementation of UDP chooses the route
The implementation of IP will establish this neighbor subsystem and establish the neighbor information
Device-Independent interfaces
Driven
function call relationship (corresponds to above)
Socket_file_ops
Do_sock_write
_sock_sendmsg
(SCI interface)
Udp_sendmsg (Routing Ip_route_output_flow)
Udp_push_pending_frames
(select route)
Ip_push_penging_frames
Ip_local_out (Implement firewall)
Dst_output
Ip_finish_output
Ip_finish_output2 (Dev->neighbour->output)
Neighbor Subsystem
Arp_generic_ops->neigh_resolve_output
(Establish neighbor Subsystem)
Dev_queue_xmit
Dev_hard_start_xmit
(Protocol Independent Interface)
Dev->netdev_ops->ndo_start_xmit
Driver
2. How the NIC receives the packet to the user for processing
Received function receive ()
will produce an interrupt
1. Acceptance
(1). Read data from hardware to SKB
(2). Call the Netif_rx () function
2.
Linux Network card device driver programming (3)