INF5060: Multimedia data communication using network processors
Download
Report
Transcript INF5060: Multimedia data communication using network processors
INF5060:
Multimedia data communication using network processors
ARP
8/10 - 2004
Assignment 5
Extend the simple packet bridge from assignment 4 with ARP support
build an ARP table to dynamically bind/map an IP address to a mac address and
an interface on the card
check IP address and forward packet to correct interface
be aware of broadcast loops
INF5060 – multimedia communication using network processors
2004 Carsten Griwodz & Pål Halvorsen
ARP Packet
Opcode:
Request: 1
Reply:
2
Sender MAC address: mandatory
MAC dest
MAC dest
MAS src
MAC src
type
… only for readability …
Hardware type = 1
Protocol type = 0x800
MACaddr len=6 Netaddr len=4
Opcode
Sender MAC address
Sender MAC address
Sender IP address
Sender IP address
Receiver MAC address
Receiver MAC address
Receiver IP address
Sender IP address: mandatory
Receiver MAC address
Request: 0
Reply: requester’s MAC address
Receiver IP address: mandatory
INF5060 – multimedia communication using network processors
2004 Carsten Griwodz & Pål Halvorsen
IXP1200
IXP1200
Broadcast problem
INF5060 – multimedia communication using network processors
2004 Carsten Griwodz & Pål Halvorsen
ARP caching
Most OSes do ARP caching
Our bridge does it for building and maintained a
spanning tree
Two proposed caches
Address-to-interface mapping
Last refresh cycle count (64 bit)
IP address (32 bit)
IF (32 bit)
Broadcast suppression
Last seen cycle count (64 bit)
IP source (32 bit)
MAC source (48 bit)
MAC dest (48 bit)
xbuf_alloc [$cyclect,2]
csr[read, $cyclect[0], CYCLE_CNT]
Microengine clock speed: 232 Mhz
xbuf_free[$cyclect]
INF5060 – multimedia communication using network processors
2004 Carsten Griwodz & Pål Halvorsen
Allocating cache memory
Memory must be allocated by StrongARM
Memory offset must be passed to microengines in shared
memory
E.g.
e = RmMalloc(RM_SRAM, &ptr, n*4); space for n address-to-IF mapping entries
e = RmGetPhysOffset(RM_SRAM, ptr, &sram_offset);
e = RmMalloc(RM_SCRATCH, &ptrptr, 1); space for pointer to cache
e = RmGetPhysOffset(RM_SCRATCH, ptrptr, &sramptr_offset);
e = RmWrite(RM_SCRATCH, sramptr_offset, sram_offset, 0);
for( i=0; i<6; i++ ) {
sym.meNumber = i;
bzero(sym.name, MAX_SIZE_OF_IMPORTED_SYMBOL);
strncpy(sym.name, CACHE_PTR_STR, MAX_SIZE_OF_IMPORTED_SYMBOL);
sym.value = sramptr_offset;
e = RmUencPatchSymbol(i,&sym,1);
}
INF5060 – multimedia communication using network processors
2004 Carsten Griwodz & Pål Halvorsen