Title: ipaddress - is_global method all multicast addresses and networks return true
Type: Stage: patch review
Components: Library (Lib) Versions: Python 3.9
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: bjames, pmoody
Priority: normal Keywords: patch

Created on 2019-08-03 05:16 by bjames, last changed 2020-02-06 01:58 by cheryl.sabella.

Pull Requests
URL Status Linked Edit
PR 15088 open bjames, 2019-08-03 05:29
Messages (1)
msg348942 - (view) Author: Brandon James (bjames) * Date: 2019-08-03 05:16
When using the ipaddress library, all multicast addresses and networks return True when using the is_global method for their respective classes. I believe their are two possible fixes for this. 

1) In practice no multicast addresses are globally routable. If our definition of is_global means the address is globally routable, then I propose adding not is_multicast to each class's is_global logic. 

2) RFC 5771 (IPv4) and RFCs 4291 and 7346 (IPv6) both have guidelines for what MAY be routed on the public internet (as mentioned above multicast is not routed globally in practice). Logic following those guidelines should be added.

IPv4:, AD-HOC I, II and III addresses -, -, and -

IPv6: Multicast addresses with 0xE in the SCOPE field

The current logic is inaccurate when looking at the relevant RFCs and worse when looking at how routing is actually implemented. 

Github PR submitted for option 1 above. I've also submitted a thread to NANOG's mailing list (currently pending moderator approval) posing a few questions regarding the RFCs above. I think it's unlikely that multicast will ever be publicly routed on the internet, so really we just need to define global here. My definition would be addresses that are routed on the public internet.
Date User Action Args
2020-02-06 01:58:26cheryl.sabellasetnosy: + pmoody

versions: + Python 3.9
2019-08-03 05:29:09bjamessetkeywords: + patch
stage: patch review
pull_requests: + pull_request14833
2019-08-03 05:16:46bjamescreate