210 likes | 315 Views
Architecture of Network Implementation. Reading: Chapters 3 and 4. Layer-Based Communication Models. End systems. Intermediate system. End systems. Anwendung. Anwendung. Application. Application. (N+1)-Protocols. Instance (N+1). Instance (N+1). Instance (N+1). Instance (N+1).
E N D
Architecture of Network Implementation Reading: Chapters 3 and 4 FSU CIS 5930 Internet Protocols
Layer-Based Communication Models End systems Intermediate system End systems Anwendung Anwendung Application Application (N+1)-Protocols Instance (N+1) Instance (N+1) Instance (N+1) Instance (N+1) Layer (N+1) (N)-protocol Layer (N) Instance (N) Instance (N) (N)-protocol Instance (N-1) Instance (N-1) Layer (N-1) Transmission medium Transmission medium FSU CIS 5930 Internet Protocols
Two Important Concepts in the Layered Model • Protocols • Rules that two parties talk and understand each other • Horizontal • Services • Functions provided by a lower layer to the neighboring upper layer • Vertical • Service interface (function calls) FSU CIS 5930 Internet Protocols
ISO/OSI Reference Model ISO/OSI Reference model Application Presentation Session Transport Network Data link Physical FSU CIS 5930 Internet Protocols
ISO/OSI Model • Physical layer • Media types, coding methods, bit sequences vs. physical signals • Data link layer • Moving data between two directly connected stations. Flow control, error detection, etc. Shared medium: access control. LLC/MAC • Network layer • Connectivity of networks. Packet routing/forwarding • Transport layer • Concerning end-to-end functions between applications. Flow control, packet ordering, etc. • Session layer • Handling structured message exchange • Presentation layer • Regulating data presentation (format) • Application layer • Protocols for different applications, HTTP, SMTP, FTP, etc FSU CIS 5930 Internet Protocols
TCP/IP Reference Model Internet reference mode ISO/OSI reference model 7 Application(HTTP, SMTP, SSH) Application 6 Presentation 5 Session 4 Transport Transport (TCP/UDP) 3 Internet (IPv4/v6) Network Data link(802.x, PPP, SLIP) Data link 2 Physical 1 FSU CIS 5930 Internet Protocols
Interplay of Layers, Instances, and Protocols (N+1)-Layer (N)-IDU (N)-Layer (N)-PCI (N)-SDU (N)-ICI (N)-PDU (N-1)-ICI (N)-PCI (N)-SDU (N-1)-IDU (N-1)-Layer (N-1)-SDU (N-1)-ICI FSU CIS 5930 Internet Protocols
PDU/PCI/SDU/ICI/IDU • PDU: protocol data unit • Elements exchanged between two protocol instances • PCI (protocol control information or packet header) + SDU (service data unit) • ICI: interface control information • Passed from layer N to layer N-1 together with layer N PDU • IDU: interface data unit • ICI + PDU FSU CIS 5930 Internet Protocols
Managing Network Packets in Kernel • Socket buffers • Where packets are stored, manipulated. • Socket buffer queues • Linked list of socket buffers FSU CIS 5930 Internet Protocols
sk_buff_head sk_buff next sk_buff prev list stamp net_device dev h nh mac Packet data storage dst len MAC-Header ... IP-Header head UDP-Header data UDP-Data tail end datarefp: 1 Socket Buffers (skb) FSU CIS 5930 Internet Protocols
Some important fields of skb • prev, next, list • Queue’s linked list • sk • Socket owning the packet • dev • Device receiving/sending packet • h, nh, mac • Pointers to the transport/network/MAC layer headers • len • Size of the packet • data, head, tail, end • Pointers associated with data packet field • datarefp • A counter indicating how many skb_buff points to the packet • Not really a field of sbk_buff FSU CIS 5930 Internet Protocols
sk_buff sk_buff sk_buff next next next prev prev prev ... ... ... head head head data data data tail tail tail end end end Packet data storage Packet data storage Packet data storage IP-Header UDP-Header UDP-Header UDP-Data UDP-Data UDP-Data datarefp: 1 datarefp: 1 datarefp: 1 Updates of skb_buff as packet passing different layers FSU CIS 5930 Internet Protocols
Operations on socket buffers • Three types of operations • Creating and releasing socket buffers • alloc_skb(), dev_alloc_skb(), skb_clone(), kfree_skb(), dev_kfree_skb() • Manipulating fields of socket buffers • skb_put(), skb_push(), skb_pull(), skb_reserve() • Managing socket buffer queues • skb_queue_head(),etc FSU CIS 5930 Internet Protocols
Creating/releasing skb • alloc_skb(size, gpf_mask) • dev_alloc_skb(length) • kfree_skb(skb) • dev_kfree_skb(skb) • skb_clone(skb,gpf_mask) • skb_copy(skb,gpf_mask) FSU CIS 5930 Internet Protocols
skb_clone sk_buff sk_buff sk_buff next next next prev prev prev ... ... ... head head head data data data tail tail tail end end end Packet data storage Packet data storage IP-Header IP-Header UDP-Header UDP-Header UDP-Data UDP-Data datarefp: 1 datarefp: 2 Skb_clone() FSU CIS 5930 Internet Protocols
skb_copy sk_buff sk_buff sk_buff next next next prev prev prev ... ... ... head head head data data data tail tail tail end end end Paketdatenbereich Paketdatenbereich Paketdatenbereich IP-Header IP-Header IP-Header UDP-Header UDP-Header UDP-Header UDP-Data UDP-Data UDP-Data datarefp: 1 datarefp: 1 datarefp: 1 skb_copy() FSU CIS 5930 Internet Protocols
Manipulating skb fields • skb_put(skb,len) • skb_push(skb,len) • skb_pull(skb,len) • skb_reserve(skb,len) After alloc_skb() After skb_reserve() An skb_buff containing data After skb_put() After skb_push() FSU CIS 5930 Internet Protocols
sk_buff_head next prev qlen: 3 sk_buff sk_buff sk_buff next next next prev prev prev ... ... ... head head head data data data tail tail tail end end end Packet data Packet data Packet data Socket buffer queue FSU CIS 5930 Internet Protocols
Operations on socket buffer queues • Managing queue structures • skb_queue_head_init(list) • skb_queue_empty(list) • skb_queue_len(list) • Managing socket buffers in queues • skb_queue_head(), skb_queue_tail(),etc FSU CIS 5930 Internet Protocols
Managing skb in queues • skb_queue_head(list, skb) • skb_queue_tail(list, skb) • skb_dequeue(list) • skb_dequeue_tail(list) • skb_insert(oldskb,newskb) • skb_append(oldskb,newskb) • skb_peek(list) • skb_peek_tail(list) FSU CIS 5930 Internet Protocols
Next time … • Chapter 5: network devices FSU CIS 5930 Internet Protocols