Network Applications - PowerPoint PPT Presentation

About This Presentation
Title:

Network Applications

Description:

search the two system list for packet type. ptype_all: ETH_P_ALL. ptype_base[]: main ... the data. call tcp_queue. Function Illustration (Cont.) tcp_queue ... – PowerPoint PPT presentation

Number of Views:40
Avg rating:3.0/5.0
Slides: 15
Provided by: cmlabCsi
Category:

less

Transcript and Presenter's Notes

Title: Network Applications


1
Network Applications
user
kernel
BSD Sockets
socket
INET Sockets
sock
sk_buff
TCP
UDP
IP
ARP
PPP
SLIP
Ethernet
2
sys_socketcall()
send
ip_queue_xmit
sys_send()
sock-gtops-gtsendmsg
dev_queue_xmit
inet_sendmsg()
do_dev_queue_xmit
sk-gtprot-gtsendmsg
tcp_sendmsg()
dev-gthard_start_xmit
el3_start_xmit()
do_tcp_sendmsg()
tcp_send_skb
sk-gtprot-gtqueue_xmit
3
(No Transcript)
4
do_tcp_sendmsg()
  • Allocate sk_buff
  • construct hardware and IP header
  • sk-gtprot-gtbuild_header()
  • ip_build_header
  • construct TCP header

5
ip_queue_xmit()
  • Partially initialize skb (sk_buff)
  • check free value
  • free 1 dont free, keep skb on the sk send
    list
  • free 0 after device send out, it will be
    freed
  • compute checksum
  • if lookback call ip_lookback()
  • if fragmentation call if_fragment()
  • call dev_queue_xmit()

6
do_dev_queue_xmit()
  • Lock device
  • check if transmission
  • find the corresponding list
  • queue the skb in the tail of list
  • dequeue the first skb in the list and call the
    dev-gthard_start_xmit()

7
el3_interrupt()
tcp_rcv
el3_rx()
tcp_data()
netif_rx()
tcp_queue()
sk-gtdata_ready()
net_bh()
def_callback2()
pt_prev-gtfun()
ip_rcv()
ipprot-gthandler()
8
Function Illustration
  • el3_interrupt()
  • get the device interface
  • call el3_rx()
  • el3_rx()
  • allocate sk_buff
  • determine the packets protocol ID
  • call netif_rx()

9
Function Illustration (Cont.)
  • netif_rx()
  • check if backlog_size is appropriate
  • if no gt drop
  • else enqueue in the system backlog list
  • call mark_bh()

10
Function Illustration (Cont.)
  • net_bh()
  • dev_transmit() check each network interface if
    anyone is ready to transmit
  • _sbk_unlink() dequeue the sk_buff from the
    backlog list
  • search the two system list for packet type
  • ptype_all ETH_P_ALL
  • ptype_base main protocol list
  • call pt_prev-gtfunc() i.e. ip_rcv()

11
Function Illustration (Cont.)
  • ip_rcv()
  • correction checking
  • ip_options_compile ip options preprocessing
  • ip_defrag()
  • if my packet
  • ip_option_processing
  • check if raw ip
  • find the protocol and call ipprot-gthandler()
    tcp_rcv()
  • else ip_forward()

12
Function Illustration (Cont.)
  • tcp_rcv()
  • _tcp_v4_lookup() find the upper INET sock
    structure
  • call tcp_data()
  • tcp_data()
  • handle the data
  • call tcp_queue

13
Function Illustration (Cont.)
  • tcp_queue()
  • tcp_insert_skb() add a sk_buff to the tcp
    receive queue (sk-gtreceive_queue)
  • sk-gtdata_ready() def_callback2()
  • def_callback2()
  • wake up the sleeping process

14
sys_socketcall()
sys_recv()
inet_recvmsg()
tcp_recvmsg()
Write a Comment
User Comments (0)
About PowerShow.com