ECE 526 – Network Processing Systems Design Software-based Protocol Processing Chapter 7: D. E. Comer.

Slides:



Advertisements
Similar presentations
Processes and Threads Chapter 3 and 4 Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College,
Advertisements

More on Processes Chapter 3. Process image _the physical representation of a process in the OS _an address space consisting of code, data and stack segments.
Lecture Objectives: 1)Explain the limitations of flash memory. 2)Define wear leveling. 3)Define the term IO Transaction 4)Define the terms synchronous.
Chapter 7 Protocol Software On A Conventional Processor.
Contiki A Lightweight and Flexible Operating System for Tiny Networked Sensors Presented by: Jeremy Schiff.
Figure 2.8 Compiler phases Compiling. Figure 2.9 Object module Linking.
Architectural Support for Operating Systems. Announcements Most office hours are finalized Assignments up every Wednesday, due next week CS 415 section.
1 Soft Timers: Efficient Microsecond Software Timer Support For Network Processing Mohit Aron and Peter Druschel Rice University Presented By Jonathan.
Introduction to Operating Systems – Windows process and thread management In this lecture we will cover Threads and processes in Windows Thread priority.
I/O Hardware n Incredible variety of I/O devices n Common concepts: – Port – connection point to the computer – Bus (daisy chain or shared direct access)
Threads 1 CS502 Spring 2006 Threads CS-502 Spring 2006.
3.5 Interprocess Communication
Advanced OS Chapter 3p2 Sections 3.4 / 3.5. Interrupts These enable software to respond to signals from hardware. The set of instructions to be executed.
Chapter 11 Operating Systems
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Process Concept An operating system executes a variety of programs
1 Process Description and Control Chapter 3 = Why process? = What is a process? = How to represent processes? = How to control processes?
Threads CS 416: Operating Systems Design, Spring 2001 Department of Computer Science Rutgers University
1 Threads Chapter 4 Reading: 4.1,4.4, Process Characteristics l Unit of resource ownership - process is allocated: n a virtual address space to.
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Introduction to Embedded Systems
LWIP TCP/IP Stack 김백규.
CSC 501 Lecture 2: Processes. Process Process is a running program a program in execution an “instantiation” of a program Program is a bunch of instructions.
Hardware Definitions –Port: Point of connection –Bus: Interface Daisy Chain (A=>B=>…=>X) Shared Direct Device Access –Controller: Device Electronics –Registers:
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS6: Device Management 6.1. Principles of I/O.
Operating Systems Lecture 2 Processes and Threads Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing Liu School of.
Recall: Three I/O Methods Synchronous: Wait for I/O operation to complete. Asynchronous: Post I/O request and switch to other work. DMA (Direct Memory.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Thread Scheduling.
CE Operating Systems Lecture 11 Windows – Object manager and process management.
Mid Term review CSC345.
Chapter 13: I/O Systems. 13.2/34 Chapter 13: I/O Systems I/O Hardware Application I/O Interface Kernel I/O Subsystem Transforming I/O Requests to Hardware.
Scheduling Lecture 6. What is Scheduling? An O/S often has many pending tasks. –Threads, async callbacks, device input. The order may matter. –Policy,
Chapter 2 Processes and Threads Introduction 2.2 Processes A Process is the execution of a Program More specifically… – A process is a program.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
Operating Systems 1 K. Salah Module 1.2: Fundamental Concepts Interrupts System Calls.
Introduction to Operating Systems and Concurrency.
Chapter 13 – I/O Systems (Pgs ). Devices  Two conflicting properties A. Growing uniformity in interfaces (both h/w and s/w): e.g., USB, TWAIN.
Processes, Threads, and Process States. Programs and Processes  Program: an executable file (before/after compilation)  Process: an instance of a program.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
What is an Operating System? Various systems and their pros and cons –E.g. multi-tasking vs. Batch OS definitions –Resource allocator –Control program.
Multithreading The objectives of this chapter are: To understand the purpose of multithreading To describe Java's multithreading mechanism.
Silberschatz, Galvin, and Gagne  Applied Operating System Concepts Module 12: I/O Systems I/O hardwared Application I/O Interface Kernel I/O.
Major OS Components CS 416: Operating Systems Design, Spring 2001 Department of Computer Science Rutgers University
Operating System Concepts
Interrupts and Exception Handling. Execution We are quite aware of the Fetch, Execute process of the control unit of the CPU –Fetch and instruction as.
Copyright © Curt Hill More on Operating Systems Continuation of Introduction.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
CSCI/CMPE 4334 Operating Systems Review: Exam 1 1.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Advanced Operating Systems CS6025 Spring 2016 Processes and Threads (Chapter 2)
Introduction to Operating Systems Concepts
Chapter 13: I/O Systems.
Module 12: I/O Systems I/O hardware Application I/O Interface
Processes and threads.
Process Management Process Concept Why only the global variables?
CS 6560: Operating Systems Design
OPERATING SYSTEMS CS3502 Fall 2017
Chapter 2 Processes and Threads Today 2.1 Processes 2.2 Threads
Chapter 15, Exploring the Digital Domain
I/O Systems I/O Hardware Application I/O Interface
Operating System Concepts
13: I/O Systems I/O hardwared Application I/O Interface
CS703 - Advanced Operating Systems
Mid Term review CSC345.
Lecture Topics: 11/1 General Operating System Concepts Processes
Threads Chapter 4.
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Chapter 13: I/O Systems.
Module 12: I/O Systems I/O hardwared Application I/O Interface
Presentation transcript:

ECE 526 – Network Processing Systems Design Software-based Protocol Processing Chapter 7: D. E. Comer

Ning WengECE 5262 Goal Understand how the network processing protocol stack ─ Implemented ─ Executed ─ Organized in software based network processing systems.

Ning WengECE 5263 Outline Protocol software on conventional processor ─ Possible implementations ─ Processing priority controlling mechanisms Software interrupts Software threads ─ Organization of software for layered systems Summary

Ning WengECE 5264 Protocols on Processor High performance network processing systems ─ Protocols with efficient data structures and algorithms ─ Powerful processor ─ Efficient implementation of protocols on processor Three possible implementations ─ In an application program Possible but not practical due lacking of speed ─ In an operating system kernel Software system managing memory and I/O devices Kernel resident in memory all time when processor on Separate address space, highest privilege Containing device driver and controlling device operations ─ In an embedded system Programmable hardware device dedicated for special tasks

Ning WengECE 5265 Implementation Comparison Easy of Programming High performance Application domain Application Program EasypoorLess performance demanding OS KernelMost difficultgoodHigher performance and shared by applications EmbeddedPossibly difficult goodStand-alone device: bridge

Data movement within protocols Ning WengECE 5266

Ning WengECE 5267 Interrupts What is interrupt? ─ Event signal to OS which results in context switch Interrupt mechanism ─ Operating asynchronously ─ Saving current processing state ─ Changing processor status ─ Branches to specified locations Types of interrupt ─ Hardware interrupt: raised by device ─ Software interrupt: raised by executing program Protocol stack operating as software interrupt ─ When packet arrives, hardware interrupts ─ Device drive raises software interrupt ─ Interrupts cleared and protocol processing invoked Multiple interrupts, how to determine who gets service first ─ Priority

Ning WengECE 5268 Priorities Determining the code which CPU executing at any time Interrupts have different priorities Higher priority code can interrupt lower priority code Kernel software can specify desired interrupt level Possible outcome of priorities processing ─ Livelock: CPU has no efficient power to handle a higher priority load Packet processing: ─ Device (NIC): receiving packets ─ Protocol stack: processing packets ─ Applications: further processing packet if necessary ─ Question: who should has the highest priority

Ning WengECE 5269 Packet Processing Priority Packet processing priorities: ─ Highest to device driver ─ Lowest to application Requires queues between interrupt levels ─ Why? ─ What is inside queues? Processing in higher interrupts should be kept briefly

Ning WengECE Kernel Threads Thread: piece of software that runs in its own context ─ Similar to process but is light-weight Different threads can run in different priorities ─ More fine-grained than interrupt levels ─ Scheduling policy allocating CPU to threads Thread synchronization handles access to shared data ─ Multiple exclusion: only one thread has accesses to data structure ─ Notification: thread blocks until event occurs How should threads be assigned to layered protocol? ─ One thread per layer ─ One thread per protocol ─ Multiple threads per protocol ─ One thread per packet

Ning WengECE Timer Management Fundamental function Timers used for ─ Protocols ARP for retransmission and cache management IP for re-assembly TCP for retransmission ─ Scheduling Multiple independent timers required ─ Cost can be high

Ning WengECE One Thread per Layer Different layers have different thread Allowing priority to be assigned to each layer A packet is en-queued once per layer Easy for programmer to understand

Ning WengECE One Thread per Protocol Each protocol has its own thread and queue Advantage over one thread per layer ─ Easier for programmer to understand ─ Finer-grain control and each protocol has its own priority

Ning WengECE Multiple Threads per Protocol Further division of duties Finer-granularity control and easier for programming Example division ─ One thread for incoming packets ─ One thread for outgoing packets ─ Thread for management/timing

Ning WengECE One Thread per Packet Layers introducing overhead ─ Queuing ─ Context switching ─ Requiring many threads How about packet processed entirely by one thread? ─ “run to completion” programming mode One thread operation ─ Pre-allocating set of operations ─ Waiting for packet arrive ─ Moving through protocol stack ─ Returning to wait for next packet

Ning WengECE Asynchronous vs. Synchronous Synchronous programming: thread-structured ─ API using blocking Main flow-of-control Explicitly invokes functions as needed ─ API using polling Function call returns immediately Performs operations if available Returns error code otherwise Asynchronous programming: event-driven ─ Programmer specifying which function to invoke for each event type ─ Programmer has no control over function invocation ─ Difficult to program

Ning WengECE Typical Implementations Application program ─ Synchronous API using blocking (e.g. socket API) ─ One application thread running while other blocks Embedded system ─ Synchronous API using polling ─ CPU dedicating to one task Operating systems ─ Asynchronous API ─ Built on interrupt mechanism

Ning WengECE Summary Protocol processing implementation on conventional processor ─ Application ─ OS kernel ─ Embedded systems Packet processing priorities Two mechanism to control processing priorities ─ Software interrupt ─ Kernel thread abstraction