Leveled stringers attached to the wall with right-angle brackets. Legs attached to the stringers to complete the basic gridwork.
Months of planning went into the P&W railroad. We looked at dozens of layouts on the internet and in the model railroad magazines. Initially we thought we would simply find a layout plan we liked and go from there. No such luck. So we designed our own layout to fit the available space.