OpenIxia / IxNetwork

A central location for IxNetwork sample scripts and utilities. Please also visit http://openixia.com
MIT License
50 stars 59 forks source link

ixNetwork.Vport.find().Interface.find() output is empty to send arp request #106

Closed skatakam7 closed 4 years ago

skatakam7 commented 4 years ago

Hi Team,

I want to send arp request to the interfaces i have created in ixnetwork config file (Please check the screen shot) . Actually when i reserved ports manually, it sending arp request automatically (as "ARP on Link Up" is enabled), but arp is not working if load the same configuration and reserve the ports through script.

So I am trying to fetch ixNetwork.Vport.find().Interface.find() to send the arp request, but i am getting empty output for this. Please let me know if i need to follow any other process to send the arp request.

Below is my code ..


ixChassisIpList = ['192.168.10.50']
portList = [[ixChassisIpList[0], 2, 1], [ixChassisIpList[0], 2, 2]]

configFile = 'test.ixncfg'

session = SessionAssistant(IpAddress=ixChassisIpList[0], UserName='test', Password='test')

ixNetwork = session.Ixnetwork

ixNetwork.LoadConfig(Files(configFile, local_file=True))

portMap = session.PortMapAssistant()
vport = dict()
for index,port in enumerate(portList):
    # For the port name, get the loaded configuration's port name
    portName = ixNetwork.Vport.find()[index].Name
    portMap.Map(IpAddress=port[0], CardId=port[1], PortId=port[2], Name=portName)

portMap.Connect(True)

vport = ixNetwork.Vport.find()
print("voprt: ", vport) ============> This displays reserved ports and other port details correctly
interface = vport.Interface.find()
print("interface: ", interface) ==============> This output is empty
interface.SendArp()  ===============> This is getting failed as the above output is empty

Please find the ixia config screenshot for the same image

whandjr commented 4 years ago

I may not have the syntax exactly right, but my guess is that vport is a dict so you have to provide an index. Perhaps something like this to do all at once.

ixNetwork.Vport.SendArpAll()

or if you want to send arp to individual vPorts, something like this

vport = ixNetwork.Vport.find()[0]

print("voprt: ", vport) ============> This displays reserved ports and other port details correctly

interface = vport.Interface.find()

print("interface: ", interface) ==============> This output is empty

interface.SendArp() ===============> This is getting failed as the above output is empty

Thanks, Wes

Wesley Hand m: 818-312-6752

