INF 5060 Multimedia data communication using network processors

  • Slides: 39
Download presentation
INF 5060: Multimedia data communication using network processors Running A First Example: The Web

INF 5060: Multimedia data communication using network processors Running A First Example: The Web Bumper 3/9 - 2004

Overview ü Packet header and encapsulation review ü How to use the card Ø

Overview ü Packet header and encapsulation review ü How to use the card Ø programming model Ø booting Ø starting and stopping ü Lab setup ü Web bumper INF 5060 – multimedia data communication using network processors 2004 Carsten Griwodz & Pål Halvorsen

Packet Headers and Encapsulation

Packet Headers and Encapsulation

Ethernet 48 bit address configured to an interface on the NIC on the receiver

Ethernet 48 bit address configured to an interface on the NIC on the receiver 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Destination Address | + +-+-+-+-+-+-+-+-+ | | | +-+-+-+-+-+-+-+-+ + | Source address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Frame type | +-+-+-+-+-+-+-+-+ describes content of ethernet frame, e. g. , 0 x 0800 indicates an IP datagram INF 5060 – multimedia data communication using network processors 48 bit address configured to an interface on the NIC on the sender 2004 Carsten Griwodz & Pål Halvorsen

Internet Protocol version 4 (IPv 4) indication of the abstract parameters of the quality

Internet Protocol version 4 (IPv 4) indication of the abstract parameters of the quality of service desired – somehow treat indicates the format of the internet header, i. e. , version 4 high precedence traffic as more important – length of the internet header in 32 bit words, and thus tradeoff between low-delay, high-reliability, and points to the beginning of the data (minimum value of 5) high-throughput – NOT used, bits now reused first zero, fragments allowed and last fragment 1 identifying value to aid assembly of fragments disable a packet to circulate forever, decrease value by at least 1 in each node – discarded if 0 0 2 3 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Version| IHL |Type of Service| Total Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Identification |Flags| Fragment Offset | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Time to Live | Protocol | Header Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Source Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Destination Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Options | Padding | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ indicates used transport layer protocol 32 -bit address fields. May be configured differently from small to large networks datagram length (octets) including header and data allows the length of 65, 535 octets indicate where this fragment belongs in datagram checksum on the header only – TCP, UDP over payload. Since some header fields change(TTL), this is recomputed and verified at each point options may extend the header – indicated by IHL. If the options do not end on a 32 -bit boundary, the remaining fields are padded in the padding field (0’s) INF 5060 – multimedia data communication using network processors 2004 Carsten Griwodz & Pål Halvorsen

UDP port to identify the sending application port to identify receiving application 0 1

UDP port to identify the sending application port to identify receiving application 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Source Port | Destination Port | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Length | Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ specifies the total length of the UDP datagram in octets INF 5060 – multimedia data communication using network processors contains a 1’s complement checksum over UDP packet and an IP pseudo header with source and destination address 2004 Carsten Griwodz & Pål Halvorsen

TCP code bits: urgent, ack, push, reset, syn, fin sequence number for data in

TCP code bits: urgent, ack, push, reset, syn, fin sequence number for data in payload port to identify the sending application port to identify receiving application acknowledgement for data received 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Source Port | Destination Port | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Sequence Number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ header length in | Acknowledgment Number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 32 bit units | Header| |U|A|P|R|S|F| | | length| Reserved |R|C|S|S|Y|I| Window | |G|K|H|T|N|N| | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Checksum | Urgent Pointer | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Options | Padding | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ contains a 1’s complement checksum over UDP packet and an IP pseudo header with source and destination address receiver’s buffer size for additional data pointer to urgent data in segment options may extend the header. If the options do not end on a 32 -bit boundary, the remaining fields are padded in the padding field (0’s) INF 5060 – multimedia data communication using network processors 2004 Carsten Griwodz & Pål Halvorsen

Encapsulation INF 5060 – multimedia data communication using network processors 2004 Carsten Griwodz &

