VOIPSoft - Western Washington University

Download Report

Transcript VOIPSoft - Western Washington University

Voice Over IP – Software
Western Washington University
By: Jonathan R. Peterson
Kernel Selection

MicroC/OS-II



Manages complicated timing
Preemptive multitasking
Message passing with Semaphores
(pending)
Task and ISR Overview

EPHY_ISR


TimerISR


Completes system initialization and task creation, removes itself
from the task scheduler.
EthernetTask


Handles the interrupt generated every 8kHz.
StartTask


Sets a Semaphore every time a physical change occurs on the
network. (Network cable plugged/unplugged)
Responds to the Semaphore created by EPHY_ISR and updates
the link status.
TCPIPTask

Scans the Rx buffers for new data and then processes it.
Task and ISR Overview (continued)

DHCPTask


KeyTask


Scans the button on bit 2 of Port-G to see if the receiver is in use
or not.
VOIPTask


Scans the keypad for a keypress.
OnHookTask


Handles dynamic addressing, and renews the IP address when
the lease expires.
Processes audio packets (incoming and outgoing), handles VOIP
call requests and acknowledgements (handshaking).
UITask

Displays user information via the LCD, and receives user input
via the keypad.
Task and ISR Specifications
Priority
Operation
Period
Execution
Time
Average
CPU Load
Maximum
CPU Load
EPHY_ISR
---
Sporadic
5s
1µs
0.0000002
.0000002
TimerISR
---
Periodic 8kHz
125µs
~40µs
0.32
0.32
StartTask
4
---
---
24.7ms
---
---
EthernetTask
5
Periodic
1ms
Typical: 57.2µs
Max: 115.2µs
0.00001144
0.00002304
TCPIPTask
6
Periodic
2ms
Typical: 353µs
Max: 724µs
0.1765
0.362
DHCPTask
7
Periodic
2ms
Typical: 1µs
Max: 100µs
0.0005
0.05
KeyTask
8
Periodic
15ms
Typical: 1µs
Max: 2.2µs
0.0000667
0.0001467
OnHookTask
9
Periodic
15ms
Typical: 1µs
Max: 2.2µs
0.0000667
0.0001467
VOIPTask
10
Periodic
2ms
~150µs
0.075
0.075
UITask
11
Periodic
200ms
~5ms
0.025
0.025
0.597
0.8323
Task/ISR
(pends on EPHY_ISR)
Total:
ISR Details – EPHY_ISR
Description:
 This ISR is generated when a physical change
occurs on the network.




Link speed
Duplex
Cable plugged/unplugged
The ISR posts to a semaphore so that that
EthernetTask may process the change.
Details:
 Period: ~5s (Sporadic)
 Execution Time: ~1µs
ISR Details – TimerISR
Description:
 This ISR handles the precise timing
required for audio capture &
reproduction.
Details:
 Period: 125µs (8kHz)
 Execution Time: ~40µs
Task Details - StartTask
Description:
 Performs all system initialization
 Creates the tasks
 Removes itself from the task scheduler
Details:
 Priority: 4
 Period: Once upon system startup
 Execution Time: 24.7ms
Task Details – EthernetTask
Description:
 Pends on the Semaphore posted by
EPHY_ISR.
 Determines what variety of link change
occurred and updates the system.
Details:
 Priority: 5
 Period: 1ms
 Execution Time: 57.2µs
Task Details - TCPIPTask
Description:
 Checks the Rx buffer for received packets.
 Writes to the Tx buffer when necessary.
 Processes packets through all layers except the
application layer (described on the next slide).
Details:
 Priority: 6
 Period: 2ms
 Execution Time: 353µs
TCP/IP Details
TCP/IP Details
Execution Time
800
700
600
time (us)
500
400
300
200
100
0
32
50
75
100
120
140
160
bytes
180
200
220
240
250
Task Details - DHCPTask
Description:
 This task processes the DHCP requests,
and renews the lease of the IP address
before it expires.
Details:
 Priority: 7
 Period: 2ms
 Execution Time: 1µs
Task Details - KeyTask
Description:
 This task scans the 4x4 keypad, waiting for
