RFC 协议分析
- 格式:pdf
- 大小:713.29 KB
- 文档页数:25
Tradeoff
• • •
network bandwidth client drawing speed server processing speed
FrameBufferUpdateRequest
•
a single FrameBufferUpdate may be sent to in reply to several FrameBufferUpdateRequest normally only needs to send incremental updates to the client. if incremental is false The area will not be updated using the CopyRect encoding.
• •
KeyEvent
•
The key itself is specified using the "keysym" values defined by the X Window System, even if the client or server is not running the X Window System. header file <X11/keysymdef.h> The interpretation of keysyms is a complex area. In order to be as widely interoperable as possible, the following guidelines should be followed
•
SetEncodings
•
order->preference, The server may or may not choose to make use of this hint. Pixel data may always be sent in raw encoding even if not specified explicitly here.
•
PointerEvent
•
0 1 2 3 4 5 6 7 ->8 buttons: left middle right 1 2 3
ClientCutText
• •
client tell the server that it has latin-text in its buffer end of the line is represented by /n without carriage return
•
•
Pixel Format
•
true-color-flag : Server->SetColorMapEntires
Client to Server Messages
•
unregistered message can't be send without confirmation
Interaction phase
•
Following the server initialization phase, it`s up to client to send whichever protocol message it wants Typically: SetPixelFormat SetEncodings FrameBufferUpdateRequest
Server to Client Messages
FrameBufferUpdate
•
a sequence of rectangles of pixel data that the client should put into its framebuffer Each rectangle starts with a rectangle header, followed by the pixel data is specified encoding (raw data without SetEncoding)
Handshaking Phase
•
Protocol Version s->c: highest RFB protocol version number supported by the server. c->s: never request a protocol version higher than that offered by the server "RFB 003.003\n" typedef char rfbProtocolVersionMsg[13]; Type of security //Version 3.8 s->c: if server didn't support the desired version then send 0 and the reason string and closed the connection else sends the number of security types, security types(0 1 2) c->s: if number of security type != 0 then sends the particular security type s->c: if security type = 2(VncAuth) s->c: challenge c->s: response(DES) else sends the security result(0 1 2)
•
Bell & ServerCutText
Encodings
Raw Encoding
•
All RFB clients must be able to handle pixel data in this raw encoding, and RFB servers should only produce raw encoding unless the client specifically asks for some other encoding type.
RFB Protocol
RFB Protocol
• •
thin client stateless client
Display Protocol
•
graphics primitive: “put a rectangle of pixel data at a given x,y position” A sequence of these rectangles makes a framebuffer update The update protocol is demand-driven by the client
•
•
Input Protocol
• •
Input events: key , pointer synthesized from non-standard I/O device
Basic Concepts
•
Pixel format refers to the representation of individual colors by pixel values Encoding refers to how a rectangle of pixel data will be sent on the wire header + data
•
SetColorMapEntries
•
When the pixel format uses a "color map", this message tells the client that the specified pixel values should be mapped to the given RGB values This message should not be sent by the server until after the client has sent at least one FramebufferUpdateRequest, and only when the agreed pixel format uses a color map
•
SetPixelFormat
•
if the client don’t send a SetPixelFormat then the server sends pixel values in its natural format as specified in the ServerInit message If true-color-flag is zero (false) then this indicates that a “color map” is to be used. The server can set any of the entries in the color map using the SetColorMapEntries message. Immediately after the client has sent this message the color map is empty, even if entries had previously been set by the server
•
Initialization Phase
•
clientInit c->s : shared-flag ServerInit s->c : framebuffer-width framebuffer-height server-pixel-format name-length name-string server-pixel-format: Client->SetPixelFormat
பைடு நூலகம்