Fall 2017 :: CSE 306
(Linux) Networking
Nima Honarmand
(Linux) Networking Nima Honarmand Fall 2017 :: CSE 306 Network - - PowerPoint PPT Presentation
Fall 2017 :: CSE 306 (Linux) Networking Nima Honarmand Fall 2017 :: CSE 306 Network Layer Diagrams OSI and TCP/IP Stacks (From Understanding Linux Network Internals ) Used in Real World Fall 2017 :: CSE 306 Ethernet (IEEE 802.3)
Fall 2017 :: CSE 306
Nima Honarmand
Fall 2017 :: CSE 306
Used in Real World
Fall 2017 :: CSE 306
Fall 2017 :: CSE 306
Fall 2017 :: CSE 306
Fall 2017 :: CSE 306
Fall 2017 :: CSE 306
Fall 2017 :: CSE 306
Source: Understanding Linux Network Internals
Fall 2017 :: CSE 306
number
POSIX interface
Fall 2017 :: CSE 306
Fall 2017 :: CSE 306
the kernel provides a ton of other services
application send and receives
Fall 2017 :: CSE 306
Source: http://www.cs.unh.edu/cnrg/people/gherrin/linux-net.html
Fall 2017 :: CSE 306
NIC Driver
(such as NICs) use pre- allocated FIFOs of descriptors as device interface
(TX) and receive (RX) rings
queue usually points to a “buffer” where NIC should read data from (for send)
DRAM
buffer buffer buffer
RX Ring
buffer buffer
TX Ring
Use to receive Use to send
NIC Device
Write to (receive) Read from (send)
Fall 2017 :: CSE 306
well-sized to the load
memory overheads
Fall 2017 :: CSE 306
RX ring and advances head pointer
buffer?
Fall 2017 :: CSE 306
the TX ring tail
buffers in the ring?
interrupting
Fall 2017 :: CSE 306
→ Need to avoid spending much time in there
all devices, not just for network
Fall 2017 :: CSE 306
bottom half
interrupt
handler from IDT)
Fall 2017 :: CSE 306
code itself
calls the function for pending Soft-IRQs
Fall 2017 :: CSE 306
exceptions/interrupts/syscalls
nothing else to do
user mode
Fall 2017 :: CSE 306
1) Minimizes time in an interrupt handler with interrupts disabled 2) Simplifies service routines (defer complicated
3) Gives kernel more scheduling flexibility
application threads
Fall 2017 :: CSE 306
Fall 2017 :: CSE 306
Moving pointers is better than removing headers
Prepending headers is more efficient than re- copy
head/end vs. data/tail pointers in sk_buff Source: Understanding Linux Network Internals
Fall 2017 :: CSE 306
Fall 2017 :: CSE 306
buffer and copies to user-mode buffer and returns to user mode
Fall 2017 :: CSE 306
Source: http://www.cs.unh.edu/cnrg/people/gherrin/linux-net.html
Fall 2017 :: CSE 306
Fall 2017 :: CSE 306
frequency?
progress
just the top half on a million
Fall 2017 :: CSE 306
Ideal Source: Mogul & Ramakrishnan, ToCS, Aug 1997
Fall 2017 :: CSE 306
Fall 2017 :: CSE 306
batch
Fall 2017 :: CSE 306
Fall 2017 :: CSE 306
Fall 2017 :: CSE 306
problem? 1) For disk, if CPU is too busy processing previous disk requests, it can’t issue more 2) For network, external CPU can generate all sorts
Fall 2017 :: CSE 306
the device
interrupts)
→ Packets dropped in the device itself without involving the CPU
Fall 2017 :: CSE 306
buffers as their interfaces