This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: ipaddress - is_global method all multicast addresses and networks return true
Type: Stage: patch review
Components: Library (Lib) Versions: Python 3.9
process
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 2022-04-11 14:59 by admin.

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: 224.0.1.0/24, AD-HOC I, II and III addresses 224.0.2.0 - 224.0.255.255, 224.3.0.0 - 224.4.255.255, and 233.252.0.0 - 233.255.255.255

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.
History
Date User Action Args
2022-04-11 14:59:18adminsetgithub: 81930
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