xref: /openbmc/ipmitool/src/plugins/lanplus/README.sol (revision c18ec02f3304ce2a889a50e378f07a4168af3884)
1This document was last updated for release 1.8.8.
2
3This document explains how Serial Over Lan is implemented on in the
4ipmitool IPMI client.  Obviously, the code itself is authoritative, but
5this document should serve as a good starting point.
6
7Serial Over Lan (SOL) is defined in the IPMI v2 specification published by
8Intel and available at http://www.intel.com/design/servers/ipmi/.  SOL
9functionality is built on top of the RMCP+ protocol as an additional
10payload type (type 1).
11
12The high end SOL logic is implemented in src/ipmitool/lib/ipmi_sol.c.  SOL
13sessions are begun in ipmitool using the "sol activate" command.  This
14command maps directly to the IPMI Activate Payload command.  It first
15verifies that an RMCP+ session (lanplus interface) is being used to
16establish the session.  Although the spec allows for a SOL connection to be
17established on a port different than the RMCP+ port that the "activate
18payload" command issued, ipmitool does not support this.
19
20Once a session has been established (the activate payload command
21succeeds), ipmitool simply loops over a select() on user input and data
22returned from the BMC.  All user input is first filtered so that special
23escape sequences can suspend or deactivate the SOL session and so that data
24can be broken into chunks no greater than N bytes.  This maximum is
25specified by the BMC in the response to the Activate Payload command.
26
27User input to the BMC is handled in ipmitool/src/plugins/lanplus/lanplus.c.
28Every SOL packet (with one exception) traveling in either direction causes
29the recipient to return an acknowledgement packet, though acks themself are
30not acknowledged.  The transport layer in lanplus.c handles the logic
31regarding acks, partial acks, sequence numbers.  SOL acknowledgements
32packets be acks, partial acks (the remote destination processed only some
33of the data), and nacks (requests to stop sending packets).  Nacks are not
34honored by ipmitool.
35
36Note that one way that SOL communication differs from standard IPMI
37commands, is that it is not simply a request response protocol.  Packets
38may be returned asyncrhonously from the BMC.  When establishing a SOL
39session, ipmitool registers a callback for asynchonously received data.
40This call back simply prints text returned from the BMC.
41
42Once a user has chosen to exit the SOL session (with ~.) ipmitool sends the
43IPMI SOL Deactivate command to the BMC.
44
45The standard code path for SOL logic follows:
46    ipmi_sol_main (ipmi_sol.c):
47
48    ipmi_sol_activate (ipmi_sol.c):
49        Argument validation
50        Creation and dispatch of IPMI Activate Payload command
51
52    ipmi_sol_red_pill (ipmi_sol.c):
53        Loop on select() for user input and data returned from the BMC
54        Periodic dispatch of "keep alive" packet to the BMC.
55        Send user input to the BMC and BMC data to the console.
56
57        processSolUserInput (ipmi_sol.c):
58            Process possible escape sequences (~., ~B, etc.)
59            Send (with retries) user data to the BMC
60            Partial creation of packet payload
61
62                ipmi_lanplus_send_sol (lanplus.c):
63                    Completion of packet payload
64                    Send (with retries) of SOL packet
65
66                     ipmi_lanplus_send_payload (lanplus.c):
67                         Creation of RMCP+ packet
68                         Details general to all V2 packet processing, as
69                         well as a some logic to handle ack reception.
70
71                     is_sol_partial_ack (lanplus.c):
72                         Determine whether a data needs to be resent
73
74        ipmi_lanplus_recv_sol (lanplus.c):
75            Handle data received by the BMC.  Ack as appropriate.
76
77