What do the first 32 characters of the ascii table do?

These are called control codes and were meant to tell the actual terminal you were on to do something, rather than pass through to display something. Some of them, such as BEL (0x07), go so far back as to when terminals were actual teletypewriters (in this, 0x07 would ring the physical bell in the teletype).

DLE is meant to work like ESC - once the terminal receives it, further incoming characters are meant to be a command or other communication to the terminal, and not to be output to the actual device itself. Though I've never witnessed an actual use of it.

ACK, NAK, and SYN (and many others like SOH start of header, STX start of text, ETX end of text) could be used to implement a protocol, but weren't designed with TCP/IP in mind. TCP/IP indicates that by setting bits in a header, not by transmitting an entire ASCII code. These may be useful if doing something like transmitting files over a 56k modem. I know serial/modem protocols like ZModem use a couple of these, and I'm sure there's other serial/56k-modem based stuff that does.

This chart knows more than I do about them, including the what the DC1, DC2, DC3, and DC4 codes were meant for.


Back in the old days they had mainframe computers to do bulk processing and simple "terminal" machines that displayed the data.

These terminals were connected via serial data lines, this means that some kind of command set is needed so that both sides can signal when they are ready to receive data, ready to send and so on. The ASCII character set basically lists out all the commands and characters available and standardises them.

The signals you have never seen used are likely only seen on very specific terminals and while ACK, SYN and NAK are analogous to their TCP counterparts they are not directly related.