Skip to contentSkip to conversation

Why does messenger sends the address of himself and of the connecting peer

DISCUSSION Ricardo Dias 3 participants 5 messages Oct 20, 2017 – Oct 23, 2017

lore
Share & tools
lore
#0 lore raw

Hi,

In the current messenger protocol, upon accepting a new connection, the messenger sends it's address and the connecting peer address along with the banner string. Why does the connecting peer need these addresses? Moreover, the connecting peer uses the connecting peer address (sent from the server) to set as it's own address.

What happens if the network is rewriting addresses because of NAT, or whatever other strange reasons?

I also saw that the code that encodes these addresses have a comment saying "// legacy". Should we remove these addresses from the new V2 protocol, or do we still need them?

Thanks,
Ricardo

Signature · 5 lines
Ricardo Dias
Senior Software Engineer - Storage Team
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton,
HRB 21284
(AG Nürnberg)
#1 lore raw

I had a similar question when I got hit by clients behind a NAT failing to connect [1] to the cluster.

[1] http://tracker.ceph.com/issues/20049

Quoted 28 lines · Ricardo Dias

Hi,

In the current messenger protocol, upon accepting a new connection, the messenger sends it's address and the connecting peer address along with the banner string. Why does the connecting peer need these addresses? Moreover, the connecting peer uses the connecting peer address (sent from the server) to set as it's own address.

What happens if the network is rewriting addresses because of NAT, or whatever other strange reasons?

I also saw that the code that encodes these addresses have a comment saying "// legacy". Should we remove these addresses from the new V2 protocol, or do we still need them?

Thanks,
Ricardo

--
Ricardo Dias
Senior Software Engineer - Storage Team
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284
(AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 1 line
Jason
#2 lore raw
In reply to Ricardo Dias
Quoted 8 lines · Ricardo Dias

In the current messenger protocol, upon accepting a new connection, the messenger sends it's address and the connecting peer address along with the banner string. Why does the connecting peer need these addresses? Moreover, the connecting peer uses the connecting peer address (sent from the server) to set as it's own address.

What happens if the network is rewriting addresses because of NAT, or whatever other strange reasons?

There are two cases:

1) client -> server connections. These always are initiated in one directly. The self address thing is included there partly so that the client can discover what its effective (public) address is. In the case of the OSD, the initial osd -> mon connection allows the osd to learn what it's public IP address will be (we advertise our address as the one that is used to connect to the mon).

2) server <-> server connections, e.g., mon<->mon, osd<->osd, mds<->mds. Here, connections can be opened in either direction. I believe here it is just used as a sanity check.

Quoted 3 lines

I also saw that the code that encodes these addresses have a comment saying "// legacy". Should we remove these addresses from the new V2 protocol, or do we still need them?

I think we'll still need them, since new clients will still need to connect to old servers, and new servers will need to allow old clients to connect.

HTH?

sage

#3 lore raw
Quoted 35 lines · Sage Weil
Quoted 1 line · Ricardo Dias

In the current messenger protocol, upon accepting a new connection,

the

Quoted 1 line

messenger sends it's address and the connecting peer address along

with

Quoted 1 line

the banner string. Why does the connecting peer need these

addresses?

Quoted 1 line

Moreover, the connecting peer uses the connecting peer address

(sent

Quoted 3 lines

from the server) to set as it's own address.

What happens if the network is rewriting addresses because of NAT,

or

Quoted 1 line

whatever other strange reasons?

There are two cases:

1) client -> server connections. These always are initiated in one directly. The self address thing is included there partly so that the
client can discover what its effective (public) address is. In the case
of the OSD, the initial osd -> mon connection allows the osd to learn what
it's public IP address will be (we advertise our address as the one that is used to connect to the mon).

2) server <-> server connections, e.g., mon<->mon, osd<->osd, mds<-

Quoted 1 line

mds.

Here, connections can be opened in either direction. I believe here it is
just used as a sanity check.

Quoted 1 line

I also saw that the code that encodes these addresses have a

comment

Quoted 8 lines
Quoted 1 line

saying "// legacy". Should we remove these addresses from the new

V2

Quoted 1 line

protocol, or do we still need them?

I think we'll still need them, since new clients will still need to connect to old servers, and new servers will need to allow old clients to
connect.

The Messenger will still support the V1 protocol, so if a new client needs to talk with an old server it will instantiate a V1 messenger. Therefore, I think we can drop this from the V2 protocol, right?

Quoted 11 lines

HTH?

sage

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 5 lines
Ricardo Dias
Senior Software Engineer - Storage Team
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton,
HRB 21284
(AG Nürnberg)
#4 lore raw
Quoted 40 lines · Ricardo Dias
Quoted 39 lines · Sage Weil
Quoted 1 line · Ricardo Dias

In the current messenger protocol, upon accepting a new connection,

the

Quoted 1 line

messenger sends it's address and the connecting peer address along

with

Quoted 1 line

the banner string. Why does the connecting peer need these

addresses?

Quoted 1 line

Moreover, the connecting peer uses the connecting peer address

(sent

Quoted 3 lines

from the server) to set as it's own address.

What happens if the network is rewriting addresses because of NAT,

or

Quoted 1 line

whatever other strange reasons?

There are two cases:

1) client -> server connections. These always are initiated in one directly. The self address thing is included there partly so that the
client can discover what its effective (public) address is. In the case
of the OSD, the initial osd -> mon connection allows the osd to learn what
it's public IP address will be (we advertise our address as the one that is used to connect to the mon).

2) server <-> server connections, e.g., mon<->mon, osd<->osd, mds<-

Quoted 1 line

mds.

Here, connections can be opened in either direction. I believe here it is
just used as a sanity check.

Quoted 1 line

I also saw that the code that encodes these addresses have a

comment

Quoted 1 line

saying "// legacy". Should we remove these addresses from the new

V2

Quoted 1 line

protocol, or do we still need them?

Quoted 8 lines
Quoted 4 lines

I think we'll still need them, since new clients will still need to connect to old servers, and new servers will need to allow old clients to
connect.

The Messenger will still support the V1 protocol, so if a new client needs to talk with an old server it will instantiate a V1 messenger. Therefore, I think we can drop this from the V2 protocol, right?

Oh, right.. yes!

sage