Ybts socket protocol


Protocol type: Packet oriented

Packet format:

PrimitivePacket description1MandatoryThe most significant bit will indicate if the packet is connection related
If not set the packet header will contain the connection id field
If set the packet will not contain the connection id field
InfoExtended info 1MandatoryInterpreted according to primitive and packet data
ConnectionId Unsigned integer in network byte order 2ConditionalPresent only if primitive most significant bit is not set
DataPacket data0-nOptional

Primitives with code 0-127 are associated with a communication channel and its ID is presen after the Info field. Primitives with code 128-255 are not associated with a channel and Data (if present) follows immediately after the Info field.


ValueNameSenderDescriptionNoteAvailable in release
0L3MessageBothConnection related L3 messageThe packet carries a connection related L3 message1
1ConnLostConnection abnormally releasedThe notifies about connection lost
No response is required
2ConnReleaseYBTSRequest connection releaseYBTS requests a connection release
No response is required
3StartMedia YBTSRequest media channelYBTS requests changing the channel mode to allow traffic
On success MediaStarted is notified, on error a MediaError is reported
4StopMediaYBTSRequest stopping media YBTS requests media traffic to stop
No response is required
5AllocMediaYBTSRequest reservation of a traffic channel YBTS requests having a traffic channel allocated
In case of error a MediaError is reported
6MediaError<YBTSPeer>Notifies about a traffic channel errorThis is sent in case of allocation failure or channel mode change failure1
7MediaStarted<YBTSPeer>Notifies that the traffic channel has startedThis is sent to confirm a StartMedia request1
8EstablishSAPI BothRequest or notification for SAPI establishmentThis should be used for SAPI 1-3, SAPI 0 is established by default1
9PhysicalInfo<YBTSPeer>Physical channel information reportProvides information about uplink physical channel4
10HandoverRequired <YBTSPeer>Outbound handover required Provides list of candidate cells and MS measured levels4
11HandoverAck <YBTSPeer>Inbound handover acknowledgeConfirms resource allocation, carries RR HANDOVER COMMAND4
?StartCipheringYBTSRequest ciphering startTo be discussed: The message may carry a RR CIPHERING MODE COMMAND
64GprsAttachReq<YBTSPeer>GPRS Attach Request from MSThis message is repeated as attach procedure progresses4
65GprsAttachLBOYBTSAttach Accept with Local Breakout Attach procedure continues with locally provided connectivity4
66GprsAttachOk YBTSAttach Accept through core network Attach procedure continues with data going through the core network 4
67GprsAttachRejYBTSAttach is rejected by network The connection is closed when this message is sent or received 4
68GprsIdentityReqYBTSThe MS is requested to send the IMSI identityA new GprsAttachReq is expected after receiving IMSI 4
69GprsAuthRequestYBTSThe MS is requested to authenticateA new GprsAttachReq is expected after successful authentication4
70GprsDetachBothGPRS is being detached either by MS or by network The connection is closed when this message is sent or received4
71PdpActivateBothPDP Context creation is requested or acknowledgedThe reply parameter indicates a response4
72PdpModifyBothPDP Context modification is requested or acknowledgedThe reply parameter indicates a response4
73PdpDeactivateBothA PDP Context is to be deletedThere is no answer, it is assumed to always succeed4
128HandshakeBothHandshakeThis is the first message exchanged on signalling interface.
Sent by < YBTSPeer>. Response: Handshake
129RadioReady<YBTSPeer>Radio ready notification This message indicates the radio side is functional1
130StartPaging YBTSPaging start requestThis message request paging. It will transport a mobile identity1
131StopPagingYBTSPaging stop requestThis message request paging. It will transport a mobile identity1
132NeighborsListYBTSUpdate the list of neighbor cellsThe data holds a list of cells ordered by ARFCN4
133HandoverRequestYBTSRequest inbound handover resourcesThe Handover Reference must be handled by YBTS4
134HandoverReject<YBTSPeer>Indicates handover allocation failure 4
135Stop<YBTSPeer>Application stopping notificationYBTS will stop. It may not restart if a non retryable radio error is received5
255HeartbeatBothConnection idle heartbeatThe packet don't carry data or connection id field
It must be sent on idle connection
Interval: ? seconds


  • L3Message, EstablishSAPI:
  • Bit 7: Set if message is for SACCH
  • Bits 0-2 contains the SAPI
  • Handshake:
  • Bits 0-3: Protocol version. Current: 0
  • Bit 7: MSC/SGSN identity. This bit must be the same on both ends of a connection
  • Bits 4-6: Reserved, must be 0
  • StartMedia
  • Codes the channel traffic type, 0-3 (0 = Signaling only, 1-3 = GSM voice v…)
  • StartPaging
  • Codes the requested paged channel type (0 = Voice, 1 = SMS, 2 = SS)
  • MediaError
  • L3 CC Cause code (similar to Q.850)
  • HandoverRequest, HandoverAck, HandoverReject
  • Handover reference used to match Ack to Request
  • GprsDetach
  • Detach reason flags, bit 3 (0x08) indicates power off
  • GprsAttachReq
  • For a routing area update procedure, the message may also contain a pdps parameter detailing the known active PDP contexts from the point a view of the MS. If the MS doesn’t provide the information, the parameter will arrive as 0xffff
  • GprsAttachOk
  • For a routing area update procedure, the message will also contain a pdps parameter listing active PDP contexts, a llcsapis parameter listing used LLC SAPIs and a tids parameter listing transaction IDs used by the MS for each PDP context
  • Stop
  • Stopping reason (Normal/RadioLost/InternalError/RadioExiting/RadioError)


  • StartPaging, StopPaging
  • Mobile identity: TMSIxxxxxxxxxxxxxxxx (hex digits) or IMSIdddddddddddddddddddddddddddddd (BCD digits) in identity parameter
  • if mobile identity is TMSI, StartPaging will also contain the IMSI in imsi parameter
  • PhysicalInfo
  • Human-readable string describing physical level information
  • NeighborsList
  • HandoverRequired
  • HandoverAck
  • Binary RR Handover Command
  • GprsAttachReq, GprsAttachOk, GprsAuthRequest, PdpActivate, PdpModify, PdpDeactivate
  • List of space separated tag=value parameters
  • Stop
  • List of space separated tag=value parameters


Protocol type: Packet oriented

Packet format:

2 bytes connection id: unsigned integer in network byte order
0..n bytes media data


Protocol type: Packet oriented

Packet format:

Byte 0 Debug typeBytes 1..nAvailable in release
0xffOutputText 1
Bits 6-7: 0Debug/Alarm with syslog level set in bits 0-5
Output if log level is not 0..7
Bits 6-7: 3Relay OutputText + 2 * NULL4
Bits 6-7: 2Relay Debug with level set in bits 0-3Text + 2 * NULL4
Bits 6-7: 1Relay Alarm with level set in bits 0-3Text + 3 * NULL + Component + NULL + Alarm Info4


Protocol type: Packet oriented

Command: 1..n bytes single line of text, up to 1023 characters

Response: 1..n bytes text, may include \n line separators