Encapsulation INF 5060 – multimedia data communication using network processors 2004 Carsten Griwodz & Pål Halvorsen

Using IXP 1200

Using IXP 1200

Programming Model ü Active computing elements (ACEs): Ø basic programming abstraction defined by Intel’s

Programming Model ü Active computing elements (ACEs): Ø basic programming abstraction defined by Intel’s software developer kit (SDK), not part of hardware Ø asynchronous unit of execution Ø a typical system contains at least three in a pipeline: input ports Ø Ø ingress ACE process ACE egress ACE output ports unidirectional queues between ACEs allow processors to run independently late bindings are used to bind ACE output at run-time (unbounded targets can be used to drop packets) INF 5060 – multimedia data communication using network processors 2004 Carsten Griwodz & Pål Halvorsen

Programming Model ü Packet flow illustration for IP forwarding: Stack ACE ingress ACE (core)

Programming Model ü Packet flow illustration for IP forwarding: Stack ACE ingress ACE (core) Strong. ARM microengine erroneous packet, not IP, … s is i et ck et egress ACE (microblock) pa IP ACE (microblock) ck ingress ACE (microblock) egress ACE (core) packet for this host pa input ports IP ACE (core) output ports no am gr ta d ar da rw IP fo e re e, m rf ro or er tf an INF 5060 – multimedia data communication using network processors 2004 Carsten Griwodz & Pål Halvorsen

Programming Model ü Often many possible communication paths, but only one used per packet

Programming Model ü Often many possible communication paths, but only one used per packet ü Division of work between ACEs running both on microengines and Strong. ARM crucial for high performance: Ø Ø microengines comprise fast data path – the common case Strong. ARM handles all exceptions INF 5060 – multimedia data communication using network processors 2004 Carsten Griwodz & Pål Halvorsen

Programming Model ü Challenge: achieve optimal parallelism Ø efficient resource utilization each part of

Programming Model ü Challenge: achieve optimal parallelism Ø efficient resource utilization each part of the pipeline should spend the same amount of time to process a packet, reduce idle time Ø which microengine runs which ACE, many possible configurations, e. g. , n n Ø exactly one microblock ACE per engine a pipeline of microblocks for ACEs on one or more engines microblock groups: § set of microblocks that run on a single engine § specified in a configuration file INF 5060 – multimedia data communication using network processors 2004 Carsten Griwodz & Pål Halvorsen

Programming Model ü Microblock group: input ports ingress ACE process ACE microengine 1 egress

Programming Model ü Microblock group: input ports ingress ACE process ACE microengine 1 egress ACE output ports microengine 2 ü Replicated microblock groups input ports ingress ACE process ACE microengine 1 input ports ingress ACE egress ACE process ACE output ports microengine 3 microengine 2 INF 5060 – multimedia data communication using network processors 2004 Carsten Griwodz & Pål Halvorsen

Programming Model ü Microblock dispatch loop Ø control packet flow among ACEs in a

Programming Model ü Microblock dispatch loop Ø control packet flow among ACEs in a microblock group Stack ACE Ø runs in an infinite loop, e. g. , IP forwarder: ingress ACE (core) IP ACE (core) egress ACE (core) ingress ACE (microblock) IP ACE (microblock) egress ACE (microblock) initialize microblocks while (1) { get next packet from input port invoke ingress microblock if not IP packet send to ingress core else { invoke IP microblock } } if packet not is for this host send to egress microblock else send to IP core INF 5060 – multimedia data communication using network processors 2004 Carsten Griwodz & Pål Halvorsen

Programming Model ü Exceptions (interrupts raised by microengines) Ø refer to packets passed from

Programming Model ü Exceptions (interrupts raised by microengines) Ø refer to packets passed from microblock components (microengine) to a core component (Strong. ARM) Ø the symbolic constant IX_EXCEPTION can be used Ø components are identified using a tag Ø an exception code informs the core component of the type Ø core component must have an exception handler determining how to process the packet INF 5060 – multimedia data communication using network processors 2004 Carsten Griwodz & Pål Halvorsen

