70 likes | 225 Views
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
E N D
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
Hardware type = 1 Protocol type = 0x800 MAC dest MACaddr len=6 Netaddr len=4 Opcode MAC dest MAS src Sender MAC address MAC src Sender MAC address Sender IP address type Sender IP address Receiver MAC address Receiver MAC address Receiver IP address ARP Packet • Opcode: • Request: 1 • Reply: 2 Sender MAC address: mandatory … only for readability … Sender IP address: mandatory • Receiver MAC address • Request: 0 • Reply: requester’s MAC address Receiver IP address: mandatory
IXP1200 IXP1200 Broadcast problem
Last refresh cycle count (64 bit) IP address (32 bit) IF (32 bit) Last seen cycle count (64 bit) IP source (32 bit) MAC source (48 bit) MAC dest (48 bit) 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 • Broadcast suppression xbuf_alloc [$cyclect,2] csr[read, $cyclect[0], CYCLE_CNT] xbuf_free[$cyclect] Microengine clock speed: 232 Mhz
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); }