Surfaces can be hospitable homes to many bacterial communities. For the bacterium Proteus mirabilis, rigid surfaces are a platform on which this organism is induced to grow up to 40-fold in length and rapidly spread out. Populations of cells (“swarms”) can cover centimeter-scale distances within a few hours through collective motility. Apparent in these swarms are self versus non-self recognition behaviors: genetically identical swarms merge into one upon meeting, but genetically distinct swarms remain separate. While key proteins involved in the mechanisms for recognition have been identified, how the proteins interact and how recognition contributes to group behaviors were previously undetermined. We have shown that the binding interactions of two distinct proteins encodes strain-specific identity and that this strain-specific identity is restricted to the intimate conveyance of identity information from one organism to its adjacent neighbor. Our recent data has revealed that this cell-cell communication of self-recognition proteins controls an organism’s access to this swarm motility. We propose a molecular model for how self versus non-self recognition regulates a collective behavior of this bacterium.