Programming Model ü Crosscalls Ø enable an ACE to invoke a function in another

Programming Model ü Crosscalls Ø enable an ACE to invoke a function in another ACE Ø similar to remote procedure calls (RPC) Ø must be programmed into both caller and callee early binding, programmer determines type (not run-time) Ø specified by declaring a function Ø three types Ø n n n deferred – caller do not block ; asynchronous return notification oneway – caller do not block ; no return value twoway – caller blocks until callee returns value INF 5060 – multimedia data communication using network processors 2004 Carsten Griwodz & Pål Halvorsen

File Access, Communication and Booting ü PCI Ethernet emulation Ø physically, the card plugs

File Access, Communication and Booting ü PCI Ethernet emulation Ø physically, the card plugs into the host’s PCI bus Ø host and board communicates sending Ethernet frames over the PCI ü The disk is mounted using NFS over PCI, e. g. , /opt/ixasdk is available at both host and card ü The card itself has no persistent memory Ø a RAM disk for the root file system is Ø when booting the card, an image is loaded from the host Ø Ø bootixp performs these instructions and boots the card allow some time after booting ü Rebooting the card from the board (reboot) only clears/reinitialize the card must run bootixp from host afterwards ü Running bootixp on a running card will crash the card Ø boot (reinitialize) card through minicom, followed by a bootixp, or Ø host reboot INF 5060 – multimedia data communication using network processors 2004 Carsten Griwodz & Pål Halvorsen

Environment Requirements ü The Makefiles assume that the following environment variables are set: Ø

Environment Requirements ü The Makefiles assume that the following environment variables are set: Ø IXROOT = /opt/ixasdk Ø CONFIG = arm_be Ø … this is already set for the root user on the lab machines INF 5060 – multimedia data communication using network processors 2004 Carsten Griwodz & Pål Halvorsen

Starting and Stopping ü Telnet to the card: telnet ixp ü To start the

Starting and Stopping ü Telnet to the card: telnet ixp ü To start the example: ixstart <config_file> Ø our example config files use relative paths Ø cd $IXROOT/bin/arm_be ; . /ixstart ixsys. config ü To stop the example: ixstop Ø stops whatever ACE that is running Ø cd $IXROOT/bin/arm_be ; . /ixstop INF 5060 – multimedia data communication using network processors 2004 Carsten Griwodz & Pål Halvorsen

Lab Setup

Lab Setup

Lab Setup IXP lab switch Internet on i ect n on c h Student

Lab Setup IXP lab switch Internet on i ect n on c h Student lab switch “reboot x” INF 5060 – multimedia data communication using network processors t o boror e R Er … ss power switch 2004 Carsten Griwodz & Pål Halvorsen

Lab Setup – Power Switch IXP lab switch … power switch INF 5060 –

Lab Setup – Power Switch IXP lab switch … power switch INF 5060 – multimedia data communication using network processors 2004 Carsten Griwodz & Pål Halvorsen

Lab Setup - Addresses IXP lab switch … power switch INF 5060 – multimedia

Lab Setup - Addresses IXP lab switch … power switch INF 5060 – multimedia data communication using network processors 2004 Carsten Griwodz & Pål Halvorsen

Lab Setup - Addresses IXP lab 129. 240. 67. 111 switch 129. 240. 67.

Lab Setup - Addresses IXP lab 129. 240. 67. 111 switch 129. 240. 67. 112 129. 240. 67. 113 192. 168. 67. 112 192. 168. 67. 113 192. 168. 67. 5 … 129. 240. 67. 110 switch … … 129. 240. 67. 118 192. 168. 67. 111 192. 168. 67. 118 power switch INF 5060 – multimedia data communication using network processors 2004 Carsten Griwodz & Pål Halvorsen

Lab Setup – Data Path IXP lab PCI ssh connection (129. 240. 67. 112)