a key to be pressed. This is the same task
that we used in ETEC 454.
Details:
 Priority: 8
 Period: 15ms
 Execution Time: 1µs
Task Details - OnHookTask
Description:
 This task scans the push-button on bit 2 of
Port-G and waits for a voltage level change.
Details:
 Priority: 9
 Period: 15ms
 Execution Time: 1µs
OnHookTask – De-bouncing
Task Details – VOIPTask
Description:
 This task processes the incoming and
outgoing audio packets, as well as handles
VOIP call requests and acknowledgements.
Details:
 Priority: 10
 Period: 2ms
 Execution Time: ~150µs
VOIPTask – Incoming Call
VOIPTask – Outgoing Call
Task Details – UITask
Description:
 This task is responsible for displaying
information to the user via the LCD.
 The task also processes the user input.
Details:
 Priority: 11
 Period: 200ms
 Execution Time: ~5ms
Module Descriptions












ATD – Analog to Digital conversions
DHCP – Dynamic IP support
EEPROM – Interface for the SPI to access the EEPROM
Ethernet Driver – Allows Ethernet functionality
IP – Internet Protocol support
Keypad – Interfaces with the 4x4 keypad (**REUSED**)
LCD – Displays text via the 2x16 LCD (**REUSED**)
SPI – Handles synchronous serial communications
TCP/IP – Integrates the Ethernet driver, IP, UDP and DHCP
Timer – Configures the 8kHz sample rate
UDP – User Datagram Protocol, Part of the TCP/IP stack
VOIP – Contains the User Interface and application specific
code.
Module Details
ISRs
ATD
DHCP
EEPROM
Ethernet
Driver
IP
Keypad
LCD
SPI
TCP/IP
Timer
UDP
VOIP
---
---
---
EPHY_ISR
---
---
---
---
---
TimerISR
---
---
---
DHCPTask
---
EthernetTask
---
KeyTask
---
---
TCPIPTask
---
---
StartTask
---
---
---
---
---
---
---
---
---
---
---
OnHookTask
---
---
---
---
---
---
---
---
---
---
---
VOIPTask
---
---
---
---
---
---
---
---
---
---
---
UITask
ATDInit
IsDHCP
InitEE
InitEthernet
IsIP
X
X
InitSPI
UDP_WriteData
InitTimer
IsUDP
main
StartATD
DHCPReq
WriteEE
CloseEthernet
MakeIPHdr
X
X
WriteSPI
GetAppData
GetCount
MakeUDPHdr
---
---
---
ReadEE
StartTx
IsICMP
X
X
ReadSPI
---
---
---
---
---
---
---
CheckRxBuffers
MakeICMP
X
X
---
---
---
---
---
---
---
---
MakeEthHdr
IsARP
X
X
---
---
---
---
---
---
---
---
IsEthernet
MakeARP
X
X
---
---
---
---
---
---
DHCPState
---
ActiveBuffer
MyNode
X
X
---
VOIPFlag
---
---
TxData[ ]
---
DHCPAddr
---
GotLink
NodeBuf[ ]
X
X
---
---
---
---
RxData[ ]
---
---
---
---
CurrNode
X
X
---
---
---
---
---
Tasks
Public
Func.
Public
Vars
General System Dataflow
Rx
Tx
Ethernet EPHY
Ethernet EPHY
Ethernet Driver
Ethernet Driver
IP/ICMP
DHCP
IP/ICMP
UDP
UDP
TCP/IP
TCP/IP
VOIP
VOIP
RxData[ ]
TxData[ ]
TimerISR
SPI
ATD
DAC
Filter
MI
C
Basic Dataflow
Ethernet Driver
TCP/IP
IsIP( )
EPHY_ISR
LinkFlag
UDP
IsUDP( )
EthernetTask
GotLink
IP
OSSemPend( )
TCPIPTask
DHCP
IsDHCP( )
VOIP
IsEthernet( )
VOIPFlag
VOIPTask
Keypad Dataflow
VOIP
Keypad Driver
Keypad I/O
KeyInit( )
Key
KeyTask
KeyPend( )
KeyFlag
KeyCodeTable