From: skatakam7 notifications@github.com Sent: Monday, June 29, 2020 5:18 AM To: OpenIxia/IxNetwork IxNetwork@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [OpenIxia/IxNetwork] ixNetwork.Vport.find().Interface.find() output is empty to send arp request (#106)

[EXTERNAL]

Hi Team,

I want to send arp request to the interfaces i have created in ixnetwork config file (Please check the screen shot) . Actually when i reserved ports manually, it sending arp request automatically (as "ARP on Link Up" is enabled), but arp is not working if load the same configuration and reserve the ports through script.

So I am trying to fetch ixNetwork.Vport.find().Interface.find() to send the arp request, but i am getting empty output for this. Please let me know if i need to follow any other process to send the arp request.

Below is my code ..

ixChassisIpList = ['192.168.10.50']

portList = [[ixChassisIpList[0], 2, 1], [ixChassisIpList[0], 2, 2]]

configFile = 'test.ixncfg'

session = SessionAssistant(IpAddress=ixChassisIpList[0], UserName='test', Password='test')

ixNetwork = session.Ixnetwork

ixNetwork.LoadConfig(Files(configFile, local_file=True))

portMap = session.PortMapAssistant()

vport = dict()

for index,port in enumerate(portList):

# For the port name, get the loaded configuration's port name

portName = ixNetwork.Vport.find()[index].Name

portMap.Map(IpAddress=port[0], CardId=port[1], PortId=port[2], Name=portName)

portMap.Connect(True)

vport = ixNetwork.Vport.find()

print("voprt: ", vport) ============> This displays reserved ports and other port details correctly

interface = vport.Interface.find()

print("interface: ", interface) ==============> This output is empty

interface.SendArp() ===============> This is getting failed as the above output is empty

Please find the ixia config screenshot for the same [image]https://urldefense.com/v3/__https:/user-images.githubusercontent.com/49817276/85996340-47887100-ba22-11ea-8a98-78be16ef5afd.png__;!!I5pVk4LIGAfnvw!xhTThrQuIa7pHeoCui1lTmbjHuw9StoCg0ohqjNhmIsLi4DohPt9kE8yXIHu7w$

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https:/github.com/OpenIxia/IxNetwork/issues/106__;!!I5pVk4LIGAfnvw!xhTThrQuIa7pHeoCui1lTmbjHuw9StoCg0ohqjNhmIsLi4DohPt9kE-wBKfXBA$, or unsubscribehttps://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AGJXMDFPBZD4TSJSW62Z2CLRZBZ7JANCNFSM4OLC5C6A__;!!I5pVk4LIGAfnvw!xhTThrQuIa7pHeoCui1lTmbjHuw9StoCg0ohqjNhmIsLi4DohPt9kE8HlExtwA$.

hubertgee commented 4 years ago

To send arp, use the Ipv4 object.

Here is the restpy user guide: https://openixia.github.io/ixnetwork_restpy/#/reference

Ipv4.SendArp()

[cid:image001.jpg@01D64E00.663F2870] Hubert Gee

From: Wesley Hand notifications@github.com Sent: Monday, June 29, 2020 10:23 AM To: OpenIxia/IxNetwork IxNetwork@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: Re: [OpenIxia/IxNetwork] ixNetwork.Vport.find().Interface.find() output is empty to send arp request (#106)

[EXTERNAL] I may not have the syntax exactly right, but my guess is that vport is a dict so you have to provide an index. Perhaps something like this to do all at once.

ixNetwork.Vport.SendArpAll()

or if you want to send arp to individual vPorts, something like this

vport = ixNetwork.Vport.find()[0]

print("voprt: ", vport) ============> This displays reserved ports and other port details correctly

interface = vport.Interface.find()

print("interface: ", interface) ==============> This output is empty

interface.SendArp() ===============> This is getting failed as the above output is empty

Thanks, Wes

Wesley Hand m: 818-312-6752

From: skatakam7 notifications@github.com<mailto:notifications@github.com> Sent: Monday, June 29, 2020 5:18 AM To: OpenIxia/IxNetwork IxNetwork@noreply.github.com<mailto:IxNetwork@noreply.github.com> Cc: Subscribed subscribed@noreply.github.com<mailto:subscribed@noreply.github.com> Subject: [OpenIxia/IxNetwork] ixNetwork.Vport.find().Interface.find() output is empty to send arp request (#106)

[EXTERNAL]

Hi Team,

I want to send arp request to the interfaces i have created in ixnetwork config file (Please check the screen shot) . Actually when i reserved ports manually, it sending arp request automatically (as "ARP on Link Up" is enabled), but arp is not working if load the same configuration and reserve the ports through script.

So I am trying to fetch ixNetwork.Vport.find().Interface.find() to send the arp request, but i am getting empty output for this. Please let me know if i need to follow any other process to send the arp request.

Below is my code ..

ixChassisIpList = ['192.168.10.50']

portList = [[ixChassisIpList[0], 2, 1], [ixChassisIpList[0], 2, 2]]

configFile = 'test.ixncfg'

session = SessionAssistant(IpAddress=ixChassisIpList[0], UserName='test', Password='test')

ixNetwork = session.Ixnetwork

ixNetwork.LoadConfig(Files(configFile, local_file=True))

portMap = session.PortMapAssistant()

vport = dict()

for index,port in enumerate(portList):

For the port name, get the loaded configuration's port name

portName = ixNetwork.Vport.find()[index].Name

portMap.Map(IpAddress=port[0], CardId=port[1], PortId=port[2], Name=portName)

portMap.Connect(True)

vport = ixNetwork.Vport.find()

print("voprt: ", vport) ============> This displays reserved ports and other port details correctly

interface = vport.Interface.find()

print("interface: ", interface) ==============> This output is empty

interface.SendArp() ===============> This is getting failed as the above output is empty

Please find the ixia config screenshot for the same [image]<https://urldefense.com/v3/__https:/user-images.githubusercontent.com/49817276/85996340-47887100-ba22-11ea-8a98-78be16ef5afd.png__;!!I5pVk4LIGAfnvw!xhTThrQuIa7pHeoCui1lTmbjHuw9StoCg0ohqjNhmIsLi4DohPt9kE8yXIHu7w$%3E

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https:/github.com/OpenIxia/IxNetwork/issues/106__;!!I5pVk4LIGAfnvw!xhTThrQuIa7pHeoCui1lTmbjHuw9StoCg0ohqjNhmIsLi4DohPt9kE-wBKfXBA$%3E, or unsubscribe<https://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AGJXMDFPBZD4TSJSW62Z2CLRZBZ7JANCNFSM4OLC5C6A__;!!I5pVk4LIGAfnvw!xhTThrQuIa7pHeoCui1lTmbjHuw9StoCg0ohqjNhmIsLi4DohPt9kE8HlExtwA$%3E.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https:/github.com/OpenIxia/IxNetwork/issues/106*issuecomment-651255009__;Iw!!I5pVk4LIGAfnvw!zbeRNWjlpH5bT_74Xo0l0FnBqkocisjjcjrjGGvB1_6CNGMShMAdcg6UYhh6PLW275Y$, or unsubscribehttps://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AINVQX3GFMXRJLGQ6IPNJYDRZDEW3ANCNFSM4OLC5C6A__;!!I5pVk4LIGAfnvw!zbeRNWjlpH5bT_74Xo0l0FnBqkocisjjcjrjGGvB1_6CNGMShMAdcg6UYhh6Qtv5btk$.

hubertgee commented 4 years ago

I just realized you want SendArp() for classic framework. It should be at the interface level like sending pings. But if that isn’t working, lets wait for Theresa or Hasmik to reply.

Hubert Gee

From: Hubert Gee Sent: Monday, June 29, 2020 10:40 AM To: OpenIxia/IxNetwork reply@reply.github.com; OpenIxia/IxNetwork IxNetwork@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: RE: [OpenIxia/IxNetwork] ixNetwork.Vport.find().Interface.find() output is empty to send arp request (#106)

To send arp, use the Ipv4 object.

Here is the restpy user guide: https://openixia.github.io/ixnetwork_restpy/#/reference

Ipv4.SendArp()

[cid:image001.jpg@01D64E01.3D3BEE80] Hubert Gee

From: Wesley Hand notifications@github.com<mailto:notifications@github.com> Sent: Monday, June 29, 2020 10:23 AM To: OpenIxia/IxNetwork IxNetwork@noreply.github.com<mailto:IxNetwork@noreply.github.com> Cc: Subscribed subscribed@noreply.github.com<mailto:subscribed@noreply.github.com> Subject: Re: [OpenIxia/IxNetwork] ixNetwork.Vport.find().Interface.find() output is empty to send arp request (#106)

[EXTERNAL] I may not have the syntax exactly right, but my guess is that vport is a dict so you have to provide an index. Perhaps something like this to do all at once.

ixNetwork.Vport.SendArpAll()

or if you want to send arp to individual vPorts, something like this

vport = ixNetwork.Vport.find()[0]

print("voprt: ", vport) ============> This displays reserved ports and other port details correctly

interface = vport.Interface.find()

print("interface: ", interface) ==============> This output is empty

interface.SendArp() ===============> This is getting failed as the above output is empty

Thanks, Wes

Wesley Hand m: 818-312-6752

From: skatakam7 notifications@github.com<mailto:notifications@github.com> Sent: Monday, June 29, 2020 5:18 AM To: OpenIxia/IxNetwork IxNetwork@noreply.github.com<mailto:IxNetwork@noreply.github.com> Cc: Subscribed subscribed@noreply.github.com<mailto:subscribed@noreply.github.com> Subject: [OpenIxia/IxNetwork] ixNetwork.Vport.find().Interface.find() output is empty to send arp request (#106)

[EXTERNAL]

Hi Team,

I want to send arp request to the interfaces i have created in ixnetwork config file (Please check the screen shot) . Actually when i reserved ports manually, it sending arp request automatically (as "ARP on Link Up" is enabled), but arp is not working if load the same configuration and reserve the ports through script.

So I am trying to fetch ixNetwork.Vport.find().Interface.find() to send the arp request, but i am getting empty output for this. Please let me know if i need to follow any other process to send the arp request.

Below is my code ..

ixChassisIpList = ['192.168.10.50']

portList = [[ixChassisIpList[0], 2, 1], [ixChassisIpList[0], 2, 2]]

configFile = 'test.ixncfg'

session = SessionAssistant(IpAddress=ixChassisIpList[0], UserName='test', Password='test')

ixNetwork = session.Ixnetwork

ixNetwork.LoadConfig(Files(configFile, local_file=True))

portMap = session.PortMapAssistant()

vport = dict()

for index,port in enumerate(portList):

For the port name, get the loaded configuration's port name

portName = ixNetwork.Vport.find()[index].Name

portMap.Map(IpAddress=port[0], CardId=port[1], PortId=port[2], Name=portName)

portMap.Connect(True)

vport = ixNetwork.Vport.find()

print("voprt: ", vport) ============> This displays reserved ports and other port details correctly

interface = vport.Interface.find()

print("interface: ", interface) ==============> This output is empty

interface.SendArp() ===============> This is getting failed as the above output is empty

Please find the ixia config screenshot for the same [image]<https://urldefense.com/v3/__https:/user-images.githubusercontent.com/49817276/85996340-47887100-ba22-11ea-8a98-78be16ef5afd.png__;!!I5pVk4LIGAfnvw!xhTThrQuIa7pHeoCui1lTmbjHuw9StoCg0ohqjNhmIsLi4DohPt9kE8yXIHu7w$%3E

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https:/github.com/OpenIxia/IxNetwork/issues/106__;!!I5pVk4LIGAfnvw!xhTThrQuIa7pHeoCui1lTmbjHuw9StoCg0ohqjNhmIsLi4DohPt9kE-wBKfXBA$%3E, or unsubscribe<https://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AGJXMDFPBZD4TSJSW62Z2CLRZBZ7JANCNFSM4OLC5C6A__;!!I5pVk4LIGAfnvw!xhTThrQuIa7pHeoCui1lTmbjHuw9StoCg0ohqjNhmIsLi4DohPt9kE8HlExtwA$%3E.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https:/github.com/OpenIxia/IxNetwork/issues/106*issuecomment-651255009__;Iw!!I5pVk4LIGAfnvw!zbeRNWjlpH5bT_74Xo0l0FnBqkocisjjcjrjGGvB1_6CNGMShMAdcg6UYhh6PLW275Y$, or unsubscribehttps://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AINVQX3GFMXRJLGQ6IPNJYDRZDEW3ANCNFSM4OLC5C6A__;!!I5pVk4LIGAfnvw!zbeRNWjlpH5bT_74Xo0l0FnBqkocisjjcjrjGGvB1_6CNGMShMAdcg6UYhh6Qtv5btk$.

skatakam7 commented 4 years ago

Thanks Wesley ad Hubert for the update ..

I will wait for Theresa/Hasmik to reply.

I have already tried using the below options, but it is not working.

ixNetwork.Vport.SendArpAll() or vport = ixNetwork.Vport.find()[0]

hshakaryan commented 4 years ago

Hi Team,

I want to send arp request to the interfaces i have created in ixnetwork config file (Please check the screen shot) . Actually when i reserved ports manually, it sending arp request automatically (as "ARP on Link Up" is enabled), but arp is not working if load the same configuration and reserve the ports through script.

So I am trying to fetch ixNetwork.Vport.find().Interface.find() to send the arp request, but i am getting empty output for this. Please let me know if i need to follow any other process to send the arp request.

Below is my code ..


ixChassisIpList = ['192.168.10.50']
portList = [[ixChassisIpList[0], 2, 1], [ixChassisIpList[0], 2, 2]]

configFile = 'test.ixncfg'

session = SessionAssistant(IpAddress=ixChassisIpList[0], UserName='test', Password='test')

ixNetwork = session.Ixnetwork

ixNetwork.LoadConfig(Files(configFile, local_file=True))

portMap = session.PortMapAssistant()
vport = dict()
for index,port in enumerate(portList):
    # For the port name, get the loaded configuration's port name
    portName = ixNetwork.Vport.find()[index].Name
    portMap.Map(IpAddress=port[0], CardId=port[1], PortId=port[2], Name=portName)

portMap.Connect(True)

vport = ixNetwork.Vport.find()
print("voprt: ", vport) ============> This displays reserved ports and other port details correctly
interface = vport.Interface.find()
print("interface: ", interface) ==============> This output is empty
interface.SendArp()  ===============> This is getting failed as the above output is empty

Please find the ixia config screenshot for the same image

skatakam7, can you please provide your name and email address, so we can open a support ticket, or you sent email to Support IX support.ix@keysight.com with this information so we can open a case and escalate to our team.

skatakam7 commented 4 years ago

@hshakaryan sent mail to support.ix@keysight.com with the above information.

therkong commented 4 years ago

Hi, can you provide your email address (your company email), your name, and ixNetwork activation code so that I can open a support ticket and work on this? If you're not sure how to find the ixNetwork activation code, i will give you instructions.

hshakaryan commented 4 years ago

skatakam7, can you please provide your name and email address, so we can open a support ticket, or you sent email to Support IX support.ix@keysight.com with this information so we can open a case and escalate to our team.

therkong commented 4 years ago

Hi, are you running the API Server on a Linux VM or Linux chassis? Have you enabled the Classic Protocols from the User Preferences Window from webUI? I tested your code. If "Enable Classic Protocols" is not selected, then vport.Interface.find() will return empty string. If it's enabled, it returns the interface object and the subsequent interface.SendArp() will succeed.

skatakam7 commented 4 years ago

Hi @therkong . My API server is on Linux and i am running script from windows.

I have not enabled "Classic Protocols" (if it is disabled by default).

Could you please let me know where can i see "Enable Classic Protocols" option. I am unable to find it from both windows ixnetwork tool and webUI . I am using 8.51.1810.5 EA ixnetwork version.

therkong commented 4 years ago

8.51.1810.5 EA does not support Classic Protocols yet. Can you upgrade to 9.0 Update 3?

skatakam7 commented 4 years ago

Thanks for the reply.

We will try to upgrade to 9.0. I am seeing "NO UPDATES AVAILABLE" in my webUI, Could you please share the path for "9.0 update 3" to upgrade it manually ?

our main intention is to get the throughput of the device, so currently we are proceeding with rfc2889 to run traffic and get throughput.

therkong commented 4 years ago

Where are you running the Linux API Server? On chassis or on VM. If VM, are you running it on EXSi or KVM? I can send you the link after I know where you're running it.

skatakam7 commented 4 years ago

@therkong Its running on chassis .

therkong commented 4 years ago

Below is the 9.0 Update3 link for Chassis deployment: http://downloads.ixiacom.com/support/downloads_and_updates/public/ixnetwork/9.00_Update-3/ixia-app-ixnetworkweb-9.00.2.223.el7.x86_64.waf

therkong commented 4 years ago

You need to upgrade the IxOS version to 9.0 Patch3. Link: http://downloads.ixiacom.com/support/downloads_and_updates/public/ixos/9.00_Patch3/Ixia_Hardware_Chassis_9.00.1900.24-Patch3.tar.gz.gpg

skatakam7 commented 4 years ago

Hi @therkong ,

Thanks for the details. We will upgrade to 9.0 and check classic protocols. I am closing the ticket now