Lab Setup – Data Path IXP lab PCI ssh connection (129. 240. 67. 112) IO switch hub interface To 192. 168. 67. 5 IXP 1200 system bus … To 192. 168. 67. 5 memory hub local network (192. 168. 67. 112) RAM CPU interface memory power switch web bumper (counting web packets and forwarding all packets from one interface to another) INF 5060 – multimedia data communication using network processors 2004 Carsten Griwodz & Pål Halvorsen

Web Bumper

Web Bumper

Lab Setup – Data Path IXP lab IO switch hub ssh connection (129. 240.

Lab Setup – Data Path IXP lab IO switch hub ssh connection (129. 240. 67. 112) IXP 1200 To 192. 168. 67. 5 … memory hub local network (192. 168. 67. 112) switch CPU memory power switch web bumper (counting web packets and forwarding all packets from one interface to another) INF 5060 – multimedia data communication using network processors 2004 Carsten Griwodz & Pål Halvorsen

The Web Bumper the wwbump core. ACE checks a packet forwarded by the micro.

The Web Bumper the wwbump core. ACE checks a packet forwarded by the micro. ACE: ü count web packet - add 1 to counter ü send back to wwbump micro. ACE ü provides access to counter via a crosscall server web bumper IXP 1200 wwbump (core) Strong. ARM microengines input port ingress ACE (microblock) the wwbump micro. ACE checks all packets if it is a web packet: ü if not, forward packet to egress micro. ACE (and sent to the other port) ü if web packet: send to wwbump core. ACE (Strong. ARM) forward packets from core to egress micro. ACE (and sent to the other port) wwbump (microblock) output port egress ACE (microblock) web bumper (counting web packets and forwarding all packets another) encompasses all ingress processing encompasses all from one interface egresstoprocessing operations performed as packets arrive operations applied as packets depart INF 5060 – multimedia data communication using network processors 2004 Carsten Griwodz & Pål Halvorsen

IXP 1200 The Web Bumper the crosscall client reads the web packet counter and

IXP 1200 The Web Bumper the crosscall client reads the web packet counter and prints the current count web bumper wwbump (core) crosscall client wwbump (microblock) egress ACE (microblock) Strong. ARM microengines input port ingress ACE (microblock) INF 5060 – multimedia data communication using network processors output port 2004 Carsten Griwodz & Pål Halvorsen

Configuration File ü It is run at boot time and specifies Ø ACEs to

Configuration File ü It is run at boot time and specifies Ø ACEs to be loaded Ø which side to run an ACE (ingress or egress) Ø number and speed of ports Ø see ixsys. config ü The interfaces that are to be started at system boot time: interface 0 10. 1. 0. 255. 0 00: 01: 02: 03: 04: 05 1 interface 1 10. 255. 0 00: 01: 02: 03: 04: 06 1 … ü Using workbench or not (we do not) mode 0 INF 5060 – multimedia data communication using network processors 2004 Carsten Griwodz & Pål Halvorsen

Configuration File ü The microcode and microaces that are to be started at system

Configuration File ü The microcode and microaces that are to be started at system boot time file 0. /Slow. Ingress. WWBump. uof Ø Ø ingress microcode (type 0) associated slow ports (10/100 Mbps) microace iface. Input. /ingress. Ace none 0 1 Ø iface. Input is a microace Ø executable no config file running on ingress side type ingress Ø Ø Ø microace wwbump. /wwbump none 0 0 Ø Ø Ø runs on ingress side (first zero) has unknown type (second zero) … INF 5060 – multimedia data communication using network processors 2004 Carsten Griwodz & Pål Halvorsen

Configuration File ü Bind configuration bind static iface. Input/default wwbump Ø binding for ingress

Configuration File ü Bind configuration bind static iface. Input/default wwbump Ø binding for ingress (iface. Input) is wwbump bind static wwbump/default iface. Output Ø binding for wwbump output is iface. Output ü Shell commands to be run, e. g. , add ARP entries in the cache INF 5060 – multimedia data communication using network processors 2004 Carsten Griwodz & Pål Halvorsen

Identifying Web Packets These are the header fields you need for the web bumper:

Identifying Web Packets These are the header fields you need for the web bumper: ü Ethernet type 0 x 800 ü IP type 6 ü TCP port 80 INF 5060 – multimedia data communication using network processors 2004 Carsten Griwodz & Pål Halvorsen

WWBump Dispatch Loop initialize dispatch loop macros do forever { if packet has arrived

WWBump Dispatch Loop initialize dispatch loop macros do forever { if packet has arrived from Strong. ARM send to egress if packet has arrived from Ethernet port { invoke WWBump macro to process packet if it is a web packet (exception specified) send to Strong. ARM else send to egress } } INF 5060 – multimedia data communication using network processors 2004 Carsten Griwodz & Pål Halvorsen

WWBump Macro allocate 6 SDRAM registers to hold header data get IXP input port

WWBump Macro allocate 6 SDRAM registers to hold header data get IXP input port set IXP output port to the other read first 24 bytes into the 6 SDRAM registers (etype, IP hlen, IP type) if not frame type is IP (0 x 800), forward packet if not IP type is TCP (6), forward packet calculate port number address using IP header length read TCP destination port number if not TCP destination port is 80, forward packet set exception code set wwbump tag set IX_EXCEPTION return INF 5060 – multimedia data communication using network processors 2004 Carsten Griwodz & Pål Halvorsen

Testing 1. Log in on the assigned IXP machine (129. 240. 67. xxx) using

Testing 1. Log in on the assigned IXP machine (129. 240. 67. xxx) using ssh as root (twice, the example is easier using two different windows) 2. Download code and place at a convenient place under $IXROOT/src, e. g. : ü ü 3. cd $IXROOT/src/microaces/ scp –r user@login. ifi. uio. no: /hom/paalh/INF 5060 code/wwbumptest Compile the code and make sure the targets are moved to $IXROOT/bin/arm_be ü ü microcode for the microengines: cd $IXROOT/src/microaces/bumptest/ucbuild; make ; cp *. uof $IXROOT/bin/arm_be/. c-code for the Strong. ARM: cd. . ; make (wwbump and getcount are automatically put right directory) 4. Copy configuration file: cp ixsys. config $IXROOT/bin/arm_be/ixsys. config-bumptest 5. Telnet to the IXP card as root: telnet ixp 6. Enter bin directory: cd $IXROOT/bin/arm_be/ 7. Stop any running aces: . /ixstop 8. Start the bumper: . /ixstart ixsys. config-bumptest INF 5060 – multimedia data communication using network processors (you may already be there!!) 2004 Carsten Griwodz & Pål Halvorsen

Testing The bumper should now be running: 1. In IXP window, check web packet

Testing The bumper should now be running: 1. In IXP window, check web packet count (should be 0): . /getcount 2. In HOST window ü ping web server machine: ping 192. 168. 67. 5 (packets should be forwarded through the card, but not counted, i. e. : . /getcount 0) ü telnet to web server machine using port 80: telnet 192. 168. 67. 5 80 (packets should be forwarded through the card, and counted, i. e. : . /getcount 4 (!!? ? )) Experiment with the card: ü … start and stop the aces ü … reboot the card ü … remotely restart the machine using the power switch INF 5060 – multimedia data communication using network processors 2004 Carsten Griwodz & Pål Halvorsen

Summary ü We’ll use remote access to the IXP lab machines ü Bumper shows

Summary ü We’ll use remote access to the IXP lab machines ü Bumper shows the basic concepts Ø Intel SDK and programming model Ø microengines and Strong. ARM Ø much code even for a small, trivial task ü Next: short demo (here) and testing (in the lab) ü Next week: extending the bumper example INF 5060 – multimedia data communication using network processors 2004 Carsten Griwodz & Pål Halvorsen