Barn Stall is an Internal Fence which can only be built inside a Barn and is used to separate and manage Domesticated Animals.
All Fences have four basic components a Starting Post, a Corner Post, a Fence Segment, and a Gate. To construct a Fence a Starting Post must first be built; when building a Starting post do NOT use ctrl to detach it from the building grid, or else the sections may not line up correctly. Once your Starting Post has been completed, you can right-click it and select the cardinal direction you wish to extend you Fence in, this will build a Fence Segment. Right-clicking a Fence Segment give you the option to keep extending your Fence in the same direction or build a Corner Post which allows you to again extend your in any direction. To build a Gate, leave a 2 tile gap between two Posts. Righting-clicking on either of these posts will then give you the option to build a Gate.
Fences are not indestructible and can be Destroyed by well-prepared raiders. A Fence's strength is dependent on its tier - the higher the tier, the harder it is to Destroy. Once Destroyed or Salvaged, Fences that are OLDER than 7 days will send out a wave of Splash Damage which will damage the nearest Fences of an equal or lesser tier. For this reason, when laying Fences, make sure to have the lowest tier Fence on the outside and the highest tier the most on the inside. Splash Damage has been known to travel as much as 5 tiles.