Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does P4Utils Support IPv6 ? #66

Open
liudsl opened this issue Nov 13, 2023 · 3 comments
Open

Does P4Utils Support IPv6 ? #66

liudsl opened this issue Nov 13, 2023 · 3 comments

Comments

@liudsl
Copy link

liudsl commented Nov 13, 2023

Hi everyone:

I want to do something about SRv6, specifically using BMV2 to implement SRv6, but I found that the function net.setIntfIp() cannot set the IPv6 address for host. How should I solve it?

Thank you very much!

here is my code:

#! /usr/bin/python3


net = NetworkAPI()

# Network general options
net.setLogLevel('info')
net.enableCli()

# Network definition
net.addSwitch("s1")
net.addHost('h1')
net.addHost('h2')

net.addLink('h1', 's1', port2=1)
net.addLink('s1', 'h2', port1=2)

net.setIntfIp("h1", "s1", "2001:db00::0/24")
# Assignment strategy
# net.l2()

# Nodes general options
net.enableLogAll()

# Start the network
net.startNetwork()

And Here is the output after sudo python3 network:

.......
Topology saved to disk!
Programming switches...
Switches programmed correctly!
Programming hosts...

Traceback (most recent call last):
  File "network.py", line 39, in <module>
    net.startNetwork()
  File "/home/ubuntu/p4-tools/p4-utils/p4utils/mininetlib/network_API.py", line 1135, in startNetwork
    self.program_hosts()
  File "/home/ubuntu/p4-tools/p4-utils/p4utils/mininetlib/network_API.py", line 341, in program_hosts
    '{}/{}'.format(intf1.ip, intf1.prefixLen))
  File "/usr/lib/python3.6/ipaddress.py", line 119, in ip_interface
    address)
ValueError: 'None/24' does not appear to be an IPv4 or IPv6 interface
@edgar-costa
Copy link
Collaborator

@liudsl Unfortunately, for most features we do not have support for IPv6.

To solve it you would need to adapt the code in all the placers where we assume addresses are IPv4.

@edgar-costa
Copy link
Collaborator

@huyongqingandczw Why do you write your question in this git issue thread, I don't think what you are asking has anything to do with the original question. Can you please not do that?

If your question is unrelated to the current thread, I kindly suggest creating a new issue or finding a thread that aligns more closely with your topic.

@jose-galvao
Copy link

Hello @liudsl what did you do to solve that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants