Washington WASHINGTON UNIVERSITY IN ST LOUIS Slice Interface to SPP Fred Kuhns Applied Research Laboratory Washington University in St. Louis
2 Washington WASHINGTON UNIVERSITY IN ST LOUIS Fred Kuhns - 3/13/2016 System Interfaces, Address and Ports C++ Interface Library: Get list of available interfaces if_list get_interfaces(); if_list = {if_entry,...} if_entry : (See Types.ppt for a complete description) –ifn : interface number. There is a 1-to-1 relationship between an interface number (logical interface) and externally visible IP addresses ( ipaddr ) –ifType : one of {Public Internet=0, SPP p2p=1}. If p2p then may call get_ifpeer() –ipaddr : externally visible IP Address for this interface. –bw_t linkBW : Total bandwidth of interface. Includes reserved, allocated and available BW. –bw_t availBW : bandwidth currently available for allocation to slices. ifn_t get_ifn(ipAddr_t) : Maps interface address to the interface’s number if_entry get_ifattrs(ifn_t) : Returns an if_entry struct for interface ifn ipAddr_t get_ifpeer(ifn_t) : If interface type SPP_p2p then returns peer’s IP address, otherwise 0. Examples using supplied commands Get list of available interfaces ]$ client --cmd get_ifaces Interface list: [ifn 0, type "inet", linkBW Kbps, availBW Kbps, ip ] [ifn 1, type "p2p", linkBW Kbps, availBW Kbps, ip ] [ifn 2, type "p2p", linkBW Kbps, availBW Kbps, ip ] Get IP address of the peering SPP node in interface number 2 ]$ client --cmd get_ifpeer --ifn 2 SPP Peer IP address: Get interface attributes for interface number 1 ]$ client --cmd get_ifattrs --ifn 1 Interface attributes: [ifn 1, type "p2p", linkBW Kbps, availBW Kbps, ip ] Get the interface number for interface with IP address ]$ client --cmd get_ifn --ipaddr ; Interface number: 0
3 Washington WASHINGTON UNIVERSITY IN ST LOUIS Fred Kuhns - 3/13/2016 Allocating EndPoints on the GPE C++ Interface Library (see Types.ppt and rmp.ppt): Reserve/Release BW on interface number ifn for Slice (bw in Kbps) retCode_t resrv_pl_ifbw(ifn_t, bw_t) retCode_t reles_pl_ifbw(ifn_t, bw_t) Allocate local Address for Slice and forward to GPE epInfo_t alloc_endpoint(epInfo_t); epInfo_t {bw_t bw, epoint_t ep} –Allocate new endpoint, installs filter in line card to direct matching traffic to the GPE –if proto is TCP or UDP and port == 0 then the substrate will allocate a port number. –If port and its not available then an error is returned. –If a slice has not reserved sufficient BW on an interface then the slice’s reservation will be increased. If the BW can not be reserved then an error is returned and no endpoint is allocated. Free endpoint, removes the endpoint’s filter and bandwidth reservation. retCode_t free_endpoint(epoint_t) Examples using command line: Reserve 4000Kbps on interface 0 ]$ client --cmd resrv_pl_ifbw --ifn 0 --bw 4000 Reserved 4000Kbps on interface 0 for Slice Release 2000Kbps on interface 0 client --cmd reles_pl_ifbw _pl_ifbw --ifn 0 --bw 2000 Allocate external address on line card ]$ client --cmd alloc_endpoint --bw ipaddr port proto 17 Allocated endpoint: epInfo [ bw 500 epoint { , 50000, 17 } ] Free the just allocated endpoint: ]$ client --cmd free_endpoint --ipaddr port proto 17 Now let the system assign an available UDP port: ]$ client --cmd alloc_endpoint --bw ipaddr port 0 --proto 17 Allocated endpoint: epInfo [ bw 500 epoint { , 1024, 17 } ]
4 Washington WASHINGTON UNIVERSITY IN ST LOUIS Fred Kuhns - 3/13/2016 Allocating a fastpath (aka meta-router) C++ Interface Library: Creating a fastpath: fpInfo_t alloc_fastpath(copt_t, bwspec_t, rcnts_t, mem_t) bwspec_t : Aggregate BW requirements for fastpath across all interfaces rcnts_t: Max resource counts mem_t : Requested size of SRAM and DRAM in Bytes (currently fixed) fpInfo_t: fpid_t fpid : fast-path id, relative to slice. Starts at 0. ipAddr_t npeIP : FP addr on the NPE epoint_t ldAddr : Local Delivery IP and UDP port epoint_t exAddr : Exception traffic IP and UDP port –see Types.ppt and rmp.ppt for a more complete description of the types. Deleting the fastpath: void free_fastpath(fpID_t fpid) : Examples using command line: Allocating a fastpath (copt == IPv4, SRAM must be 4096): client --cmd alloc_fastpath --copt 1 --firm soft 0 --fltrs 12 --qs 10 --buffs 14 --stats 8 --sram dram 0 alloc_fastpath completed successfully Fastpath ID: 0, NPE IP address: Local Delivery (LD) end point { , 33402, 17 }, Exception traffic (EX) end point { , 33404, 17 }, LD Socket: sd 4, socket type 2, flags 0 EX Socket: sd 5, socket type 2, flags 0 Deleting fastpath client --cmd free_fastpath --fpid 0
5 Washington WASHINGTON UNIVERSITY IN ST LOUIS Fred Kuhns - 3/13/2016 Reserving BW and Adding Meta-Interfaces C++ Interface Library: Reserving bw Kbps on interface ifn for a fastpath fpid : retCode_t resrv_fpath_ifbw(fpID_t, ifn_t, bw_t) Release bandwidth retCode_t reles_fpath_ifbw(fpID_t, ifn_t, bw_t) Allocate a new meta-interface with local address tuple { ipaddr, port, UDP } for fastpath fpid with bandwidth bw Kbps, returning the meta-interface id: [miID_t, epInfo_t] alloc_udp_tunnel(fpID_t, bw_t, ipAddr_t, ipPort_t) Release (i.e. free) meta-interface and it’s associated local address tuple. retCode_t free_udp_tunnel(fpID_t, miID_t) Translate the fastpath specific meta-interface id to he corresponding local address tuple (aka end point) epoint_t get_endpoint(fpID_t, miID_t) Examples using command line: Reserve 5Mbps on interface 0 for fastpath 0 client --cmd resrv_fpath_ifbw --fpid 0 --ifn 0 --bw 5000 Reserved 5000Kbps on interface 0 for fastpath 0 Allocate meta-interface for fastpath 0: client --cmd alloc_udp_tunnel --fpid 0 --bw ipaddr port Allocate meta-interface: miid = 1, epInfo [ bw 5000 epoint { , 40000, 17 } ] Remove meta-interface 0 client --cmd free_udp_tunnel --fpid 0 --miid 1 Free interface bandwidth
6 Washington WASHINGTON UNIVERSITY IN ST LOUIS Fred Kuhns - 3/13/2016 Manipulating Queues and Attributes C++ Interface Library: Associate one or more queues with a meta-interface: retcode bind_queue(fpid, miid, list_type, qid_t[]) Set queue drop threshold and bandwidth: bw_t set_queue_params(fpID_t, qid_t, threshold, bw) Get the current queue parameters (BW and Threshold): [threshold, bw] get_queue_params(fpID_t, qid_t) Get the number of packets/bytes in a queue: {cnt_t pktCnt, cnt_t byteCnt} get_queue_len(fpID_t, qid_t) Examples using command line: Associate queues 0-2 with fastpath 0, meta-interface 1: client --cmd bind_queue --fpid 0 --miid 1 --qid_list_type 0 --qid_list 0 --qid_list 1 --qid_list 2 Set qid 0 to a bandwidth of 1Mbps and threshold of 1000 packets: client --cmd set_queue_params --fpid 0 --qid 0 --threshold bw 2000 Get qid 0’s parameters settings: client --cmd get_queue_params --fpid 0 --qid 0 qid 0 params: [threshold 1000, bw 2000] Get the number of packets/bytes in a queue 1: client --cmd get_queue_len --fpid 0 --qid 1 qid 1 length: [pktCnt 0, byteCnt 0]
7 Washington WASHINGTON UNIVERSITY IN ST LOUIS Fred Kuhns - 3/13/2016 Managing the Lookup table C++ Interface Library (see Types.ppt for complete description of types): Write code option specific filter to TCAM retCode_t write_fltr(fpID_t, fid_t, keyWrap, mask[N], fltrResult) Modify result vecctor for filter with ID fid : retCode_t update_result(fpid, fid, fltrResult) Find filter by ID: fltr_t, get_fltr_byfid(fpid, fid) Find filter by key: fltr_t, get_fltr_bykey(fpid, keyWrap) Get result vector for filter matching key value: fpFltrResult_t lookup_fltr(fpid, keyWrap) Remove (invalidate) filter with ID fid : retcode_t rem_fltr_byfid(fpid, fid) Remove (invalidate) highest priority filter matching key: retcode_t rem_fltr_bykey(fpid, keyWrap) Examples using command line: Continued on next two slides...
8 Washington WASHINGTON UNIVERSITY IN ST LOUIS Fred Kuhns - 3/13/2016 Example Filter Commands Examples using command line: Install a fastpath filter to forward packets from meta-interface 1 to meta-interface 2 when the destination address matches the prefix /24 fltr --cmd write_fltr \ --fpid 0 --fid 0 \ # Lookup Key --key_type 0 --key_rxmi 1 \ --key_daddr key_saddr 0 \ --key_sport 0 --key_dport 0 --key_proto 0 \ # Lookup (Key) Mask --mask_daddr 0xFFFFFF00 --mask_saddr 0 \ --mask_sport 0 --mask_dport 0 --mask_flags 0 \ # Result: Next Hop --txdaddr txdport \ # Output queue and stats index --qid 3 --sindx 0 Success Read back filter with fid 6: fltr --cmd get_fltr_byfid --fpid 0 --fid 0 Found Fltr: [ key [sub_Key: T 0, rxmi 1, copt_Key: 0a ], mask [ sub_Mask: ff ff ff ff, copt_Mask: ff ff ff ], result [ actions 0, daddr , dport 50001, qid 3, sindx 0] Remove filter by id: fltr --cmd rem_fltr_byfid --fpid 0 --fid 0 Success
9 Washington WASHINGTON UNIVERSITY IN ST LOUIS Fred Kuhns - 3/13/2016 Example Filter Commands: Continued Examples using command line: Update result to use qid 4: fltr --cmd update_result --fpid 0 --fid 3 --txdaddr txdport qid 4 --sindx 0 FIXME -- always writes 0 for txdport, qid and sindx Lookup filter with key matching fid 6 fltr --cmd get_fltr_bykey --fpid 0 --key_type 0 --key_rxmi 1 -- key_daddr key_saddr 0 --key_sport 0 --key_dport 0 -- key_proto 0 FIXME -- scd hangs and board must be reset manually Remove filter by key: fltr --cmd rem_fltr_bykey --fpid 0 --key_type 0 --key_rxmi 1 --key_daddr key_saddr 0 --key_sport 0 --key_dport 0 --key_proto 0 FIXME -- does not find filter Lookup filter by key returning result vector only fltr --cmd lookup_fltr --fpid 0 --key_type 0 --key_rxmi 1 --key_daddr key_saddr 0 --key_sport 0 --key_dport 0 --key_proto 0 FIXME: Finds filter but fields are incorrect, sindx is completely wrong and qid is for wrong filter (and doesn’t match the rxmiid).
10 Washington WASHINGTON UNIVERSITY IN ST LOUIS Fred Kuhns - 3/13/2016 C++ Interface Library (see Types.ppt for complete description of types): Read stats counter: stats_t read_stats(fpid, sindx, flags) Reset stats value... not implemented on SCD: result = clear_stats(fpid, sindx) Not implemented at scd: handle create_periodic(fpid, index, P, cnt, flags) retcode delete_periodic(fpid, handle) retcode set_callback(fpid, handle, xport) stats_t get_periodic(fpid, handle) Examples using command line: Get byte pre-Q byte counter for stats index sindx : stats --cmd read_stats --fpid 0 --sindx 1 --bytes --preq sindx 1: [value 0, tstamp ms] Remaining operations not yet supported. Stats (accessing FP instance specific counters) Flags: W : {0 - Bytes, 1 - Packts} L : {0 - PreQ, 1 - PostQ} T : {0 - Push, 1 - Pull} X : Don’t Care WLTXXXXX
11 Washington WASHINGTON UNIVERSITY IN ST LOUIS Fred Kuhns - 3/13/2016 Accessing Code Option Data C++ Interface Library (see Types.ppt for complete description of types): Not supported: Write a byte vector to sram allocated to code option instance (aka fast path): retcode mem_write(fpid, offset[, len], data) Read a byte vector from sram allocated to code option instance (aka fast path): data mem_read(fpid, offset, len) Examples using command line: Not Supported