Skip to content

IRC server linking

The BBS can be a server on an IRC network: a hub that links to any number of other servers, in and out, and routes between them. It speaks TS6, the server protocol of Solanum (Libera.Chat), charybdis, ircd-ratbox and ircd-hybrid (EFnet), and P10, that of ircu (Undernet). It needs no ircd of its own.

  • Every BBS user is on the network. Whoever is online, on a terminal, a 3270, the web, IRC, AIM or ICQ, is a user there under their name (Carol Ann is Carol_Ann). Anyone on the network can /msg and /whois them; the message reaches them however they came.
  • The rooms beginning irc- are the network's channels. irc-retro is #retro: whoever is in the room is in the channel, and talk in one is talk in the other. The network's users are in the room's member list.
  • A taken nick is never fought over. When a BBS user comes on and their nick is in use on the network, or a link comes up with someone there by that nick, the BBS user is renamed Nick|Tag, Tag being the BBS's short tag (alice|DM). It is cut to fit the network's nick length, and numbered (alice|DM2) if that too is taken. The BBS user's name on the BBS does not change.
[irclink]
server_name = irc.bbs.example.org
sid = 1BB
tag = DM
address = :7000

[ircpeer hub.example.net]
address = hub.example.net:7000
send_password = ours-to-it
accept_password = its-to-us
Setting Default What it sets
server_name (required) the BBS's server name on the network
sid (required) its TS6 server ID: a digit and two letters or digits, unique on the network
numeric (none) its P10 server numeric, 0 to 4095, unique on the network (needed for a P10 link)
description the BBS's name its description, in LINKS
network the BBS's name the network's name, as WHOIS of its users shows it on the BBS
tag the BBS name's first letters Nick\|Tag for a BBS user whose nick is taken
host server_name the BBS users' host, as the network sees them (alice!bbs@host)
prefix irc- the rooms that are channels (none: every room but sysop- ones)
nick_length 30 (12 with a P10 peer) the network's NICKLEN (Solanum's is 31 less one; ratbox and hybrid: 9; ircu: 12)
address :7000 where servers link in (none: nowhere)
tls_address, tls_cert, tls_key (none) servers linking in by TLS
retry 30 seconds between tries of a link out

Each server the BBS links with directly has an [ircpeer NAME], its name being the server's:

Setting Default What it sets
address (none: it links in) where to link out to; the BBS links again whenever the link drops
tls no link out by TLS
tls_verify yes check its certificate (no for a self-signed one)
send_password (required) the password the BBS sends (its accept_password)
accept_password (required) the password it must send (its send_password)
tag its name's first letters its users' tag, beside a BBS user of the same nick
protocol ts6 ts6 (Solanum, charybdis, ratbox), hybrid (ircd-hybrid 8, whose TS6 differs) or p10 (ircu); one linking in is told apart by its handshake

The other side's connect block names the BBS's server_name, with the passwords the other way round. For Solanum:

connect "irc.bbs.example.org" {
    host = "192.0.2.10";
    port = 7000;
    send_password = "its-to-us";
    accept_password = "ours-to-it";
    class = "server";
    flags = topicburst;
};

A server name, SID, password or address that is wrong, or a server already on the network by another way (a loop), is refused with an ERROR that says why.

With ircu (P10)

An ircu network is linked the same way, with numeric set in [irclink] and protocol = p10 on the peer. ircu has one password for a link, both ways, so send_password and accept_password are the same. Its Connect block names the BBS, and needs hub; if the BBS is to bring other servers behind it:

[irclink]
server_name = irc.bbs.example.org
sid = 1BB
numeric = 42

[ircpeer hub.undernet.example]
address = hub.undernet.example:4400
protocol = p10
send_password = linkpass
accept_password = linkpass
Connect {
 name = "irc.bbs.example.org";
 host = "192.0.2.10";
 password = "linkpass";
 port = 7000;
 class = "Server";
 hub;
};

ircu's users come with their accounts (+r), as WHOIS on the BBS shows them; the BBS's users go to it with theirs. Its nick length is 12 unless its NICKLEN feature says otherwise: set nick_length to match, or ircu refuses a longer nick.

The BBS keeps the network by TS6's names, so it can link TS6 and P10 servers at once, each given the other's servers, users and channels in its own protocol. Between two P10 servers every line goes as it came; between P10 and TS6 only what both have goes across: users, nicks, channels and their members and ops, topics, talk, private messages, AWAY, KILL, WHOIS and the other queries. Channel modes go across as TMODE and MODE, and bans from TS6; G-lines, jupes and ircu's CLEARMODE, OPMODE and ACCOUNT stay on the P10 side, and TS6's ENCAP on its side.

On the BBS

  • In the chat, /msg NICK TEXT sends to someone on the network (/msg 3 TEXT is still node 3).
  • On the BBS's own IRC server, the network's users are in the linked channels' NAMES and WHO, and /msg, /whois and ISON reach them as they reach BBS users.
  • Someone on the network with the nick of a BBS user online is shown on the BBS as Nick|Tag, with their server's tag (alice|hub), so the two are never confused; /msg alice|hub reaches them.
  • Topics set on the network are told to the room.

As a hub

The BBS keeps the network's map: which servers are behind which link, their users and channels. A server linking in is given everything not behind it: the servers (SID), users (EUID, or UID), channels (SJOIN) and topics (TB). What comes from one link goes on to the others; a private message goes only toward the one it is for. When a link drops, the servers behind it are gone from the network (a netsplit): the rooms are told those users left, and the other links get the SQUIT.

The BBS sends its burst once the other side's has come (the answer to its PING; P10's END_OF_BURST), so a BBS user whose nick the other side has is renamed Nick|Tag before they are sent. When two users of other servers collide, the TS6 rules apply: the newer is killed, or both if they are as old. A BBS user killed off the network (by an oper, or services) is back on it when they next log in. Channel modes, bans and the like (TMODE, BMASK, ENCAP ...) are passed on as they come; the BBS sets none of its own.

The BBS answers WHOIS, VERSION, MOTD, ADMIN, INFO, TIME and LINKS for itself, and passes those for other servers on.

Testing against a real ircd

internal/irclink's TestLive links to a real ircd when one is set up: see the top of live_test.go. It has been run against Solanum (built from its main branch), ircd-hybrid 8.2.43 and ircu 2.10.12.19 (built from UndernetIRC's ircu2, linking both in and out, with IRCLINK_LIVE_PROTOCOL=p10).

See also: IRC, Chat and paging, MRC