ECE 526 - PowerPoint PPT Presentation

About This Presentation
Title:

ECE 526

Description:

Title: Slide 1 Author: Ning Weng Last modified by: Ning Weng Created Date: 1/15/2006 6:21:19 AM Document presentation format: On-screen Show (4:3) Company – PowerPoint PPT presentation

Number of Views:52
Avg rating:3.0/5.0
Slides: 19
Provided by: Ning78
Learn more at: http://www.engr.siu.edu
Category:
Tags: ece | device | power | saving

less

Transcript and Presenter's Notes

Title: ECE 526


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

2
Goal
  • Understand how the network processing protocol
    stack
  • Implemented
  • Executed
  • Organized
  • in software based network processing systems.

3
Outline
  • Protocol software on conventional processor
  • Possible implementations
  • Processing priority controlling mechanisms
  • Software interrupts
  • Software threads
  • Organization of software for layered systems
  • Summary

4
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

5
Implementation Comparison
Easy of Programming High performance Application domain
Application Program Easy poor Less performance demanding
OS Kernel Most difficult good Higher performance and shared by applications
Embedded Possibly difficult good Stand-alone device bridge
6
Data movement within protocols
7
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

8
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

9
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

10
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

11
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

12
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

13
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

14
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

15
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

16
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

17
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

18
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
Write a Comment
User Comments (0)
About PowerShow.com