  We construct a theory for long-distance quantum communication based on
sharing entanglement through a linear chain of $N$ elementary swapping segments
of length~$L=Nl$ where $l$ is the length of each elementary swap setup.
Entanglement swapping is achieved by linear optics, photon counting and
post-selection, and we include effects due to multi-photon sources,
transmission loss and detector inefficiencies and dark counts. Specifically we
calculate the resultant four-mode state shared by the two parties at the two
ends of the chain, and we derive the two-photon coincidence rate expected for
this state and thereby the visibility of this long-range entangled state. The
expression is a nested sum with each sum extending from zero to infinite
photons, and we solve the case $N=2$ exactly for the ideal case (zero dark
counts, unit-efficiency detectors and no transmission loss) and numerically for
$N=2$ in the non-ideal case with truncation at $n_\text{max}=3$ photons in each
mode. For the general case, we show that the computational complexity for the
numerical solution is $n_\text{max}^{12N}$.
