12-27-2016, 06:46 PM
Okay after some thoughts.
Here's a better packet exchange for protocol identification.
--
Total success:
A: Ping!
B: Pong!
B: Ping!
A: Pong!
A: This is a protocol request
B: Affirmative
A: For protocol X
B: Yeah, I use version Y
A: Okay I'm starting transmission now.
--
B online but does not use protocol X:
A: Ping!
B: Pong!
B: Ping!
A: Pong!
A: This is a protocol request
B: Affirmative
A: For protocol X
B: Oh, I don't have protocol X support (all 1s in the data.)
A: Okay, carrying on.
--
B is not online:
A: Ping!
B: ...
--
B is online but A isn't reachable:
A: Ping!
B: Pong!
B: Ping!
A: ...
(After a few failed pings from B):
B: Not getting a pong, terminating connection.
--
Keep in mind with all of these after a timeout if no ack is received a new packet is sent, after a few failed packets (no response) a termination is sent.
Here's a better packet exchange for protocol identification.
--
Total success:
A: Ping!
B: Pong!
B: Ping!
A: Pong!
A: This is a protocol request
B: Affirmative
A: For protocol X
B: Yeah, I use version Y
A: Okay I'm starting transmission now.
--
B online but does not use protocol X:
A: Ping!
B: Pong!
B: Ping!
A: Pong!
A: This is a protocol request
B: Affirmative
A: For protocol X
B: Oh, I don't have protocol X support (all 1s in the data.)
A: Okay, carrying on.
--
B is not online:
A: Ping!
B: ...
--
B is online but A isn't reachable:
A: Ping!
B: Pong!
B: Ping!
A: ...
(After a few failed pings from B):
B: Not getting a pong, terminating connection.
--
Keep in mind with all of these after a timeout if no ack is received a new packet is sent, after a few failed packets (no response) a termination is sent.
This is my signature.