1 / 17

Linux Networking Overview

Linux Networking Overview. COMS W6998-5 Spring 2010. Outline. Layering in Networks ISO Network Model IP Network Model Linux Kernel Outline Network Subsystem Outline. Layer-Based Communication Models. End systems. End systems. Intermediate system. Application. Application.

jana
Download Presentation

Linux Networking Overview

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Linux Networking Overview COMS W6998-5 Spring 2010

  2. Outline • Layering in Networks • ISO Network Model • IP Network Model • Linux Kernel Outline • Network Subsystem Outline

  3. Layer-Based Communication Models End systems End systems Intermediate system Application Application Application Application (N+1)-Protocols Instance (N+1) Instance (N+1) Instance (N+1) Instance (N+1) Layer (N+1) (N)-protocol Instance (N) Instance (N) Layer (N) (N-1)-protocol Instance (N-1) Instance (N-1) Layer (N-1) Transmission medium Transmission medium

  4. Concepts in Layered Model • Protocols • Rules that two parties talk and understand each other • Horizontal interface • Services • Functions provided by a lower layer to the neighboring upper layer • Vertical interface • Service interface (function calls)

  5. ISO/OSI Reference Model • Application: Protocols for different applications, HTTP, SMTP, FTP, etc • Presentation layer: Regulating data presentation (formatting, ASN/1) • Session : Handling structured message exchange, multiplexing sessions • Transport: End-to-end functions between applications. Flow control, packet ordering, etc. • Network: Connecting networks. Packet routing/forwarding • Data link layer: Moving data between two directly connected stations. Flow control, error detection, etc. Shared medium: access control. LLC/MAC • Physical: Media types, coding methods, bit sequences vs. physical signals ISO/OSI Reference model Application Presentation Session Transport Network Data link Physical

  6. ISO vs. The Internet Internet reference model 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

  7. Design Principles • Optimize for the common case • E.g., TCP header prediction • Never touch/copy data • E.g., checksum offload • Mistakes can be made at each layer • Use common facilities at each layer • Buffer management, hash tables, timers • Use best-of-breed practices in these facilities

  8. Kernel Structure vim apache sshd User Shared C Library Kernel System Call Interface Process Mgmt Memory Mgmt Device Control File System Network Subsys CPU Support Code MMU Support Code Character device drivers Block device drivers Network device drivers Character Devices Block Devices Network Devices CPU RAM Hardware

  9. Kernel Structure • Process management • Creating, destroying, putting to sleep, waking up, and scheduling processes. • Memory management • Allocates memory to processes; maps virtual memory to physical memory; enforces protection • File system • In UNIX, almost everything is handled over the file system interface. • Device drivers can be addressed as files • /proc file system allows us to access data and parameters in the kernel

  10. Kernel Structure (2) • Device drivers • Abstract away the underlying hardware and allow us to access the hardware with well-defined APIs • The use of kernel modules allow device drivers to be dynamically loaded/unloaded • Networking • Provides communication between end hosts • Incoming packets are asynchronous events and have to be collected and identified, before a process can handle them. • Many network operations occur asynchronously and cannot be associated to a specific process. Instead, interrupts and timers are used extensively.

  11. Kernel Structure COMS W6998 vim apache sshd User Shared C Library Kernel System Call Interface Process Mgmt Memory Mgmt Device Control File System Network Subsys CPU Support Code MMU Support Code Character device drivers Block device drivers Network device drivers Character Devices Block Devices Network Devices CPU RAM Hardware

  12. Network Subsystem Application User U/K copy Synch & Atomic Ops ip_proto System Call Interface sock Sockets VFS socket UDP TCP SCTP ICMP Mem Alloc Interrupts sk_buff Kernel IPV4 IPV6 ARP bridging Soft IRQs Hash Tables net_device data link layer Notifiers E1000 driver E1000 driver Lists Wait Queues PCI DMA Timers Hardware Intel E1000 Intel E1000

  13. Network-specific facilities • sk_buff: • Core networking data structure for managing data (i.e., packets) • net_device: • Core data structure that represents a network interface (e.g., an Intel E1000 Ethernet NIC). • proto_ops: • Data structure for different IP protocol families • SOCK_STREAM, SOCK_DGRAM, SOCK_RAW • Virtual functions for bind(), accept(), connect(), etc. • struct sock/ struct socket: • Core data structures for representing sockets

  14. Kernel facilities (1) • Timers • Facility for scheduling work in the future (e.g., retransmitting a lost TCP segment) • Hash tables • Facility for creating associations (e.g., 4-tuple  TCP connection block), looking them up, deleting them • User/kernel copying • Library for safely transferring data across the user/kernel boundary • Memory allocation • Mechanism for the network subsystem to obtain memory (e.g., pinned pages for arriving packets to land in) • Linked lists • What you think

  15. Kernel facilities (2) • Atomic operations and synchronization • Mechanisms for managing concurrency correctly • Interrupts • Hardware interface for notifying OS of an event (e.g., a packet arrival) • Soft IRQs • “Software interrupts” that are asynchronously executed in response to a hardware interrupt • Wait Queues • Mechanism for processes/threads/tasks to wait for an event, put themselves to sleep, or wake another process up • Notifiers • Publish/subscribe system for notifying other systems about an event (e.g., interface goes down)

  16. That’s the big picture… • Later lectures will delve into the details • Not enough time to cover everything • Suggestions about what to cover welcome • Or how to cover it • Bottom-up or top-down? • Use your project to cover something interesting and/or important to you

  17. For next week • Install a distribution inside a VM • Download/build/install the appropriate 2.6.31 kernel source in the VM • Enable kgdb, kprobes, oprofile, magic sysreq, debugfs • If this is difficult for you, you probably are in the wrong class..

More Related