NOTE: this info is a bit out of date Radix Tree is 32 bits deep with a width of 4 bits (16 children) Which breaks out to 8 levels (8 iterations to get one refernce) Here is the bit allocation for each type of label: ** Label space mean the label space of the interface (or plateform) this label is associated with either in OR out ** (ie label allocated to the LSR on atm0 which has been assigned labelspace 1, which is not the same a the label space advertised by atm0's adjacency) Generic ------- 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Label Space(12) | Generic Label Value(20) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ATM --- 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Label Space(8) | VPI (8) | VCI(16) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Frame Relay ----------- 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Label Space(12) | DLCI(20) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ There will be 2 trees. Incoming label tree which stores: -installed - 1 if it is in use, 0 if it is free -age - jiffies when it was installed -label - struct label_type pointer that stores this label's info -opcodes[8] - POP,PUSH,FWD,ROT,PFR,POPALL,NOP that will be executed on an incoming label -data[8] - pointer to data for each opcode: POP data is NULL (POPs top label) PUSH data is a pointer to a struct label_type (PUSHes on the label from label_type) FWD data is a pointer to a struct device (forwards to a outgoing device) ROT is NULL (ROTate the circleQ) POPALL data is a protocol type or NULL (which stack to forward to unless it can be infered from the label) PFR data is NULL (PUSHes and ForWarDs to the label that the circleQ points to then ROTates the circleQ) NOP data is NULL Example: POP,PUSH,PFR,POP,PFR,NOP,NOP would POP incoming label,PUSH on a new label, PUSH on another label then FWD to that label device POP the top label,PUSH on a new lable FWD it to that label device NOP,NOP Typical: POP,PFR -owner[8] - do we own the data[] elements? (can we free it when the time come?) -circleQ - circular linked list of all Labels that we forward to (multipath) -PHB? Outgoing label tree which stores: -installed - 1 if it is in use, 0 if it is free -age - jiffies when it was installed -label - struct label_type pointer that stores this label's info -nexthop - layer 3 next hop info (if any) -dst - struct dst_entry pointer (if any) -exp - exermental bits to push on before it leaves -refence - list of Incoming labels that reference me in the data[] -dev - interface that this label exits IOCTLs ------ -Add Incoming Label (by default POPs top label first opcode is POP) -Get Incoming Label "program" -Set Incoming Label "program" *Add a PFR to a Incoming Label program (must already be connected to an Outgoing Label) *Del a PFR from a Incoming Label program -Del Incoming Label -Add Outgoing Label -Mod Outgoing Label (nexthop, exp, dev, fec) -Del Outgoing Label -Connect Incoming Label to an Outgoing Label -Connect a Outgoing Label to a FEC -Set an interfaces Label Space * - denotes that the "program" must only consist of POP,PFR for the Del case and POP for the Add case