Internals
State Machine
The state machine for a SIPDHT node is shown in the following diagram. For simplicity, transactions caused by requests to be redirected or belonging to get and put operations are not shown.
Transaction Details
INIT
Goes to to:
- ENTERING
- happens immediately and causes the sending of a join request to the a known node.
ENTERING
Goes to to:
- ENTERING
- triggered by a redirection and causes the sending of a join request to the node referred in the response message.
- STANDALONE
- triggered by a failure response.
- OVERLAY
- triggered by a successful response.
OVERLAY
Goes to to:
- OVERLAY
- triggered by a join, stabilization or update request (which for simplicity here always succedes).
- STABILIZING
- triggered by the stabilization timer and causes a stabilization request.
STABILIZING
Goes to to:
- OVERLAY
- triggered by a successful response.
- STABILIZING
- triggered by a redirection and causes the sending of a stabilization request to the node referred in the response message.
- FIXING
- triggered by a failure response when at least one more successor is known. It causes the sending of a stabilization request to another successor.
- STANDALONE
- triggered by a failure response when at no more successors are known.
FIXING
Goes to to:
- OVERLAY
- triggered by a successful response.
- FIXING
- triggered by a redirection and causes the sending of a stabilization request to the node referred in the response message.
- FIXING
- triggered by a failure response when at least one more successor is known. It causes the sending of a stabilization request to another successor.
- STANDALONE
- triggered by a failure response when at no more successors are known.
STANDALONE
Goes to to:
- OVERLAY
- triggered by a join request (which for simplicity here always successes).
Message Format
The message format is much similar to the one defined in draft-bryan-sipping-p2p-02. This sections shows some example messages.
Join
REGISTER sip:b3@127.0.0.64:4001;user=node SIP/2.0
Via: SIP/2.0/TCP 127.0.0.1:4001;branch=z9hG4bKayBQ74N72eHFN
Max-Forwards: 0
From: <sip:7a@127.0.0.1:4001;user=node>;tag=e9NaDmj68t8HD
To: <sip:7a@127.0.0.1:4001;user=node>
Call-ID: dcf591c8-d30b-1229-c4ac-0050dae0e811
CSeq: 74126366 REGISTER
Contact: <sip:7a@127.0.0.1:4001;user=node>
Expires: 3600
Content-Length: 0
DHT-NodeID: <sip:7a@127.0.0.1:4001;user=node>;algorithm=sum-8
Via: SIP/2.0/TCP 127.0.0.1:4001;branch=z9hG4bKayBQ74N72eHFN
Max-Forwards: 0
From: <sip:7a@127.0.0.1:4001;user=node>;tag=e9NaDmj68t8HD
To: <sip:7a@127.0.0.1:4001;user=node>
Call-ID: dcf591c8-d30b-1229-c4ac-0050dae0e811
CSeq: 74126366 REGISTER
Contact: <sip:7a@127.0.0.1:4001;user=node>
Expires: 3600
Content-Length: 0
DHT-NodeID: <sip:7a@127.0.0.1:4001;user=node>;algorithm=sum-8
SIP/2.0 200 OK
Via: SIP/2.0/TCP 127.0.0.1:4001;branch=z9hG4bKayBQ74N72eHFN;rport=45739
From: <sip:7a@127.0.0.1:4001;user=node>;tag=e9NaDmj68t8HD
To: <sip:7a@127.0.0.1:4001;user=node>;tag=eBcXBpZc6jH3H
Call-ID: dcf591c8-d30b-1229-c4ac-0050dae0e811
CSeq: 74126366 REGISTER
Contact: <sip:7a@127.0.0.1:4001;user=node>;expires=3600
Content-Length: 0
DHT-Link: <sip:7a@127.0.0.1:4001;user=node>;link=P0
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=S0
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F0
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F1
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F2
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F3
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F4
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F5
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F6
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F7
DHT-NodeID: <sip:b3@127.0.0.64:4001;user=node>;algorithm=sum-8
Via: SIP/2.0/TCP 127.0.0.1:4001;branch=z9hG4bKayBQ74N72eHFN;rport=45739
From: <sip:7a@127.0.0.1:4001;user=node>;tag=e9NaDmj68t8HD
To: <sip:7a@127.0.0.1:4001;user=node>;tag=eBcXBpZc6jH3H
Call-ID: dcf591c8-d30b-1229-c4ac-0050dae0e811
CSeq: 74126366 REGISTER
Contact: <sip:7a@127.0.0.1:4001;user=node>;expires=3600
Content-Length: 0
DHT-Link: <sip:7a@127.0.0.1:4001;user=node>;link=P0
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=S0
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F0
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F1
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F2
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F3
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F4
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F5
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F6
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F7
DHT-NodeID: <sip:b3@127.0.0.64:4001;user=node>;algorithm=sum-8
Stabilization
REGISTER sip:b3@127.0.0.64:4001;user=node SIP/2.0
Via: SIP/2.0/TCP 127.0.0.1:4001;branch=z9hG4bKayBQ74N72eHFN
Max-Forwards: 0
From: <sip:7a@127.0.0.1:4001;user=node>;tag=e9NaDmj68t8HD
To: <sip:7a@127.0.0.1:4001;user=node>
Call-ID: dcf591c8-d30b-1229-c4ac-0050dae0e811
CSeq: 74126366 REGISTER
Contact: <sip:7a@127.0.0.1:4001;user=node>
Expires: 3600
Content-Length: 0
DHT-NodeID: <sip:7a@127.0.0.1:4001;user=node>;algorithm=sum-8
Via: SIP/2.0/TCP 127.0.0.1:4001;branch=z9hG4bKayBQ74N72eHFN
Max-Forwards: 0
From: <sip:7a@127.0.0.1:4001;user=node>;tag=e9NaDmj68t8HD
To: <sip:7a@127.0.0.1:4001;user=node>
Call-ID: dcf591c8-d30b-1229-c4ac-0050dae0e811
CSeq: 74126366 REGISTER
Contact: <sip:7a@127.0.0.1:4001;user=node>
Expires: 3600
Content-Length: 0
DHT-NodeID: <sip:7a@127.0.0.1:4001;user=node>;algorithm=sum-8
SIP/2.0 200 OK
Via: SIP/2.0/TCP 127.0.0.1:4001;branch=z9hG4bKayBQ74N72eHFN;rport=45739
From: <sip:7a@127.0.0.1:4001;user=node>;tag=e9NaDmj68t8HD
To: <sip:7a@127.0.0.1:4001;user=node>;tag=eBcXBpZc6jH3H
Call-ID: dcf591c8-d30b-1229-c4ac-0050dae0e811
CSeq: 74126366 REGISTER
Contact: <sip:7a@127.0.0.1:4001;user=node>;expires=3600
Content-Length: 0
DHT-Link: <sip:7a@127.0.0.1:4001;user=node>;link=P0
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=S0
DHT-Link: <sip:7a@127.0.0.1:4001;user=node>;link=S1
DHT-Link: <sip:b3@127.0.0.64:4001;user=node>;link=S2
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F0
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F1
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F2
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F3
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F4
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F5
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F6
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F7
DHT-NodeID: <sip:b3@127.0.0.64:4001;user=node>;algorithm=sum-8
Via: SIP/2.0/TCP 127.0.0.1:4001;branch=z9hG4bKayBQ74N72eHFN;rport=45739
From: <sip:7a@127.0.0.1:4001;user=node>;tag=e9NaDmj68t8HD
To: <sip:7a@127.0.0.1:4001;user=node>;tag=eBcXBpZc6jH3H
Call-ID: dcf591c8-d30b-1229-c4ac-0050dae0e811
CSeq: 74126366 REGISTER
Contact: <sip:7a@127.0.0.1:4001;user=node>;expires=3600
Content-Length: 0
DHT-Link: <sip:7a@127.0.0.1:4001;user=node>;link=P0
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=S0
DHT-Link: <sip:7a@127.0.0.1:4001;user=node>;link=S1
DHT-Link: <sip:b3@127.0.0.64:4001;user=node>;link=S2
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F0
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F1
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F2
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F3
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F4
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F5
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F6
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F7
DHT-NodeID: <sip:b3@127.0.0.64:4001;user=node>;algorithm=sum-8
Update
REGISTER sip:b3@127.0.0.64:4001;user=node SIP/2.0
Via: SIP/2.0/TCP 127.0.0.1:4001;branch=z9hG4bKayBQ74N72eHFN
Max-Forwards: 0
From: <sip:7a@127.0.0.1:4001;user=node>;tag=e9NaDmj68t8HD
To: <sip:79@127.0.0.1:4000;user=node>
Call-ID: dcf591c8-d30b-1229-c4ac-0050dae0e811
CSeq: 74126366 REGISTER
Contact: *
Expires: 0
Content-Length: 0
DHT-NodeID: <sip:7a@127.0.0.1:4001;user=node>;algorithm=sum-8
Via: SIP/2.0/TCP 127.0.0.1:4001;branch=z9hG4bKayBQ74N72eHFN
Max-Forwards: 0
From: <sip:7a@127.0.0.1:4001;user=node>;tag=e9NaDmj68t8HD
To: <sip:79@127.0.0.1:4000;user=node>
Call-ID: dcf591c8-d30b-1229-c4ac-0050dae0e811
CSeq: 74126366 REGISTER
Contact: *
Expires: 0
Content-Length: 0
DHT-NodeID: <sip:7a@127.0.0.1:4001;user=node>;algorithm=sum-8
SIP/2.0 200 OK
Via: SIP/2.0/TCP 127.0.0.1:4001;branch=z9hG4bKayBQ74N72eHFN;rport=45739
From: <sip:7a@127.0.0.1:4001;user=node>;tag=e9NaDmj68t8HD
To: <sip:79@127.0.0.1:4000;user=node>;tag=eBcXBpZc6jH3H
Call-ID: dcf591c8-d30b-1229-c4ac-0050dae0e811
CSeq: 74126366 REGISTER
Contact: <sip:79@127.0.0.1:4000;user=node>;expires=0
Content-Length: 0
DHT-Link: <sip:7a@127.0.0.1:4001;user=node>;link=P0
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=S0
DHT-Link: <sip:7a@127.0.0.1:4001;user=node>;link=S1
DHT-Link: <sip:b3@127.0.0.64:4001;user=node>;link=S2
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F0
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F1
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F2
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F3
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F4
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F5
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F6
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F7
DHT-NodeID: <sip:b3@127.0.0.64:4001;user=node>;algorithm=sum-8
Via: SIP/2.0/TCP 127.0.0.1:4001;branch=z9hG4bKayBQ74N72eHFN;rport=45739
From: <sip:7a@127.0.0.1:4001;user=node>;tag=e9NaDmj68t8HD
To: <sip:79@127.0.0.1:4000;user=node>;tag=eBcXBpZc6jH3H
Call-ID: dcf591c8-d30b-1229-c4ac-0050dae0e811
CSeq: 74126366 REGISTER
Contact: <sip:79@127.0.0.1:4000;user=node>;expires=0
Content-Length: 0
DHT-Link: <sip:7a@127.0.0.1:4001;user=node>;link=P0
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=S0
DHT-Link: <sip:7a@127.0.0.1:4001;user=node>;link=S1
DHT-Link: <sip:b3@127.0.0.64:4001;user=node>;link=S2
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F0
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F1
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F2
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F3
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F4
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F5
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F6
DHT-Link: <sip:e4@127.0.0.128:4001;user=node>;link=F7
DHT-NodeID: <sip:b3@127.0.0.64:4001;user=node>;algorithm=sum-8