Subject: [SIP] a tiny binary sip proxy protocol

From: "Ashhar Farhan" <[email-masked]>
Date: 30 Dec 2000 08:13:22 -0000

i am proposing a very easily implemented, binary level protocol that can easily translate to and from sip 
signalling. the protocol is right now called STP (Sip's Tiny Proxy).
the protocol has the following features:

1. it can painlessly traverse SOCKS 5 proxies, NAT and other forms of proxy like WinSock. It uses in-band signalling so that a single port on proxies and firewalls is used for both streaming as well as signalling. This is an issue of immense importance currently. Most of the people who have an always on presence on the Net are usually behind a proxy of some sort. 

2. the signalling uses binary structures that can be directly read into C structures eliminating the need of costly parsers. This leads to a loss of many facilities inherent in SIP. This is by design. It is a cut down protocol that can easily translate to SIP through a gateway.

3. All the signalling messages are handled uniformly (retransmit until response or time-out). forking is not allowed. INVITE and ACK are replaced with RING and ANSWER (as two separate messages).

4. No call parameter renegotiation is allowed. 

here is the signalling structure:

#define CMD_LOGIN		1
#define CMD_NEWUSER		2
#define CMD_RING		3
#define CMD_ANSWER		4
#define CMD_MSG			5
#define CMD_HANGUP		6
#define CMD_CANCEL		7
#define CMD_LOGOUT		8
#define CMD_REFUSE		9

#pragma pack(1)
#define MAX_USERID 64
#define RTP_PORT 5004
struct stp
{
	short	version;
	short	command;
	short	response;
	char	to[MAX_USERID];
	char	from[MAX_USERID];
	int		session;
	int		msgid;
	char	authenticate[16];
	int		contactIp;
	short	contactPort;
	char	body[];
};

Notes:
1. Works exclusively on UDP port (randomly chosen).
2. The body field extends to the length of the udp packet.
3. the session id is mapped to the ssrc of rtp.
4. requests have a 0 in the response field.
5. userid consists of userid@host. The port for signalling is same as the port for streaming.
6. If contact Ip and contact port are zero, then use the ip address from where the packet arrived for further communications.
7. current version is 1.
8. responses are as per SIP definitions.
9. Only MD5 authentication is used.
10. msgid should be unique throughout the session.
11. A new registration is created if the email is sent in the data field.
12. the proposed port for STP servers is 5061.

I have been off the list for the past few months refining and simplifying the protocol and i believe that it is a sufficient protocol to ensure easy translation to and from sip while at the same time solving the problems of NAT, SOCKS 5 interoperability as well as small footprints.

- [email-masked]

_____________________________________________________
Chat with your friends as soon as they come online. Get Rediff Bol at
http://bol.rediff.com

_______________________________________________
SIP mailing list
[email-masked]
http://lists.bell-labs.com/mailman/listinfo/sip