A salt marsh is a coastal ecosystem that experiences tidal flooding. It has high salinity, waterlogged soil, and is dominated by cordgrass (Spartina alterniflora). The marsh periwinkle snail (Littoraria irrorata) grazes on algae on cordgrass stems, and uses the grass as a substrate to avoid predators. During high tide, the snail climbs up the grass to escape water.
Describe what is meant by the terms ecosystem and niche, using the salt marsh as an example.