SlideShare a Scribd company logo
Linux Networking Architecture
Hugo
9/11/2014
Outline
• Architecture of Communication System
• Managing Network Packets
• Network Device
• Data-Link Layer
• Network Layer
• Transport Layer
• Sockets in Linux Kernel
• Socket Programming
Outline
• Architecture of Communication System
• Managing Network Packets
• Network Device
• Data-Link Layer
• Network Layer
• Transport Layer
• Sockets in Linux Kernel
• Socket Programming
Linux Kernel Structure
Layer-Based Communication
TCP/IP Reference Model
Vertical & Horizontal Comm.
PDU Protocol Data Unit
PCI Protocol Control Information
SDU Service Data Unit
ICI Interface Control Information
IDU Interface Data Unit
Outline
• Architecture of Communication System
• Managing Network Packets
• Network Device
• Data-Link Layer
• Network Layer
• Transport Layer
• Sockets in Linux Kernel
• Socket Programming
Socket Buffer
• socket buffers are data structures used to represent and manage packets
Layer 4 Layer 3Layer 5-7
Operations on Socket Buffers
• Create, Release, Duplicate Socket Buffers
– alloc_skb(), skb_copy(), skb_copy_expand(),
skb_clone(), kfree_skb(), skb_header_init()
• Manipulate Packet Data Space
– skb_get(), skb_put(), skb_push(),
skb_pull(), skb_tailroom(), skb_headroom(),
skb_realloc_headroom(), skb_reserve(),
skb_trim(), skb_cow()
• Manage Socket Buffer Queues
– skb_cloned(), skb_over_panic(),
skb_under_panic(), skb_head_to_pool(),
skb_head_from_pool()
Socket-Buffer Queue
Operations on Socket-Buffer Queues
• Manage Queue Structures
– skb_queue_head_init(), skb_queue_empty(),
skb_queue_len()
• Manage Socket Buffers in Queues
– skb_queue_head(), skb_queue_tail(),
skb_dequeue(), skb_dequeue_tail(),
skb_queue_purge(), skb_insert(),
skb_append(), skb_unlink(), skb_peek(),
skb_peek_tail()
Outline
• Architecture of Communication System
• Managing Network Packets
• Network Device
• Data-Link Layer
• Network Layer
• Transport Layer
• Sockets in Linux Kernel
• Socket Programming
Network Device Interface
The net_device Structure
• General Fields of a Network Device
– name, next, owner, ifindex, iflink, state, trans_start, last_rx,
priv, qdisc, refcnt, xmit_lock, xmit_lock_owner, queue_lock
• Hardware-Specific Fields
– rmem_end, rmem_start, mem_end, mem_start , base_addr, irq, dma,
if_port
• Data on the Physical Layer
– hard_header_length, mtu, tx_queue_len, type, addr_len, dev_addr,
broadcast, dev_mc_list, mc_count, watchdog_timeo, watchdog_timer
• Data on the Network Layer
– ip_ptr, ip6_ptr, atalk_ptr, dn_ptr, ec_ptr, family, pa_alen,
pa_addr, pa_braddr, pa_mask, pa_dstaddr, flags
• Device-Driver Methods
– init(), uninit(), destructor(), open(), stop(), hard_start_xmit(),
get_stats(), get_wireless_stats(), set_multicast_list(),
watchdog_timeo(), do_ioctl(), set_config(), hard_header(),
rebuild_header(), hard_header_cache(), header_cache_update(),
hard_header_parse(), set_mac_address(), change_mtu()
Managing Network Devices
• Registering and Unregistering Network Devices
– init_netdev(), init_etherdev(), ether_setup(),
register_netdevice(), unregister_netdevice()
• Opening and Closing Network Devices
– dev_open(), dev_close()
• Creating and Finding Network Devices
– dev_alloc_name(), dev_alloc(), dev_get_by_name(),
dev_get_by_index(), dev_load()
• Notification Chains for State Changes
– notifier_call(), notifier_call_chain(),
register_netdevice_notifier(),
unregister_netdevice_notifier()
• Transmitting over Network Devices
– dev_queue_xmit()
Linked List of net_device
Managing Network Drivers
• Initializing Network Adapters
• Opening and Closing a Network Adapter
• Transmitting Data
• Problems In Transmitting Packets
• Runtime Configuration
• Adapter-Specific ioctl() Commands
• Statistical Information About a Network Device
• Multicast Support on Adapter Level
Transmitting Data Packets
static int net_send_packet(struct sk_buff *skb, struct
net_device *dev) {
struct net_local *np = (struct net_local *)dev->priv;
int ioaddr = dev->base_addr;
short length = ETH_ZLEN < skb->len ? skb->len :
ETH_ZLEN;
unsigned char *buf = skb->data;
hardware_send_packet(ioaddr, buf, length);
np->stats.tx_bytes += skb->len;
dev->trans_start = jiffies;
if (inw(ioaddr) == /*RU*/81)
np->stats.tx_aborted_errors++;
dev_kfree_skb (skb);
Interrupts from Network Adapter
Receiving Packets from Adapter
static void net_interrupt(int irq, void *dev_id, struct
pt_regs * regs) {
ioaddr = dev->base_addr;
np = (struct net_local *)dev->priv;
status = inw(ioaddr + 0);
if (status & RX_INTR) {
net_rx(dev);
}
if (status & TX_INTR) {
net_tx(dev);
np->stats.tx_packets++;
netif_wake_queue(dev);
}
Receiving a Data Packet
static void net_rx(struct net_device *dev) {
do {
if (pkt_len == 0)
break;
if (status & 0x40) {
/* There was an error. */
}else{
skb = dev_alloc_skb(pkt_len);
ptr = skb_put(skb,pkt_len);
memcpy(ptr, (void*)dev->rmem_start, pkt_len);
netif_rx(skb);
}
} while (–boguscount);
Acknowledging a Transmission
void net_tx(struct net_device *dev) {
spin_lock(&np->lock);
while (tx_entry_is_sent(np, entry)) {
struct sk_buff *skb = np->skbs[entry];
np->stats.tx_bytes += skb->len;
dev_kfree_skb_irq (skb);
entry = next_tx_entry(np, entry);
}
if (netif_queue_stopped(dev) && ! tx_full(dev))
netif_wake_queue(dev);
spin_unlock(&np->lock);
Outline
• Architecture of Communication System
• Managing Network Packets
• Network Device
• Data-Link Layer
• Network Layer
• Transport Layer
• Sockets in Linux Kernel
• Socket Programming
Media Access & Data-Link Layer
• Data-Link Layer (Ethernet)
• The Serial-Line Internet Protocol (SLIP)
• The Point-to-Point Protocol (PPP)
• PPP over Ethernet
• Asynchronous Transfer Mode—ATM
• Bluetooth in Linux
• Transparent Bridges
Implementation of Data Link Layer
LLC (Logical-Link Control) provide a uniform interface for the upper layer.
MAC (Media-Access Control) handles the media-specific part.
Linux Network Activity
eth_type_trans(skb, dev)
• Recognize the LLC protocol type used and protocol ID of layer-3
• Identify the packet type (unicast, multicast, broadcast)
• Check whether the packet is addressed to the local computer
Internet Protocol Suite
SSH Secure Socket Shell
FTP File Transfer Protocol
DNS Domain Name Service
SMTP Simple Mail Transfer Protocol
TCP Transmission Control Protocol
UDP User Datagram Protocol
IP Internet Protocol
ICMP Internet Control Message Protocol
IGMP Internet Group Management Protocol
ARP Address Resolution Protocol
RARP Reverse Address Resolution Protocol
Outline
• Architecture of Communication System
• Managing Network Packets
• Network Device
• Data-Link Layer
• Network Layer
• Transport Layer
• Sockets in Linux Kernel
• Socket Programming
Network Layer
• IPv4 - Internet Protocol Version 4
• Internet Control Message Protocol (ICMP)
• Address Resolution Protocol (ARP)
• IP Routing
• IP Multicast for Group Communication
• Using Traffic Control to Support Quality of Service (QoS)
• Packet Filters and Firewalls
• Connection Tracking
• Network Address Translation (NAT)
• IPv6 - Internet Protocol Version 6
Internet Protocol
• Provides an unsecured connectionless
datagram service
• Defines IP datagrams as basic units for data
transmission
• Defines the IP addressing scheme
• Routes and forwards IP datagrams across
interconnected networks
• Verifies the lifetime of packets
• Fragments and reassembles packets
• Uses ICMP to output errors
Routing IP Packets between LANs
IP Packet Header
IP Address Classes
The class-A network address 127 represents the loopback network device of a computer.
An IP address with all bits of the computer part set to zero identifies the network itself.
An IP address where the computer part consists of 1-bits defines a broadcast address.
Delivering Packets Locally
• If ip_route_input() is the selected route,
then the packet is addressed to the local
computer. In this case, branching is
to ip_local_deliver() rather than
to ip_forward().
– Reassemble fragmented packets
– ip_local_deliver_finish(): RAW-IP socket or up
to transport layer
Fragmenting an IP Datagram
Each network has a maximum packet size, which is called Maximum
Transfer Unit (MTU). If the MTU of a transmission medium is smaller than
the size of a packet, then the packet has to be split into smaller IP packets.
MTU=1000
MTU=600
The saddr, daddr, id, and protocol elements are keys for the hash
function and the allocation of incoming fragments to their IP datagrams.
Transport-Layer Packets
IP Network Device
IP Options
Class Number Length Name
0 0 - End of Option
0 1 - No Operation
0 2 11 Security
0 3 var Loose Source Routing
0 9 var Strict Source Routing
0 7 var Record Route
0 8 4 Stream ID
2 4 var Internet Timestamp
copy
flag
option
class
option
number
1-bit 2-bit 5-bit
IP Options in the IP layer
Internet Control Message Protocol
• Error-report mechanism for the IP layer.
• The most popular application of ICMP is
error detection or error diagnostics. (ping)
ICMP Packet Header
ICMP Packet Type (RFC 792)
Type Description
Destination Unreachable The destination address cannot be reached.
Time Exceeded A packet was discarded, because its TTL
has expired.
Parameter Problem Unknown or false options.
Source Quench Informs the sender that IP packets were
lost to overload.
Redirect Enables path optimization.
Echo and Echo Reply The data sent to the destination address is
returned in a reply.
Timestamp and Timestamp Reply The timestamp sent to the destination
address is used-to reply with the timestamp
of the destination address.
Information Request und Information Reply Request/reply used to find the network a
computer connects to.
ICMP in the Linux Kernel
• Sending ICMP Packets
– icmp_send()
• Handling Incoming ICMP Packets
– icmp_rcv(), icmp_reply(), icmp_redirect(),
icmp_unreach(), icmp_echo(), icmp_timestamp(),
icmp_addres(), icmp_address_reply()
• ICMP messages generated within the kernel
Address Resolution Protocol
ARP Command
root@tux # arp -a
IP address HW type HW address
129.25.10.97 10Mbit/s Ethernet 49:72:16:08:80:70
129.25.10.72 10Mbit/s Ethernet 49:72:16:08:64:14
129.25.10.81 10Mbit/s Ethernet 49:17:92:96:96:96
Outline
• Architecture of Communication System
• Managing Network Packets
• Network Device
• Data-Link Layer
• Network Layer
• Transport Layer
• Sockets in Linux Kernel
• Socket Programming
Transport Layer
• Transmission Control Protocol (TCP)
• User Datagram Protocol (UDP)
Transmission Control Protocol
• Connection orientation
• Peer-to-peer communication
• Complete reliability
• Full-duplex communication
• Byte-stream interface
• Reliable connection startup
• Graceful connection shutdown
TCP Packet Header
URG points to important data that have to be forwarded immediately.
SYN is used to establish connections. SYN = 1 denotes a connection request.
ACK shows that the ACKNOWLEDGEMENT NUMBER field includes relevant data.
RST can request a connection to be reset. RST = 1 denotes a request to reset a connection.
PSH means that the TCP instance must immediately pass the data received to the higher layers.
FIN means that the connection is to be torn down.
Receiving TCP Segment
Sending TCP Segments
Flow Control
Sliding-Window
Packet Loss & Fast Retransmit
Detecting & Handling Congestions
Congestion Avoidance
User Datagram Protocol
• Same functionality as Internet Protocol (IP)
• Connectionless
• Unreliable service
• Cannot detect and handle lost or duplicate
packets
• Transmitting data easily and quickly
• For audio or video streaming
UDP Packet Format
UDP Header & Payload
Service Interface to App Layer
Outline
• Architecture of Communication System
• Managing Network Packets
• Network Device
• Data-Link Layer
• Network Layer
• Transport Layer
• Sockets in Linux Kernel
• Socket Programming
Socket Support in Linux Kernel
if copy_from_user(a, args, nargs[call]))
return -EFAULT;
a0=a[0];
a1=a[1];
switch(call) {
case SYS_SOCKET:
err = sys_socket(a0,a1,a[2]);
break;
case SYS_BIND:
err = sys_bind(a0, (struct sockaddr *)a1, a[2]);
break;
case SYS_CONNECT:
err = sys_connect (a0, (struct sockaddr *)a1, a[2]);
break;
case SYS_LISTEN:
err = sys_listen (a0,a1);
break;
}
int socket (int family, int type, int protocol)
int bind(int sockfd, struct sockaddr *mAddress, int AddrLength)
int connect(int sockfd, struct sockaddr *ServAddr, int AddrLength)
int listen(int sockfd, int backlog)
sys_socketcall()
BSD Socket
PF_INET Socket
Outline
• Architecture of Communication System
• Managing Network Packets
• Network Device
• Data-Link Layer
• Network Layer
• Transport Layer
• Sockets in Linux Kernel
• Socket Programming
System Calls at Socket Interface
Data Transmission
• Transmitting data
size_t write(sockfd, buffer, length)
int send(sockfd, buffer, length, flags)
int sendto(sockfd, buffer, length, flags, destaddr, addrlen)
• Receiving data
size_t read(sockfd, buffer, length)
int recv(sockfd, buffer, length, flags)
int recvfrom (sockfd, buffer, length, flags, fromaddr,
addrlen)
• Rransmit and receive an array of iovec structures
int readv(int sockfd, const struct iovec *vector, size_t
count)
int writev(int sockfd, const struct iovec *vector, size_t
count)
int sendmsg(int sockfd, const struct msghdr *msg, int flags)
int recvmsg(int sockfd, struct msghdr *msg, int flags)
Q & A
• Architecture of Communication System
• Managing Network Packets
• Network Device
• Data-Link Layer
• Network Layer
• Transport Layer
• Sockets in Linux Kernel
• Socket Programming

More Related Content

What's hot

DoS and DDoS mitigations with eBPF, XDP and DPDK
DoS and DDoS mitigations with eBPF, XDP and DPDKDoS and DDoS mitigations with eBPF, XDP and DPDK
DoS and DDoS mitigations with eBPF, XDP and DPDK
Marian Marinov
 
Faster packet processing in Linux: XDP
Faster packet processing in Linux: XDPFaster packet processing in Linux: XDP
Faster packet processing in Linux: XDP
Daniel T. Lee
 
Linux Networking Explained
Linux Networking ExplainedLinux Networking Explained
Linux Networking Explained
Thomas Graf
 
BPF / XDP 8월 세미나 KossLab
BPF / XDP 8월 세미나 KossLabBPF / XDP 8월 세미나 KossLab
BPF / XDP 8월 세미나 KossLab
Taeung Song
 
VLANs in the Linux Kernel
VLANs in the Linux KernelVLANs in the Linux Kernel
VLANs in the Linux Kernel
Kernel TLV
 
FD.io VPP事始め
FD.io VPP事始めFD.io VPP事始め
FD.io VPP事始め
tetsusat
 
Fun with Network Interfaces
Fun with Network InterfacesFun with Network Interfaces
Fun with Network Interfaces
Kernel TLV
 
BPF - in-kernel virtual machine
BPF - in-kernel virtual machineBPF - in-kernel virtual machine
BPF - in-kernel virtual machine
Alexei Starovoitov
 
High-Performance Networking Using eBPF, XDP, and io_uring
High-Performance Networking Using eBPF, XDP, and io_uringHigh-Performance Networking Using eBPF, XDP, and io_uring
High-Performance Networking Using eBPF, XDP, and io_uring
ScyllaDB
 
DPDK KNI interface
DPDK KNI interfaceDPDK KNI interface
DPDK KNI interface
Denys Haryachyy
 
DPDK in Containers Hands-on Lab
DPDK in Containers Hands-on LabDPDK in Containers Hands-on Lab
DPDK in Containers Hands-on Lab
Michelle Holley
 
eBPF Workshop
eBPF WorkshopeBPF Workshop
eBPF Workshop
Michael Kehoe
 
Linux Ethernet device driver
Linux Ethernet device driverLinux Ethernet device driver
Linux Ethernet device driver
艾鍗科技
 
Understanding eBPF in a Hurry!
Understanding eBPF in a Hurry!Understanding eBPF in a Hurry!
Understanding eBPF in a Hurry!
Ray Jenkins
 
Hands-on ethernet driver
Hands-on ethernet driverHands-on ethernet driver
Hands-on ethernet driver
SUSE Labs Taipei
 
introduction to linux kernel tcp/ip ptocotol stack
introduction to linux kernel tcp/ip ptocotol stack introduction to linux kernel tcp/ip ptocotol stack
introduction to linux kernel tcp/ip ptocotol stack
monad bobo
 
The Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast StorageThe Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast Storage
Kernel TLV
 
Tcpdump
TcpdumpTcpdump
Tcpdump
Sourav Roy
 
Network Programming: Data Plane Development Kit (DPDK)
Network Programming: Data Plane Development Kit (DPDK)Network Programming: Data Plane Development Kit (DPDK)
Network Programming: Data Plane Development Kit (DPDK)
Andriy Berestovskyy
 
Intel DPDK Step by Step instructions
Intel DPDK Step by Step instructionsIntel DPDK Step by Step instructions
Intel DPDK Step by Step instructions
Hisaki Ohara
 

What's hot (20)

DoS and DDoS mitigations with eBPF, XDP and DPDK
DoS and DDoS mitigations with eBPF, XDP and DPDKDoS and DDoS mitigations with eBPF, XDP and DPDK
DoS and DDoS mitigations with eBPF, XDP and DPDK
 
Faster packet processing in Linux: XDP
Faster packet processing in Linux: XDPFaster packet processing in Linux: XDP
Faster packet processing in Linux: XDP
 
Linux Networking Explained
Linux Networking ExplainedLinux Networking Explained
Linux Networking Explained
 
BPF / XDP 8월 세미나 KossLab
BPF / XDP 8월 세미나 KossLabBPF / XDP 8월 세미나 KossLab
BPF / XDP 8월 세미나 KossLab
 
VLANs in the Linux Kernel
VLANs in the Linux KernelVLANs in the Linux Kernel
VLANs in the Linux Kernel
 
FD.io VPP事始め
FD.io VPP事始めFD.io VPP事始め
FD.io VPP事始め
 
Fun with Network Interfaces
Fun with Network InterfacesFun with Network Interfaces
Fun with Network Interfaces
 
BPF - in-kernel virtual machine
BPF - in-kernel virtual machineBPF - in-kernel virtual machine
BPF - in-kernel virtual machine
 
High-Performance Networking Using eBPF, XDP, and io_uring
High-Performance Networking Using eBPF, XDP, and io_uringHigh-Performance Networking Using eBPF, XDP, and io_uring
High-Performance Networking Using eBPF, XDP, and io_uring
 
DPDK KNI interface
DPDK KNI interfaceDPDK KNI interface
DPDK KNI interface
 
DPDK in Containers Hands-on Lab
DPDK in Containers Hands-on LabDPDK in Containers Hands-on Lab
DPDK in Containers Hands-on Lab
 
eBPF Workshop
eBPF WorkshopeBPF Workshop
eBPF Workshop
 
Linux Ethernet device driver
Linux Ethernet device driverLinux Ethernet device driver
Linux Ethernet device driver
 
Understanding eBPF in a Hurry!
Understanding eBPF in a Hurry!Understanding eBPF in a Hurry!
Understanding eBPF in a Hurry!
 
Hands-on ethernet driver
Hands-on ethernet driverHands-on ethernet driver
Hands-on ethernet driver
 
introduction to linux kernel tcp/ip ptocotol stack
introduction to linux kernel tcp/ip ptocotol stack introduction to linux kernel tcp/ip ptocotol stack
introduction to linux kernel tcp/ip ptocotol stack
 
The Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast StorageThe Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast Storage
 
Tcpdump
TcpdumpTcpdump
Tcpdump
 
Network Programming: Data Plane Development Kit (DPDK)
Network Programming: Data Plane Development Kit (DPDK)Network Programming: Data Plane Development Kit (DPDK)
Network Programming: Data Plane Development Kit (DPDK)
 
Intel DPDK Step by Step instructions
Intel DPDK Step by Step instructionsIntel DPDK Step by Step instructions
Intel DPDK Step by Step instructions
 

Viewers also liked

Bandwidth Management on Linux
Bandwidth Management on LinuxBandwidth Management on Linux
Bandwidth Management on Linux
KHNOG
 
Networking, QoS, Liberty, Mitaka and Newton - Livnat Peer - OpenStack Day Isr...
Networking, QoS, Liberty, Mitaka and Newton - Livnat Peer - OpenStack Day Isr...Networking, QoS, Liberty, Mitaka and Newton - Livnat Peer - OpenStack Day Isr...
Networking, QoS, Liberty, Mitaka and Newton - Livnat Peer - OpenStack Day Isr...
Cloud Native Day Tel Aviv
 
Tc basics
Tc basicsTc basics
Tc basics
jeromy fu
 
Network emulator
Network emulatorNetwork emulator
Network emulator
jeromy fu
 
BPF: Next Generation of Programmable Datapath
BPF: Next Generation of Programmable DatapathBPF: Next Generation of Programmable Datapath
BPF: Next Generation of Programmable Datapath
Thomas Graf
 
Cilium - Container Networking with BPF & XDP
Cilium - Container Networking with BPF & XDPCilium - Container Networking with BPF & XDP
Cilium - Container Networking with BPF & XDP
Thomas Graf
 
Cilium - Fast IPv6 Container Networking with BPF and XDP
Cilium - Fast IPv6 Container Networking with BPF and XDPCilium - Fast IPv6 Container Networking with BPF and XDP
Cilium - Fast IPv6 Container Networking with BPF and XDP
Thomas Graf
 
Wire harness & cable assembly 進階瞭解
Wire harness & cable assembly 進階瞭解Wire harness & cable assembly 進階瞭解
Wire harness & cable assembly 進階瞭解Yung Jui Chen 陳泳睿
 
Continuous integration
Continuous integrationContinuous integration
Continuous integration
hugo lu
 
Wire harness & cable assembly 基礎認識
Wire harness & cable assembly 基礎認識Wire harness & cable assembly 基礎認識
Wire harness & cable assembly 基礎認識
Yung Jui Chen 陳泳睿
 
B+S油封選用
B+S油封選用B+S油封選用
B+S油封選用
ychsiehme
 
모바일한글입력표준화
모바일한글입력표준화모바일한글입력표준화
모바일한글입력표준화lsmgame
 
Dev ops 簡介
Dev ops 簡介Dev ops 簡介
Dev ops 簡介
hugo lu
 
Ds 017 機械公差配合
Ds 017 機械公差配合Ds 017 機械公差配合
Ds 017 機械公差配合handbook
 
Wire harness & cable assembly 塑膠概論
Wire harness & cable assembly 塑膠概論Wire harness & cable assembly 塑膠概論
Wire harness & cable assembly 塑膠概論
Yung Jui Chen 陳泳睿
 
困境與轉型:一個小型開發團隊的 DevOps 學習之旅
困境與轉型:一個小型開發團隊的 DevOps 學習之旅困境與轉型:一個小型開發團隊的 DevOps 學習之旅
困境與轉型:一個小型開發團隊的 DevOps 學習之旅
Chen Cheng-Wei
 
提到 DevOps 到底在
談些什麼玩意兒?(@ Agile Tour Taichung 2017)
提到 DevOps 到底在
談些什麼玩意兒?(@ Agile Tour Taichung 2017)提到 DevOps 到底在
談些什麼玩意兒?(@ Agile Tour Taichung 2017)
提到 DevOps 到底在
談些什麼玩意兒?(@ Agile Tour Taichung 2017)
Chen Cheng-Wei
 
從廢柴到成材 - 那 20 個 sprints 教會我們的事 C.C Agile #40
從廢柴到成材 - 那 20 個 sprints 教會我們的事 C.C Agile #40從廢柴到成材 - 那 20 個 sprints 教會我們的事 C.C Agile #40
從廢柴到成材 - 那 20 個 sprints 教會我們的事 C.C Agile #40
diro fan
 
DevOps:建造開發維運的跨界之橋 (@ C.C. Agile #37)
DevOps:建造開發維運的跨界之橋 (@ C.C. Agile #37)DevOps:建造開發維運的跨界之橋 (@ C.C. Agile #37)
DevOps:建造開發維運的跨界之橋 (@ C.C. Agile #37)
Chen Cheng-Wei
 

Viewers also liked (20)

Bandwidth Management on Linux
Bandwidth Management on LinuxBandwidth Management on Linux
Bandwidth Management on Linux
 
Networking, QoS, Liberty, Mitaka and Newton - Livnat Peer - OpenStack Day Isr...
Networking, QoS, Liberty, Mitaka and Newton - Livnat Peer - OpenStack Day Isr...Networking, QoS, Liberty, Mitaka and Newton - Livnat Peer - OpenStack Day Isr...
Networking, QoS, Liberty, Mitaka and Newton - Livnat Peer - OpenStack Day Isr...
 
Tc basics
Tc basicsTc basics
Tc basics
 
Network emulator
Network emulatorNetwork emulator
Network emulator
 
BPF: Next Generation of Programmable Datapath
BPF: Next Generation of Programmable DatapathBPF: Next Generation of Programmable Datapath
BPF: Next Generation of Programmable Datapath
 
Cilium - Container Networking with BPF & XDP
Cilium - Container Networking with BPF & XDPCilium - Container Networking with BPF & XDP
Cilium - Container Networking with BPF & XDP
 
Cilium - Fast IPv6 Container Networking with BPF and XDP
Cilium - Fast IPv6 Container Networking with BPF and XDPCilium - Fast IPv6 Container Networking with BPF and XDP
Cilium - Fast IPv6 Container Networking with BPF and XDP
 
Wire harness & cable assembly 進階瞭解
Wire harness & cable assembly 進階瞭解Wire harness & cable assembly 進階瞭解
Wire harness & cable assembly 進階瞭解
 
Continuous integration
Continuous integrationContinuous integration
Continuous integration
 
Wire harness & cable assembly 基礎認識
Wire harness & cable assembly 基礎認識Wire harness & cable assembly 基礎認識
Wire harness & cable assembly 基礎認識
 
B+S油封選用
B+S油封選用B+S油封選用
B+S油封選用
 
모바일한글입력표준화
모바일한글입력표준화모바일한글입력표준화
모바일한글입력표준화
 
咬花簡介
咬花簡介咬花簡介
咬花簡介
 
Dev ops 簡介
Dev ops 簡介Dev ops 簡介
Dev ops 簡介
 
Ds 017 機械公差配合
Ds 017 機械公差配合Ds 017 機械公差配合
Ds 017 機械公差配合
 
Wire harness & cable assembly 塑膠概論
Wire harness & cable assembly 塑膠概論Wire harness & cable assembly 塑膠概論
Wire harness & cable assembly 塑膠概論
 
困境與轉型:一個小型開發團隊的 DevOps 學習之旅
困境與轉型:一個小型開發團隊的 DevOps 學習之旅困境與轉型:一個小型開發團隊的 DevOps 學習之旅
困境與轉型:一個小型開發團隊的 DevOps 學習之旅
 
提到 DevOps 到底在
談些什麼玩意兒?(@ Agile Tour Taichung 2017)
提到 DevOps 到底在
談些什麼玩意兒?(@ Agile Tour Taichung 2017)提到 DevOps 到底在
談些什麼玩意兒?(@ Agile Tour Taichung 2017)
提到 DevOps 到底在
談些什麼玩意兒?(@ Agile Tour Taichung 2017)
 
從廢柴到成材 - 那 20 個 sprints 教會我們的事 C.C Agile #40
從廢柴到成材 - 那 20 個 sprints 教會我們的事 C.C Agile #40從廢柴到成材 - 那 20 個 sprints 教會我們的事 C.C Agile #40
從廢柴到成材 - 那 20 個 sprints 教會我們的事 C.C Agile #40
 
DevOps:建造開發維運的跨界之橋 (@ C.C. Agile #37)
DevOps:建造開發維運的跨界之橋 (@ C.C. Agile #37)DevOps:建造開發維運的跨界之橋 (@ C.C. Agile #37)
DevOps:建造開發維運的跨界之橋 (@ C.C. Agile #37)
 

Similar to The linux networking architecture

Network Layer
Network LayerNetwork Layer
Network Layer
Lakshika Rasanjali
 
computerNetworkSecurity.ppt
computerNetworkSecurity.pptcomputerNetworkSecurity.ppt
computerNetworkSecurity.ppt
ChandrasekharBehera16
 
210202021018701 suratNetworkSecurity.ppt
210202021018701 suratNetworkSecurity.ppt210202021018701 suratNetworkSecurity.ppt
210202021018701 suratNetworkSecurity.ppt
jayvagasiya136
 
CCNA
CCNACCNA
Packet Analysis - Course Technology Computing Conference
Packet Analysis - Course Technology Computing ConferencePacket Analysis - Course Technology Computing Conference
Packet Analysis - Course Technology Computing Conference
Cengage Learning
 
ip nnnnnnnnnnnnnnnnnnbbbbbbblecture06.ppt
ip nnnnnnnnnnnnnnnnnnbbbbbbblecture06.pptip nnnnnnnnnnnnnnnnnnbbbbbbblecture06.ppt
ip nnnnnnnnnnnnnnnnnnbbbbbbblecture06.ppt
VINAYTANWAR18
 
IT Networks and Vulnarabilities .pdf
IT Networks and Vulnarabilities .pdfIT Networks and Vulnarabilities .pdf
IT Networks and Vulnarabilities .pdf
PeterOwenje1
 
Network protocol
Network protocolNetwork protocol
Network protocol
Online
 
Network Layer And I Pv6
Network Layer And I Pv6Network Layer And I Pv6
Network Layer And I Pv6
Ram Dutt Shukla
 
NUMA-aware thread-parallel breadth-first search for Graph500 and Green Graph5...
NUMA-aware thread-parallel breadth-first search for Graph500 and Green Graph5...NUMA-aware thread-parallel breadth-first search for Graph500 and Green Graph5...
NUMA-aware thread-parallel breadth-first search for Graph500 and Green Graph5...
Yuichiro Yasui
 
Internetworking - IP
Internetworking - IPInternetworking - IP
Internetworking - IP
selvakumar_b1985
 
Chapter 4 internetworking [compatibility mode]
Chapter 4   internetworking [compatibility mode]Chapter 4   internetworking [compatibility mode]
Chapter 4 internetworking [compatibility mode]
Sĩ Anh Nguyễn
 
Computer network (12)
Computer network (12)Computer network (12)
Computer network (12)
NYversity
 
Cisco CCNA module 10
Cisco CCNA module 10Cisco CCNA module 10
Cisco CCNA module 10
Anjar Septiawan
 
Ccna Imp Guide
Ccna Imp GuideCcna Imp Guide
Ccna Imp Guide
abhijitgnbbl
 
10 coms 525 tcpip - internet protocol - ip
10   coms 525 tcpip -  internet protocol - ip10   coms 525 tcpip -  internet protocol - ip
10 coms 525 tcpip - internet protocol - ip
Palanivel Kuppusamy
 
Network State Awareness & Troubleshooting
Network State Awareness & TroubleshootingNetwork State Awareness & Troubleshooting
Network State Awareness & Troubleshooting
APNIC
 
Network Layer & Transport Layer
Network Layer & Transport LayerNetwork Layer & Transport Layer
Network Layer & Transport Layer
Sweta Kumari Barnwal
 
Troubleshooting basic networks
Troubleshooting basic networksTroubleshooting basic networks
Troubleshooting basic networks
Arnold Derrick Kinney
 
Tcp
TcpTcp
Tcp
giaolvq
 

Similar to The linux networking architecture (20)

Network Layer
Network LayerNetwork Layer
Network Layer
 
computerNetworkSecurity.ppt
computerNetworkSecurity.pptcomputerNetworkSecurity.ppt
computerNetworkSecurity.ppt
 
210202021018701 suratNetworkSecurity.ppt
210202021018701 suratNetworkSecurity.ppt210202021018701 suratNetworkSecurity.ppt
210202021018701 suratNetworkSecurity.ppt
 
CCNA
CCNACCNA
CCNA
 
Packet Analysis - Course Technology Computing Conference
Packet Analysis - Course Technology Computing ConferencePacket Analysis - Course Technology Computing Conference
Packet Analysis - Course Technology Computing Conference
 
ip nnnnnnnnnnnnnnnnnnbbbbbbblecture06.ppt
ip nnnnnnnnnnnnnnnnnnbbbbbbblecture06.pptip nnnnnnnnnnnnnnnnnnbbbbbbblecture06.ppt
ip nnnnnnnnnnnnnnnnnnbbbbbbblecture06.ppt
 
IT Networks and Vulnarabilities .pdf
IT Networks and Vulnarabilities .pdfIT Networks and Vulnarabilities .pdf
IT Networks and Vulnarabilities .pdf
 
Network protocol
Network protocolNetwork protocol
Network protocol
 
Network Layer And I Pv6
Network Layer And I Pv6Network Layer And I Pv6
Network Layer And I Pv6
 
NUMA-aware thread-parallel breadth-first search for Graph500 and Green Graph5...
NUMA-aware thread-parallel breadth-first search for Graph500 and Green Graph5...NUMA-aware thread-parallel breadth-first search for Graph500 and Green Graph5...
NUMA-aware thread-parallel breadth-first search for Graph500 and Green Graph5...
 
Internetworking - IP
Internetworking - IPInternetworking - IP
Internetworking - IP
 
Chapter 4 internetworking [compatibility mode]
Chapter 4   internetworking [compatibility mode]Chapter 4   internetworking [compatibility mode]
Chapter 4 internetworking [compatibility mode]
 
Computer network (12)
Computer network (12)Computer network (12)
Computer network (12)
 
Cisco CCNA module 10
Cisco CCNA module 10Cisco CCNA module 10
Cisco CCNA module 10
 
Ccna Imp Guide
Ccna Imp GuideCcna Imp Guide
Ccna Imp Guide
 
10 coms 525 tcpip - internet protocol - ip
10   coms 525 tcpip -  internet protocol - ip10   coms 525 tcpip -  internet protocol - ip
10 coms 525 tcpip - internet protocol - ip
 
Network State Awareness & Troubleshooting
Network State Awareness & TroubleshootingNetwork State Awareness & Troubleshooting
Network State Awareness & Troubleshooting
 
Network Layer & Transport Layer
Network Layer & Transport LayerNetwork Layer & Transport Layer
Network Layer & Transport Layer
 
Troubleshooting basic networks
Troubleshooting basic networksTroubleshooting basic networks
Troubleshooting basic networks
 
Tcp
TcpTcp
Tcp
 

More from hugo lu

WSO2 IoTS Device Manufacturer Guide
WSO2 IoTS Device Manufacturer GuideWSO2 IoTS Device Manufacturer Guide
WSO2 IoTS Device Manufacturer Guide
hugo lu
 
關於測試,我說的其實是......
關於測試,我說的其實是......關於測試,我說的其實是......
關於測試,我說的其實是......
hugo lu
 
Sql injection 幼幼班
Sql injection 幼幼班Sql injection 幼幼班
Sql injection 幼幼班
hugo lu
 
Sql or no sql, that is the question
Sql or no sql, that is the questionSql or no sql, that is the question
Sql or no sql, that is the question
hugo lu
 
Swift 2.0 的新玩意
Swift 2.0 的新玩意Swift 2.0 的新玩意
Swift 2.0 的新玩意
hugo lu
 
精實執行工作坊
精實執行工作坊精實執行工作坊
精實執行工作坊
hugo lu
 
Testing in swift
Testing in swiftTesting in swift
Testing in swifthugo lu
 
畫出商業模式
畫出商業模式畫出商業模式
畫出商業模式
hugo lu
 
精實軟體度量
精實軟體度量精實軟體度量
精實軟體度量
hugo lu
 
看板實驗室
看板實驗室看板實驗室
看板實驗室
hugo lu
 
嵌入式測試驅動開發
嵌入式測試驅動開發嵌入式測試驅動開發
嵌入式測試驅動開發
hugo lu
 

More from hugo lu (11)

WSO2 IoTS Device Manufacturer Guide
WSO2 IoTS Device Manufacturer GuideWSO2 IoTS Device Manufacturer Guide
WSO2 IoTS Device Manufacturer Guide
 
關於測試,我說的其實是......
關於測試,我說的其實是......關於測試,我說的其實是......
關於測試,我說的其實是......
 
Sql injection 幼幼班
Sql injection 幼幼班Sql injection 幼幼班
Sql injection 幼幼班
 
Sql or no sql, that is the question
Sql or no sql, that is the questionSql or no sql, that is the question
Sql or no sql, that is the question
 
Swift 2.0 的新玩意
Swift 2.0 的新玩意Swift 2.0 的新玩意
Swift 2.0 的新玩意
 
精實執行工作坊
精實執行工作坊精實執行工作坊
精實執行工作坊
 
Testing in swift
Testing in swiftTesting in swift
Testing in swift
 
畫出商業模式
畫出商業模式畫出商業模式
畫出商業模式
 
精實軟體度量
精實軟體度量精實軟體度量
精實軟體度量
 
看板實驗室
看板實驗室看板實驗室
看板實驗室
 
嵌入式測試驅動開發
嵌入式測試驅動開發嵌入式測試驅動開發
嵌入式測試驅動開發
 

Recently uploaded

UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
SitimaJohn
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Webinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data WarehouseWebinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data Warehouse
Federico Razzoli
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Jeffrey Haguewood
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
fredae14
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
Postman
 

Recently uploaded (20)

UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Webinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data WarehouseWebinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data Warehouse
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
 

The linux networking architecture

  • 2. Outline • Architecture of Communication System • Managing Network Packets • Network Device • Data-Link Layer • Network Layer • Transport Layer • Sockets in Linux Kernel • Socket Programming
  • 3. Outline • Architecture of Communication System • Managing Network Packets • Network Device • Data-Link Layer • Network Layer • Transport Layer • Sockets in Linux Kernel • Socket Programming
  • 7. Vertical & Horizontal Comm. PDU Protocol Data Unit PCI Protocol Control Information SDU Service Data Unit ICI Interface Control Information IDU Interface Data Unit
  • 8. Outline • Architecture of Communication System • Managing Network Packets • Network Device • Data-Link Layer • Network Layer • Transport Layer • Sockets in Linux Kernel • Socket Programming
  • 9. Socket Buffer • socket buffers are data structures used to represent and manage packets
  • 10. Layer 4 Layer 3Layer 5-7
  • 11. Operations on Socket Buffers • Create, Release, Duplicate Socket Buffers – alloc_skb(), skb_copy(), skb_copy_expand(), skb_clone(), kfree_skb(), skb_header_init() • Manipulate Packet Data Space – skb_get(), skb_put(), skb_push(), skb_pull(), skb_tailroom(), skb_headroom(), skb_realloc_headroom(), skb_reserve(), skb_trim(), skb_cow() • Manage Socket Buffer Queues – skb_cloned(), skb_over_panic(), skb_under_panic(), skb_head_to_pool(), skb_head_from_pool()
  • 13. Operations on Socket-Buffer Queues • Manage Queue Structures – skb_queue_head_init(), skb_queue_empty(), skb_queue_len() • Manage Socket Buffers in Queues – skb_queue_head(), skb_queue_tail(), skb_dequeue(), skb_dequeue_tail(), skb_queue_purge(), skb_insert(), skb_append(), skb_unlink(), skb_peek(), skb_peek_tail()
  • 14. Outline • Architecture of Communication System • Managing Network Packets • Network Device • Data-Link Layer • Network Layer • Transport Layer • Sockets in Linux Kernel • Socket Programming
  • 16. The net_device Structure • General Fields of a Network Device – name, next, owner, ifindex, iflink, state, trans_start, last_rx, priv, qdisc, refcnt, xmit_lock, xmit_lock_owner, queue_lock • Hardware-Specific Fields – rmem_end, rmem_start, mem_end, mem_start , base_addr, irq, dma, if_port • Data on the Physical Layer – hard_header_length, mtu, tx_queue_len, type, addr_len, dev_addr, broadcast, dev_mc_list, mc_count, watchdog_timeo, watchdog_timer • Data on the Network Layer – ip_ptr, ip6_ptr, atalk_ptr, dn_ptr, ec_ptr, family, pa_alen, pa_addr, pa_braddr, pa_mask, pa_dstaddr, flags • Device-Driver Methods – init(), uninit(), destructor(), open(), stop(), hard_start_xmit(), get_stats(), get_wireless_stats(), set_multicast_list(), watchdog_timeo(), do_ioctl(), set_config(), hard_header(), rebuild_header(), hard_header_cache(), header_cache_update(), hard_header_parse(), set_mac_address(), change_mtu()
  • 17. Managing Network Devices • Registering and Unregistering Network Devices – init_netdev(), init_etherdev(), ether_setup(), register_netdevice(), unregister_netdevice() • Opening and Closing Network Devices – dev_open(), dev_close() • Creating and Finding Network Devices – dev_alloc_name(), dev_alloc(), dev_get_by_name(), dev_get_by_index(), dev_load() • Notification Chains for State Changes – notifier_call(), notifier_call_chain(), register_netdevice_notifier(), unregister_netdevice_notifier() • Transmitting over Network Devices – dev_queue_xmit()
  • 18. Linked List of net_device
  • 19. Managing Network Drivers • Initializing Network Adapters • Opening and Closing a Network Adapter • Transmitting Data • Problems In Transmitting Packets • Runtime Configuration • Adapter-Specific ioctl() Commands • Statistical Information About a Network Device • Multicast Support on Adapter Level
  • 20.
  • 21. Transmitting Data Packets static int net_send_packet(struct sk_buff *skb, struct net_device *dev) { struct net_local *np = (struct net_local *)dev->priv; int ioaddr = dev->base_addr; short length = ETH_ZLEN < skb->len ? skb->len : ETH_ZLEN; unsigned char *buf = skb->data; hardware_send_packet(ioaddr, buf, length); np->stats.tx_bytes += skb->len; dev->trans_start = jiffies; if (inw(ioaddr) == /*RU*/81) np->stats.tx_aborted_errors++; dev_kfree_skb (skb);
  • 23. Receiving Packets from Adapter static void net_interrupt(int irq, void *dev_id, struct pt_regs * regs) { ioaddr = dev->base_addr; np = (struct net_local *)dev->priv; status = inw(ioaddr + 0); if (status & RX_INTR) { net_rx(dev); } if (status & TX_INTR) { net_tx(dev); np->stats.tx_packets++; netif_wake_queue(dev); }
  • 24. Receiving a Data Packet static void net_rx(struct net_device *dev) { do { if (pkt_len == 0) break; if (status & 0x40) { /* There was an error. */ }else{ skb = dev_alloc_skb(pkt_len); ptr = skb_put(skb,pkt_len); memcpy(ptr, (void*)dev->rmem_start, pkt_len); netif_rx(skb); } } while (–boguscount);
  • 25. Acknowledging a Transmission void net_tx(struct net_device *dev) { spin_lock(&np->lock); while (tx_entry_is_sent(np, entry)) { struct sk_buff *skb = np->skbs[entry]; np->stats.tx_bytes += skb->len; dev_kfree_skb_irq (skb); entry = next_tx_entry(np, entry); } if (netif_queue_stopped(dev) && ! tx_full(dev)) netif_wake_queue(dev); spin_unlock(&np->lock);
  • 26. Outline • Architecture of Communication System • Managing Network Packets • Network Device • Data-Link Layer • Network Layer • Transport Layer • Sockets in Linux Kernel • Socket Programming
  • 27. Media Access & Data-Link Layer • Data-Link Layer (Ethernet) • The Serial-Line Internet Protocol (SLIP) • The Point-to-Point Protocol (PPP) • PPP over Ethernet • Asynchronous Transfer Mode—ATM • Bluetooth in Linux • Transparent Bridges
  • 28. Implementation of Data Link Layer LLC (Logical-Link Control) provide a uniform interface for the upper layer. MAC (Media-Access Control) handles the media-specific part.
  • 30.
  • 31. eth_type_trans(skb, dev) • Recognize the LLC protocol type used and protocol ID of layer-3 • Identify the packet type (unicast, multicast, broadcast) • Check whether the packet is addressed to the local computer
  • 32.
  • 33. Internet Protocol Suite SSH Secure Socket Shell FTP File Transfer Protocol DNS Domain Name Service SMTP Simple Mail Transfer Protocol TCP Transmission Control Protocol UDP User Datagram Protocol IP Internet Protocol ICMP Internet Control Message Protocol IGMP Internet Group Management Protocol ARP Address Resolution Protocol RARP Reverse Address Resolution Protocol
  • 34. Outline • Architecture of Communication System • Managing Network Packets • Network Device • Data-Link Layer • Network Layer • Transport Layer • Sockets in Linux Kernel • Socket Programming
  • 35. Network Layer • IPv4 - Internet Protocol Version 4 • Internet Control Message Protocol (ICMP) • Address Resolution Protocol (ARP) • IP Routing • IP Multicast for Group Communication • Using Traffic Control to Support Quality of Service (QoS) • Packet Filters and Firewalls • Connection Tracking • Network Address Translation (NAT) • IPv6 - Internet Protocol Version 6
  • 36. Internet Protocol • Provides an unsecured connectionless datagram service • Defines IP datagrams as basic units for data transmission • Defines the IP addressing scheme • Routes and forwards IP datagrams across interconnected networks • Verifies the lifetime of packets • Fragments and reassembles packets • Uses ICMP to output errors
  • 37. Routing IP Packets between LANs
  • 39. IP Address Classes The class-A network address 127 represents the loopback network device of a computer. An IP address with all bits of the computer part set to zero identifies the network itself. An IP address where the computer part consists of 1-bits defines a broadcast address.
  • 40.
  • 41.
  • 42. Delivering Packets Locally • If ip_route_input() is the selected route, then the packet is addressed to the local computer. In this case, branching is to ip_local_deliver() rather than to ip_forward(). – Reassemble fragmented packets – ip_local_deliver_finish(): RAW-IP socket or up to transport layer
  • 43. Fragmenting an IP Datagram Each network has a maximum packet size, which is called Maximum Transfer Unit (MTU). If the MTU of a transmission medium is smaller than the size of a packet, then the packet has to be split into smaller IP packets. MTU=1000 MTU=600
  • 44. The saddr, daddr, id, and protocol elements are keys for the hash function and the allocation of incoming fragments to their IP datagrams.
  • 47. IP Options Class Number Length Name 0 0 - End of Option 0 1 - No Operation 0 2 11 Security 0 3 var Loose Source Routing 0 9 var Strict Source Routing 0 7 var Record Route 0 8 4 Stream ID 2 4 var Internet Timestamp copy flag option class option number 1-bit 2-bit 5-bit
  • 48. IP Options in the IP layer
  • 49. Internet Control Message Protocol • Error-report mechanism for the IP layer. • The most popular application of ICMP is error detection or error diagnostics. (ping)
  • 51. ICMP Packet Type (RFC 792) Type Description Destination Unreachable The destination address cannot be reached. Time Exceeded A packet was discarded, because its TTL has expired. Parameter Problem Unknown or false options. Source Quench Informs the sender that IP packets were lost to overload. Redirect Enables path optimization. Echo and Echo Reply The data sent to the destination address is returned in a reply. Timestamp and Timestamp Reply The timestamp sent to the destination address is used-to reply with the timestamp of the destination address. Information Request und Information Reply Request/reply used to find the network a computer connects to.
  • 52. ICMP in the Linux Kernel • Sending ICMP Packets – icmp_send() • Handling Incoming ICMP Packets – icmp_rcv(), icmp_reply(), icmp_redirect(), icmp_unreach(), icmp_echo(), icmp_timestamp(), icmp_addres(), icmp_address_reply() • ICMP messages generated within the kernel
  • 54.
  • 55. ARP Command root@tux # arp -a IP address HW type HW address 129.25.10.97 10Mbit/s Ethernet 49:72:16:08:80:70 129.25.10.72 10Mbit/s Ethernet 49:72:16:08:64:14 129.25.10.81 10Mbit/s Ethernet 49:17:92:96:96:96
  • 56.
  • 57.
  • 58. Outline • Architecture of Communication System • Managing Network Packets • Network Device • Data-Link Layer • Network Layer • Transport Layer • Sockets in Linux Kernel • Socket Programming
  • 59. Transport Layer • Transmission Control Protocol (TCP) • User Datagram Protocol (UDP)
  • 60. Transmission Control Protocol • Connection orientation • Peer-to-peer communication • Complete reliability • Full-duplex communication • Byte-stream interface • Reliable connection startup • Graceful connection shutdown
  • 61.
  • 62. TCP Packet Header URG points to important data that have to be forwarded immediately. SYN is used to establish connections. SYN = 1 denotes a connection request. ACK shows that the ACKNOWLEDGEMENT NUMBER field includes relevant data. RST can request a connection to be reset. RST = 1 denotes a request to reset a connection. PSH means that the TCP instance must immediately pass the data received to the higher layers. FIN means that the connection is to be torn down.
  • 63.
  • 65.
  • 66.
  • 67.
  • 69.
  • 70.
  • 71.
  • 72.
  • 73.
  • 75.
  • 77. Packet Loss & Fast Retransmit
  • 78. Detecting & Handling Congestions
  • 80. User Datagram Protocol • Same functionality as Internet Protocol (IP) • Connectionless • Unreliable service • Cannot detect and handle lost or duplicate packets • Transmitting data easily and quickly • For audio or video streaming
  • 82. UDP Header & Payload
  • 83. Service Interface to App Layer
  • 84. Outline • Architecture of Communication System • Managing Network Packets • Network Device • Data-Link Layer • Network Layer • Transport Layer • Sockets in Linux Kernel • Socket Programming
  • 85. Socket Support in Linux Kernel
  • 86. if copy_from_user(a, args, nargs[call])) return -EFAULT; a0=a[0]; a1=a[1]; switch(call) { case SYS_SOCKET: err = sys_socket(a0,a1,a[2]); break; case SYS_BIND: err = sys_bind(a0, (struct sockaddr *)a1, a[2]); break; case SYS_CONNECT: err = sys_connect (a0, (struct sockaddr *)a1, a[2]); break; case SYS_LISTEN: err = sys_listen (a0,a1); break; } int socket (int family, int type, int protocol) int bind(int sockfd, struct sockaddr *mAddress, int AddrLength) int connect(int sockfd, struct sockaddr *ServAddr, int AddrLength) int listen(int sockfd, int backlog) sys_socketcall()
  • 89. Outline • Architecture of Communication System • Managing Network Packets • Network Device • Data-Link Layer • Network Layer • Transport Layer • Sockets in Linux Kernel • Socket Programming
  • 90. System Calls at Socket Interface
  • 91.
  • 92.
  • 93.
  • 94. Data Transmission • Transmitting data size_t write(sockfd, buffer, length) int send(sockfd, buffer, length, flags) int sendto(sockfd, buffer, length, flags, destaddr, addrlen) • Receiving data size_t read(sockfd, buffer, length) int recv(sockfd, buffer, length, flags) int recvfrom (sockfd, buffer, length, flags, fromaddr, addrlen) • Rransmit and receive an array of iovec structures int readv(int sockfd, const struct iovec *vector, size_t count) int writev(int sockfd, const struct iovec *vector, size_t count) int sendmsg(int sockfd, const struct msghdr *msg, int flags) int recvmsg(int sockfd, struct msghdr *msg, int flags)
  • 95. Q & A • Architecture of Communication System • Managing Network Packets • Network Device • Data-Link Layer • Network Layer • Transport Layer • Sockets in Linux Kernel • Socket Programming