User Tools

Site Tools


doc:networking:praxis

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
doc:networking:praxis [2012/12/02 03:05]
uvray313
doc:networking:praxis [2015/08/12 21:31] (current)
alessandro_s
Line 23: Line 23:
 {{http://​www.linuxfoundation.org/​images/​1/​1c/​Network_data_flow_through_kernel.png?​900}} {{http://​www.linuxfoundation.org/​images/​1/​1c/​Network_data_flow_through_kernel.png?​900}}
  
-  * [[http://gicl.cs.drexel.edu/​people/​sevy/​network/​Linux_network_stack_walkthrough.html|Linux Network Stack Walkthrough (Linux Kernel 2.4.20)]]+  * [[http://www.jsevy.com/​network/​Linux_network_stack_walkthrough.html|Linux Network Stack Walkthrough (Linux Kernel 2.4.20)]]
   * [[http://​www.google.com/​search?​q=Network+Data+Flow+through+the+Linux+Kernel&​btnG=Search&​hl=en&​gbv=1&​sei=Bv1dT4XfA_Da4QSM5ZG6Dw|google.com:​ "​Network Data Flow through the Linux Kernel"​]]   * [[http://​www.google.com/​search?​q=Network+Data+Flow+through+the+Linux+Kernel&​btnG=Search&​hl=en&​gbv=1&​sei=Bv1dT4XfA_Da4QSM5ZG6Dw|google.com:​ "​Network Data Flow through the Linux Kernel"​]]
  
Line 35: Line 35:
 === RX Reception === === RX Reception ===
   - Queue No.1: The hardware (NIC) puts all incoming network packets into the //​rx_ring//,​ a ring buffer the driver shares with the NIC   - Queue No.1: The hardware (NIC) puts all incoming network packets into the //​rx_ring//,​ a ring buffer the driver shares with the NIC
-  - Queue No.2: The //IRQ handler// of the driver takes the packet from the //​rx_ring//,​ puts it (by ([[wp>​Evaluation strategy#​Call_by_reference]])) in the //ingress buffer// (aka //backlog queue//) and schedules a SoftIRQ (in former days, every incoming packet triggered an IRQ, since Kernel FIXME this is solved by polling instead)+  - Queue No.2: The //IRQ handler// of the driver takes the packet from the //​rx_ring//,​ puts it (by ([[wp>​Evaluation strategy#​Call_by_reference]])) in the //ingress buffer// (aka //backlog queue//) and schedules a SoftIRQ (in kernels up to 2.4, every incoming packet triggered an IRQ, since Kernels 2.6 and the introduction of [[wp>​New_API|NAPI]] ​this is solved by polling instead: [[https://​lwn.net/​Articles/​30107/​]])
   - Queue No.3: is the the //receive socket buffer//   - Queue No.3: is the the //receive socket buffer//
  
Line 41: Line 41:
   * The //socket buffers// can be set by the application (''​set_sockopt()''​)   * The //socket buffers// can be set by the application (''​set_sockopt()''​)
     * ''​cat /​proc/​sys/​net/​core/​rmem_default''​ or ''​cat /​proc/​sys/​net/​core/​wmem_default''​     * ''​cat /​proc/​sys/​net/​core/​rmem_default''​ or ''​cat /​proc/​sys/​net/​core/​wmem_default''​
-  * The default queuing discipline is a FIFO queue. Default length is 100 packets (ether_setup():​ dev->​queue_len, ​drivers/net/net_init.c)+  * The default queuing discipline is a FIFO queue. Default length is 1000 packets (ether_setup():​ dev->​queue_len,​ net/ethernet/​eth.c)
   * The //tx_ring// and //rx_ring// are driver dependent (e.g. the e1000 driver set these lengths to 80 packets)   * The //tx_ring// and //rx_ring// are driver dependent (e.g. the e1000 driver set these lengths to 80 packets)
-  * The //backlog queue// is 300 packets in size (''/​proc/​sys/​net/​core/​netdev_max_backlog''​). Once it is full, it waits for being totally empty to allow again an enqueue() (netif_rx(),​ net/​core/​dev.c).+  * The //backlog queue// is 1,000 packets in size (''/​proc/​sys/​net/​core/​netdev_max_backlog''​). Once it is full, it waits for being totally empty to allow again an enqueue() (netif_rx(),​ net/​core/​dev.c).
  
 == /proc == == /proc ==
doc/networking/praxis.1354413958.txt.bz2 · Last modified: 2012/12/02 03:05 by uvray313