Network Applications
This presentation is the property of its rightful owner.
Sponsored Links
1 / 14

Network Applications PowerPoint PPT Presentation


  • 77 Views
  • Uploaded on
  • Presentation posted in: General

Network Applications. user. kernel. socket. BSD Sockets. sock. INET Sockets. sk_buff. TCP. UDP. IP. ARP. PPP. SLIP. Ethernet. sys_socketcall(). send. ip_queue_xmit. sys_send(). sock->ops->sendmsg. dev_queue_xmit. inet_sendmsg(). do_dev_queue_xmit. sk->prot->sendmsg.

Download Presentation

Network Applications

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Network applications

Network Applications

user

kernel

socket

BSD

Sockets

sock

INET

Sockets

sk_buff

TCP

UDP

IP

ARP

PPP

SLIP

Ethernet


Network applications

sys_socketcall()

send

ip_queue_xmit

sys_send()

sock->ops->sendmsg

dev_queue_xmit

inet_sendmsg()

do_dev_queue_xmit

sk->prot->sendmsg

tcp_sendmsg()

dev->hard_start_xmit

el3_start_xmit()

do_tcp_sendmsg()

tcp_send_skb

sk->prot->queue_xmit


Do tcp sendmsg

do_tcp_sendmsg()

  • Allocate sk_buff

  • construct hardware and IP header

    • sk->prot->build_header()

      • ip_build_header

  • construct TCP header


Ip queue xmit

ip_queue_xmit()

  • Partially initialize skb (sk_buff)

  • check “free” value

    • free == 1: don’t 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()


Do dev queue xmit

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->hard_start_xmit()


Network applications

el3_interrupt()

tcp_rcv

el3_rx()

tcp_data()

netif_rx()

tcp_queue()

sk->data_ready()

net_bh()

def_callback2()

pt_prev->fun()

ip_rcv()

ipprot->handler()


Function illustration

Function Illustration

  • el3_interrupt()

    • get the device interface

    • call el3_rx()

  • el3_rx()

    • allocate sk_buff

    • determine the packet’s protocol ID

    • call netif_rx()


Function illustration cont

Function Illustration (Cont.)

  • netif_rx()

    • check if backlog_size is appropriate

    • if no => drop

    • else enqueue in the system backlog list

    • call mark_bh()


Function illustration cont1

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->func() : i.e. ip_rcv()


Function illustration cont2

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->handler(): tcp_rcv()

    • else ip_forward()


Function illustration cont3

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


Function illustration cont4

Function Illustration (Cont.)

  • tcp_queue()

    • tcp_insert_skb(): add a sk_buff to the tcp receive queue (sk->receive_queue)

    • sk->data_ready(): def_callback2()

  • def_callback2()

    • wake up the sleeping process


Network applications

sys_socketcall()

sys_recv()

inet_recvmsg()

tcp_recvmsg()


  • Login