qdeconinck / mp-quic

Please read https://multipath-quic.org/2017/12/09/artifacts-available.html to figure out how to setup the code.
MIT License
176 stars 71 forks source link

These two bits of code in the path_manager.go file confuse me. #45

Open linyuana opened 1 year ago

linyuana commented 1 year ago

1.from ‘setup()’

` // Initial PathID is 0 // PathIDs of client-initiated paths are even // those of server-initiated paths odd

if pm.sess.perspective == protocol.PerspectiveClient {
    pm.nxtPathID = 1
} else {
    pm.nxtPathID = 2
}

` 2.from ‘createPathFromRemote(p *receivedPacket)’

` // Sanity check: odd is client initiated, even for server initiated

if pm.sess.perspective == protocol.PerspectiveClient && pathID%2 != 0 {
    return nil, errors.New("server tries to create odd pathID")
}
if pm.sess.perspective == protocol.PerspectiveServer && pathID%2 == 0 {
    return nil, errors.New("client tries to create even pathID")
}

` So who created the odd numbered paths and who created the even numbered paths?