Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

The first 32 characters of the ASCII table (0x00 - 0x1F) are all of the non-printable characters (with the exception of 'DEL' which comes at the end of the table).

What are these used for, other than borking your terminal when you cat a binary file?

A few of them are obvious:

   Oct   Dec   Hex   Char
   ----------------------------------------------
   000   0     00    NUL '\0'                    

   007   7     07    BEL '\a' (bell)             
   010   8     08    BS  '\b' (backspace)        
   011   9     09    HT  '\t' (horizontal tab)   
   012   10    0A    LF  '\n' (new line)         
   013   11    0B    VT  '\v' (vertical tab)     
   014   12    0C    FF  '\f' (form feed)        
   015   13    0D    CR  '\r' (carriage ret)     

   033   27    1B    ESC (escape)                

others, such as

   020   16    10    DLE (data link escape)
   021   17    11    DC1 (device control 1)
   022   18    12    DC2 (device control 2)
   023   19    13    DC3 (device control 3)
   024   20    14    DC4 (device control 4)

I've never seen used.

Are ACK, NAK and SYN the same bytes used for the three way handshake in TCP, or are they simply analogous?

share|improve this question
add comment

2 Answers

up vote 4 down vote accepted

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.