Skip to content
Edit this page

ictdesigntools.cabling.polarity

Polarity of array (MPO, MMC) channels: methods A, B, C, U1 and U2, adapters and mating checks.

ANSI/TIA-568.3-E builds each duplex polarity method from four parts: an array trunk, the array adapters it plugs into, the fiber transitions (MPO-to-LC modules or harnesses) and duplex patch cords. METHODS lists them:

====== =========== ================ ========== =================== Method Trunk Adapters Transition Duplex patch cords ====== =========== ================ ========== =================== A Type-A Type-A, KU-KD Type-A one A-to-B, one A-to-A B Type-B Type-B, KU-KU Type-A A-to-B C Type-C Type-A, KU-KD Type-A A-to-B U1 Type-B Type-A, KU-KD Type-U1 A-to-B U2 Type-B Type-B, KU-KU Type-U2 A-to-B ====== =========== ================ ========== ===================

A Channel is the parts in order from one piece of equipment to the other. Each part moves a lane (a fiber position, counted from 0) to another: a Type-A trunk keeps position k, Type-B turns it to n-1-k and Type-C swaps each pair; a key-up to key-down adapter keeps the positions facing and a key-up to key-up one turns them over; an A-to-B cord crosses its pair. trace follows every lane through, and problems says where the channel fails:

  • polarity: a transmit lane that does not land on a receive lane;
  • gender: two pinned plugs, or two unpinned ones, meeting in an adapter;
  • polish: angled (APC) and flat (UPC) plugs meeting, or APC plugs in a key-up to key-up adapter, where their angles do not meet face to face.

The Type-U1 and Type-U2 transitions map each duplex pair to positions at opposite ends of the array, U2 the mirror of U1 for its key-up to key-up adapter (pair 1: U1 to positions 1 and 12, U2 to 12 and 1). The standard's tables are not public: the mappings here are those that make the universal methods work with a Type-B trunk and A-to-B cords on every port, and the tests check each method end to end.

>>> ch = method("U1", polish="apc")
>>> ch.problems(), ch.pairs()[:3]
([], [(1, 1), (2, 2), (3, 3)])
>>> ch.descriptor()
'U1 / Type-B / KU-KD / M-M / APC'
>>> [p.kind for p in method("U2", polish="apc").problems()]
['polish', 'polish']

Trunk dataclass

Trunk(type: str = 'B', a: End = PINNED, b: End = PINNED)

An array trunk or array patch cord of polarity type, with its plug at each end.

of classmethod

of(asm: Assembly) -> Trunk

The trunk an assembly is: its polarity and its two ends.

Source code in src/ictdesigntools/cabling/polarity.py
@classmethod
def of(cls, asm: Assembly) -> Trunk:
    """The trunk an assembly is: its polarity and its two ends."""
    return cls(asm.polarity, asm.a, asm.b)

Adapter dataclass

Adapter(keying: str = 'KU-KD')

An array adapter: key-up to key-down (Type-A) keeps the positions facing; key-up to key-up (Type-B) turns them over.

Transition dataclass

Transition(
    type: str = "A", plug: End = UNPINNED, far: bool = False
)

A fiber transition (MPO-to-LC module or harness) of type A, U1 or U2: duplex ports on one side, the array plug on the other. far turns it round for the far end of a channel, array side first.

lanes

lanes(n: int) -> list[int]

Duplex lane to array position (to duplex lane when far).

Source code in src/ictdesigntools/cabling/polarity.py
def lanes(self, n: int) -> list[int]:
    """Duplex lane to array position (to duplex lane when ``far``)."""
    out = list(range(n))
    if self.type != "A":
        for j in range(n // 2):
            lo, hi = j, n - 1 - j
            out[2 * j], out[2 * j + 1] = (lo, hi) if self.type == "U1" else (hi, lo)
    if self.far:
        inverse = [0] * n
        for k, v in enumerate(out):
            inverse[v] = k
        return inverse
    return out

Cord dataclass

Cord(type: str = 'A-to-B')

A duplex patch cord: A-to-B crosses its pair, A-to-A keeps it.

Channel dataclass

Channel(
    parts: tuple[Part, ...], n: int = 12, method: str = ""
)

Parts in order from one piece of equipment to the other, carrying n lanes. With a transition the channel is duplex: transmit on each pair's A lane (even) must reach a B lane (odd). Without one it is parallel: transmit on the first half of the array (positions 1–4 of an MPO-8 used as 1–4 and 9–12, counted here 0–3) must reach the second half.

pairs

pairs() -> list[tuple[int, int]]

Duplex ports, counted from 1: where each near port's transmit lane arrives.

Source code in src/ictdesigntools/cabling/polarity.py
def pairs(self) -> list[tuple[int, int]]:
    """Duplex ports, counted from 1: where each near port's transmit lane arrives."""
    return [(j + 1, self.trace(2 * j) // 2 + 1) for j in range(self.n // 2)]

descriptor

descriptor() -> str

A compact line for badges and schedules: method, trunk, adapter keying, the trunk's plug genders (M pinned, F unpinned) and polish, such as U1 / Type-B / KU-KD / M-M / APC. Parts the channel lacks are left out.

Source code in src/ictdesigntools/cabling/polarity.py
def descriptor(self) -> str:
    """A compact line for badges and schedules: method, trunk, adapter keying, the trunk's
    plug genders (M pinned, F unpinned) and polish, such as ``U1 / Type-B / KU-KD / M-M /
    APC``. Parts the channel lacks are left out."""
    trunk = next((p for p in self.parts if isinstance(p, Trunk)), None)
    adapter = next((p for p in self.parts if isinstance(p, Adapter)), None)
    out = [self.method] if self.method else []
    if trunk:
        out.append(f"Type-{trunk.type}")
    if adapter:
        out.append(adapter.keying)
    if trunk:
        g = {"pinned": "M", "unpinned": "F"}
        if trunk.a.pins and trunk.b.pins:
            out.append(f"{g[trunk.a.pins]}-{g[trunk.b.pins]}")
        polishes = {e.polish for e in (trunk.a, trunk.b) if e.polish}
        if len(polishes) == 1:
            out.append(polishes.pop().upper())
    return " / ".join(out)

method

method(
    name: str, n: int = 12, polish: str = "upc"
) -> Channel

A duplex channel built by a TIA-568.3-E method, with a pinned trunk and unpinned transitions (as recommended for array cabling) of one polish.

Source code in src/ictdesigntools/cabling/polarity.py
def method(name: str, n: int = 12, polish: str = "upc") -> Channel:
    """A duplex channel built by a TIA-568.3-E method, with a pinned trunk and unpinned
    transitions (as recommended for array cabling) of one ``polish``."""
    if name not in METHODS:
        raise ValueError(f"Polarity methods are {', '.join(METHODS)}, not “{name}”.")
    m = METHODS[name]
    trunk_end = End("mpo", polish, "pinned")
    plug = End("mpo", polish, "unpinned")
    parts = (
        Cord(m.cords[0]),
        Transition(m.transition, plug),
        Adapter(m.keying),
        Trunk(m.trunk, trunk_end, trunk_end),
        Adapter(m.keying),
        Transition(m.transition, plug, far=True),
        Cord(m.cords[1]),
    )
    return Channel(parts, n, name)